@thoughtspot/visual-embed-sdk 1.36.7 → 1.36.9-PA
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 +23 -21
- package/cjs/src/embed/bodyless-conversation.d.ts +16 -0
- 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/liveboard.d.ts +15 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +4 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +25 -1
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +1 -1
- package/cjs/src/embed/search.d.ts +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +14 -2
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +111 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/pages/embed-test.page.d.ts +8 -0
- package/cjs/src/pages/embed-test.page.d.ts.map +1 -0
- package/cjs/src/pages/embed-test.page.js +20 -0
- package/cjs/src/pages/embed-test.page.js.map +1 -0
- package/cjs/src/pages/home.page.d.ts +6 -0
- package/cjs/src/pages/home.page.d.ts.map +1 -0
- package/cjs/src/pages/home.page.js +12 -0
- package/cjs/src/pages/home.page.js.map +1 -0
- package/cjs/src/pages/login.page.d.ts +15 -0
- package/cjs/src/pages/login.page.d.ts.map +1 -0
- package/cjs/src/pages/login.page.js +22 -0
- package/cjs/src/pages/login.page.js.map +1 -0
- package/cjs/src/react/index.d.ts +1 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +10 -5
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/util.d.ts +2 -0
- package/cjs/src/react/util.d.ts.map +1 -1
- package/cjs/src/react/util.js.map +1 -1
- package/cjs/src/tests/auth.test.d.ts +1 -0
- package/cjs/src/tests/auth.test.d.ts.map +1 -0
- package/cjs/src/tests/auth.test.js +1 -0
- package/cjs/src/tests/auth.test.js.map +1 -0
- package/cjs/src/tests/e2e/auth.spec.d.ts +2 -0
- package/cjs/src/tests/e2e/auth.spec.d.ts.map +1 -0
- package/cjs/src/tests/e2e/auth.spec.js +54 -0
- package/cjs/src/tests/e2e/auth.spec.js.map +1 -0
- package/cjs/src/types.d.ts +93 -11
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +56 -9
- package/cjs/src/types.js.map +1 -1
- package/dist/index-BEyovSez.js +7370 -0
- package/dist/{index-BratITNz.js → index-BJx3m5_V.js} +1 -1
- package/dist/index-CpzF_6NO.js +7440 -0
- package/dist/index-Dg18PU5Z.js +7370 -0
- package/dist/index-Do_T8J8z.js +7370 -0
- package/dist/index-KdQfn0ah.js +7440 -0
- package/dist/src/embed/bodyless-conversation.d.ts +16 -0
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +15 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +1 -1
- package/dist/src/embed/search.d.ts +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/pages/embed-test.page.d.ts +8 -0
- package/dist/src/pages/embed-test.page.d.ts.map +1 -0
- package/dist/src/pages/home.page.d.ts +6 -0
- package/dist/src/pages/home.page.d.ts.map +1 -0
- package/dist/src/pages/login.page.d.ts +15 -0
- package/dist/src/pages/login.page.d.ts.map +1 -0
- package/dist/src/react/index.d.ts +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/react/util.d.ts +2 -0
- package/dist/src/react/util.d.ts.map +1 -1
- package/dist/src/tests/auth.test.d.ts +1 -0
- package/dist/src/tests/auth.test.d.ts.map +1 -0
- package/dist/src/tests/e2e/auth.spec.d.ts +2 -0
- package/dist/src/tests/e2e/auth.spec.d.ts.map +1 -0
- package/dist/src/types.d.ts +93 -11
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +85 -19
- package/dist/tsembed-react.js +269 -133
- package/dist/tsembed.es.js +78 -16
- package/dist/tsembed.js +261 -129
- package/dist/visual-embed-sdk-react-full.d.ts +127 -14
- package/dist/visual-embed-sdk-react.d.ts +127 -14
- package/dist/visual-embed-sdk.d.ts +126 -14
- package/lib/package.json +23 -21
- package/lib/src/embed/bodyless-conversation.d.ts +16 -0
- 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/liveboard.d.ts +15 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +4 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +25 -1
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +1 -1
- package/lib/src/embed/search.d.ts +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +14 -2
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +111 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/pages/embed-test.page.d.ts +8 -0
- package/lib/src/pages/embed-test.page.d.ts.map +1 -0
- package/lib/src/pages/embed-test.page.js +16 -0
- package/lib/src/pages/embed-test.page.js.map +1 -0
- package/lib/src/pages/home.page.d.ts +6 -0
- package/lib/src/pages/home.page.d.ts.map +1 -0
- package/lib/src/pages/home.page.js +8 -0
- package/lib/src/pages/home.page.js.map +1 -0
- package/lib/src/pages/login.page.d.ts +15 -0
- package/lib/src/pages/login.page.d.ts.map +1 -0
- package/lib/src/pages/login.page.js +18 -0
- package/lib/src/pages/login.page.js.map +1 -0
- package/lib/src/react/index.d.ts +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +9 -5
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/util.d.ts +2 -0
- package/lib/src/react/util.d.ts.map +1 -1
- package/lib/src/react/util.js.map +1 -1
- package/lib/src/tests/auth.test.d.ts +1 -0
- package/lib/src/tests/auth.test.d.ts.map +1 -0
- package/lib/src/tests/auth.test.js +1 -0
- package/lib/src/tests/auth.test.js.map +1 -0
- package/lib/src/tests/e2e/auth.spec.d.ts +2 -0
- package/lib/src/tests/e2e/auth.spec.d.ts.map +1 -0
- package/lib/src/tests/e2e/auth.spec.js +52 -0
- package/lib/src/tests/e2e/auth.spec.js.map +1 -0
- package/lib/src/types.d.ts +93 -11
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +55 -8
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +128 -15
- package/package.json +23 -21
- package/src/embed/bodyless-conversation.ts +1 -1
- package/src/embed/liveboard.spec.ts +35 -7
- package/src/embed/liveboard.ts +21 -1
- package/src/embed/search-bar.tsx +1 -1
- package/src/embed/search.ts +1 -1
- package/src/embed/ts-embed.spec.ts +118 -0
- package/src/embed/ts-embed.ts +15 -0
- package/src/index.ts +2 -0
- package/src/react/index.tsx +12 -8
- package/src/react/util.ts +1 -0
- package/src/types.ts +94 -10
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.36.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.36.9-PA */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
}
|
|
163
163
|
return false;
|
|
164
164
|
};
|
|
165
|
-
const merge = (...objects) => objects.reduce((result, current) => {
|
|
165
|
+
const merge$1 = (...objects) => objects.reduce((result, current) => {
|
|
166
166
|
if (Array.isArray(current)) {
|
|
167
167
|
throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
|
|
168
168
|
}
|
|
@@ -171,19 +171,19 @@
|
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
if (Array.isArray(result[key]) && Array.isArray(current[key])) {
|
|
174
|
-
result[key] = merge.options.mergeArrays
|
|
175
|
-
? merge.options.uniqueArrayItems
|
|
174
|
+
result[key] = merge$1.options.mergeArrays
|
|
175
|
+
? merge$1.options.uniqueArrayItems
|
|
176
176
|
? Array.from(new Set(result[key].concat(current[key])))
|
|
177
177
|
: [...result[key], ...current[key]]
|
|
178
178
|
: current[key];
|
|
179
179
|
}
|
|
180
180
|
else if (isObject$1(result[key]) && isObject$1(current[key])) {
|
|
181
|
-
result[key] = merge(result[key], current[key]);
|
|
181
|
+
result[key] = merge$1(result[key], current[key]);
|
|
182
182
|
}
|
|
183
183
|
else {
|
|
184
184
|
result[key] =
|
|
185
185
|
current[key] === undefined
|
|
186
|
-
? merge.options.allowUndefinedOverrides
|
|
186
|
+
? merge$1.options.allowUndefinedOverrides
|
|
187
187
|
? current[key]
|
|
188
188
|
: result[key]
|
|
189
189
|
: current[key];
|
|
@@ -196,11 +196,11 @@
|
|
|
196
196
|
mergeArrays: true,
|
|
197
197
|
uniqueArrayItems: true,
|
|
198
198
|
};
|
|
199
|
-
merge.options = defaultOptions;
|
|
200
|
-
merge.withOptions = (options, ...objects) => {
|
|
201
|
-
merge.options = Object.assign(Object.assign({}, defaultOptions), options);
|
|
202
|
-
const result = merge(...objects);
|
|
203
|
-
merge.options = defaultOptions;
|
|
199
|
+
merge$1.options = defaultOptions;
|
|
200
|
+
merge$1.withOptions = (options, ...objects) => {
|
|
201
|
+
merge$1.options = Object.assign(Object.assign({}, defaultOptions), options);
|
|
202
|
+
const result = merge$1(...objects);
|
|
203
|
+
merge$1.options = defaultOptions;
|
|
204
204
|
return result;
|
|
205
205
|
};
|
|
206
206
|
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
function getDOMNode(domSelector) {
|
|
402
402
|
return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
|
|
403
403
|
}
|
|
404
|
-
const deepMerge = (target, source) => merge(target, source);
|
|
404
|
+
const deepMerge = (target, source) => merge$1(target, source);
|
|
405
405
|
const getOperationNameFromQuery = (query) => {
|
|
406
406
|
const regex = /(?:query|mutation)\s+(\w+)/;
|
|
407
407
|
const matches = query.match(regex);
|
|
@@ -814,6 +814,35 @@
|
|
|
814
814
|
*/
|
|
815
815
|
HomepageModule["Learning"] = "LEARNING";
|
|
816
816
|
})(exports.HomepageModule || (exports.HomepageModule = {}));
|
|
817
|
+
/**
|
|
818
|
+
* List page columns that can be hidden.
|
|
819
|
+
* **Note**: This option is applicable only in full app embedding.
|
|
820
|
+
* @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
|
|
821
|
+
*/
|
|
822
|
+
// eslint-disable-next-line no-shadow
|
|
823
|
+
exports.ListPageColumns = void 0;
|
|
824
|
+
(function (ListPageColumns) {
|
|
825
|
+
/**
|
|
826
|
+
* Favourite
|
|
827
|
+
*/
|
|
828
|
+
ListPageColumns["Favourite"] = "FAVOURITE";
|
|
829
|
+
/**
|
|
830
|
+
* Tags
|
|
831
|
+
*/
|
|
832
|
+
ListPageColumns["Tags"] = "TAGS";
|
|
833
|
+
/**
|
|
834
|
+
* Author
|
|
835
|
+
*/
|
|
836
|
+
ListPageColumns["Author"] = "AUTHOR";
|
|
837
|
+
/**
|
|
838
|
+
* Last viewed/Last modified
|
|
839
|
+
*/
|
|
840
|
+
ListPageColumns["DateSort"] = "DATE_SORT";
|
|
841
|
+
/**
|
|
842
|
+
* Share
|
|
843
|
+
*/
|
|
844
|
+
ListPageColumns["Share"] = "SHARE";
|
|
845
|
+
})(exports.ListPageColumns || (exports.ListPageColumns = {}));
|
|
817
846
|
/**
|
|
818
847
|
* Event types emitted by the embedded ThoughtSpot application.
|
|
819
848
|
*
|
|
@@ -1804,16 +1833,19 @@
|
|
|
1804
1833
|
/**
|
|
1805
1834
|
* Emits when a table visualization is rendered in
|
|
1806
1835
|
* the ThoughtSpot embedded app.
|
|
1836
|
+
*
|
|
1807
1837
|
* You can also use this event as a hook to trigger host events
|
|
1808
1838
|
* such as `HostEvent.TransformTableVizData` on the table visualization.
|
|
1809
1839
|
* The event payload contains the data used in the rendered table.
|
|
1810
1840
|
* You can extract the relevant data from the payload
|
|
1811
1841
|
* stored in `payload.data.data.columnDataLite`.
|
|
1842
|
+
*
|
|
1812
1843
|
* `columnDataLite` is a multidimensional array that contains
|
|
1813
1844
|
* data values for each column, which was used in the query to
|
|
1814
1845
|
* generate the table visualization. To find and modify specific cell data,
|
|
1815
1846
|
* you can either loop through the array or directly access a cell if
|
|
1816
1847
|
* you know its position and data index.
|
|
1848
|
+
*
|
|
1817
1849
|
* In the following code sample, the first cell in the first column
|
|
1818
1850
|
* (`columnDataLite[0].dataValue[0]`) is set to `new fob`.
|
|
1819
1851
|
* Note that any changes made to the data in the payload will only update the
|
|
@@ -1823,6 +1855,7 @@
|
|
|
1823
1855
|
* payload in the `columnDataLite` is passed on to
|
|
1824
1856
|
* `HostEvent.TransformTableVizData` and trigger an update to
|
|
1825
1857
|
* the table visualization.
|
|
1858
|
+
*
|
|
1826
1859
|
* If the Row-Level Security (RLS) rules are applied on the
|
|
1827
1860
|
* Worksheet or Model, exercise caution when changing column
|
|
1828
1861
|
* or table cell values to maintain data security.
|
|
@@ -1837,7 +1870,7 @@
|
|
|
1837
1870
|
* searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
|
|
1838
1871
|
* })
|
|
1839
1872
|
* ```
|
|
1840
|
-
* @version SDK: 1.
|
|
1873
|
+
* @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
|
|
1841
1874
|
*/
|
|
1842
1875
|
EmbedEvent["TableVizRendered"] = "TableVizRendered";
|
|
1843
1876
|
/**
|
|
@@ -1850,7 +1883,7 @@
|
|
|
1850
1883
|
* console.log('payload', payload);
|
|
1851
1884
|
* })
|
|
1852
1885
|
*```
|
|
1853
|
-
* @version SDK : 1.
|
|
1886
|
+
* @version SDK : 1.38.0 | ThoughtSpot : 10.8.0.cl
|
|
1854
1887
|
*/
|
|
1855
1888
|
EmbedEvent["CreateLiveboard"] = "createLiveboard";
|
|
1856
1889
|
/**
|
|
@@ -2299,7 +2332,7 @@
|
|
|
2299
2332
|
* ```js
|
|
2300
2333
|
* liveboardEmbed.trigger(HostEvent.Remove)
|
|
2301
2334
|
* ```
|
|
2302
|
-
* @version SDK: 1.
|
|
2335
|
+
* @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
|
|
2303
2336
|
*/
|
|
2304
2337
|
HostEvent["Remove"] = "delete";
|
|
2305
2338
|
/**
|
|
@@ -2847,7 +2880,7 @@
|
|
|
2847
2880
|
* ```js
|
|
2848
2881
|
* liveboardEmbed.trigger(HostEvent.InfoSuccess, data);
|
|
2849
2882
|
*```
|
|
2850
|
-
* @version SDK: 1.36.0 |
|
|
2883
|
+
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2851
2884
|
*/
|
|
2852
2885
|
HostEvent["InfoSuccess"] = "InfoSuccess";
|
|
2853
2886
|
/**
|
|
@@ -2894,7 +2927,7 @@
|
|
|
2894
2927
|
* searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
|
|
2895
2928
|
* })
|
|
2896
2929
|
* ```
|
|
2897
|
-
* @version SDK: 1.
|
|
2930
|
+
* @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
|
|
2898
2931
|
*/
|
|
2899
2932
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
2900
2933
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
@@ -2949,6 +2982,7 @@
|
|
|
2949
2982
|
Param["livedBoardEmbed"] = "isLiveboardEmbed";
|
|
2950
2983
|
Param["searchEmbed"] = "isSearchEmbed";
|
|
2951
2984
|
Param["vizEmbed"] = "isVizEmbed";
|
|
2985
|
+
Param["StringIDsUrl"] = "overrideStringIDsUrl";
|
|
2952
2986
|
Param["Version"] = "sdkVersion";
|
|
2953
2987
|
Param["ViewPortHeight"] = "viewPortHeight";
|
|
2954
2988
|
Param["ViewPortWidth"] = "viewPortWidth";
|
|
@@ -3004,6 +3038,7 @@
|
|
|
3004
3038
|
Param["HideSageAnswerHeader"] = "hideSageAnswerHeader";
|
|
3005
3039
|
Param["HideSearchBar"] = "hideSearchBar";
|
|
3006
3040
|
Param["ClientLogLevel"] = "clientLogLevel";
|
|
3041
|
+
Param["ExposeTranslationIDs"] = "exposeTranslationIDs";
|
|
3007
3042
|
Param["OverrideNativeConsole"] = "overrideConsoleLogs";
|
|
3008
3043
|
Param["enableAskSage"] = "enableAskSage";
|
|
3009
3044
|
Param["CollapseSearchBarInitially"] = "collapseSearchBarInitially";
|
|
@@ -3030,6 +3065,8 @@
|
|
|
3030
3065
|
Param["DataSourceId"] = "dataSourceId";
|
|
3031
3066
|
Param["preAuthCache"] = "preAuthCache";
|
|
3032
3067
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
3068
|
+
Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
|
|
3069
|
+
Param["PrimaryAction"] = "primaryAction";
|
|
3033
3070
|
})(Param || (Param = {}));
|
|
3034
3071
|
/**
|
|
3035
3072
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -3196,7 +3233,7 @@
|
|
|
3196
3233
|
* The **Collapse data panel** icon on the Search page.
|
|
3197
3234
|
* Collapses the data panel view.
|
|
3198
3235
|
*
|
|
3199
|
-
* @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
|
|
3236
|
+
* @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
|
|
3200
3237
|
*
|
|
3201
3238
|
* @example
|
|
3202
3239
|
* ```js
|
|
@@ -4241,6 +4278,16 @@
|
|
|
4241
4278
|
* @version SDK: 1.38.0 | ThoughtSpot Cloud: 10.8.0.cl
|
|
4242
4279
|
*/
|
|
4243
4280
|
Action["ColumnRename"] = "columnRename";
|
|
4281
|
+
/**
|
|
4282
|
+
* Action ID for hide checkboxes for include or exclude
|
|
4283
|
+
* cover and filter pages in the Liveboard PDF
|
|
4284
|
+
* @example
|
|
4285
|
+
* ```js
|
|
4286
|
+
* hiddenAction: [Action.CoverAndFilterOptionInPDF]
|
|
4287
|
+
* ```
|
|
4288
|
+
* @version SDK: 1.38.0 | ThoughtSpot Cloud: 10.8.0.cl
|
|
4289
|
+
*/
|
|
4290
|
+
Action["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
|
|
4244
4291
|
})(exports.Action || (exports.Action = {}));
|
|
4245
4292
|
var PrefetchFeatures;
|
|
4246
4293
|
(function (PrefetchFeatures) {
|
|
@@ -4250,8 +4297,8 @@
|
|
|
4250
4297
|
PrefetchFeatures["VizEmbed"] = "VizEmbed";
|
|
4251
4298
|
})(PrefetchFeatures || (PrefetchFeatures = {}));
|
|
4252
4299
|
/**
|
|
4253
|
-
* Enum for options to change context trigger
|
|
4254
|
-
* BOTH_CLICKS option is
|
|
4300
|
+
* Enum for options to change context trigger.
|
|
4301
|
+
* The `BOTH_CLICKS` option is available from 10.8.0.cl.
|
|
4255
4302
|
*/
|
|
4256
4303
|
var ContextMenuTriggerOptions;
|
|
4257
4304
|
(function (ContextMenuTriggerOptions) {
|
|
@@ -15221,7 +15268,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15221
15268
|
return e;
|
|
15222
15269
|
}
|
|
15223
15270
|
|
|
15224
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.
|
|
15271
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.9-PA";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 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:"^18.3.1","react-dom":"^18.3.1"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",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":"^8.28.0","@typescript-eslint/parser":"^8.28.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:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.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",prettier:"2.1.2",react:"^18.3.1","react-dom":"^18.3.1","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","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4","@types/react":"^18.2.37","@types/react-dom":"^18.2.15"};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};
|
|
15225
15272
|
|
|
15226
15273
|
/**
|
|
15227
15274
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15695,6 +15742,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15695
15742
|
? (_b = this.viewConfig) === null || _b === void 0 ? void 0 : _b.hiddenHomeLeftNavItems
|
|
15696
15743
|
: [],
|
|
15697
15744
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
15745
|
+
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
15698
15746
|
};
|
|
15699
15747
|
}
|
|
15700
15748
|
async getAppInitData() {
|
|
@@ -15720,7 +15768,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15720
15768
|
* @returns queryParams
|
|
15721
15769
|
*/
|
|
15722
15770
|
getBaseQueryParams(queryParams = {}) {
|
|
15723
|
-
var _a, _b;
|
|
15771
|
+
var _a, _b, _c, _d;
|
|
15724
15772
|
let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
|
|
15725
15773
|
// The below check is needed because TS Cloud firewall, blocks
|
|
15726
15774
|
// localhost/127.0.0.1 in any url param.
|
|
@@ -15757,7 +15805,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15757
15805
|
if (this.embedConfig.currencyFormat) {
|
|
15758
15806
|
queryParams[Param.CurrencyFormat] = this.embedConfig.currencyFormat;
|
|
15759
15807
|
}
|
|
15760
|
-
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, } = this.viewConfig;
|
|
15808
|
+
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, primaryAction, } = this.viewConfig;
|
|
15761
15809
|
const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
|
|
15762
15810
|
const additionalFlags = {
|
|
15763
15811
|
...additionalFlagsFromInit,
|
|
@@ -15771,12 +15819,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15771
15819
|
this.handleError('You cannot have both hidden Tabs and visible Tabs');
|
|
15772
15820
|
return queryParams;
|
|
15773
15821
|
}
|
|
15822
|
+
if (primaryAction) {
|
|
15823
|
+
queryParams[Param.PrimaryAction] = primaryAction;
|
|
15824
|
+
}
|
|
15774
15825
|
if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
|
|
15775
15826
|
queryParams[Param.DisableActions] = disabledActions;
|
|
15776
15827
|
}
|
|
15777
15828
|
if (disabledActionReason) {
|
|
15778
15829
|
queryParams[Param.DisableActionReason] = disabledActionReason;
|
|
15779
15830
|
}
|
|
15831
|
+
if (exposeTranslationIDs) {
|
|
15832
|
+
queryParams[Param.ExposeTranslationIDs] = exposeTranslationIDs;
|
|
15833
|
+
}
|
|
15780
15834
|
queryParams[Param.HideActions] = [...this.defaultHiddenActions, ...(hiddenActions !== null && hiddenActions !== void 0 ? hiddenActions : [])];
|
|
15781
15835
|
if (Array.isArray(visibleActions)) {
|
|
15782
15836
|
queryParams[Param.VisibleActions] = visibleActions;
|
|
@@ -15806,6 +15860,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15806
15860
|
if (spriteUrl) {
|
|
15807
15861
|
queryParams[Param.IconSpriteUrl] = spriteUrl.replace('https://', '');
|
|
15808
15862
|
}
|
|
15863
|
+
const stringIDsUrl = ((_c = customizations === null || customizations === void 0 ? void 0 : customizations.content) === null || _c === void 0 ? void 0 : _c.stringIDsUrl)
|
|
15864
|
+
|| ((_d = embedCustomizations === null || embedCustomizations === void 0 ? void 0 : embedCustomizations.content) === null || _d === void 0 ? void 0 : _d.stringIDsUrl);
|
|
15865
|
+
if (stringIDsUrl) {
|
|
15866
|
+
queryParams[Param.StringIDsUrl] = stringIDsUrl;
|
|
15867
|
+
}
|
|
15809
15868
|
if (showAlerts !== undefined) {
|
|
15810
15869
|
queryParams[Param.ShowAlerts] = showAlerts;
|
|
15811
15870
|
}
|
|
@@ -17285,7 +17344,7 @@ query GetEurekaVizSnapshots(
|
|
|
17285
17344
|
getEmbedParams() {
|
|
17286
17345
|
let params = {};
|
|
17287
17346
|
params = this.getBaseQueryParams(params);
|
|
17288
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, } = this.viewConfig;
|
|
17347
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, } = this.viewConfig;
|
|
17289
17348
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
17290
17349
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
17291
17350
|
if (fullHeight === true) {
|
|
@@ -17337,6 +17396,9 @@ query GetEurekaVizSnapshots(
|
|
|
17337
17396
|
if (dataSourceId !== undefined) {
|
|
17338
17397
|
params[Param.DataSourceId] = dataSourceId;
|
|
17339
17398
|
}
|
|
17399
|
+
if (coverAndFilterOptionInPDF !== undefined) {
|
|
17400
|
+
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17401
|
+
}
|
|
17340
17402
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
17341
17403
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
17342
17404
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -17598,7 +17660,7 @@ query GetEurekaVizSnapshots(
|
|
|
17598
17660
|
// not be destroyed when the component is unmounted.
|
|
17599
17661
|
isPreRenderedComponent = false) => React.forwardRef((props, forwardedRef) => {
|
|
17600
17662
|
const ref = React.useRef(null);
|
|
17601
|
-
const { className, ...embedProps } = props;
|
|
17663
|
+
const { className, style, ...embedProps } = props;
|
|
17602
17664
|
const { viewConfig, listeners } = getViewPropsAndListeners(embedProps);
|
|
17603
17665
|
const handleDestroy = (tsEmbed) => {
|
|
17604
17666
|
// do not destroy if it is a preRender component
|
|
@@ -17641,14 +17703,18 @@ query GetEurekaVizSnapshots(
|
|
|
17641
17703
|
});
|
|
17642
17704
|
handleRendering(tsEmbed);
|
|
17643
17705
|
if (forwardedRef) {
|
|
17644
|
-
|
|
17645
|
-
|
|
17706
|
+
if (typeof forwardedRef === 'function') {
|
|
17707
|
+
forwardedRef(tsEmbed);
|
|
17708
|
+
}
|
|
17709
|
+
else {
|
|
17710
|
+
forwardedRef.current = tsEmbed;
|
|
17711
|
+
}
|
|
17646
17712
|
}
|
|
17647
17713
|
return () => {
|
|
17648
17714
|
handleDestroy(tsEmbed);
|
|
17649
17715
|
};
|
|
17650
17716
|
}, [viewConfig, listeners]);
|
|
17651
|
-
return viewConfig.insertAsSibling ? (React.createElement("span", { "data-testid": "tsEmbed", ref: ref, style: { position: 'absolute' } })) : (React.createElement("div", { "data-testid": "tsEmbed", ref: ref, className: className }));
|
|
17717
|
+
return viewConfig.insertAsSibling ? (React.createElement("span", { "data-testid": "tsEmbed", ref: ref, style: { position: 'absolute' } })) : (React.createElement("div", { "data-testid": "tsEmbed", ref: ref, style: style, className: `ts-embed-container ${className}` }));
|
|
17652
17718
|
});
|
|
17653
17719
|
/**
|
|
17654
17720
|
* React component for Search Embed.
|
|
@@ -19223,23 +19289,32 @@ query GetEurekaVizSnapshots(
|
|
|
19223
19289
|
start = start.replace(/\n+/g, `$&${indent}`);
|
|
19224
19290
|
}
|
|
19225
19291
|
const indentSize = indent ? '2' : '1'; // root is at -1
|
|
19226
|
-
|
|
19292
|
+
// Leading | or > is added later
|
|
19293
|
+
let header = (startWithSpace ? indentSize : '') + chomp;
|
|
19227
19294
|
if (comment) {
|
|
19228
19295
|
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
|
19229
19296
|
if (onComment)
|
|
19230
19297
|
onComment();
|
|
19231
19298
|
}
|
|
19232
|
-
if (literal) {
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
|
|
19239
|
-
|
|
19240
|
-
|
|
19241
|
-
|
|
19242
|
-
|
|
19299
|
+
if (!literal) {
|
|
19300
|
+
const foldedValue = value
|
|
19301
|
+
.replace(/\n+/g, '\n$&')
|
|
19302
|
+
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
19303
|
+
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
19304
|
+
.replace(/\n+/g, `$&${indent}`);
|
|
19305
|
+
let literalFallback = false;
|
|
19306
|
+
const foldOptions = getFoldOptions(ctx, true);
|
|
19307
|
+
if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
|
|
19308
|
+
foldOptions.onOverflow = () => {
|
|
19309
|
+
literalFallback = true;
|
|
19310
|
+
};
|
|
19311
|
+
}
|
|
19312
|
+
const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
|
|
19313
|
+
if (!literalFallback)
|
|
19314
|
+
return `>${header}\n${indent}${body}`;
|
|
19315
|
+
}
|
|
19316
|
+
value = value.replace(/\n+/g, `$&${indent}`);
|
|
19317
|
+
return `|${header}\n${indent}${start}${value}${end}`;
|
|
19243
19318
|
}
|
|
19244
19319
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
19245
19320
|
const { type, value } = item;
|
|
@@ -19380,7 +19455,12 @@ query GetEurekaVizSnapshots(
|
|
|
19380
19455
|
let obj;
|
|
19381
19456
|
if (isScalar$1(item)) {
|
|
19382
19457
|
obj = item.value;
|
|
19383
|
-
|
|
19458
|
+
let match = tags.filter(t => t.identify?.(obj));
|
|
19459
|
+
if (match.length > 1) {
|
|
19460
|
+
const testMatch = match.filter(t => t.test);
|
|
19461
|
+
if (testMatch.length > 0)
|
|
19462
|
+
match = testMatch;
|
|
19463
|
+
}
|
|
19384
19464
|
tagObj =
|
|
19385
19465
|
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
|
19386
19466
|
}
|
|
@@ -19593,54 +19673,10 @@ query GetEurekaVizSnapshots(
|
|
|
19593
19673
|
|
|
19594
19674
|
function warn(logLevel, warning) {
|
|
19595
19675
|
if (logLevel === 'debug' || logLevel === 'warn') {
|
|
19596
|
-
|
|
19597
|
-
process.emitWarning(warning);
|
|
19598
|
-
else
|
|
19599
|
-
console.warn(warning);
|
|
19676
|
+
console.warn(warning);
|
|
19600
19677
|
}
|
|
19601
19678
|
}
|
|
19602
19679
|
|
|
19603
|
-
const MERGE_KEY = '<<';
|
|
19604
|
-
function addPairToJSMap(ctx, map, { key, value }) {
|
|
19605
|
-
if (ctx?.doc.schema.merge && isMergeKey(key)) {
|
|
19606
|
-
value = isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
19607
|
-
if (isSeq(value))
|
|
19608
|
-
for (const it of value.items)
|
|
19609
|
-
mergeToJSMap(ctx, map, it);
|
|
19610
|
-
else if (Array.isArray(value))
|
|
19611
|
-
for (const it of value)
|
|
19612
|
-
mergeToJSMap(ctx, map, it);
|
|
19613
|
-
else
|
|
19614
|
-
mergeToJSMap(ctx, map, value);
|
|
19615
|
-
}
|
|
19616
|
-
else {
|
|
19617
|
-
const jsKey = toJS(key, '', ctx);
|
|
19618
|
-
if (map instanceof Map) {
|
|
19619
|
-
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
19620
|
-
}
|
|
19621
|
-
else if (map instanceof Set) {
|
|
19622
|
-
map.add(jsKey);
|
|
19623
|
-
}
|
|
19624
|
-
else {
|
|
19625
|
-
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
19626
|
-
const jsValue = toJS(value, stringKey, ctx);
|
|
19627
|
-
if (stringKey in map)
|
|
19628
|
-
Object.defineProperty(map, stringKey, {
|
|
19629
|
-
value: jsValue,
|
|
19630
|
-
writable: true,
|
|
19631
|
-
enumerable: true,
|
|
19632
|
-
configurable: true
|
|
19633
|
-
});
|
|
19634
|
-
else
|
|
19635
|
-
map[stringKey] = jsValue;
|
|
19636
|
-
}
|
|
19637
|
-
}
|
|
19638
|
-
return map;
|
|
19639
|
-
}
|
|
19640
|
-
const isMergeKey = (key) => key === MERGE_KEY ||
|
|
19641
|
-
(isScalar$1(key) &&
|
|
19642
|
-
key.value === MERGE_KEY &&
|
|
19643
|
-
(!key.type || key.type === Scalar.PLAIN));
|
|
19644
19680
|
// If the value associated with a merge key is a single mapping node, each of
|
|
19645
19681
|
// its key/value pairs is inserted into the current mapping, unless the key
|
|
19646
19682
|
// already exists in it. If the value associated with the merge key is a
|
|
@@ -19648,7 +19684,35 @@ query GetEurekaVizSnapshots(
|
|
|
19648
19684
|
// of these nodes is merged in turn according to its order in the sequence.
|
|
19649
19685
|
// Keys in mapping nodes earlier in the sequence override keys specified in
|
|
19650
19686
|
// later mapping nodes. -- http://yaml.org/type/merge.html
|
|
19651
|
-
|
|
19687
|
+
const MERGE_KEY = '<<';
|
|
19688
|
+
const merge = {
|
|
19689
|
+
identify: value => value === MERGE_KEY ||
|
|
19690
|
+
(typeof value === 'symbol' && value.description === MERGE_KEY),
|
|
19691
|
+
default: 'key',
|
|
19692
|
+
tag: 'tag:yaml.org,2002:merge',
|
|
19693
|
+
test: /^<<$/,
|
|
19694
|
+
resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
|
|
19695
|
+
addToJSMap: addMergeToJSMap
|
|
19696
|
+
}),
|
|
19697
|
+
stringify: () => MERGE_KEY
|
|
19698
|
+
};
|
|
19699
|
+
const isMergeKey = (ctx, key) => (merge.identify(key) ||
|
|
19700
|
+
(isScalar$1(key) &&
|
|
19701
|
+
(!key.type || key.type === Scalar.PLAIN) &&
|
|
19702
|
+
merge.identify(key.value))) &&
|
|
19703
|
+
ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
|
|
19704
|
+
function addMergeToJSMap(ctx, map, value) {
|
|
19705
|
+
value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
19706
|
+
if (isSeq(value))
|
|
19707
|
+
for (const it of value.items)
|
|
19708
|
+
mergeValue(ctx, map, it);
|
|
19709
|
+
else if (Array.isArray(value))
|
|
19710
|
+
for (const it of value)
|
|
19711
|
+
mergeValue(ctx, map, it);
|
|
19712
|
+
else
|
|
19713
|
+
mergeValue(ctx, map, value);
|
|
19714
|
+
}
|
|
19715
|
+
function mergeValue(ctx, map, value) {
|
|
19652
19716
|
const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
19653
19717
|
if (!isMap(source))
|
|
19654
19718
|
throw new Error('Merge sources must be maps or map aliases');
|
|
@@ -19672,6 +19736,37 @@ query GetEurekaVizSnapshots(
|
|
|
19672
19736
|
}
|
|
19673
19737
|
return map;
|
|
19674
19738
|
}
|
|
19739
|
+
|
|
19740
|
+
function addPairToJSMap(ctx, map, { key, value }) {
|
|
19741
|
+
if (isNode(key) && key.addToJSMap)
|
|
19742
|
+
key.addToJSMap(ctx, map, value);
|
|
19743
|
+
// TODO: Should drop this special case for bare << handling
|
|
19744
|
+
else if (isMergeKey(ctx, key))
|
|
19745
|
+
addMergeToJSMap(ctx, map, value);
|
|
19746
|
+
else {
|
|
19747
|
+
const jsKey = toJS(key, '', ctx);
|
|
19748
|
+
if (map instanceof Map) {
|
|
19749
|
+
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
19750
|
+
}
|
|
19751
|
+
else if (map instanceof Set) {
|
|
19752
|
+
map.add(jsKey);
|
|
19753
|
+
}
|
|
19754
|
+
else {
|
|
19755
|
+
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
19756
|
+
const jsValue = toJS(value, stringKey, ctx);
|
|
19757
|
+
if (stringKey in map)
|
|
19758
|
+
Object.defineProperty(map, stringKey, {
|
|
19759
|
+
value: jsValue,
|
|
19760
|
+
writable: true,
|
|
19761
|
+
enumerable: true,
|
|
19762
|
+
configurable: true
|
|
19763
|
+
});
|
|
19764
|
+
else
|
|
19765
|
+
map[stringKey] = jsValue;
|
|
19766
|
+
}
|
|
19767
|
+
}
|
|
19768
|
+
return map;
|
|
19769
|
+
}
|
|
19675
19770
|
function stringifyKey(key, jsKey, ctx) {
|
|
19676
19771
|
if (jsKey === null)
|
|
19677
19772
|
return '';
|
|
@@ -20307,7 +20402,7 @@ query GetEurekaVizSnapshots(
|
|
|
20307
20402
|
identify: value => typeof value === 'boolean',
|
|
20308
20403
|
default: true,
|
|
20309
20404
|
tag: 'tag:yaml.org,2002:bool',
|
|
20310
|
-
test: /^true
|
|
20405
|
+
test: /^true$|^false$/,
|
|
20311
20406
|
resolve: str => str === 'true',
|
|
20312
20407
|
stringify: stringifyJSON
|
|
20313
20408
|
},
|
|
@@ -20352,10 +20447,7 @@ query GetEurekaVizSnapshots(
|
|
|
20352
20447
|
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
|
20353
20448
|
*/
|
|
20354
20449
|
resolve(src, onError) {
|
|
20355
|
-
if (typeof
|
|
20356
|
-
return Buffer.from(src, 'base64');
|
|
20357
|
-
}
|
|
20358
|
-
else if (typeof atob === 'function') {
|
|
20450
|
+
if (typeof atob === 'function') {
|
|
20359
20451
|
// On IE 11, atob() can't handle newlines
|
|
20360
20452
|
const str = atob(src.replace(/[\n\r]/g, ''));
|
|
20361
20453
|
const buffer = new Uint8Array(str.length);
|
|
@@ -20369,15 +20461,11 @@ query GetEurekaVizSnapshots(
|
|
|
20369
20461
|
}
|
|
20370
20462
|
},
|
|
20371
20463
|
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
20464
|
+
if (!value)
|
|
20465
|
+
return '';
|
|
20372
20466
|
const buf = value; // checked earlier by binary.identify()
|
|
20373
20467
|
let str;
|
|
20374
|
-
if (typeof
|
|
20375
|
-
str =
|
|
20376
|
-
buf instanceof Buffer
|
|
20377
|
-
? buf.toString('base64')
|
|
20378
|
-
: Buffer.from(buf.buffer).toString('base64');
|
|
20379
|
-
}
|
|
20380
|
-
else if (typeof btoa === 'function') {
|
|
20468
|
+
if (typeof btoa === 'function') {
|
|
20381
20469
|
let s = '';
|
|
20382
20470
|
for (let i = 0; i < buf.length; ++i)
|
|
20383
20471
|
s += String.fromCharCode(buf[i]);
|
|
@@ -20856,7 +20944,7 @@ query GetEurekaVizSnapshots(
|
|
|
20856
20944
|
}
|
|
20857
20945
|
return new Date(date);
|
|
20858
20946
|
},
|
|
20859
|
-
stringify: ({ value }) => value
|
|
20947
|
+
stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? ''
|
|
20860
20948
|
};
|
|
20861
20949
|
|
|
20862
20950
|
const schema = [
|
|
@@ -20874,6 +20962,7 @@ query GetEurekaVizSnapshots(
|
|
|
20874
20962
|
floatExp,
|
|
20875
20963
|
float,
|
|
20876
20964
|
binary,
|
|
20965
|
+
merge,
|
|
20877
20966
|
omap,
|
|
20878
20967
|
pairs,
|
|
20879
20968
|
set,
|
|
@@ -20901,6 +20990,7 @@ query GetEurekaVizSnapshots(
|
|
|
20901
20990
|
intOct: intOct$1,
|
|
20902
20991
|
intTime,
|
|
20903
20992
|
map,
|
|
20993
|
+
merge,
|
|
20904
20994
|
null: nullTag,
|
|
20905
20995
|
omap,
|
|
20906
20996
|
pairs,
|
|
@@ -20910,13 +21000,20 @@ query GetEurekaVizSnapshots(
|
|
|
20910
21000
|
};
|
|
20911
21001
|
const coreKnownTags = {
|
|
20912
21002
|
'tag:yaml.org,2002:binary': binary,
|
|
21003
|
+
'tag:yaml.org,2002:merge': merge,
|
|
20913
21004
|
'tag:yaml.org,2002:omap': omap,
|
|
20914
21005
|
'tag:yaml.org,2002:pairs': pairs,
|
|
20915
21006
|
'tag:yaml.org,2002:set': set,
|
|
20916
21007
|
'tag:yaml.org,2002:timestamp': timestamp
|
|
20917
21008
|
};
|
|
20918
|
-
function getTags(customTags, schemaName) {
|
|
20919
|
-
|
|
21009
|
+
function getTags(customTags, schemaName, addMergeTag) {
|
|
21010
|
+
const schemaTags = schemas.get(schemaName);
|
|
21011
|
+
if (schemaTags && !customTags) {
|
|
21012
|
+
return addMergeTag && !schemaTags.includes(merge)
|
|
21013
|
+
? schemaTags.concat(merge)
|
|
21014
|
+
: schemaTags.slice();
|
|
21015
|
+
}
|
|
21016
|
+
let tags = schemaTags;
|
|
20920
21017
|
if (!tags) {
|
|
20921
21018
|
if (Array.isArray(customTags))
|
|
20922
21019
|
tags = [];
|
|
@@ -20935,17 +21032,21 @@ query GetEurekaVizSnapshots(
|
|
|
20935
21032
|
else if (typeof customTags === 'function') {
|
|
20936
21033
|
tags = customTags(tags.slice());
|
|
20937
21034
|
}
|
|
20938
|
-
|
|
20939
|
-
|
|
20940
|
-
|
|
20941
|
-
const tagObj = tagsByName[tag];
|
|
20942
|
-
if (tagObj)
|
|
20943
|
-
|
|
20944
|
-
|
|
20945
|
-
|
|
20946
|
-
|
|
20947
|
-
|
|
20948
|
-
|
|
21035
|
+
if (addMergeTag)
|
|
21036
|
+
tags = tags.concat(merge);
|
|
21037
|
+
return tags.reduce((tags, tag) => {
|
|
21038
|
+
const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
|
|
21039
|
+
if (!tagObj) {
|
|
21040
|
+
const tagName = JSON.stringify(tag);
|
|
21041
|
+
const keys = Object.keys(tagsByName)
|
|
21042
|
+
.map(key => JSON.stringify(key))
|
|
21043
|
+
.join(', ');
|
|
21044
|
+
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
|
|
21045
|
+
}
|
|
21046
|
+
if (!tags.includes(tagObj))
|
|
21047
|
+
tags.push(tagObj);
|
|
21048
|
+
return tags;
|
|
21049
|
+
}, []);
|
|
20949
21050
|
}
|
|
20950
21051
|
|
|
20951
21052
|
const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
@@ -20956,10 +21057,9 @@ query GetEurekaVizSnapshots(
|
|
|
20956
21057
|
: compat
|
|
20957
21058
|
? getTags(null, compat)
|
|
20958
21059
|
: null;
|
|
20959
|
-
this.merge = !!merge;
|
|
20960
21060
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
|
20961
21061
|
this.knownTags = resolveKnownTags ? coreKnownTags : {};
|
|
20962
|
-
this.tags = getTags(customTags, this.name);
|
|
21062
|
+
this.tags = getTags(customTags, this.name, merge);
|
|
20963
21063
|
this.toStringOptions = toStringDefaults ?? null;
|
|
20964
21064
|
Object.defineProperty(this, MAP, { value: map });
|
|
20965
21065
|
Object.defineProperty(this, SCALAR$1, { value: string });
|
|
@@ -21084,6 +21184,7 @@ query GetEurekaVizSnapshots(
|
|
|
21084
21184
|
logLevel: 'warn',
|
|
21085
21185
|
prettyErrors: true,
|
|
21086
21186
|
strict: true,
|
|
21187
|
+
stringKeys: false,
|
|
21087
21188
|
uniqueKeys: true,
|
|
21088
21189
|
version: '1.2'
|
|
21089
21190
|
}, options);
|
|
@@ -21307,7 +21408,7 @@ query GetEurekaVizSnapshots(
|
|
|
21307
21408
|
this.directives.yaml.version = '1.1';
|
|
21308
21409
|
else
|
|
21309
21410
|
this.directives = new Directives({ version: '1.1' });
|
|
21310
|
-
opt = {
|
|
21411
|
+
opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
21311
21412
|
break;
|
|
21312
21413
|
case '1.2':
|
|
21313
21414
|
case 'next':
|
|
@@ -21315,7 +21416,7 @@ query GetEurekaVizSnapshots(
|
|
|
21315
21416
|
this.directives.yaml.version = version;
|
|
21316
21417
|
else
|
|
21317
21418
|
this.directives = new Directives({ version });
|
|
21318
|
-
opt = {
|
|
21419
|
+
opt = { resolveKnownTags: true, schema: 'core' };
|
|
21319
21420
|
break;
|
|
21320
21421
|
case null:
|
|
21321
21422
|
if (this.directives)
|
|
@@ -21493,7 +21594,7 @@ query GetEurekaVizSnapshots(
|
|
|
21493
21594
|
if (atNewline) {
|
|
21494
21595
|
if (comment)
|
|
21495
21596
|
comment += token.source;
|
|
21496
|
-
else
|
|
21597
|
+
else if (!found || indicator !== 'seq-item-ind')
|
|
21497
21598
|
spaceBefore = true;
|
|
21498
21599
|
}
|
|
21499
21600
|
else
|
|
@@ -21634,11 +21735,7 @@ query GetEurekaVizSnapshots(
|
|
|
21634
21735
|
return false;
|
|
21635
21736
|
const isEqual = typeof uniqueKeys === 'function'
|
|
21636
21737
|
? uniqueKeys
|
|
21637
|
-
: (a, b) => a === b ||
|
|
21638
|
-
(isScalar$1(a) &&
|
|
21639
|
-
isScalar$1(b) &&
|
|
21640
|
-
a.value === b.value &&
|
|
21641
|
-
!(a.value === '<<' && ctx.schema.merge));
|
|
21738
|
+
: (a, b) => a === b || (isScalar$1(a) && isScalar$1(b) && a.value === b.value);
|
|
21642
21739
|
return items.some(pair => isEqual(pair.key, search));
|
|
21643
21740
|
}
|
|
21644
21741
|
|
|
@@ -21687,12 +21784,14 @@ query GetEurekaVizSnapshots(
|
|
|
21687
21784
|
onError(offset, 'BAD_INDENT', startColMsg);
|
|
21688
21785
|
}
|
|
21689
21786
|
// key value
|
|
21787
|
+
ctx.atKey = true;
|
|
21690
21788
|
const keyStart = keyProps.end;
|
|
21691
21789
|
const keyNode = key
|
|
21692
21790
|
? composeNode(ctx, key, keyProps, onError)
|
|
21693
21791
|
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
|
21694
21792
|
if (ctx.schema.compat)
|
|
21695
21793
|
flowIndentCheck(bm.indent, key, onError);
|
|
21794
|
+
ctx.atKey = false;
|
|
21696
21795
|
if (mapIncludes(ctx, map.items, keyNode))
|
|
21697
21796
|
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
|
21698
21797
|
// value properties
|
|
@@ -21752,6 +21851,8 @@ query GetEurekaVizSnapshots(
|
|
|
21752
21851
|
const seq = new NodeClass(ctx.schema);
|
|
21753
21852
|
if (ctx.atRoot)
|
|
21754
21853
|
ctx.atRoot = false;
|
|
21854
|
+
if (ctx.atKey)
|
|
21855
|
+
ctx.atKey = false;
|
|
21755
21856
|
let offset = bs.offset;
|
|
21756
21857
|
let commentEnd = null;
|
|
21757
21858
|
for (const { start, value } of bs.items) {
|
|
@@ -21836,6 +21937,8 @@ query GetEurekaVizSnapshots(
|
|
|
21836
21937
|
const atRoot = ctx.atRoot;
|
|
21837
21938
|
if (atRoot)
|
|
21838
21939
|
ctx.atRoot = false;
|
|
21940
|
+
if (ctx.atKey)
|
|
21941
|
+
ctx.atKey = false;
|
|
21839
21942
|
let offset = fc.offset + fc.start.source.length;
|
|
21840
21943
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
21841
21944
|
const collItem = fc.items[i];
|
|
@@ -21915,12 +22018,14 @@ query GetEurekaVizSnapshots(
|
|
|
21915
22018
|
else {
|
|
21916
22019
|
// item is a key+value pair
|
|
21917
22020
|
// key value
|
|
22021
|
+
ctx.atKey = true;
|
|
21918
22022
|
const keyStart = props.end;
|
|
21919
22023
|
const keyNode = key
|
|
21920
22024
|
? composeNode(ctx, key, props, onError)
|
|
21921
22025
|
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
|
21922
22026
|
if (isBlock(key))
|
|
21923
22027
|
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
|
22028
|
+
ctx.atKey = false;
|
|
21924
22029
|
// value properties
|
|
21925
22030
|
const valueProps = resolveProps(sep ?? [], {
|
|
21926
22031
|
flow: fcName,
|
|
@@ -22076,8 +22181,8 @@ query GetEurekaVizSnapshots(
|
|
|
22076
22181
|
tag = kt;
|
|
22077
22182
|
}
|
|
22078
22183
|
else {
|
|
22079
|
-
if (kt
|
|
22080
|
-
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
|
|
22184
|
+
if (kt) {
|
|
22185
|
+
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
|
|
22081
22186
|
}
|
|
22082
22187
|
else {
|
|
22083
22188
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
|
|
@@ -22518,11 +22623,16 @@ query GetEurekaVizSnapshots(
|
|
|
22518
22623
|
const tagName = tagToken
|
|
22519
22624
|
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
|
22520
22625
|
: null;
|
|
22521
|
-
|
|
22522
|
-
|
|
22523
|
-
|
|
22524
|
-
|
|
22525
|
-
|
|
22626
|
+
let tag;
|
|
22627
|
+
if (ctx.options.stringKeys && ctx.atKey) {
|
|
22628
|
+
tag = ctx.schema[SCALAR$1];
|
|
22629
|
+
}
|
|
22630
|
+
else if (tagName)
|
|
22631
|
+
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
|
22632
|
+
else if (token.type === 'scalar')
|
|
22633
|
+
tag = findScalarTagByTest(ctx, value, token, onError);
|
|
22634
|
+
else
|
|
22635
|
+
tag = ctx.schema[SCALAR$1];
|
|
22526
22636
|
let scalar;
|
|
22527
22637
|
try {
|
|
22528
22638
|
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
|
@@ -22570,8 +22680,9 @@ query GetEurekaVizSnapshots(
|
|
|
22570
22680
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
|
22571
22681
|
return schema[SCALAR$1];
|
|
22572
22682
|
}
|
|
22573
|
-
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
|
22574
|
-
const tag = schema.tags.find(tag => tag.default && tag.
|
|
22683
|
+
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
|
|
22684
|
+
const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
|
|
22685
|
+
tag.test?.test(value)) || schema[SCALAR$1];
|
|
22575
22686
|
if (schema.compat) {
|
|
22576
22687
|
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
|
22577
22688
|
schema[SCALAR$1];
|
|
@@ -22613,6 +22724,7 @@ query GetEurekaVizSnapshots(
|
|
|
22613
22724
|
|
|
22614
22725
|
const CN = { composeNode, composeEmptyNode };
|
|
22615
22726
|
function composeNode(ctx, token, props, onError) {
|
|
22727
|
+
const atKey = ctx.atKey;
|
|
22616
22728
|
const { spaceBefore, comment, anchor, tag } = props;
|
|
22617
22729
|
let node;
|
|
22618
22730
|
let isSrcToken = true;
|
|
@@ -22648,6 +22760,14 @@ query GetEurekaVizSnapshots(
|
|
|
22648
22760
|
}
|
|
22649
22761
|
if (anchor && node.anchor === '')
|
|
22650
22762
|
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
|
|
22763
|
+
if (atKey &&
|
|
22764
|
+
ctx.options.stringKeys &&
|
|
22765
|
+
(!isScalar$1(node) ||
|
|
22766
|
+
typeof node.value !== 'string' ||
|
|
22767
|
+
(node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
|
|
22768
|
+
const msg = 'With stringKeys, all keys must be strings';
|
|
22769
|
+
onError(tag ?? token, 'NON_STRING_KEY', msg);
|
|
22770
|
+
}
|
|
22651
22771
|
if (spaceBefore)
|
|
22652
22772
|
node.spaceBefore = true;
|
|
22653
22773
|
if (comment) {
|
|
@@ -22700,6 +22820,7 @@ query GetEurekaVizSnapshots(
|
|
|
22700
22820
|
const opts = Object.assign({ _directives: directives }, options);
|
|
22701
22821
|
const doc = new Document(undefined, opts);
|
|
22702
22822
|
const ctx = {
|
|
22823
|
+
atKey: false,
|
|
22703
22824
|
atRoot: true,
|
|
22704
22825
|
directives: doc.directives,
|
|
22705
22826
|
options: doc.options,
|
|
@@ -24834,7 +24955,20 @@ query GetEurekaVizSnapshots(
|
|
|
24834
24955
|
default: {
|
|
24835
24956
|
const bv = this.startBlockValue(map);
|
|
24836
24957
|
if (bv) {
|
|
24837
|
-
if (
|
|
24958
|
+
if (bv.type === 'block-seq') {
|
|
24959
|
+
if (!it.explicitKey &&
|
|
24960
|
+
it.sep &&
|
|
24961
|
+
!includesToken(it.sep, 'newline')) {
|
|
24962
|
+
yield* this.pop({
|
|
24963
|
+
type: 'error',
|
|
24964
|
+
offset: this.offset,
|
|
24965
|
+
message: 'Unexpected block-seq-ind on same line with key',
|
|
24966
|
+
source: this.source
|
|
24967
|
+
});
|
|
24968
|
+
return;
|
|
24969
|
+
}
|
|
24970
|
+
}
|
|
24971
|
+
else if (atMapIndent) {
|
|
24838
24972
|
map.items.push({ start });
|
|
24839
24973
|
}
|
|
24840
24974
|
this.stack.push(bv);
|
|
@@ -25205,6 +25339,8 @@ query GetEurekaVizSnapshots(
|
|
|
25205
25339
|
if (!keepUndefined)
|
|
25206
25340
|
return undefined;
|
|
25207
25341
|
}
|
|
25342
|
+
if (isDocument(value) && !_replacer)
|
|
25343
|
+
return value.toString(options);
|
|
25208
25344
|
return new Document(value, _replacer, options).toString(options);
|
|
25209
25345
|
}
|
|
25210
25346
|
|