@sigmacomputing/react-embed-sdk 0.2.10 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +14 -4
- package/dist/index.mjs +15 -5
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
@@ -164,5 +164,6 @@ declare function createWorkbookBookmark(iframeRef: React.RefObject<HTMLIFrameEle
|
|
164
164
|
declare function updateWorkbookBookmark(iframeRef: React.RefObject<HTMLIFrameElement>): void;
|
165
165
|
declare function updateWorkbookFullscreen(iframeRef: React.RefObject<HTMLIFrameElement>, nodeId: string | null): void;
|
166
166
|
declare function updateWorkbookSelectedNodeId(iframeRef: React.RefObject<HTMLIFrameElement>, nodeId: string, nodeType: "element" | "page"): void;
|
167
|
+
declare function updateWorkbookSharingLink(iframeRef: React.RefObject<HTMLIFrameElement>, sharingLink: string | null, sharingExplorationLink: string | null): void;
|
167
168
|
|
168
|
-
export { createWorkbookBookmark, getWorkbookVariables, updateWorkbookBookmark, updateWorkbookFullscreen, updateWorkbookSelectedNodeId, updateWorkbookVariables, usePageHeight, useSigmaIframe, useTableCellSelect, useUrlOnChange, useVariableChange, useWorkbookBookmarkOnChange, useWorkbookBookmarkOnCreate, useWorkbookChartError, useWorkbookChartValueSelect, useWorkbookCurrentVariables, useWorkbookDataLoaded, useWorkbookError, useWorkbookExploreKeyOnChange, useWorkbookFullScreen, useWorkbookIdOnChange, useWorkbookLoaded, useWorkbookPageHeight, useWorkbookPageSelectedNode, useWorkbookPivotTableCellSelect, useWorkbookPublished, useWorkbookVariables };
|
169
|
+
export { createWorkbookBookmark, getWorkbookVariables, updateWorkbookBookmark, updateWorkbookFullscreen, updateWorkbookSelectedNodeId, updateWorkbookSharingLink, updateWorkbookVariables, usePageHeight, useSigmaIframe, useTableCellSelect, useUrlOnChange, useVariableChange, useWorkbookBookmarkOnChange, useWorkbookBookmarkOnCreate, useWorkbookChartError, useWorkbookChartValueSelect, useWorkbookCurrentVariables, useWorkbookDataLoaded, useWorkbookError, useWorkbookExploreKeyOnChange, useWorkbookFullScreen, useWorkbookIdOnChange, useWorkbookLoaded, useWorkbookPageHeight, useWorkbookPageSelectedNode, useWorkbookPivotTableCellSelect, useWorkbookPublished, useWorkbookVariables };
|
package/dist/index.d.ts
CHANGED
@@ -164,5 +164,6 @@ declare function createWorkbookBookmark(iframeRef: React.RefObject<HTMLIFrameEle
|
|
164
164
|
declare function updateWorkbookBookmark(iframeRef: React.RefObject<HTMLIFrameElement>): void;
|
165
165
|
declare function updateWorkbookFullscreen(iframeRef: React.RefObject<HTMLIFrameElement>, nodeId: string | null): void;
|
166
166
|
declare function updateWorkbookSelectedNodeId(iframeRef: React.RefObject<HTMLIFrameElement>, nodeId: string, nodeType: "element" | "page"): void;
|
167
|
+
declare function updateWorkbookSharingLink(iframeRef: React.RefObject<HTMLIFrameElement>, sharingLink: string | null, sharingExplorationLink: string | null): void;
|
167
168
|
|
168
|
-
export { createWorkbookBookmark, getWorkbookVariables, updateWorkbookBookmark, updateWorkbookFullscreen, updateWorkbookSelectedNodeId, updateWorkbookVariables, usePageHeight, useSigmaIframe, useTableCellSelect, useUrlOnChange, useVariableChange, useWorkbookBookmarkOnChange, useWorkbookBookmarkOnCreate, useWorkbookChartError, useWorkbookChartValueSelect, useWorkbookCurrentVariables, useWorkbookDataLoaded, useWorkbookError, useWorkbookExploreKeyOnChange, useWorkbookFullScreen, useWorkbookIdOnChange, useWorkbookLoaded, useWorkbookPageHeight, useWorkbookPageSelectedNode, useWorkbookPivotTableCellSelect, useWorkbookPublished, useWorkbookVariables };
|
169
|
+
export { createWorkbookBookmark, getWorkbookVariables, updateWorkbookBookmark, updateWorkbookFullscreen, updateWorkbookSelectedNodeId, updateWorkbookSharingLink, updateWorkbookVariables, usePageHeight, useSigmaIframe, useTableCellSelect, useUrlOnChange, useVariableChange, useWorkbookBookmarkOnChange, useWorkbookBookmarkOnCreate, useWorkbookChartError, useWorkbookChartValueSelect, useWorkbookCurrentVariables, useWorkbookDataLoaded, useWorkbookError, useWorkbookExploreKeyOnChange, useWorkbookFullScreen, useWorkbookIdOnChange, useWorkbookLoaded, useWorkbookPageHeight, useWorkbookPageSelectedNode, useWorkbookPivotTableCellSelect, useWorkbookPublished, useWorkbookVariables };
|
package/dist/index.js
CHANGED
@@ -25,6 +25,7 @@ __export(src_exports, {
|
|
25
25
|
updateWorkbookBookmark: () => updateWorkbookBookmark,
|
26
26
|
updateWorkbookFullscreen: () => updateWorkbookFullscreen,
|
27
27
|
updateWorkbookSelectedNodeId: () => updateWorkbookSelectedNodeId,
|
28
|
+
updateWorkbookSharingLink: () => updateWorkbookSharingLink,
|
28
29
|
updateWorkbookVariables: () => updateWorkbookVariables,
|
29
30
|
usePageHeight: () => usePageHeight,
|
30
31
|
useSigmaIframe: () => useSigmaIframe,
|
@@ -333,8 +334,7 @@ var import_react3 = require("react");
|
|
333
334
|
function usePageHeight(iframeRef) {
|
334
335
|
const [height, setHeight] = (0, import_react3.useState)(void 0);
|
335
336
|
useWorkbookPageHeight(iframeRef, (event) => {
|
336
|
-
if (!iframeRef.current)
|
337
|
-
return;
|
337
|
+
if (!iframeRef.current) return;
|
338
338
|
setHeight(event.pageHeight);
|
339
339
|
});
|
340
340
|
return height;
|
@@ -365,8 +365,7 @@ var useWorkbookVariables = (iframeRef) => {
|
|
365
365
|
[iframeRef]
|
366
366
|
);
|
367
367
|
(0, import_react4.useEffect)(() => {
|
368
|
-
if (!iframeRef.current)
|
369
|
-
return;
|
368
|
+
if (!iframeRef.current) return;
|
370
369
|
const listener = (event) => {
|
371
370
|
if (!iframeRef.current) {
|
372
371
|
return;
|
@@ -427,6 +426,16 @@ function updateWorkbookSelectedNodeId(iframeRef, nodeId, nodeType) {
|
|
427
426
|
}
|
428
427
|
(0, import_embed_sdk3.workbookSelectedNodeIdUpdate)(iframeRef.current, nodeId, nodeType);
|
429
428
|
}
|
429
|
+
function updateWorkbookSharingLink(iframeRef, sharingLink, sharingExplorationLink) {
|
430
|
+
if (!iframeRef.current) {
|
431
|
+
throw new Error("iframe is not available");
|
432
|
+
}
|
433
|
+
(0, import_embed_sdk3.workbookSharingLinkUpdate)(
|
434
|
+
iframeRef.current,
|
435
|
+
sharingLink,
|
436
|
+
sharingExplorationLink
|
437
|
+
);
|
438
|
+
}
|
430
439
|
// Annotate the CommonJS export names for ESM import in node:
|
431
440
|
0 && (module.exports = {
|
432
441
|
createWorkbookBookmark,
|
@@ -434,6 +443,7 @@ function updateWorkbookSelectedNodeId(iframeRef, nodeId, nodeType) {
|
|
434
443
|
updateWorkbookBookmark,
|
435
444
|
updateWorkbookFullscreen,
|
436
445
|
updateWorkbookSelectedNodeId,
|
446
|
+
updateWorkbookSharingLink,
|
437
447
|
updateWorkbookVariables,
|
438
448
|
usePageHeight,
|
439
449
|
useSigmaIframe,
|
package/dist/index.mjs
CHANGED
@@ -300,8 +300,7 @@ import { useState as useState2 } from "react";
|
|
300
300
|
function usePageHeight(iframeRef) {
|
301
301
|
const [height, setHeight] = useState2(void 0);
|
302
302
|
useWorkbookPageHeight(iframeRef, (event) => {
|
303
|
-
if (!iframeRef.current)
|
304
|
-
return;
|
303
|
+
if (!iframeRef.current) return;
|
305
304
|
setHeight(event.pageHeight);
|
306
305
|
});
|
307
306
|
return height;
|
@@ -336,8 +335,7 @@ var useWorkbookVariables = (iframeRef) => {
|
|
336
335
|
[iframeRef]
|
337
336
|
);
|
338
337
|
useEffect2(() => {
|
339
|
-
if (!iframeRef.current)
|
340
|
-
return;
|
338
|
+
if (!iframeRef.current) return;
|
341
339
|
const listener = (event) => {
|
342
340
|
if (!iframeRef.current) {
|
343
341
|
return;
|
@@ -367,7 +365,8 @@ import {
|
|
367
365
|
workbookBookmarkCreate,
|
368
366
|
workbookBookmarkUpdate,
|
369
367
|
workbookFullscreenUpdate,
|
370
|
-
workbookSelectedNodeIdUpdate
|
368
|
+
workbookSelectedNodeIdUpdate,
|
369
|
+
workbookSharingLinkUpdate
|
371
370
|
} from "@sigmacomputing/embed-sdk";
|
372
371
|
function getWorkbookVariables(iframeRef) {
|
373
372
|
if (!iframeRef.current) {
|
@@ -405,12 +404,23 @@ function updateWorkbookSelectedNodeId(iframeRef, nodeId, nodeType) {
|
|
405
404
|
}
|
406
405
|
workbookSelectedNodeIdUpdate(iframeRef.current, nodeId, nodeType);
|
407
406
|
}
|
407
|
+
function updateWorkbookSharingLink(iframeRef, sharingLink, sharingExplorationLink) {
|
408
|
+
if (!iframeRef.current) {
|
409
|
+
throw new Error("iframe is not available");
|
410
|
+
}
|
411
|
+
workbookSharingLinkUpdate(
|
412
|
+
iframeRef.current,
|
413
|
+
sharingLink,
|
414
|
+
sharingExplorationLink
|
415
|
+
);
|
416
|
+
}
|
408
417
|
export {
|
409
418
|
createWorkbookBookmark,
|
410
419
|
getWorkbookVariables,
|
411
420
|
updateWorkbookBookmark,
|
412
421
|
updateWorkbookFullscreen,
|
413
422
|
updateWorkbookSelectedNodeId,
|
423
|
+
updateWorkbookSharingLink,
|
414
424
|
updateWorkbookVariables,
|
415
425
|
usePageHeight,
|
416
426
|
useSigmaIframe,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sigmacomputing/react-embed-sdk",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.3.0",
|
4
4
|
"description": "React JavaScript SDK to interact with Sigma Computing's Embed API",
|
5
5
|
"author": "sigmacomputing",
|
6
6
|
"license": "ISC",
|
@@ -17,14 +17,14 @@
|
|
17
17
|
"react-dom": "^16.8 || ^17 || ^18"
|
18
18
|
},
|
19
19
|
"devDependencies": {
|
20
|
-
"@types/react": "^18.
|
21
|
-
"react": "^18.
|
22
|
-
"react-dom": "^18.
|
23
|
-
"@sigmacomputing/
|
24
|
-
"@sigmacomputing/
|
20
|
+
"@types/react": "^18.3.3",
|
21
|
+
"react": "^18.3.1",
|
22
|
+
"react-dom": "^18.3.1",
|
23
|
+
"@sigmacomputing/eslint-config": "0.0.0",
|
24
|
+
"@sigmacomputing/typescript-config": "0.0.0"
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
|
-
"@sigmacomputing/embed-sdk": "0.
|
27
|
+
"@sigmacomputing/embed-sdk": "0.3.0"
|
28
28
|
},
|
29
29
|
"scripts": {
|
30
30
|
"prepublish": "pnpm build",
|