@thoughtspot/visual-embed-sdk 1.36.3 → 1.36.5
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/cjs/package.json +1 -1
- package/cjs/src/css-variables.d.ts +1 -1
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +1 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/base.d.ts +4 -0
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +27 -1
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +1 -1
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +1 -1
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/embedConfig.d.ts.map +1 -1
- package/cjs/src/embed/embedConfig.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +2 -2
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +4 -5
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +11 -11
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +1 -1
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +1 -1
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +1 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +4 -3
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +25 -16
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +71 -5
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +16 -0
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +25 -2
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/types.d.ts +43 -19
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +43 -19
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/with-resolvers-polyfill.d.ts +1 -0
- package/cjs/src/utils/with-resolvers-polyfill.d.ts.map +1 -0
- package/cjs/src/utils/with-resolvers-polyfill.js +12 -0
- package/cjs/src/utils/with-resolvers-polyfill.js.map +1 -0
- package/cjs/src/utils.d.ts +17 -2
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +27 -3
- package/cjs/src/utils.js.map +1 -1
- package/dist/{index-BJx3m5_V.js → index-Cyvfex-A.js} +1 -1
- package/dist/src/css-variables.d.ts +1 -1
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +4 -0
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/embedConfig.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +2 -2
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +4 -3
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +16 -0
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +43 -19
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/with-resolvers-polyfill.d.ts +1 -0
- package/dist/src/utils/with-resolvers-polyfill.d.ts.map +1 -0
- package/dist/src/utils.d.ts +17 -2
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +392 -64
- package/dist/tsembed-react.js +390 -61
- package/dist/tsembed.es.js +128 -51
- package/dist/tsembed.js +127 -50
- package/dist/visual-embed-sdk-react-full.d.ts +1277 -1234
- package/dist/visual-embed-sdk-react.d.ts +711 -668
- package/dist/visual-embed-sdk.d.ts +53 -24
- package/lib/package.json +1 -1
- package/lib/src/css-variables.d.ts +1 -1
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +1 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/base.d.ts +4 -0
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +24 -1
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +1 -1
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +1 -1
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/embedConfig.d.ts.map +1 -1
- package/lib/src/embed/embedConfig.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +2 -2
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +4 -5
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +11 -11
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +1 -1
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +1 -1
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +1 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +4 -3
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +26 -17
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +71 -5
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/index.d.ts +16 -0
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +23 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/types.d.ts +43 -19
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +43 -19
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/with-resolvers-polyfill.d.ts +1 -0
- package/lib/src/utils/with-resolvers-polyfill.d.ts.map +1 -0
- package/lib/src/utils/with-resolvers-polyfill.js +12 -0
- package/lib/src/utils/with-resolvers-polyfill.js.map +1 -0
- package/lib/src/utils.d.ts +17 -2
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +25 -2
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +54 -25
- package/package.json +1 -1
- package/src/css-variables.ts +1 -1
- package/src/embed/app.ts +2 -1
- package/src/embed/base.ts +41 -1
- package/src/embed/bodyless-conversation.ts +2 -1
- package/src/embed/conversation.ts +2 -1
- package/src/embed/embedConfig.ts +1 -1
- package/src/embed/liveboard.spec.ts +11 -11
- package/src/embed/liveboard.ts +5 -6
- package/src/embed/sage.ts +1 -2
- package/src/embed/search-bar.tsx +1 -2
- package/src/embed/search.ts +1 -2
- package/src/embed/ts-embed.spec.ts +83 -5
- package/src/embed/ts-embed.ts +33 -17
- package/src/errors.ts +1 -0
- package/src/react/all-types-export.ts +1 -0
- package/src/react/index.tsx +27 -2
- package/src/types.ts +43 -19
- package/src/utils/with-resolvers-polyfill.ts +11 -0
- package/src/utils.ts +35 -4
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.36.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.36.5 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
@@ -352,13 +352,23 @@
|
|
|
352
352
|
* Stores a value in the global `window` object under the `_tsEmbedSDK` namespace.
|
|
353
353
|
* @param key - The key under which the value will be stored.
|
|
354
354
|
* @param value - The value to store.
|
|
355
|
+
* @param options - Additional options.
|
|
356
|
+
* @param options.ignoreIfAlreadyExists - Does not set if value for key is set.
|
|
357
|
+
*
|
|
358
|
+
* @returns The stored value.
|
|
359
|
+
*
|
|
360
|
+
* @version SDK: 1.36.2 | ThoughtSpot: *
|
|
355
361
|
*/
|
|
356
|
-
|
|
362
|
+
function storeValueInWindow(key, value, options = {}) {
|
|
357
363
|
if (!window[sdkWindowKey]) {
|
|
358
364
|
window[sdkWindowKey] = {};
|
|
359
365
|
}
|
|
366
|
+
if (options.ignoreIfAlreadyExists && key in window[sdkWindowKey]) {
|
|
367
|
+
return window[sdkWindowKey][key];
|
|
368
|
+
}
|
|
360
369
|
window[sdkWindowKey][key] = value;
|
|
361
|
-
|
|
370
|
+
return value;
|
|
371
|
+
}
|
|
362
372
|
/**
|
|
363
373
|
* Retrieves a stored value from the global `window` object under the `_tsEmbedSDK` namespace.
|
|
364
374
|
* @param key - The key whose value needs to be retrieved.
|
|
@@ -755,8 +765,9 @@
|
|
|
755
765
|
*/
|
|
756
766
|
EmbedEvent["Load"] = "load";
|
|
757
767
|
/**
|
|
758
|
-
* Data pertaining to an Answer or Liveboard is received
|
|
759
|
-
*
|
|
768
|
+
* Data pertaining to an Answer or Liveboard is received.
|
|
769
|
+
* The event payload includes the raw data of the object.
|
|
770
|
+
* @return data - Answer of Liveboard data
|
|
760
771
|
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
761
772
|
* @example
|
|
762
773
|
*```js
|
|
@@ -1660,17 +1671,39 @@
|
|
|
1660
1671
|
*/
|
|
1661
1672
|
EmbedEvent["ParameterChanged"] = "parameterChanged";
|
|
1662
1673
|
/**
|
|
1663
|
-
*
|
|
1664
|
-
*
|
|
1665
|
-
*
|
|
1674
|
+
* Emits when a table visualization is rendered in
|
|
1675
|
+
* the ThoughtSpot embedded app.
|
|
1676
|
+
* You can also use this event as a hook to trigger host events
|
|
1677
|
+
* such as `HostEvent.TransformTableVizData` on the table visualization.
|
|
1678
|
+
* The event payload contains the data used in the rendered table.
|
|
1679
|
+
* You can extract the relevant data from the payload
|
|
1680
|
+
* stored in `payload.data.data.columnDataLite`.
|
|
1681
|
+
* `columnDataLite` is a multidimensional array that contains
|
|
1682
|
+
* data values for each column, which was used in the query to
|
|
1683
|
+
* generate the table visualization. To find and modify specific cell data,
|
|
1684
|
+
* you can either loop through the array or directly access a cell if
|
|
1685
|
+
* you know its position and data index.
|
|
1686
|
+
* In the following code sample, the first cell in the first column
|
|
1687
|
+
* (`columnDataLite[0].dataValue[0]`) is set to `new fob`.
|
|
1688
|
+
* Note that any changes made to the data in the payload will only update the
|
|
1689
|
+
* visual presentation and do not affect the underlying data.
|
|
1690
|
+
* To persist data value modifications after a reload or during chart
|
|
1691
|
+
* interactions such as drill down, ensure that the modified
|
|
1692
|
+
* payload in the `columnDataLite` is passed on to
|
|
1693
|
+
* `HostEvent.TransformTableVizData` and trigger an update to
|
|
1694
|
+
* the table visualization.
|
|
1695
|
+
* If the Row-Level Security (RLS) rules are applied on the
|
|
1696
|
+
* Worksheet or Model, exercise caution when changing column
|
|
1697
|
+
* or table cell values to maintain data security.
|
|
1698
|
+
*
|
|
1666
1699
|
* @example
|
|
1667
1700
|
* ```js
|
|
1668
1701
|
* searchEmbed.on(EmbedEvent.TableVizRendered, (payload) => {
|
|
1669
|
-
*
|
|
1670
|
-
*
|
|
1671
|
-
*
|
|
1672
|
-
*
|
|
1673
|
-
*
|
|
1702
|
+
* console.log(payload);
|
|
1703
|
+
* const columnDataLite = payload.data.data.columnDataLite;
|
|
1704
|
+
* columnDataLite[0].dataValue[0]="new fob";
|
|
1705
|
+
* console.log('>>> new Data', columnDataLite);
|
|
1706
|
+
* searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
|
|
1674
1707
|
* })
|
|
1675
1708
|
* ```
|
|
1676
1709
|
* @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
|
|
@@ -2709,19 +2742,20 @@
|
|
|
2709
2742
|
*/
|
|
2710
2743
|
HostEvent["UIPassthrough"] = "UiPassthrough";
|
|
2711
2744
|
/**
|
|
2712
|
-
* Triggers the table
|
|
2745
|
+
* Triggers the table visualization re-render with the updated data.
|
|
2713
2746
|
* Includes the following properties:
|
|
2714
|
-
* @param - columnDataLite - an array of object containing
|
|
2715
|
-
*
|
|
2716
|
-
* For example, { columnDataLite: []}
|
|
2747
|
+
* @param - `columnDataLite` - an array of object containing the
|
|
2748
|
+
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2749
|
+
* payload.For example, { columnDataLite: []}`.
|
|
2750
|
+
*
|
|
2717
2751
|
* @example
|
|
2718
2752
|
* ```js
|
|
2719
2753
|
* searchEmbed.on(EmbedEvent.TableVizRendered, (payload) => {
|
|
2720
|
-
*
|
|
2721
|
-
*
|
|
2722
|
-
*
|
|
2723
|
-
*
|
|
2724
|
-
*
|
|
2754
|
+
* console.log(payload);
|
|
2755
|
+
* const columnDataLite = payload.data.data.columnDataLite;
|
|
2756
|
+
* columnDataLite[0].dataValue[0]="new fob";
|
|
2757
|
+
* console.log('>>> new Data', columnDataLite);
|
|
2758
|
+
* searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
|
|
2725
2759
|
* })
|
|
2726
2760
|
* ```
|
|
2727
2761
|
* @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
|
|
@@ -6527,6 +6561,7 @@
|
|
|
6527
6561
|
CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
|
|
6528
6562
|
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
|
|
6529
6563
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
6564
|
+
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
6530
6565
|
};
|
|
6531
6566
|
|
|
6532
6567
|
const EndPoints = {
|
|
@@ -14751,6 +14786,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14751
14786
|
}
|
|
14752
14787
|
};
|
|
14753
14788
|
|
|
14789
|
+
if (typeof Promise.withResolvers === 'undefined') {
|
|
14790
|
+
Promise.withResolvers = () => {
|
|
14791
|
+
let resolve;
|
|
14792
|
+
let reject;
|
|
14793
|
+
const promise = new Promise((res, rej) => {
|
|
14794
|
+
resolve = res;
|
|
14795
|
+
reject = rej;
|
|
14796
|
+
});
|
|
14797
|
+
return { promise, resolve, reject };
|
|
14798
|
+
};
|
|
14799
|
+
}
|
|
14800
|
+
|
|
14754
14801
|
/* eslint-disable camelcase */
|
|
14755
14802
|
/* eslint-disable import/no-mutable-exports */
|
|
14756
14803
|
/**
|
|
@@ -14857,6 +14904,25 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14857
14904
|
}
|
|
14858
14905
|
return newConfig;
|
|
14859
14906
|
}
|
|
14907
|
+
const initFlagKey = 'initFlagKey';
|
|
14908
|
+
const createAndSetInitPromise = () => {
|
|
14909
|
+
const { promise: initPromise, resolve: initPromiseResolve,
|
|
14910
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
14911
|
+
// @ts-ignore
|
|
14912
|
+
} = Promise.withResolvers();
|
|
14913
|
+
const initFlagStore = {
|
|
14914
|
+
initPromise,
|
|
14915
|
+
isInitCalled: false,
|
|
14916
|
+
initPromiseResolve,
|
|
14917
|
+
};
|
|
14918
|
+
storeValueInWindow(initFlagKey, initFlagStore, {
|
|
14919
|
+
// In case of diff imports the promise might be already set
|
|
14920
|
+
ignoreIfAlreadyExists: true,
|
|
14921
|
+
});
|
|
14922
|
+
};
|
|
14923
|
+
createAndSetInitPromise();
|
|
14924
|
+
const getInitPromise = () => { var _a; return (_a = getValueFromWindow(initFlagKey)) === null || _a === void 0 ? void 0 : _a.initPromise; };
|
|
14925
|
+
const getIsInitCalled = () => { var _a; return !!((_a = getValueFromWindow(initFlagKey)) === null || _a === void 0 ? void 0 : _a.isInitCalled); };
|
|
14860
14926
|
/**
|
|
14861
14927
|
* Initializes the Visual Embed SDK globally and perform
|
|
14862
14928
|
* authentication if applicable. This function needs to be called before any ThoughtSpot
|
|
@@ -14903,6 +14969,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14903
14969
|
if (getEmbedConfig().callPrefetch) {
|
|
14904
14970
|
prefetch(getEmbedConfig().thoughtSpotHost);
|
|
14905
14971
|
}
|
|
14972
|
+
// Resolves the promise created in the initPromiseKey
|
|
14973
|
+
getValueFromWindow(initFlagKey).initPromiseResolve(authEE);
|
|
14974
|
+
getValueFromWindow(initFlagKey).isInitCalled = true;
|
|
14906
14975
|
return authEE;
|
|
14907
14976
|
};
|
|
14908
14977
|
/**
|
|
@@ -15173,7 +15242,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15173
15242
|
return e;
|
|
15174
15243
|
}
|
|
15175
15244
|
|
|
15176
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.
|
|
15245
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.5";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"6.3.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
15177
15246
|
|
|
15178
15247
|
/**
|
|
15179
15248
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15482,13 +15551,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15482
15551
|
}
|
|
15483
15552
|
};
|
|
15484
15553
|
this.el = getDOMNode(domSelector);
|
|
15485
|
-
// TODO: handle error
|
|
15486
|
-
this.embedConfig = getEmbedConfig();
|
|
15487
|
-
if (!this.embedConfig.authTriggerContainer && !this.embedConfig.useEventForSAMLPopup) {
|
|
15488
|
-
this.embedConfig.authTriggerContainer = domSelector;
|
|
15489
|
-
}
|
|
15490
|
-
this.thoughtSpotHost = getThoughtSpotHost(this.embedConfig);
|
|
15491
|
-
this.thoughtSpotV2Base = getV2BasePath(this.embedConfig);
|
|
15492
15554
|
this.eventHandlerMap = new Map();
|
|
15493
15555
|
this.isError = false;
|
|
15494
15556
|
this.viewConfig = {
|
|
@@ -15496,12 +15558,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15496
15558
|
excludeRuntimeParametersfromURL: false,
|
|
15497
15559
|
...viewConfig,
|
|
15498
15560
|
};
|
|
15499
|
-
this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
|
|
15500
15561
|
this.registerAppInit();
|
|
15501
15562
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
15502
15563
|
...viewConfig,
|
|
15503
15564
|
});
|
|
15504
15565
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
15566
|
+
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
15567
|
+
const embedConfig = getEmbedConfig();
|
|
15568
|
+
this.embedConfig = embedConfig;
|
|
15569
|
+
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
15570
|
+
this.embedConfig.authTriggerContainer = domSelector;
|
|
15571
|
+
}
|
|
15572
|
+
this.thoughtSpotHost = getThoughtSpotHost(embedConfig);
|
|
15573
|
+
this.thoughtSpotV2Base = getV2BasePath(embedConfig);
|
|
15574
|
+
this.shouldEncodeUrlQueryParams = embedConfig.shouldEncodeUrlQueryParams;
|
|
15575
|
+
});
|
|
15505
15576
|
}
|
|
15506
15577
|
/**
|
|
15507
15578
|
* Throws error encountered during initialization.
|
|
@@ -16219,6 +16290,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16219
16290
|
* @param args
|
|
16220
16291
|
*/
|
|
16221
16292
|
async render() {
|
|
16293
|
+
if (!getIsInitCalled()) {
|
|
16294
|
+
logger$3.error(ERROR_MESSAGE.RENDER_CALLED_BEFORE_INIT);
|
|
16295
|
+
}
|
|
16296
|
+
await this.isReadyForRenderPromise;
|
|
16222
16297
|
this.isRendered = true;
|
|
16223
16298
|
return this;
|
|
16224
16299
|
}
|
|
@@ -16226,21 +16301,20 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16226
16301
|
return '';
|
|
16227
16302
|
}
|
|
16228
16303
|
handleRenderForPrerender() {
|
|
16229
|
-
this.render();
|
|
16304
|
+
return this.render();
|
|
16230
16305
|
}
|
|
16231
16306
|
/**
|
|
16232
16307
|
* Creates the preRender shell
|
|
16233
16308
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
|
16234
16309
|
*/
|
|
16235
|
-
preRender(showPreRenderByDefault = false) {
|
|
16310
|
+
async preRender(showPreRenderByDefault = false) {
|
|
16236
16311
|
if (!this.viewConfig.preRenderId) {
|
|
16237
16312
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
16238
16313
|
return this;
|
|
16239
16314
|
}
|
|
16240
16315
|
this.isPreRendered = true;
|
|
16241
16316
|
this.showPreRenderByDefault = showPreRenderByDefault;
|
|
16242
|
-
this.handleRenderForPrerender();
|
|
16243
|
-
return this;
|
|
16317
|
+
return this.handleRenderForPrerender();
|
|
16244
16318
|
}
|
|
16245
16319
|
/**
|
|
16246
16320
|
* Get the Post Url Params for THOUGHTSPOT from the current
|
|
@@ -16293,6 +16367,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16293
16367
|
* @returns
|
|
16294
16368
|
*/
|
|
16295
16369
|
async prerenderGeneric() {
|
|
16370
|
+
if (!getIsInitCalled()) {
|
|
16371
|
+
logger$3.error(ERROR_MESSAGE.RENDER_CALLED_BEFORE_INIT);
|
|
16372
|
+
}
|
|
16373
|
+
await this.isReadyForRenderPromise;
|
|
16296
16374
|
const prerenderFrameSrc = this.getRootIframeSrc();
|
|
16297
16375
|
this.isRendered = true;
|
|
16298
16376
|
return this.renderIFrame(prerenderFrameSrc);
|
|
@@ -16306,17 +16384,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16306
16384
|
* Also, synchronizes the style of the PreRender component with the embedding
|
|
16307
16385
|
* element.
|
|
16308
16386
|
*/
|
|
16309
|
-
showPreRender() {
|
|
16387
|
+
async showPreRender() {
|
|
16310
16388
|
if (!this.viewConfig.preRenderId) {
|
|
16311
16389
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
16312
|
-
return;
|
|
16390
|
+
return this;
|
|
16313
16391
|
}
|
|
16314
16392
|
if (!this.isPreRenderAvailable()) {
|
|
16315
16393
|
const isAvailable = this.connectPreRendered();
|
|
16316
16394
|
if (!isAvailable) {
|
|
16317
16395
|
// if the Embed component is not preRendered , Render it now and
|
|
16318
|
-
this.preRender(true);
|
|
16319
|
-
return;
|
|
16396
|
+
return this.preRender(true);
|
|
16320
16397
|
}
|
|
16321
16398
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
16322
16399
|
}
|
|
@@ -16339,6 +16416,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16339
16416
|
this.beforePrerenderVisible();
|
|
16340
16417
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
16341
16418
|
this.subscribeToEvents();
|
|
16419
|
+
return this;
|
|
16342
16420
|
}
|
|
16343
16421
|
/**
|
|
16344
16422
|
* Synchronizes the style properties of the PreRender component with the embedding
|
|
@@ -16756,7 +16834,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16756
16834
|
* to be embedded.
|
|
16757
16835
|
*/
|
|
16758
16836
|
async render() {
|
|
16759
|
-
super.render();
|
|
16837
|
+
await super.render();
|
|
16760
16838
|
const src = this.getIFrameSrc();
|
|
16761
16839
|
await this.renderV1Embed(src);
|
|
16762
16840
|
return this;
|
|
@@ -17035,12 +17113,11 @@ query GetEurekaVizSnapshots(
|
|
|
17035
17113
|
this.navigateToLiveboard(libId);
|
|
17036
17114
|
}
|
|
17037
17115
|
}
|
|
17038
|
-
handleRenderForPrerender() {
|
|
17116
|
+
async handleRenderForPrerender() {
|
|
17039
17117
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
17040
|
-
this.prerenderGeneric();
|
|
17041
|
-
return;
|
|
17118
|
+
return this.prerenderGeneric();
|
|
17042
17119
|
}
|
|
17043
|
-
super.handleRenderForPrerender();
|
|
17120
|
+
return super.handleRenderForPrerender();
|
|
17044
17121
|
}
|
|
17045
17122
|
/**
|
|
17046
17123
|
* Triggers an event to the embedded app
|
|
@@ -17065,7 +17142,7 @@ query GetEurekaVizSnapshots(
|
|
|
17065
17142
|
* visualization ID and the runtime filters.
|
|
17066
17143
|
*/
|
|
17067
17144
|
async render() {
|
|
17068
|
-
super.render();
|
|
17145
|
+
await super.render();
|
|
17069
17146
|
const src = this.getIFrameSrc();
|
|
17070
17147
|
await this.renderV1Embed(src);
|
|
17071
17148
|
this.showPreviewLoader();
|
|
@@ -17273,7 +17350,7 @@ query GetEurekaVizSnapshots(
|
|
|
17273
17350
|
* Render the embedded ThoughtSpot search
|
|
17274
17351
|
*/
|
|
17275
17352
|
async render() {
|
|
17276
|
-
super.render();
|
|
17353
|
+
await super.render();
|
|
17277
17354
|
this.viewConfig;
|
|
17278
17355
|
const src = this.getIFrameSrc();
|
|
17279
17356
|
await this.renderIFrame(src);
|
|
@@ -17340,7 +17417,7 @@ query GetEurekaVizSnapshots(
|
|
|
17340
17417
|
* Render the embedded ThoughtSpot search
|
|
17341
17418
|
*/
|
|
17342
17419
|
async render() {
|
|
17343
|
-
super.render();
|
|
17420
|
+
await super.render();
|
|
17344
17421
|
const src = this.getIFrameSrc();
|
|
17345
17422
|
await this.renderIFrame(src);
|
|
17346
17423
|
return this;
|
|
@@ -17764,7 +17841,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
17764
17841
|
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
17765
17842
|
}
|
|
17766
17843
|
async render() {
|
|
17767
|
-
super.render();
|
|
17844
|
+
await super.render();
|
|
17768
17845
|
const src = this.getIframeSrc();
|
|
17769
17846
|
await this.renderIFrame(src);
|
|
17770
17847
|
return this;
|
|
@@ -17892,7 +17969,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
17892
17969
|
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
17893
17970
|
}
|
|
17894
17971
|
async render() {
|
|
17895
|
-
super.render();
|
|
17972
|
+
await super.render();
|
|
17896
17973
|
const src = this.getIframeSrc();
|
|
17897
17974
|
await this.renderIFrame(src);
|
|
17898
17975
|
return this;
|
|
@@ -17968,7 +18045,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
17968
18045
|
* @returns {SageEmbed} Eureka/Sage embed
|
|
17969
18046
|
*/
|
|
17970
18047
|
async render() {
|
|
17971
|
-
super.render();
|
|
18048
|
+
await super.render();
|
|
17972
18049
|
const src = this.getIFrameSrc();
|
|
17973
18050
|
await this.renderV1Embed(src);
|
|
17974
18051
|
return this;
|