@thoughtspot/visual-embed-sdk 1.36.8 → 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 -18
- 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/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 +8 -3
- package/cjs/src/react/index.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 +81 -10
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +45 -9
- package/cjs/src/types.js.map +1 -1
- package/dist/index-BEyovSez.js +7370 -0
- package/dist/{index-BnVGyY5S.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/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/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 +81 -10
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +68 -16
- package/dist/tsembed-react.js +252 -130
- package/dist/tsembed.es.js +63 -15
- package/dist/tsembed.js +246 -128
- package/dist/visual-embed-sdk-react-full.d.ts +99 -13
- package/dist/visual-embed-sdk-react.d.ts +99 -13
- package/dist/visual-embed-sdk.d.ts +99 -13
- package/lib/package.json +23 -18
- 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/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 +7 -3
- package/lib/src/react/index.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 +81 -10
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +44 -8
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +101 -14
- package/package.json +23 -18
- package/src/embed/bodyless-conversation.ts +1 -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 +10 -6
- package/src/types.ts +83 -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";
|
|
@@ -3031,6 +3066,7 @@
|
|
|
3031
3066
|
Param["preAuthCache"] = "preAuthCache";
|
|
3032
3067
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
3033
3068
|
Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
|
|
3069
|
+
Param["PrimaryAction"] = "primaryAction";
|
|
3034
3070
|
})(Param || (Param = {}));
|
|
3035
3071
|
/**
|
|
3036
3072
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -3197,7 +3233,7 @@
|
|
|
3197
3233
|
* The **Collapse data panel** icon on the Search page.
|
|
3198
3234
|
* Collapses the data panel view.
|
|
3199
3235
|
*
|
|
3200
|
-
* @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
|
|
3236
|
+
* @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
|
|
3201
3237
|
*
|
|
3202
3238
|
* @example
|
|
3203
3239
|
* ```js
|
|
@@ -4261,8 +4297,8 @@
|
|
|
4261
4297
|
PrefetchFeatures["VizEmbed"] = "VizEmbed";
|
|
4262
4298
|
})(PrefetchFeatures || (PrefetchFeatures = {}));
|
|
4263
4299
|
/**
|
|
4264
|
-
* Enum for options to change context trigger
|
|
4265
|
-
* BOTH_CLICKS option is
|
|
4300
|
+
* Enum for options to change context trigger.
|
|
4301
|
+
* The `BOTH_CLICKS` option is available from 10.8.0.cl.
|
|
4266
4302
|
*/
|
|
4267
4303
|
var ContextMenuTriggerOptions;
|
|
4268
4304
|
(function (ContextMenuTriggerOptions) {
|
|
@@ -15232,7 +15268,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15232
15268
|
return e;
|
|
15233
15269
|
}
|
|
15234
15270
|
|
|
15235
|
-
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};
|
|
15236
15272
|
|
|
15237
15273
|
/**
|
|
15238
15274
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15706,6 +15742,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15706
15742
|
? (_b = this.viewConfig) === null || _b === void 0 ? void 0 : _b.hiddenHomeLeftNavItems
|
|
15707
15743
|
: [],
|
|
15708
15744
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
15745
|
+
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
15709
15746
|
};
|
|
15710
15747
|
}
|
|
15711
15748
|
async getAppInitData() {
|
|
@@ -15731,7 +15768,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15731
15768
|
* @returns queryParams
|
|
15732
15769
|
*/
|
|
15733
15770
|
getBaseQueryParams(queryParams = {}) {
|
|
15734
|
-
var _a, _b;
|
|
15771
|
+
var _a, _b, _c, _d;
|
|
15735
15772
|
let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
|
|
15736
15773
|
// The below check is needed because TS Cloud firewall, blocks
|
|
15737
15774
|
// localhost/127.0.0.1 in any url param.
|
|
@@ -15768,7 +15805,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15768
15805
|
if (this.embedConfig.currencyFormat) {
|
|
15769
15806
|
queryParams[Param.CurrencyFormat] = this.embedConfig.currencyFormat;
|
|
15770
15807
|
}
|
|
15771
|
-
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;
|
|
15772
15809
|
const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
|
|
15773
15810
|
const additionalFlags = {
|
|
15774
15811
|
...additionalFlagsFromInit,
|
|
@@ -15782,12 +15819,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15782
15819
|
this.handleError('You cannot have both hidden Tabs and visible Tabs');
|
|
15783
15820
|
return queryParams;
|
|
15784
15821
|
}
|
|
15822
|
+
if (primaryAction) {
|
|
15823
|
+
queryParams[Param.PrimaryAction] = primaryAction;
|
|
15824
|
+
}
|
|
15785
15825
|
if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
|
|
15786
15826
|
queryParams[Param.DisableActions] = disabledActions;
|
|
15787
15827
|
}
|
|
15788
15828
|
if (disabledActionReason) {
|
|
15789
15829
|
queryParams[Param.DisableActionReason] = disabledActionReason;
|
|
15790
15830
|
}
|
|
15831
|
+
if (exposeTranslationIDs) {
|
|
15832
|
+
queryParams[Param.ExposeTranslationIDs] = exposeTranslationIDs;
|
|
15833
|
+
}
|
|
15791
15834
|
queryParams[Param.HideActions] = [...this.defaultHiddenActions, ...(hiddenActions !== null && hiddenActions !== void 0 ? hiddenActions : [])];
|
|
15792
15835
|
if (Array.isArray(visibleActions)) {
|
|
15793
15836
|
queryParams[Param.VisibleActions] = visibleActions;
|
|
@@ -15817,6 +15860,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15817
15860
|
if (spriteUrl) {
|
|
15818
15861
|
queryParams[Param.IconSpriteUrl] = spriteUrl.replace('https://', '');
|
|
15819
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
|
+
}
|
|
15820
15868
|
if (showAlerts !== undefined) {
|
|
15821
15869
|
queryParams[Param.ShowAlerts] = showAlerts;
|
|
15822
15870
|
}
|
|
@@ -17655,8 +17703,12 @@ query GetEurekaVizSnapshots(
|
|
|
17655
17703
|
});
|
|
17656
17704
|
handleRendering(tsEmbed);
|
|
17657
17705
|
if (forwardedRef) {
|
|
17658
|
-
|
|
17659
|
-
|
|
17706
|
+
if (typeof forwardedRef === 'function') {
|
|
17707
|
+
forwardedRef(tsEmbed);
|
|
17708
|
+
}
|
|
17709
|
+
else {
|
|
17710
|
+
forwardedRef.current = tsEmbed;
|
|
17711
|
+
}
|
|
17660
17712
|
}
|
|
17661
17713
|
return () => {
|
|
17662
17714
|
handleDestroy(tsEmbed);
|
|
@@ -19237,23 +19289,32 @@ query GetEurekaVizSnapshots(
|
|
|
19237
19289
|
start = start.replace(/\n+/g, `$&${indent}`);
|
|
19238
19290
|
}
|
|
19239
19291
|
const indentSize = indent ? '2' : '1'; // root is at -1
|
|
19240
|
-
|
|
19292
|
+
// Leading | or > is added later
|
|
19293
|
+
let header = (startWithSpace ? indentSize : '') + chomp;
|
|
19241
19294
|
if (comment) {
|
|
19242
19295
|
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
|
19243
19296
|
if (onComment)
|
|
19244
19297
|
onComment();
|
|
19245
19298
|
}
|
|
19246
|
-
if (literal) {
|
|
19247
|
-
|
|
19248
|
-
|
|
19249
|
-
|
|
19250
|
-
|
|
19251
|
-
|
|
19252
|
-
|
|
19253
|
-
|
|
19254
|
-
|
|
19255
|
-
|
|
19256
|
-
|
|
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}`;
|
|
19257
19318
|
}
|
|
19258
19319
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
19259
19320
|
const { type, value } = item;
|
|
@@ -19394,7 +19455,12 @@ query GetEurekaVizSnapshots(
|
|
|
19394
19455
|
let obj;
|
|
19395
19456
|
if (isScalar$1(item)) {
|
|
19396
19457
|
obj = item.value;
|
|
19397
|
-
|
|
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
|
+
}
|
|
19398
19464
|
tagObj =
|
|
19399
19465
|
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
|
19400
19466
|
}
|
|
@@ -19607,54 +19673,10 @@ query GetEurekaVizSnapshots(
|
|
|
19607
19673
|
|
|
19608
19674
|
function warn(logLevel, warning) {
|
|
19609
19675
|
if (logLevel === 'debug' || logLevel === 'warn') {
|
|
19610
|
-
|
|
19611
|
-
process.emitWarning(warning);
|
|
19612
|
-
else
|
|
19613
|
-
console.warn(warning);
|
|
19676
|
+
console.warn(warning);
|
|
19614
19677
|
}
|
|
19615
19678
|
}
|
|
19616
19679
|
|
|
19617
|
-
const MERGE_KEY = '<<';
|
|
19618
|
-
function addPairToJSMap(ctx, map, { key, value }) {
|
|
19619
|
-
if (ctx?.doc.schema.merge && isMergeKey(key)) {
|
|
19620
|
-
value = isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
19621
|
-
if (isSeq(value))
|
|
19622
|
-
for (const it of value.items)
|
|
19623
|
-
mergeToJSMap(ctx, map, it);
|
|
19624
|
-
else if (Array.isArray(value))
|
|
19625
|
-
for (const it of value)
|
|
19626
|
-
mergeToJSMap(ctx, map, it);
|
|
19627
|
-
else
|
|
19628
|
-
mergeToJSMap(ctx, map, value);
|
|
19629
|
-
}
|
|
19630
|
-
else {
|
|
19631
|
-
const jsKey = toJS(key, '', ctx);
|
|
19632
|
-
if (map instanceof Map) {
|
|
19633
|
-
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
19634
|
-
}
|
|
19635
|
-
else if (map instanceof Set) {
|
|
19636
|
-
map.add(jsKey);
|
|
19637
|
-
}
|
|
19638
|
-
else {
|
|
19639
|
-
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
19640
|
-
const jsValue = toJS(value, stringKey, ctx);
|
|
19641
|
-
if (stringKey in map)
|
|
19642
|
-
Object.defineProperty(map, stringKey, {
|
|
19643
|
-
value: jsValue,
|
|
19644
|
-
writable: true,
|
|
19645
|
-
enumerable: true,
|
|
19646
|
-
configurable: true
|
|
19647
|
-
});
|
|
19648
|
-
else
|
|
19649
|
-
map[stringKey] = jsValue;
|
|
19650
|
-
}
|
|
19651
|
-
}
|
|
19652
|
-
return map;
|
|
19653
|
-
}
|
|
19654
|
-
const isMergeKey = (key) => key === MERGE_KEY ||
|
|
19655
|
-
(isScalar$1(key) &&
|
|
19656
|
-
key.value === MERGE_KEY &&
|
|
19657
|
-
(!key.type || key.type === Scalar.PLAIN));
|
|
19658
19680
|
// If the value associated with a merge key is a single mapping node, each of
|
|
19659
19681
|
// its key/value pairs is inserted into the current mapping, unless the key
|
|
19660
19682
|
// already exists in it. If the value associated with the merge key is a
|
|
@@ -19662,7 +19684,35 @@ query GetEurekaVizSnapshots(
|
|
|
19662
19684
|
// of these nodes is merged in turn according to its order in the sequence.
|
|
19663
19685
|
// Keys in mapping nodes earlier in the sequence override keys specified in
|
|
19664
19686
|
// later mapping nodes. -- http://yaml.org/type/merge.html
|
|
19665
|
-
|
|
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) {
|
|
19666
19716
|
const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
19667
19717
|
if (!isMap(source))
|
|
19668
19718
|
throw new Error('Merge sources must be maps or map aliases');
|
|
@@ -19686,6 +19736,37 @@ query GetEurekaVizSnapshots(
|
|
|
19686
19736
|
}
|
|
19687
19737
|
return map;
|
|
19688
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
|
+
}
|
|
19689
19770
|
function stringifyKey(key, jsKey, ctx) {
|
|
19690
19771
|
if (jsKey === null)
|
|
19691
19772
|
return '';
|
|
@@ -20321,7 +20402,7 @@ query GetEurekaVizSnapshots(
|
|
|
20321
20402
|
identify: value => typeof value === 'boolean',
|
|
20322
20403
|
default: true,
|
|
20323
20404
|
tag: 'tag:yaml.org,2002:bool',
|
|
20324
|
-
test: /^true
|
|
20405
|
+
test: /^true$|^false$/,
|
|
20325
20406
|
resolve: str => str === 'true',
|
|
20326
20407
|
stringify: stringifyJSON
|
|
20327
20408
|
},
|
|
@@ -20366,10 +20447,7 @@ query GetEurekaVizSnapshots(
|
|
|
20366
20447
|
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
|
20367
20448
|
*/
|
|
20368
20449
|
resolve(src, onError) {
|
|
20369
|
-
if (typeof
|
|
20370
|
-
return Buffer.from(src, 'base64');
|
|
20371
|
-
}
|
|
20372
|
-
else if (typeof atob === 'function') {
|
|
20450
|
+
if (typeof atob === 'function') {
|
|
20373
20451
|
// On IE 11, atob() can't handle newlines
|
|
20374
20452
|
const str = atob(src.replace(/[\n\r]/g, ''));
|
|
20375
20453
|
const buffer = new Uint8Array(str.length);
|
|
@@ -20383,15 +20461,11 @@ query GetEurekaVizSnapshots(
|
|
|
20383
20461
|
}
|
|
20384
20462
|
},
|
|
20385
20463
|
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
20464
|
+
if (!value)
|
|
20465
|
+
return '';
|
|
20386
20466
|
const buf = value; // checked earlier by binary.identify()
|
|
20387
20467
|
let str;
|
|
20388
|
-
if (typeof
|
|
20389
|
-
str =
|
|
20390
|
-
buf instanceof Buffer
|
|
20391
|
-
? buf.toString('base64')
|
|
20392
|
-
: Buffer.from(buf.buffer).toString('base64');
|
|
20393
|
-
}
|
|
20394
|
-
else if (typeof btoa === 'function') {
|
|
20468
|
+
if (typeof btoa === 'function') {
|
|
20395
20469
|
let s = '';
|
|
20396
20470
|
for (let i = 0; i < buf.length; ++i)
|
|
20397
20471
|
s += String.fromCharCode(buf[i]);
|
|
@@ -20870,7 +20944,7 @@ query GetEurekaVizSnapshots(
|
|
|
20870
20944
|
}
|
|
20871
20945
|
return new Date(date);
|
|
20872
20946
|
},
|
|
20873
|
-
stringify: ({ value }) => value
|
|
20947
|
+
stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? ''
|
|
20874
20948
|
};
|
|
20875
20949
|
|
|
20876
20950
|
const schema = [
|
|
@@ -20888,6 +20962,7 @@ query GetEurekaVizSnapshots(
|
|
|
20888
20962
|
floatExp,
|
|
20889
20963
|
float,
|
|
20890
20964
|
binary,
|
|
20965
|
+
merge,
|
|
20891
20966
|
omap,
|
|
20892
20967
|
pairs,
|
|
20893
20968
|
set,
|
|
@@ -20915,6 +20990,7 @@ query GetEurekaVizSnapshots(
|
|
|
20915
20990
|
intOct: intOct$1,
|
|
20916
20991
|
intTime,
|
|
20917
20992
|
map,
|
|
20993
|
+
merge,
|
|
20918
20994
|
null: nullTag,
|
|
20919
20995
|
omap,
|
|
20920
20996
|
pairs,
|
|
@@ -20924,13 +21000,20 @@ query GetEurekaVizSnapshots(
|
|
|
20924
21000
|
};
|
|
20925
21001
|
const coreKnownTags = {
|
|
20926
21002
|
'tag:yaml.org,2002:binary': binary,
|
|
21003
|
+
'tag:yaml.org,2002:merge': merge,
|
|
20927
21004
|
'tag:yaml.org,2002:omap': omap,
|
|
20928
21005
|
'tag:yaml.org,2002:pairs': pairs,
|
|
20929
21006
|
'tag:yaml.org,2002:set': set,
|
|
20930
21007
|
'tag:yaml.org,2002:timestamp': timestamp
|
|
20931
21008
|
};
|
|
20932
|
-
function getTags(customTags, schemaName) {
|
|
20933
|
-
|
|
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;
|
|
20934
21017
|
if (!tags) {
|
|
20935
21018
|
if (Array.isArray(customTags))
|
|
20936
21019
|
tags = [];
|
|
@@ -20949,17 +21032,21 @@ query GetEurekaVizSnapshots(
|
|
|
20949
21032
|
else if (typeof customTags === 'function') {
|
|
20950
21033
|
tags = customTags(tags.slice());
|
|
20951
21034
|
}
|
|
20952
|
-
|
|
20953
|
-
|
|
20954
|
-
|
|
20955
|
-
const tagObj = tagsByName[tag];
|
|
20956
|
-
if (tagObj)
|
|
20957
|
-
|
|
20958
|
-
|
|
20959
|
-
|
|
20960
|
-
|
|
20961
|
-
|
|
20962
|
-
|
|
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
|
+
}, []);
|
|
20963
21050
|
}
|
|
20964
21051
|
|
|
20965
21052
|
const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
@@ -20970,10 +21057,9 @@ query GetEurekaVizSnapshots(
|
|
|
20970
21057
|
: compat
|
|
20971
21058
|
? getTags(null, compat)
|
|
20972
21059
|
: null;
|
|
20973
|
-
this.merge = !!merge;
|
|
20974
21060
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
|
20975
21061
|
this.knownTags = resolveKnownTags ? coreKnownTags : {};
|
|
20976
|
-
this.tags = getTags(customTags, this.name);
|
|
21062
|
+
this.tags = getTags(customTags, this.name, merge);
|
|
20977
21063
|
this.toStringOptions = toStringDefaults ?? null;
|
|
20978
21064
|
Object.defineProperty(this, MAP, { value: map });
|
|
20979
21065
|
Object.defineProperty(this, SCALAR$1, { value: string });
|
|
@@ -21098,6 +21184,7 @@ query GetEurekaVizSnapshots(
|
|
|
21098
21184
|
logLevel: 'warn',
|
|
21099
21185
|
prettyErrors: true,
|
|
21100
21186
|
strict: true,
|
|
21187
|
+
stringKeys: false,
|
|
21101
21188
|
uniqueKeys: true,
|
|
21102
21189
|
version: '1.2'
|
|
21103
21190
|
}, options);
|
|
@@ -21321,7 +21408,7 @@ query GetEurekaVizSnapshots(
|
|
|
21321
21408
|
this.directives.yaml.version = '1.1';
|
|
21322
21409
|
else
|
|
21323
21410
|
this.directives = new Directives({ version: '1.1' });
|
|
21324
|
-
opt = {
|
|
21411
|
+
opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
21325
21412
|
break;
|
|
21326
21413
|
case '1.2':
|
|
21327
21414
|
case 'next':
|
|
@@ -21329,7 +21416,7 @@ query GetEurekaVizSnapshots(
|
|
|
21329
21416
|
this.directives.yaml.version = version;
|
|
21330
21417
|
else
|
|
21331
21418
|
this.directives = new Directives({ version });
|
|
21332
|
-
opt = {
|
|
21419
|
+
opt = { resolveKnownTags: true, schema: 'core' };
|
|
21333
21420
|
break;
|
|
21334
21421
|
case null:
|
|
21335
21422
|
if (this.directives)
|
|
@@ -21507,7 +21594,7 @@ query GetEurekaVizSnapshots(
|
|
|
21507
21594
|
if (atNewline) {
|
|
21508
21595
|
if (comment)
|
|
21509
21596
|
comment += token.source;
|
|
21510
|
-
else
|
|
21597
|
+
else if (!found || indicator !== 'seq-item-ind')
|
|
21511
21598
|
spaceBefore = true;
|
|
21512
21599
|
}
|
|
21513
21600
|
else
|
|
@@ -21648,11 +21735,7 @@ query GetEurekaVizSnapshots(
|
|
|
21648
21735
|
return false;
|
|
21649
21736
|
const isEqual = typeof uniqueKeys === 'function'
|
|
21650
21737
|
? uniqueKeys
|
|
21651
|
-
: (a, b) => a === b ||
|
|
21652
|
-
(isScalar$1(a) &&
|
|
21653
|
-
isScalar$1(b) &&
|
|
21654
|
-
a.value === b.value &&
|
|
21655
|
-
!(a.value === '<<' && ctx.schema.merge));
|
|
21738
|
+
: (a, b) => a === b || (isScalar$1(a) && isScalar$1(b) && a.value === b.value);
|
|
21656
21739
|
return items.some(pair => isEqual(pair.key, search));
|
|
21657
21740
|
}
|
|
21658
21741
|
|
|
@@ -21701,12 +21784,14 @@ query GetEurekaVizSnapshots(
|
|
|
21701
21784
|
onError(offset, 'BAD_INDENT', startColMsg);
|
|
21702
21785
|
}
|
|
21703
21786
|
// key value
|
|
21787
|
+
ctx.atKey = true;
|
|
21704
21788
|
const keyStart = keyProps.end;
|
|
21705
21789
|
const keyNode = key
|
|
21706
21790
|
? composeNode(ctx, key, keyProps, onError)
|
|
21707
21791
|
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
|
21708
21792
|
if (ctx.schema.compat)
|
|
21709
21793
|
flowIndentCheck(bm.indent, key, onError);
|
|
21794
|
+
ctx.atKey = false;
|
|
21710
21795
|
if (mapIncludes(ctx, map.items, keyNode))
|
|
21711
21796
|
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
|
21712
21797
|
// value properties
|
|
@@ -21766,6 +21851,8 @@ query GetEurekaVizSnapshots(
|
|
|
21766
21851
|
const seq = new NodeClass(ctx.schema);
|
|
21767
21852
|
if (ctx.atRoot)
|
|
21768
21853
|
ctx.atRoot = false;
|
|
21854
|
+
if (ctx.atKey)
|
|
21855
|
+
ctx.atKey = false;
|
|
21769
21856
|
let offset = bs.offset;
|
|
21770
21857
|
let commentEnd = null;
|
|
21771
21858
|
for (const { start, value } of bs.items) {
|
|
@@ -21850,6 +21937,8 @@ query GetEurekaVizSnapshots(
|
|
|
21850
21937
|
const atRoot = ctx.atRoot;
|
|
21851
21938
|
if (atRoot)
|
|
21852
21939
|
ctx.atRoot = false;
|
|
21940
|
+
if (ctx.atKey)
|
|
21941
|
+
ctx.atKey = false;
|
|
21853
21942
|
let offset = fc.offset + fc.start.source.length;
|
|
21854
21943
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
21855
21944
|
const collItem = fc.items[i];
|
|
@@ -21929,12 +22018,14 @@ query GetEurekaVizSnapshots(
|
|
|
21929
22018
|
else {
|
|
21930
22019
|
// item is a key+value pair
|
|
21931
22020
|
// key value
|
|
22021
|
+
ctx.atKey = true;
|
|
21932
22022
|
const keyStart = props.end;
|
|
21933
22023
|
const keyNode = key
|
|
21934
22024
|
? composeNode(ctx, key, props, onError)
|
|
21935
22025
|
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
|
21936
22026
|
if (isBlock(key))
|
|
21937
22027
|
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
|
22028
|
+
ctx.atKey = false;
|
|
21938
22029
|
// value properties
|
|
21939
22030
|
const valueProps = resolveProps(sep ?? [], {
|
|
21940
22031
|
flow: fcName,
|
|
@@ -22090,8 +22181,8 @@ query GetEurekaVizSnapshots(
|
|
|
22090
22181
|
tag = kt;
|
|
22091
22182
|
}
|
|
22092
22183
|
else {
|
|
22093
|
-
if (kt
|
|
22094
|
-
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);
|
|
22095
22186
|
}
|
|
22096
22187
|
else {
|
|
22097
22188
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
|
|
@@ -22532,11 +22623,16 @@ query GetEurekaVizSnapshots(
|
|
|
22532
22623
|
const tagName = tagToken
|
|
22533
22624
|
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
|
22534
22625
|
: null;
|
|
22535
|
-
|
|
22536
|
-
|
|
22537
|
-
|
|
22538
|
-
|
|
22539
|
-
|
|
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];
|
|
22540
22636
|
let scalar;
|
|
22541
22637
|
try {
|
|
22542
22638
|
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
|
@@ -22584,8 +22680,9 @@ query GetEurekaVizSnapshots(
|
|
|
22584
22680
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
|
22585
22681
|
return schema[SCALAR$1];
|
|
22586
22682
|
}
|
|
22587
|
-
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
|
22588
|
-
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];
|
|
22589
22686
|
if (schema.compat) {
|
|
22590
22687
|
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
|
22591
22688
|
schema[SCALAR$1];
|
|
@@ -22627,6 +22724,7 @@ query GetEurekaVizSnapshots(
|
|
|
22627
22724
|
|
|
22628
22725
|
const CN = { composeNode, composeEmptyNode };
|
|
22629
22726
|
function composeNode(ctx, token, props, onError) {
|
|
22727
|
+
const atKey = ctx.atKey;
|
|
22630
22728
|
const { spaceBefore, comment, anchor, tag } = props;
|
|
22631
22729
|
let node;
|
|
22632
22730
|
let isSrcToken = true;
|
|
@@ -22662,6 +22760,14 @@ query GetEurekaVizSnapshots(
|
|
|
22662
22760
|
}
|
|
22663
22761
|
if (anchor && node.anchor === '')
|
|
22664
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
|
+
}
|
|
22665
22771
|
if (spaceBefore)
|
|
22666
22772
|
node.spaceBefore = true;
|
|
22667
22773
|
if (comment) {
|
|
@@ -22714,6 +22820,7 @@ query GetEurekaVizSnapshots(
|
|
|
22714
22820
|
const opts = Object.assign({ _directives: directives }, options);
|
|
22715
22821
|
const doc = new Document(undefined, opts);
|
|
22716
22822
|
const ctx = {
|
|
22823
|
+
atKey: false,
|
|
22717
22824
|
atRoot: true,
|
|
22718
22825
|
directives: doc.directives,
|
|
22719
22826
|
options: doc.options,
|
|
@@ -24848,7 +24955,20 @@ query GetEurekaVizSnapshots(
|
|
|
24848
24955
|
default: {
|
|
24849
24956
|
const bv = this.startBlockValue(map);
|
|
24850
24957
|
if (bv) {
|
|
24851
|
-
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) {
|
|
24852
24972
|
map.items.push({ start });
|
|
24853
24973
|
}
|
|
24854
24974
|
this.stack.push(bv);
|
|
@@ -25219,6 +25339,8 @@ query GetEurekaVizSnapshots(
|
|
|
25219
25339
|
if (!keepUndefined)
|
|
25220
25340
|
return undefined;
|
|
25221
25341
|
}
|
|
25342
|
+
if (isDocument(value) && !_replacer)
|
|
25343
|
+
return value.toString(options);
|
|
25222
25344
|
return new Document(value, _replacer, options).toString(options);
|
|
25223
25345
|
}
|
|
25224
25346
|
|