@contrail/extensions-sdk 1.0.31 → 1.0.33

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.
@@ -81,6 +81,36 @@ export interface ComposeContentRequest {
81
81
  * A newly created set item, by contrast, has no image at all and wants this.
82
82
  */
83
83
  assignAsPrimaryViewable?: boolean;
84
+ /**
85
+ * Also drop an item component for the holder onto the board, showing the composition.
86
+ *
87
+ * Done here rather than through a separate command because only this call holds all three
88
+ * things the component needs at once - the item, the new content, and its URLs. Adding the
89
+ * component afterwards would mean re-reading the item and racing the server's denormalisation
90
+ * of the viewable URLs onto it, which is what leaves a component rendering an empty frame.
91
+ *
92
+ * Only meaningful for an `item:` holder.
93
+ */
94
+ addComponentToBoard?: {
95
+ /**
96
+ * Put the component just below these elements, sized to match them.
97
+ *
98
+ * Prefer this over `position`: measuring an element is the board's job, not the extension's -
99
+ * a component's rendered box is not simply what its `size` field says, so geometry computed
100
+ * from the launch context lands in the wrong place or, when the fields are absent, nowhere.
101
+ * Pass the ids of the elements the work came from and let the board do the arithmetic.
102
+ */
103
+ nearElementIds?: Array<string>;
104
+ /** Explicit board coordinates. Ignored when `nearElementIds` resolves to anything. */
105
+ position?: {
106
+ x: number;
107
+ y: number;
108
+ };
109
+ size?: {
110
+ width: number;
111
+ height: number;
112
+ };
113
+ };
84
114
  }
85
115
  export interface ComposeContentResult {
86
116
  contentId: string;
@@ -92,6 +122,8 @@ export interface ComposeContentResult {
92
122
  };
93
123
  /** Whether the holder was repointed at this content, when it was asked for. */
94
124
  assignedAsPrimaryViewable?: boolean;
125
+ /** The id of the component added to the board, when one was asked for. */
126
+ componentElementId?: string;
95
127
  }
96
128
  export interface BoardDocumentElement extends DocumentElement {
97
129
  [key: string]: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/extensions-sdk",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "description": "Client library for interfacing with VibeIQ's services and apps from an extension.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",