@sigmacomputing/embed-sdk 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +10 -0
- package/dist/index.mjs +9 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
@@ -64,6 +64,7 @@ declare const WorkbookVariablesListEventName: "workbook:variables:list";
|
|
64
64
|
declare const WorkbookVariablesUpdateEventName: "workbook:variables:update";
|
65
65
|
declare const WorkbookVariablesCurrentEventName: "workbook:variables:current";
|
66
66
|
declare const WorkbookSharingLinkUpdateEventName: "workbook:sharinglink:update";
|
67
|
+
declare const ActionOutboundEventName: "action:outbound";
|
67
68
|
interface WorkbookLoadedEvent {
|
68
69
|
type: typeof WorkbookLoadedEventName;
|
69
70
|
workbook: {
|
@@ -165,6 +166,11 @@ type WorkbookBookmarkCreateEvent = {
|
|
165
166
|
isDefault: boolean;
|
166
167
|
isShared: boolean;
|
167
168
|
};
|
169
|
+
type ActionOutboundEvent = {
|
170
|
+
type: typeof ActionOutboundEventName;
|
171
|
+
name: string;
|
172
|
+
values: Record<string, unknown>;
|
173
|
+
};
|
168
174
|
|
169
175
|
declare const workbookLoadedListener: (event: MessageEvent, iframe: HTMLIFrameElement, onLoaded: (event: WorkbookLoadedEvent) => void) => void;
|
170
176
|
declare const workbookErrorListener: (event: MessageEvent, iframe: HTMLIFrameElement, onError: (event: WorkbookErrorEvent) => void) => void;
|
@@ -186,6 +192,7 @@ declare const workbookExploreKeyOnChangeListener: (event: MessageEvent, iframe:
|
|
186
192
|
declare const workbookBookmarkOnChangeListener: (event: MessageEvent, iframe: HTMLIFrameElement, onBookmarkChange: (event: WorkbookBookmarkOnChangeEvent) => void) => void;
|
187
193
|
declare const urlOnChangeListener: (event: MessageEvent, iframe: HTMLIFrameElement, onUrlChange: (event: UrlOnChangeEvent) => void) => void;
|
188
194
|
declare const workbookIdOnChangeListener: (event: MessageEvent, iframe: HTMLIFrameElement, onWorkbookIdChange: (event: WorkbookIdOnChangeEvent) => void) => void;
|
195
|
+
declare const actionOutboundListener: (event: MessageEvent, iframe: HTMLIFrameElement, onActionOutbound: (event: ActionOutboundEvent) => void) => void;
|
189
196
|
|
190
197
|
declare const workbookBookmarkCreate: (iframe: HTMLIFrameElement, bookmark: WorkbookBookmarkCreateEvent) => void;
|
191
198
|
declare const workbookBookmarkUpdate: (iframe: HTMLIFrameElement) => void;
|
@@ -195,4 +202,4 @@ declare const workbookVariablesList: (iframe: HTMLIFrameElement) => void;
|
|
195
202
|
declare const workbookVariablesUpdate: (iframe: HTMLIFrameElement, variables: Record<string, string>) => void;
|
196
203
|
declare const workbookSharingLinkUpdate: (iframe: HTMLIFrameElement, sharingLink: string | null, sharingExplorationLink?: string | null) => void;
|
197
204
|
|
198
|
-
export { CellType_t, type Cell_t, type ChartValue_t, type ChartValues_t, type DataRow_t, type DataRows_t, type Data_t, type LevelTableCell_t, type LevelTableCells, type LevelTableColumnCell_t, type LevelTableValueCell_t, type PathChunk_t, type PivotPath_t, type PivotTableCell_t, type PivotTableCells_t, type UrlOnChangeEvent, UrlOnChangeEventName, type Value_t, type WorkbookBookmarkCreateEvent, WorkbookBookmarkCreateEventName, type WorkbookBookmarkOnChangeEvent, WorkbookBookmarkOnChangeEventName, type WorkbookBookmarkOnCreateEvent, WorkbookBookmarkOnCreateEventName, WorkbookBookmarkUpdateEventName, type WorkbookChartErrorEvent, WorkbookChartErrorEventName, type WorkbookChartValueSelectEvent, WorkbookChartValueSelectEventName, type WorkbookCurrentVariablesEvent, WorkbookCurrentVariablesEventName, type WorkbookDataLoadedEvent, WorkbookDataLoadedEventName, type WorkbookErrorEvent, WorkbookErrorEventName, type WorkbookExploreKeyOnChangeEvent, WorkbookExploreKeyOnChangeEventName, type WorkbookFullScreenEvent, WorkbookFullScreenEventName, WorkbookFullscreenUpdateEventName, type WorkbookIdOnChangeEvent, WorkbookIdOnChangeEventName, type WorkbookLoadedEvent, WorkbookLoadedEventName, type WorkbookPageHeightEvent, WorkbookPageHeightEventName, type WorkbookPivotTableCellSelectEvent, WorkbookPivotTableCellSelectEventName, type WorkbookPublishedEvent, WorkbookPublishedEventName, type WorkbookSelectedNodeEvent, WorkbookSelectedNodeEventName, WorkbookSelectedNodeIdUpdateEventName, type WorkbookSharingLinkUpdateEvent, WorkbookSharingLinkUpdateEventName, type WorkbookTableCellSelectEvent, WorkbookTableCellSelectEventName, type WorkbookVariableCurrentEvent, WorkbookVariableEventOnChangeName, type WorkbookVariableOnChangeEvent, WorkbookVariablesCurrentEventName, WorkbookVariablesListEventName, WorkbookVariablesUpdateEventName, urlOnChangeListener, workbookBookmarkCreate, workbookBookmarkCreateListener, workbookBookmarkOnChangeListener, workbookBookmarkUpdate, workbookChartErrorListener, workbookChartValueSelectListener, workbookCurrentVariablesListener, workbookDataLoadedListener, workbookErrorListener, workbookExploreKeyOnChangeListener, workbookFullScreenListener, workbookFullscreenUpdate, workbookIdOnChangeListener, workbookLinkSharingUpdateListener, workbookLoadedListener, workbookPageHeightListener, workbookPivotTableCellSelectListener, workbookPublishedListener, workbookSelectedNodeIdUpdate, workbookSelectedNodeListener, workbookSharingLinkUpdate, workbookTableCellSelectListener, workbookVariableChangeListener, workbookVariableCurrentListener, workbookVariablesList, workbookVariablesUpdate };
|
205
|
+
export { type ActionOutboundEvent, ActionOutboundEventName, CellType_t, type Cell_t, type ChartValue_t, type ChartValues_t, type DataRow_t, type DataRows_t, type Data_t, type LevelTableCell_t, type LevelTableCells, type LevelTableColumnCell_t, type LevelTableValueCell_t, type PathChunk_t, type PivotPath_t, type PivotTableCell_t, type PivotTableCells_t, type UrlOnChangeEvent, UrlOnChangeEventName, type Value_t, type WorkbookBookmarkCreateEvent, WorkbookBookmarkCreateEventName, type WorkbookBookmarkOnChangeEvent, WorkbookBookmarkOnChangeEventName, type WorkbookBookmarkOnCreateEvent, WorkbookBookmarkOnCreateEventName, WorkbookBookmarkUpdateEventName, type WorkbookChartErrorEvent, WorkbookChartErrorEventName, type WorkbookChartValueSelectEvent, WorkbookChartValueSelectEventName, type WorkbookCurrentVariablesEvent, WorkbookCurrentVariablesEventName, type WorkbookDataLoadedEvent, WorkbookDataLoadedEventName, type WorkbookErrorEvent, WorkbookErrorEventName, type WorkbookExploreKeyOnChangeEvent, WorkbookExploreKeyOnChangeEventName, type WorkbookFullScreenEvent, WorkbookFullScreenEventName, WorkbookFullscreenUpdateEventName, type WorkbookIdOnChangeEvent, WorkbookIdOnChangeEventName, type WorkbookLoadedEvent, WorkbookLoadedEventName, type WorkbookPageHeightEvent, WorkbookPageHeightEventName, type WorkbookPivotTableCellSelectEvent, WorkbookPivotTableCellSelectEventName, type WorkbookPublishedEvent, WorkbookPublishedEventName, type WorkbookSelectedNodeEvent, WorkbookSelectedNodeEventName, WorkbookSelectedNodeIdUpdateEventName, type WorkbookSharingLinkUpdateEvent, WorkbookSharingLinkUpdateEventName, type WorkbookTableCellSelectEvent, WorkbookTableCellSelectEventName, type WorkbookVariableCurrentEvent, WorkbookVariableEventOnChangeName, type WorkbookVariableOnChangeEvent, WorkbookVariablesCurrentEventName, WorkbookVariablesListEventName, WorkbookVariablesUpdateEventName, actionOutboundListener, urlOnChangeListener, workbookBookmarkCreate, workbookBookmarkCreateListener, workbookBookmarkOnChangeListener, workbookBookmarkUpdate, workbookChartErrorListener, workbookChartValueSelectListener, workbookCurrentVariablesListener, workbookDataLoadedListener, workbookErrorListener, workbookExploreKeyOnChangeListener, workbookFullScreenListener, workbookFullscreenUpdate, workbookIdOnChangeListener, workbookLinkSharingUpdateListener, workbookLoadedListener, workbookPageHeightListener, workbookPivotTableCellSelectListener, workbookPublishedListener, workbookSelectedNodeIdUpdate, workbookSelectedNodeListener, workbookSharingLinkUpdate, workbookTableCellSelectListener, workbookVariableChangeListener, workbookVariableCurrentListener, workbookVariablesList, workbookVariablesUpdate };
|
package/dist/index.d.ts
CHANGED
@@ -64,6 +64,7 @@ declare const WorkbookVariablesListEventName: "workbook:variables:list";
|
|
64
64
|
declare const WorkbookVariablesUpdateEventName: "workbook:variables:update";
|
65
65
|
declare const WorkbookVariablesCurrentEventName: "workbook:variables:current";
|
66
66
|
declare const WorkbookSharingLinkUpdateEventName: "workbook:sharinglink:update";
|
67
|
+
declare const ActionOutboundEventName: "action:outbound";
|
67
68
|
interface WorkbookLoadedEvent {
|
68
69
|
type: typeof WorkbookLoadedEventName;
|
69
70
|
workbook: {
|
@@ -165,6 +166,11 @@ type WorkbookBookmarkCreateEvent = {
|
|
165
166
|
isDefault: boolean;
|
166
167
|
isShared: boolean;
|
167
168
|
};
|
169
|
+
type ActionOutboundEvent = {
|
170
|
+
type: typeof ActionOutboundEventName;
|
171
|
+
name: string;
|
172
|
+
values: Record<string, unknown>;
|
173
|
+
};
|
168
174
|
|
169
175
|
declare const workbookLoadedListener: (event: MessageEvent, iframe: HTMLIFrameElement, onLoaded: (event: WorkbookLoadedEvent) => void) => void;
|
170
176
|
declare const workbookErrorListener: (event: MessageEvent, iframe: HTMLIFrameElement, onError: (event: WorkbookErrorEvent) => void) => void;
|
@@ -186,6 +192,7 @@ declare const workbookExploreKeyOnChangeListener: (event: MessageEvent, iframe:
|
|
186
192
|
declare const workbookBookmarkOnChangeListener: (event: MessageEvent, iframe: HTMLIFrameElement, onBookmarkChange: (event: WorkbookBookmarkOnChangeEvent) => void) => void;
|
187
193
|
declare const urlOnChangeListener: (event: MessageEvent, iframe: HTMLIFrameElement, onUrlChange: (event: UrlOnChangeEvent) => void) => void;
|
188
194
|
declare const workbookIdOnChangeListener: (event: MessageEvent, iframe: HTMLIFrameElement, onWorkbookIdChange: (event: WorkbookIdOnChangeEvent) => void) => void;
|
195
|
+
declare const actionOutboundListener: (event: MessageEvent, iframe: HTMLIFrameElement, onActionOutbound: (event: ActionOutboundEvent) => void) => void;
|
189
196
|
|
190
197
|
declare const workbookBookmarkCreate: (iframe: HTMLIFrameElement, bookmark: WorkbookBookmarkCreateEvent) => void;
|
191
198
|
declare const workbookBookmarkUpdate: (iframe: HTMLIFrameElement) => void;
|
@@ -195,4 +202,4 @@ declare const workbookVariablesList: (iframe: HTMLIFrameElement) => void;
|
|
195
202
|
declare const workbookVariablesUpdate: (iframe: HTMLIFrameElement, variables: Record<string, string>) => void;
|
196
203
|
declare const workbookSharingLinkUpdate: (iframe: HTMLIFrameElement, sharingLink: string | null, sharingExplorationLink?: string | null) => void;
|
197
204
|
|
198
|
-
export { CellType_t, type Cell_t, type ChartValue_t, type ChartValues_t, type DataRow_t, type DataRows_t, type Data_t, type LevelTableCell_t, type LevelTableCells, type LevelTableColumnCell_t, type LevelTableValueCell_t, type PathChunk_t, type PivotPath_t, type PivotTableCell_t, type PivotTableCells_t, type UrlOnChangeEvent, UrlOnChangeEventName, type Value_t, type WorkbookBookmarkCreateEvent, WorkbookBookmarkCreateEventName, type WorkbookBookmarkOnChangeEvent, WorkbookBookmarkOnChangeEventName, type WorkbookBookmarkOnCreateEvent, WorkbookBookmarkOnCreateEventName, WorkbookBookmarkUpdateEventName, type WorkbookChartErrorEvent, WorkbookChartErrorEventName, type WorkbookChartValueSelectEvent, WorkbookChartValueSelectEventName, type WorkbookCurrentVariablesEvent, WorkbookCurrentVariablesEventName, type WorkbookDataLoadedEvent, WorkbookDataLoadedEventName, type WorkbookErrorEvent, WorkbookErrorEventName, type WorkbookExploreKeyOnChangeEvent, WorkbookExploreKeyOnChangeEventName, type WorkbookFullScreenEvent, WorkbookFullScreenEventName, WorkbookFullscreenUpdateEventName, type WorkbookIdOnChangeEvent, WorkbookIdOnChangeEventName, type WorkbookLoadedEvent, WorkbookLoadedEventName, type WorkbookPageHeightEvent, WorkbookPageHeightEventName, type WorkbookPivotTableCellSelectEvent, WorkbookPivotTableCellSelectEventName, type WorkbookPublishedEvent, WorkbookPublishedEventName, type WorkbookSelectedNodeEvent, WorkbookSelectedNodeEventName, WorkbookSelectedNodeIdUpdateEventName, type WorkbookSharingLinkUpdateEvent, WorkbookSharingLinkUpdateEventName, type WorkbookTableCellSelectEvent, WorkbookTableCellSelectEventName, type WorkbookVariableCurrentEvent, WorkbookVariableEventOnChangeName, type WorkbookVariableOnChangeEvent, WorkbookVariablesCurrentEventName, WorkbookVariablesListEventName, WorkbookVariablesUpdateEventName, urlOnChangeListener, workbookBookmarkCreate, workbookBookmarkCreateListener, workbookBookmarkOnChangeListener, workbookBookmarkUpdate, workbookChartErrorListener, workbookChartValueSelectListener, workbookCurrentVariablesListener, workbookDataLoadedListener, workbookErrorListener, workbookExploreKeyOnChangeListener, workbookFullScreenListener, workbookFullscreenUpdate, workbookIdOnChangeListener, workbookLinkSharingUpdateListener, workbookLoadedListener, workbookPageHeightListener, workbookPivotTableCellSelectListener, workbookPublishedListener, workbookSelectedNodeIdUpdate, workbookSelectedNodeListener, workbookSharingLinkUpdate, workbookTableCellSelectListener, workbookVariableChangeListener, workbookVariableCurrentListener, workbookVariablesList, workbookVariablesUpdate };
|
205
|
+
export { type ActionOutboundEvent, ActionOutboundEventName, CellType_t, type Cell_t, type ChartValue_t, type ChartValues_t, type DataRow_t, type DataRows_t, type Data_t, type LevelTableCell_t, type LevelTableCells, type LevelTableColumnCell_t, type LevelTableValueCell_t, type PathChunk_t, type PivotPath_t, type PivotTableCell_t, type PivotTableCells_t, type UrlOnChangeEvent, UrlOnChangeEventName, type Value_t, type WorkbookBookmarkCreateEvent, WorkbookBookmarkCreateEventName, type WorkbookBookmarkOnChangeEvent, WorkbookBookmarkOnChangeEventName, type WorkbookBookmarkOnCreateEvent, WorkbookBookmarkOnCreateEventName, WorkbookBookmarkUpdateEventName, type WorkbookChartErrorEvent, WorkbookChartErrorEventName, type WorkbookChartValueSelectEvent, WorkbookChartValueSelectEventName, type WorkbookCurrentVariablesEvent, WorkbookCurrentVariablesEventName, type WorkbookDataLoadedEvent, WorkbookDataLoadedEventName, type WorkbookErrorEvent, WorkbookErrorEventName, type WorkbookExploreKeyOnChangeEvent, WorkbookExploreKeyOnChangeEventName, type WorkbookFullScreenEvent, WorkbookFullScreenEventName, WorkbookFullscreenUpdateEventName, type WorkbookIdOnChangeEvent, WorkbookIdOnChangeEventName, type WorkbookLoadedEvent, WorkbookLoadedEventName, type WorkbookPageHeightEvent, WorkbookPageHeightEventName, type WorkbookPivotTableCellSelectEvent, WorkbookPivotTableCellSelectEventName, type WorkbookPublishedEvent, WorkbookPublishedEventName, type WorkbookSelectedNodeEvent, WorkbookSelectedNodeEventName, WorkbookSelectedNodeIdUpdateEventName, type WorkbookSharingLinkUpdateEvent, WorkbookSharingLinkUpdateEventName, type WorkbookTableCellSelectEvent, WorkbookTableCellSelectEventName, type WorkbookVariableCurrentEvent, WorkbookVariableEventOnChangeName, type WorkbookVariableOnChangeEvent, WorkbookVariablesCurrentEventName, WorkbookVariablesListEventName, WorkbookVariablesUpdateEventName, actionOutboundListener, urlOnChangeListener, workbookBookmarkCreate, workbookBookmarkCreateListener, workbookBookmarkOnChangeListener, workbookBookmarkUpdate, workbookChartErrorListener, workbookChartValueSelectListener, workbookCurrentVariablesListener, workbookDataLoadedListener, workbookErrorListener, workbookExploreKeyOnChangeListener, workbookFullScreenListener, workbookFullscreenUpdate, workbookIdOnChangeListener, workbookLinkSharingUpdateListener, workbookLoadedListener, workbookPageHeightListener, workbookPivotTableCellSelectListener, workbookPublishedListener, workbookSelectedNodeIdUpdate, workbookSelectedNodeListener, workbookSharingLinkUpdate, workbookTableCellSelectListener, workbookVariableChangeListener, workbookVariableCurrentListener, workbookVariablesList, workbookVariablesUpdate };
|
package/dist/index.js
CHANGED
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
20
20
|
// src/index.ts
|
21
21
|
var src_exports = {};
|
22
22
|
__export(src_exports, {
|
23
|
+
actionOutboundListener: () => actionOutboundListener,
|
23
24
|
urlOnChangeListener: () => urlOnChangeListener,
|
24
25
|
workbookBookmarkCreate: () => workbookBookmarkCreate,
|
25
26
|
workbookBookmarkCreateListener: () => workbookBookmarkCreateListener,
|
@@ -77,6 +78,7 @@ var WorkbookVariablesListEventName = "workbook:variables:list";
|
|
77
78
|
var WorkbookVariablesUpdateEventName = "workbook:variables:update";
|
78
79
|
var WorkbookVariablesCurrentEventName = "workbook:variables:current";
|
79
80
|
var WorkbookSharingLinkUpdateEventName = "workbook:sharinglink:update";
|
81
|
+
var ActionOutboundEventName = "action:outbound";
|
80
82
|
|
81
83
|
// src/wrapper.ts
|
82
84
|
var checkEventOrigin = (url) => {
|
@@ -225,6 +227,13 @@ var workbookIdOnChangeListener = (event, iframe, onWorkbookIdChange) => {
|
|
225
227
|
}
|
226
228
|
}
|
227
229
|
};
|
230
|
+
var actionOutboundListener = (event, iframe, onActionOutbound) => {
|
231
|
+
if (event.source === iframe.contentWindow && checkEventOrigin(event.origin)) {
|
232
|
+
if (event.data.type === ActionOutboundEventName) {
|
233
|
+
onActionOutbound(event.data);
|
234
|
+
}
|
235
|
+
}
|
236
|
+
};
|
228
237
|
|
229
238
|
// src/mutations.ts
|
230
239
|
var sendIframeMessage = (iframe, message) => {
|
@@ -280,6 +289,7 @@ var workbookSharingLinkUpdate = (iframe, sharingLink, sharingExplorationLink) =>
|
|
280
289
|
};
|
281
290
|
// Annotate the CommonJS export names for ESM import in node:
|
282
291
|
0 && (module.exports = {
|
292
|
+
actionOutboundListener,
|
283
293
|
urlOnChangeListener,
|
284
294
|
workbookBookmarkCreate,
|
285
295
|
workbookBookmarkCreateListener,
|
package/dist/index.mjs
CHANGED
@@ -25,6 +25,7 @@ var WorkbookVariablesListEventName = "workbook:variables:list";
|
|
25
25
|
var WorkbookVariablesUpdateEventName = "workbook:variables:update";
|
26
26
|
var WorkbookVariablesCurrentEventName = "workbook:variables:current";
|
27
27
|
var WorkbookSharingLinkUpdateEventName = "workbook:sharinglink:update";
|
28
|
+
var ActionOutboundEventName = "action:outbound";
|
28
29
|
|
29
30
|
// src/wrapper.ts
|
30
31
|
var checkEventOrigin = (url) => {
|
@@ -173,6 +174,13 @@ var workbookIdOnChangeListener = (event, iframe, onWorkbookIdChange) => {
|
|
173
174
|
}
|
174
175
|
}
|
175
176
|
};
|
177
|
+
var actionOutboundListener = (event, iframe, onActionOutbound) => {
|
178
|
+
if (event.source === iframe.contentWindow && checkEventOrigin(event.origin)) {
|
179
|
+
if (event.data.type === ActionOutboundEventName) {
|
180
|
+
onActionOutbound(event.data);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
};
|
176
184
|
|
177
185
|
// src/mutations.ts
|
178
186
|
var sendIframeMessage = (iframe, message) => {
|
@@ -227,6 +235,7 @@ var workbookSharingLinkUpdate = (iframe, sharingLink, sharingExplorationLink) =>
|
|
227
235
|
});
|
228
236
|
};
|
229
237
|
export {
|
238
|
+
actionOutboundListener,
|
230
239
|
urlOnChangeListener,
|
231
240
|
workbookBookmarkCreate,
|
232
241
|
workbookBookmarkCreateListener,
|