@thoughtspot/visual-embed-sdk 1.42.1-alpha.6 → 1.42.2
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 +3 -2
- package/cjs/src/css-variables.d.ts +0 -48
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +20 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +9 -4
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +62 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +1 -1
- package/cjs/src/embed/conversation.d.ts +16 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +5 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +25 -1
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +1 -11
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +0 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +5 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +46 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +4 -4
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +1 -3
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +0 -2
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +14 -42
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.js +1 -1
- package/cjs/src/errors.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 +1 -2
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +3 -2
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/util.d.ts +1 -0
- package/cjs/src/react/util.d.ts.map +1 -1
- package/cjs/src/types.d.ts +58 -93
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +21 -46
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/custom-actions.d.ts.map +1 -1
- package/cjs/src/utils/custom-actions.js +9 -0
- package/cjs/src/utils/custom-actions.js.map +1 -1
- package/cjs/src/utils/custom-actions.spec.js +20 -0
- package/cjs/src/utils/custom-actions.spec.js.map +1 -1
- package/cjs/src/utils/processData.d.ts +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +8 -8
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/dist/{index-DvNA626T.js → index-CjbriUI0.js} +1 -1
- package/dist/src/css-variables.d.ts +0 -48
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +20 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +1 -1
- package/dist/src/embed/conversation.d.ts +16 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +1 -11
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +4 -4
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +0 -2
- 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/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/util.d.ts +1 -0
- package/dist/src/react/util.d.ts.map +1 -1
- package/dist/src/types.d.ts +58 -93
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/custom-actions.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +84 -219
- package/dist/tsembed-react.js +228 -439
- package/dist/tsembed.es.js +85 -220
- package/dist/tsembed.js +228 -439
- package/dist/visual-embed-sdk-react-full.d.ts +104 -160
- package/dist/visual-embed-sdk-react.d.ts +95 -155
- package/dist/visual-embed-sdk.d.ts +95 -158
- package/lib/package.json +3 -2
- package/lib/src/css-variables.d.ts +0 -48
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +20 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +9 -4
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +62 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +1 -1
- package/lib/src/embed/conversation.d.ts +16 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +5 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +25 -1
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +1 -11
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +0 -1
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +5 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +47 -1
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +4 -4
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +1 -3
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +0 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +14 -42
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.js +1 -1
- package/lib/src/errors.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/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/util.d.ts +1 -0
- package/lib/src/react/util.d.ts.map +1 -1
- package/lib/src/types.d.ts +58 -93
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +20 -45
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/custom-actions.d.ts.map +1 -1
- package/lib/src/utils/custom-actions.js +9 -0
- package/lib/src/utils/custom-actions.js.map +1 -1
- package/lib/src/utils/custom-actions.spec.js +20 -0
- package/lib/src/utils/custom-actions.spec.js.map +1 -1
- package/lib/src/utils/processData.d.ts +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +8 -8
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/package.json +3 -2
- package/src/css-variables.ts +0 -58
- package/src/embed/app.spec.ts +87 -0
- package/src/embed/app.ts +35 -4
- package/src/embed/bodyless-conversation.ts +1 -1
- package/src/embed/conversation.spec.ts +35 -1
- package/src/embed/conversation.ts +22 -0
- package/src/embed/hostEventClient/contracts.ts +0 -10
- package/src/embed/liveboard.spec.ts +60 -0
- package/src/embed/liveboard.ts +9 -0
- package/src/embed/sage.ts +4 -4
- package/src/embed/search.ts +1 -3
- package/src/embed/ts-embed.spec.ts +7 -7
- package/src/embed/ts-embed.ts +31 -67
- package/src/errors.ts +1 -1
- package/src/index.ts +0 -2
- package/src/react/all-types-export.ts +2 -1
- package/src/types.ts +56 -94
- package/src/utils/custom-actions.spec.ts +22 -0
- package/src/utils/custom-actions.ts +11 -0
- package/src/utils/processData.spec.ts +1 -0
- package/src/utils/processData.ts +11 -11
- package/cjs/src/api-intercept.d.ts +0 -31
- package/cjs/src/api-intercept.d.ts.map +0 -1
- package/cjs/src/api-intercept.js +0 -117
- package/cjs/src/api-intercept.js.map +0 -1
- package/cjs/src/api-intercept.spec.d.ts +0 -2
- package/cjs/src/api-intercept.spec.d.ts.map +0 -1
- package/cjs/src/api-intercept.spec.js +0 -122
- package/cjs/src/api-intercept.spec.js.map +0 -1
- package/dist/index-BCC3Z072.js +0 -7371
- package/dist/index-BEzW4MDA.js +0 -7371
- package/dist/index-BaESA9rq.js +0 -7371
- package/dist/index-CFNZIcKr.js +0 -7447
- package/dist/index-DFnPKcjZ.js +0 -7447
- package/dist/index-DhFH7b7U.js +0 -7447
- package/dist/src/api-intercept.d.ts +0 -31
- package/dist/src/api-intercept.d.ts.map +0 -1
- package/dist/src/api-intercept.spec.d.ts +0 -2
- package/dist/src/api-intercept.spec.d.ts.map +0 -1
- package/lib/src/api-intercept.d.ts +0 -31
- package/lib/src/api-intercept.d.ts.map +0 -1
- package/lib/src/api-intercept.js +0 -110
- package/lib/src/api-intercept.js.map +0 -1
- package/lib/src/api-intercept.spec.d.ts +0 -2
- package/lib/src/api-intercept.spec.d.ts.map +0 -1
- package/lib/src/api-intercept.spec.js +0 -119
- package/lib/src/api-intercept.spec.js.map +0 -1
- package/src/api-intercept.ts +0 -136
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.42.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.2 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
}
|
|
164
164
|
return false;
|
|
165
165
|
};
|
|
166
|
-
const merge
|
|
166
|
+
const merge = (...objects) => objects.reduce((result, current) => {
|
|
167
167
|
if (Array.isArray(current)) {
|
|
168
168
|
throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
|
|
169
169
|
}
|
|
@@ -172,19 +172,19 @@
|
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
174
|
if (Array.isArray(result[key]) && Array.isArray(current[key])) {
|
|
175
|
-
result[key] = merge
|
|
176
|
-
? merge
|
|
175
|
+
result[key] = merge.options.mergeArrays
|
|
176
|
+
? merge.options.uniqueArrayItems
|
|
177
177
|
? Array.from(new Set(result[key].concat(current[key])))
|
|
178
178
|
: [...result[key], ...current[key]]
|
|
179
179
|
: current[key];
|
|
180
180
|
}
|
|
181
181
|
else if (isObject$1(result[key]) && isObject$1(current[key])) {
|
|
182
|
-
result[key] = merge
|
|
182
|
+
result[key] = merge(result[key], current[key]);
|
|
183
183
|
}
|
|
184
184
|
else {
|
|
185
185
|
result[key] =
|
|
186
186
|
current[key] === undefined
|
|
187
|
-
? merge
|
|
187
|
+
? merge.options.allowUndefinedOverrides
|
|
188
188
|
? current[key]
|
|
189
189
|
: result[key]
|
|
190
190
|
: current[key];
|
|
@@ -197,11 +197,11 @@
|
|
|
197
197
|
mergeArrays: true,
|
|
198
198
|
uniqueArrayItems: true,
|
|
199
199
|
};
|
|
200
|
-
merge
|
|
201
|
-
merge
|
|
202
|
-
merge
|
|
203
|
-
const result = merge
|
|
204
|
-
merge
|
|
200
|
+
merge.options = defaultOptions;
|
|
201
|
+
merge.withOptions = (options, ...objects) => {
|
|
202
|
+
merge.options = Object.assign(Object.assign({}, defaultOptions), options);
|
|
203
|
+
const result = merge(...objects);
|
|
204
|
+
merge.options = defaultOptions;
|
|
205
205
|
return result;
|
|
206
206
|
};
|
|
207
207
|
|
|
@@ -1573,7 +1573,7 @@
|
|
|
1573
1573
|
* the table visualization.
|
|
1574
1574
|
*
|
|
1575
1575
|
* If the Row-Level Security (RLS) rules are applied on the
|
|
1576
|
-
*
|
|
1576
|
+
* Model, exercise caution when changing column
|
|
1577
1577
|
* or table cell values to maintain data security.
|
|
1578
1578
|
*
|
|
1579
1579
|
* @example
|
|
@@ -1631,7 +1631,7 @@
|
|
|
1631
1631
|
*/
|
|
1632
1632
|
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1633
1633
|
/**
|
|
1634
|
-
* Emitted when user opens up the
|
|
1634
|
+
* Emitted when user opens up the data source preview modal in Spotter embed.
|
|
1635
1635
|
* @example
|
|
1636
1636
|
* ```js
|
|
1637
1637
|
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
@@ -1719,21 +1719,6 @@
|
|
|
1719
1719
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1720
1720
|
*/
|
|
1721
1721
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1722
|
-
/**
|
|
1723
|
-
* Emitted when the user intercepts a URL.
|
|
1724
|
-
*
|
|
1725
|
-
* Supported on all embed types.
|
|
1726
|
-
*
|
|
1727
|
-
* @example
|
|
1728
|
-
* ```js
|
|
1729
|
-
* embed.on(EmbedEvent.ApiIntercept, (payload) => {
|
|
1730
|
-
* console.log('payload', payload);
|
|
1731
|
-
* })
|
|
1732
|
-
* ```
|
|
1733
|
-
*
|
|
1734
|
-
* @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl
|
|
1735
|
-
*/
|
|
1736
|
-
EmbedEvent["ApiIntercept"] = "ApiIntercept";
|
|
1737
1722
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1738
1723
|
/**
|
|
1739
1724
|
* Event types that can be triggered by the host application
|
|
@@ -1872,9 +1857,7 @@
|
|
|
1872
1857
|
*/
|
|
1873
1858
|
HostEvent["Reload"] = "reload";
|
|
1874
1859
|
/**
|
|
1875
|
-
* Get iframe URL for the current embed view
|
|
1876
|
-
* Developers can use this URL to embed a ThoughtSpot object
|
|
1877
|
-
* in apps like Salesforce or Sharepoint.
|
|
1860
|
+
* Get iframe URL for the current embed view.
|
|
1878
1861
|
* @example
|
|
1879
1862
|
* ```js
|
|
1880
1863
|
* const url = embed.trigger(HostEvent.GetIframeUrl);
|
|
@@ -2946,7 +2929,7 @@
|
|
|
2946
2929
|
*/
|
|
2947
2930
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2948
2931
|
/**
|
|
2949
|
-
* Opens the
|
|
2932
|
+
* Opens the data source preview modal in Spotter Embed.
|
|
2950
2933
|
* @example
|
|
2951
2934
|
* ```js
|
|
2952
2935
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
@@ -3071,6 +3054,7 @@
|
|
|
3071
3054
|
Param["HideResult"] = "hideResult";
|
|
3072
3055
|
Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
|
|
3073
3056
|
Param["Tag"] = "tag";
|
|
3057
|
+
Param["HideTagFilterChips"] = "hideTagFilterChips";
|
|
3074
3058
|
Param["AutoLogin"] = "autoLogin";
|
|
3075
3059
|
Param["searchTokenString"] = "searchTokenString";
|
|
3076
3060
|
Param["executeSearch"] = "executeSearch";
|
|
@@ -3159,6 +3143,7 @@
|
|
|
3159
3143
|
Param["ShowLiveboardReverifyBanner"] = "showLiveboardReverifyBanner";
|
|
3160
3144
|
Param["LiveboardHeaderV2"] = "isLiveboardHeaderV2Enabled";
|
|
3161
3145
|
Param["HideIrrelevantFiltersInTab"] = "hideIrrelevantFiltersAtTabLevel";
|
|
3146
|
+
Param["IsEnhancedFilterInteractivityEnabled"] = "isLiveboardPermissionV2Enabled";
|
|
3162
3147
|
Param["SpotterEnabled"] = "isSpotterExperienceEnabled";
|
|
3163
3148
|
Param["IsUnifiedSearchExperienceEnabled"] = "isUnifiedSearchExperienceEnabled";
|
|
3164
3149
|
Param["OverrideOrgId"] = "orgId";
|
|
@@ -3175,7 +3160,9 @@
|
|
|
3175
3160
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3176
3161
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3177
3162
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3163
|
+
Param["isCentralizedLiveboardFilterUXEnabled"] = "isCentralizedLiveboardFilterUXEnabled";
|
|
3178
3164
|
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3165
|
+
Param["EnablePastConversationsSidebar"] = "enablePastConversationsSidebar";
|
|
3179
3166
|
})(Param || (Param = {}));
|
|
3180
3167
|
/**
|
|
3181
3168
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -3288,7 +3275,7 @@
|
|
|
3288
3275
|
*/
|
|
3289
3276
|
Action["SchedulesList"] = "schedule-list";
|
|
3290
3277
|
/**
|
|
3291
|
-
* The **Share** action on a Liveboard, Answer, or
|
|
3278
|
+
* The **Share** action on a Liveboard, Answer, or Model.
|
|
3292
3279
|
* Allows users to share an object with other users and groups.
|
|
3293
3280
|
* @example
|
|
3294
3281
|
* ```js
|
|
@@ -3746,7 +3733,7 @@
|
|
|
3746
3733
|
Action["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
3747
3734
|
/**
|
|
3748
3735
|
* The Favorites icon (*) for Answers,
|
|
3749
|
-
* Liveboard, and data objects like
|
|
3736
|
+
* Liveboard, and data objects like Model,
|
|
3750
3737
|
* Tables and Views.
|
|
3751
3738
|
* Allows adding an object to the user's favorites list.
|
|
3752
3739
|
* @example
|
|
@@ -4480,6 +4467,16 @@
|
|
|
4480
4467
|
* @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
4481
4468
|
*/
|
|
4482
4469
|
Action["RemoveAttachment"] = "removeAttachment";
|
|
4470
|
+
/**
|
|
4471
|
+
* The **Style panel** on a Liveboard.
|
|
4472
|
+
* Controls the visibility of the Liveboard style panel.
|
|
4473
|
+
* @example
|
|
4474
|
+
* ```js
|
|
4475
|
+
* hiddenActions: [Action.LiveboardStylePanel]
|
|
4476
|
+
* ```
|
|
4477
|
+
* @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.15.0.cl
|
|
4478
|
+
*/
|
|
4479
|
+
Action["LiveboardStylePanel"] = "liveboardStylePanel";
|
|
4483
4480
|
})(exports.Action || (exports.Action = {}));
|
|
4484
4481
|
var PrefetchFeatures;
|
|
4485
4482
|
(function (PrefetchFeatures) {
|
|
@@ -4601,29 +4598,7 @@
|
|
|
4601
4598
|
* @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl
|
|
4602
4599
|
*/
|
|
4603
4600
|
LogLevel["TRACE"] = "TRACE";
|
|
4604
|
-
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4605
|
-
/**
|
|
4606
|
-
* Enum for the type of API intercepted
|
|
4607
|
-
*/
|
|
4608
|
-
var InterceptedApiType;
|
|
4609
|
-
(function (InterceptedApiType) {
|
|
4610
|
-
/**
|
|
4611
|
-
* The apis that are use to get the metadata for the embed
|
|
4612
|
-
*/
|
|
4613
|
-
InterceptedApiType["METADATA"] = "METADATA";
|
|
4614
|
-
/**
|
|
4615
|
-
* The apis that are use to get the data for the embed
|
|
4616
|
-
*/
|
|
4617
|
-
InterceptedApiType["ANSWER_DATA"] = "ANSWER_DATA";
|
|
4618
|
-
/**
|
|
4619
|
-
* This will intercept all the apis
|
|
4620
|
-
*/
|
|
4621
|
-
InterceptedApiType["ALL"] = "ALL";
|
|
4622
|
-
/**
|
|
4623
|
-
* The apis that are use to get the data for the liveboard
|
|
4624
|
-
*/
|
|
4625
|
-
InterceptedApiType["LIVEBOARD_DATA"] = "LIVEBOARD_DATA";
|
|
4626
|
-
})(InterceptedApiType || (InterceptedApiType = {}));
|
|
4601
|
+
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4627
4602
|
|
|
4628
4603
|
const logFunctions = {
|
|
4629
4604
|
[exports.LogLevel.SILENT]: () => undefined,
|
|
@@ -4892,7 +4867,7 @@
|
|
|
4892
4867
|
function getDOMNode(domSelector) {
|
|
4893
4868
|
return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
|
|
4894
4869
|
}
|
|
4895
|
-
const deepMerge = (target, source) => merge
|
|
4870
|
+
const deepMerge = (target, source) => merge(target, source);
|
|
4896
4871
|
const getOperationNameFromQuery = (query) => {
|
|
4897
4872
|
const regex = /(?:query|mutation)\s+(\w+)/;
|
|
4898
4873
|
const matches = query.match(regex);
|
|
@@ -7386,20 +7361,9 @@
|
|
|
7386
7361
|
|
|
7387
7362
|
var isEmpty_1 = isEmpty$1;
|
|
7388
7363
|
|
|
7389
|
-
var UIPassthroughEvent;
|
|
7390
|
-
(function (UIPassthroughEvent) {
|
|
7391
|
-
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
7392
|
-
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
7393
|
-
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7394
|
-
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
7395
|
-
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7396
|
-
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7397
|
-
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
7398
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
7399
|
-
|
|
7400
7364
|
const ERROR_MESSAGE = {
|
|
7401
7365
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7402
|
-
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a
|
|
7366
|
+
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
|
|
7403
7367
|
LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
|
|
7404
7368
|
TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
|
|
7405
7369
|
SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
|
|
@@ -9849,6 +9813,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
9849
9813
|
finalValidActions.push(action);
|
|
9850
9814
|
}
|
|
9851
9815
|
});
|
|
9816
|
+
// Step 4: Collect warnings for long custom action names
|
|
9817
|
+
const MAX_ACTION_NAME_LENGTH = 30;
|
|
9818
|
+
const warnings = finalValidActions
|
|
9819
|
+
.filter(action => action.name.length > MAX_ACTION_NAME_LENGTH)
|
|
9820
|
+
.map(action => `Custom action name '${action.name}' exceeds ${MAX_ACTION_NAME_LENGTH} characters. This may cause display or truncation issues in the UI.`);
|
|
9821
|
+
if (warnings.length > 0) {
|
|
9822
|
+
logger$3.warn(warnings);
|
|
9823
|
+
}
|
|
9852
9824
|
const sortedActions = sortBy_1(finalValidActions, (a) => a.name.toLocaleLowerCase());
|
|
9853
9825
|
return {
|
|
9854
9826
|
actions: sortedActions,
|
|
@@ -17481,27 +17453,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17481
17453
|
* @param thoughtSpotHost
|
|
17482
17454
|
* @param containerEl
|
|
17483
17455
|
*/
|
|
17484
|
-
function processEventData(type,
|
|
17456
|
+
function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
17485
17457
|
switch (type) {
|
|
17486
17458
|
case exports.EmbedEvent.CustomAction:
|
|
17487
|
-
return processCustomAction(
|
|
17459
|
+
return processCustomAction(e, thoughtSpotHost);
|
|
17488
17460
|
case exports.EmbedEvent.AuthInit:
|
|
17489
|
-
return processAuthInit(
|
|
17461
|
+
return processAuthInit(e);
|
|
17490
17462
|
case exports.EmbedEvent.NoCookieAccess:
|
|
17491
|
-
return processNoCookieAccess(
|
|
17463
|
+
return processNoCookieAccess(e, containerEl);
|
|
17492
17464
|
case exports.EmbedEvent.AuthFailure:
|
|
17493
|
-
return processAuthFailure(
|
|
17465
|
+
return processAuthFailure(e, containerEl);
|
|
17494
17466
|
case exports.EmbedEvent.AuthLogout:
|
|
17495
|
-
return processAuthLogout(
|
|
17467
|
+
return processAuthLogout(e, containerEl);
|
|
17496
17468
|
case exports.EmbedEvent.ExitPresentMode:
|
|
17497
17469
|
return processExitPresentMode();
|
|
17498
17470
|
case exports.EmbedEvent.CLEAR_INFO_CACHE:
|
|
17499
17471
|
return processClearInfoCache();
|
|
17500
17472
|
}
|
|
17501
|
-
return
|
|
17473
|
+
return e;
|
|
17502
17474
|
}
|
|
17503
17475
|
|
|
17504
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.
|
|
17476
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.2";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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.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 | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={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":"^11.2.0","@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",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",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":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};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:"32 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};
|
|
17505
17477
|
|
|
17506
17478
|
/**
|
|
17507
17479
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17573,6 +17545,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17573
17545
|
});
|
|
17574
17546
|
}
|
|
17575
17547
|
|
|
17548
|
+
var UIPassthroughEvent;
|
|
17549
|
+
(function (UIPassthroughEvent) {
|
|
17550
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17551
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17552
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17553
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17554
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17555
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17556
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
17557
|
+
|
|
17576
17558
|
class HostEventClient {
|
|
17577
17559
|
constructor(iFrame) {
|
|
17578
17560
|
this.iFrame = iFrame;
|
|
@@ -17664,109 +17646,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17664
17646
|
}
|
|
17665
17647
|
}
|
|
17666
17648
|
|
|
17667
|
-
const defaultUrls = {
|
|
17668
|
-
[InterceptedApiType.METADATA]: [
|
|
17669
|
-
'/prism/?op=CreateAnswerSession',
|
|
17670
|
-
'/prism/?op=GetV2SourceDetail',
|
|
17671
|
-
],
|
|
17672
|
-
[InterceptedApiType.ANSWER_DATA]: [
|
|
17673
|
-
'/prism/?op=GetChartWithData',
|
|
17674
|
-
'/prism/?op=GetTableWithHeadlineData',
|
|
17675
|
-
],
|
|
17676
|
-
[InterceptedApiType.LIVEBOARD_DATA]: [
|
|
17677
|
-
'/prism/?op=LoadContextBook'
|
|
17678
|
-
],
|
|
17679
|
-
};
|
|
17680
|
-
const formatInterceptUrl = (url) => {
|
|
17681
|
-
const host = getThoughtSpotHost(getEmbedConfig());
|
|
17682
|
-
if (url.startsWith('/'))
|
|
17683
|
-
return `${host}${url}`;
|
|
17684
|
-
return url;
|
|
17685
|
-
};
|
|
17686
|
-
const processInterceptUrls = (interceptUrls) => {
|
|
17687
|
-
let processedUrls = [...interceptUrls];
|
|
17688
|
-
Object.entries(defaultUrls).forEach(([apiType, apiTypeUrls]) => {
|
|
17689
|
-
if (!processedUrls.includes(apiType))
|
|
17690
|
-
return;
|
|
17691
|
-
processedUrls = processedUrls.filter(url => url !== apiType);
|
|
17692
|
-
processedUrls = [...processedUrls, ...apiTypeUrls];
|
|
17693
|
-
});
|
|
17694
|
-
return processedUrls.map(url => formatInterceptUrl(url));
|
|
17695
|
-
};
|
|
17696
|
-
const getInterceptInitData = (embedConfig, viewConfig) => {
|
|
17697
|
-
const enableApiIntercept = (embedConfig.enableApiIntercept || viewConfig.enableApiIntercept) && (viewConfig.enableApiIntercept !== false);
|
|
17698
|
-
if (!enableApiIntercept)
|
|
17699
|
-
return {
|
|
17700
|
-
enableApiIntercept: false,
|
|
17701
|
-
};
|
|
17702
|
-
const combinedUrls = [...(embedConfig.interceptUrls || []), ...(viewConfig.interceptUrls || [])];
|
|
17703
|
-
if (viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17704
|
-
combinedUrls.push(InterceptedApiType.ANSWER_DATA);
|
|
17705
|
-
}
|
|
17706
|
-
const shouldInterceptAll = combinedUrls.includes(InterceptedApiType.ALL);
|
|
17707
|
-
const interceptUrls = shouldInterceptAll ? [InterceptedApiType.ALL] : processInterceptUrls(combinedUrls);
|
|
17708
|
-
const interceptTimeout = embedConfig.interceptTimeout || viewConfig.interceptTimeout;
|
|
17709
|
-
return {
|
|
17710
|
-
interceptUrls,
|
|
17711
|
-
interceptTimeout,
|
|
17712
|
-
enableApiIntercept,
|
|
17713
|
-
};
|
|
17714
|
-
};
|
|
17715
|
-
/**
|
|
17716
|
-
*
|
|
17717
|
-
* @param fetchInit
|
|
17718
|
-
*/
|
|
17719
|
-
const parseInterceptData = (eventDataString) => {
|
|
17720
|
-
try {
|
|
17721
|
-
const { input, init } = JSON.parse(eventDataString);
|
|
17722
|
-
init.body = JSON.parse(init.body);
|
|
17723
|
-
const parsedInit = { input, init };
|
|
17724
|
-
return [parsedInit, null];
|
|
17725
|
-
}
|
|
17726
|
-
catch (error) {
|
|
17727
|
-
return [null, error];
|
|
17728
|
-
}
|
|
17729
|
-
};
|
|
17730
|
-
const handleInterceptEvent = async (params) => {
|
|
17731
|
-
var _a, _b, _c, _d, _e;
|
|
17732
|
-
const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
|
|
17733
|
-
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
17734
|
-
if (bodyParseError) {
|
|
17735
|
-
executeEvent(exports.EmbedEvent.Error, {
|
|
17736
|
-
error: 'Error parsing api intercept body',
|
|
17737
|
-
});
|
|
17738
|
-
logger$3.error('Error parsing request body', bodyParseError);
|
|
17739
|
-
return;
|
|
17740
|
-
}
|
|
17741
|
-
const { input: requestUrl, init } = interceptData;
|
|
17742
|
-
const sessionId = (_c = (_b = (_a = init === null || init === void 0 ? void 0 : init.body) === null || _a === void 0 ? void 0 : _a.variables) === null || _b === void 0 ? void 0 : _b.session) === null || _c === void 0 ? void 0 : _c.sessionId;
|
|
17743
|
-
const vizId = (_e = (_d = init === null || init === void 0 ? void 0 : init.body) === null || _d === void 0 ? void 0 : _d.variables) === null || _e === void 0 ? void 0 : _e.contextBookId;
|
|
17744
|
-
if (defaultUrls.ANSWER_DATA.includes(requestUrl) && viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17745
|
-
const answerTml = await getUnsavedAnswerTml({ sessionId, vizId });
|
|
17746
|
-
executeEvent(exports.EmbedEvent.OnBeforeGetVizDataIntercept, { data: { data: answerTml } });
|
|
17747
|
-
}
|
|
17748
|
-
executeEvent(exports.EmbedEvent.ApiIntercept, interceptData);
|
|
17749
|
-
};
|
|
17750
|
-
const processLegacyInterceptResponse = (payload) => {
|
|
17751
|
-
var _a, _b, _c;
|
|
17752
|
-
const payloadToSend = {
|
|
17753
|
-
execute: (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.execute,
|
|
17754
|
-
response: {
|
|
17755
|
-
body: {
|
|
17756
|
-
errors: [
|
|
17757
|
-
{
|
|
17758
|
-
title: (_b = payload === null || payload === void 0 ? void 0 : payload.data) === null || _b === void 0 ? void 0 : _b.errorText,
|
|
17759
|
-
message: (_c = payload === null || payload === void 0 ? void 0 : payload.data) === null || _c === void 0 ? void 0 : _c.errorDescription,
|
|
17760
|
-
isUserError: true,
|
|
17761
|
-
},
|
|
17762
|
-
],
|
|
17763
|
-
data: {},
|
|
17764
|
-
},
|
|
17765
|
-
},
|
|
17766
|
-
};
|
|
17767
|
-
return { data: payloadToSend };
|
|
17768
|
-
};
|
|
17769
|
-
|
|
17770
17649
|
/**
|
|
17771
17650
|
* Copyright (c) 2022
|
|
17772
17651
|
*
|
|
@@ -17820,27 +17699,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17820
17699
|
*/
|
|
17821
17700
|
this.fullscreenChangeHandler = null;
|
|
17822
17701
|
this.subscribedListeners = {};
|
|
17823
|
-
this.messageEventListener = async (event) => {
|
|
17824
|
-
const eventType = this.getEventType(event);
|
|
17825
|
-
const eventPort = this.getEventPort(event);
|
|
17826
|
-
const eventData = this.formatEventData(event, eventType);
|
|
17827
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
17828
|
-
const processedEventData = await processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
17829
|
-
const executeEvent = (_eventType, data) => {
|
|
17830
|
-
this.executeCallbacks(_eventType, data, eventPort);
|
|
17831
|
-
};
|
|
17832
|
-
if (eventType === exports.EmbedEvent.ApiIntercept && this.viewConfig.enableApiIntercept) {
|
|
17833
|
-
const getUnsavedAnswerTml = async (props) => {
|
|
17834
|
-
var _a;
|
|
17835
|
-
const response = await this.triggerUIPassThrough(UIPassthroughEvent.GetUnsavedAnswerTML, props);
|
|
17836
|
-
return (_a = response[0]) === null || _a === void 0 ? void 0 : _a.value;
|
|
17837
|
-
};
|
|
17838
|
-
handleInterceptEvent({ eventData: processedEventData, executeEvent, embedConfig: this.embedConfig, viewConfig: this.viewConfig, getUnsavedAnswerTml });
|
|
17839
|
-
return;
|
|
17840
|
-
}
|
|
17841
|
-
this.executeCallbacks(eventType, processedEventData, eventPort);
|
|
17842
|
-
}
|
|
17843
|
-
};
|
|
17844
17702
|
/**
|
|
17845
17703
|
* Send Custom style as part of payload of APP_INIT
|
|
17846
17704
|
* @param _
|
|
@@ -17925,18 +17783,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17925
17783
|
this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
17926
17784
|
};
|
|
17927
17785
|
this.showPreRenderByDefault = false;
|
|
17928
|
-
this.createEmbedEventResponder = (eventPort, eventType) => {
|
|
17929
|
-
const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
|
|
17930
|
-
if (eventType === exports.EmbedEvent.OnBeforeGetVizDataIntercept && enableApiIntercept) {
|
|
17931
|
-
return (payload) => {
|
|
17932
|
-
const payloadToSend = processLegacyInterceptResponse(payload);
|
|
17933
|
-
this.triggerEventOnPort(eventPort, payloadToSend);
|
|
17934
|
-
};
|
|
17935
|
-
}
|
|
17936
|
-
return (payload) => {
|
|
17937
|
-
this.triggerEventOnPort(eventPort, payload);
|
|
17938
|
-
};
|
|
17939
|
-
};
|
|
17940
17786
|
/**
|
|
17941
17787
|
* @hidden
|
|
17942
17788
|
* Internal state to track if the embed container is loaded.
|
|
@@ -18122,8 +17968,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18122
17968
|
*/
|
|
18123
17969
|
subscribeToMessageEvents() {
|
|
18124
17970
|
this.unsubscribeToMessageEvents();
|
|
18125
|
-
|
|
18126
|
-
|
|
17971
|
+
const messageEventListener = (event) => {
|
|
17972
|
+
const eventType = this.getEventType(event);
|
|
17973
|
+
const eventPort = this.getEventPort(event);
|
|
17974
|
+
const eventData = this.formatEventData(event, eventType);
|
|
17975
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
17976
|
+
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
17977
|
+
}
|
|
17978
|
+
};
|
|
17979
|
+
window.addEventListener('message', messageEventListener);
|
|
17980
|
+
this.subscribedListeners.message = messageEventListener;
|
|
18127
17981
|
}
|
|
18128
17982
|
/**
|
|
18129
17983
|
* Adds event listeners for both network and message events.
|
|
@@ -18184,7 +18038,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18184
18038
|
message: customActionsResult.errors,
|
|
18185
18039
|
});
|
|
18186
18040
|
}
|
|
18187
|
-
|
|
18041
|
+
return {
|
|
18188
18042
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
18189
18043
|
authToken,
|
|
18190
18044
|
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
@@ -18202,9 +18056,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18202
18056
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
18203
18057
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
18204
18058
|
customActions: customActionsResult.actions,
|
|
18205
|
-
...getInterceptInitData(this.embedConfig, this.viewConfig),
|
|
18206
18059
|
};
|
|
18207
|
-
return baseInitData;
|
|
18208
18060
|
}
|
|
18209
18061
|
async getAppInitData() {
|
|
18210
18062
|
return this.getDefaultAppInitData();
|
|
@@ -18633,8 +18485,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18633
18485
|
// When start status is false it trigger only end releated
|
|
18634
18486
|
// payload
|
|
18635
18487
|
|| (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
|
|
18636
|
-
|
|
18637
|
-
|
|
18488
|
+
callbackObj.callback(data, (payload) => {
|
|
18489
|
+
this.triggerEventOnPort(eventPort, payload);
|
|
18490
|
+
});
|
|
18638
18491
|
}
|
|
18639
18492
|
});
|
|
18640
18493
|
}
|
|
@@ -19418,8 +19271,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19418
19271
|
if (hideSearchBar) {
|
|
19419
19272
|
queryParams[Param.HideSearchBar] = true;
|
|
19420
19273
|
}
|
|
19421
|
-
|
|
19422
|
-
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
19274
|
+
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19423
19275
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19424
19276
|
}
|
|
19425
19277
|
if (!focusSearchBarOnRender) {
|
|
@@ -19680,7 +19532,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19680
19532
|
* embedded Liveboard or visualization.
|
|
19681
19533
|
*/
|
|
19682
19534
|
getEmbedParams() {
|
|
19683
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
|
|
19535
|
+
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
|
|
19684
19536
|
let params = {};
|
|
19685
19537
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19686
19538
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19692,6 +19544,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19692
19544
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19693
19545
|
params[Param.IsFullAppEmbed] = true;
|
|
19694
19546
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19547
|
+
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
19695
19548
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
19696
19549
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
19697
19550
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
@@ -19733,8 +19586,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19733
19586
|
if (enableAskSage) {
|
|
19734
19587
|
params[Param.enableAskSage] = enableAskSage;
|
|
19735
19588
|
}
|
|
19736
|
-
|
|
19737
|
-
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
19589
|
+
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19738
19590
|
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19739
19591
|
}
|
|
19740
19592
|
if (homePageSearchBarMode) {
|
|
@@ -19749,9 +19601,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19749
19601
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19750
19602
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19751
19603
|
}
|
|
19604
|
+
if (hideTagFilterChips !== undefined) {
|
|
19605
|
+
params[Param.HideTagFilterChips] = hideTagFilterChips;
|
|
19606
|
+
}
|
|
19752
19607
|
if (isLinkParametersEnabled !== undefined) {
|
|
19753
19608
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19754
19609
|
}
|
|
19610
|
+
if (isCentralizedLiveboardFilterUXEnabled != undefined) {
|
|
19611
|
+
params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
|
|
19612
|
+
}
|
|
19755
19613
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19756
19614
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19757
19615
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -20106,7 +19964,7 @@ query GetEurekaVizSnapshots(
|
|
|
20106
19964
|
getEmbedParamsObject() {
|
|
20107
19965
|
let params = {};
|
|
20108
19966
|
params = this.getBaseQueryParams(params);
|
|
20109
|
-
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 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isLinkParametersEnabled, } = this.viewConfig;
|
|
19967
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
|
|
20110
19968
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
20111
19969
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
20112
19970
|
if (fullHeight === true) {
|
|
@@ -20174,11 +20032,15 @@ query GetEurekaVizSnapshots(
|
|
|
20174
20032
|
if (isLinkParametersEnabled !== undefined) {
|
|
20175
20033
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
20176
20034
|
}
|
|
20035
|
+
if (isCentralizedLiveboardFilterUXEnabled !== undefined) {
|
|
20036
|
+
params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
|
|
20037
|
+
}
|
|
20177
20038
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
20178
20039
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
20179
20040
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
20180
20041
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
20181
20042
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
20043
|
+
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
20182
20044
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
20183
20045
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
20184
20046
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
@@ -20909,7 +20771,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20909
20771
|
this.viewConfig = viewConfig;
|
|
20910
20772
|
}
|
|
20911
20773
|
getEmbedParamsObject() {
|
|
20912
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20774
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20913
20775
|
if (!worksheetId) {
|
|
20914
20776
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
20915
20777
|
}
|
|
@@ -20933,9 +20795,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20933
20795
|
return queryParams;
|
|
20934
20796
|
}
|
|
20935
20797
|
getIframeSrc() {
|
|
20936
|
-
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20798
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar } = this.viewConfig;
|
|
20937
20799
|
const path = 'insights/conv-assist';
|
|
20938
20800
|
const queryParams = this.getEmbedParamsObject();
|
|
20801
|
+
if (!isUndefined_1(enablePastConversationsSidebar)) {
|
|
20802
|
+
queryParams[Param.EnablePastConversationsSidebar] = !!enablePastConversationsSidebar;
|
|
20803
|
+
}
|
|
20939
20804
|
let query = '';
|
|
20940
20805
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20941
20806
|
if (queryParamsString) {
|
|
@@ -21851,7 +21716,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
21851
21716
|
return {
|
|
21852
21717
|
onAnchor: (source) => {
|
|
21853
21718
|
aliasObjects.push(source);
|
|
21854
|
-
|
|
21719
|
+
if (!prevAnchors)
|
|
21720
|
+
prevAnchors = anchorNames(doc);
|
|
21855
21721
|
const anchor = findNewAnchor(prefix, prevAnchors);
|
|
21856
21722
|
prevAnchors.add(anchor);
|
|
21857
21723
|
return anchor;
|
|
@@ -22015,36 +21881,23 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22015
21881
|
* Resolve the value of this alias within `doc`, finding the last
|
|
22016
21882
|
* instance of the `source` anchor before this node.
|
|
22017
21883
|
*/
|
|
22018
|
-
resolve(doc
|
|
22019
|
-
let nodes;
|
|
22020
|
-
if (ctx?.aliasResolveCache) {
|
|
22021
|
-
nodes = ctx.aliasResolveCache;
|
|
22022
|
-
}
|
|
22023
|
-
else {
|
|
22024
|
-
nodes = [];
|
|
22025
|
-
visit$1(doc, {
|
|
22026
|
-
Node: (_key, node) => {
|
|
22027
|
-
if (isAlias(node) || hasAnchor(node))
|
|
22028
|
-
nodes.push(node);
|
|
22029
|
-
}
|
|
22030
|
-
});
|
|
22031
|
-
if (ctx)
|
|
22032
|
-
ctx.aliasResolveCache = nodes;
|
|
22033
|
-
}
|
|
21884
|
+
resolve(doc) {
|
|
22034
21885
|
let found = undefined;
|
|
22035
|
-
|
|
22036
|
-
|
|
22037
|
-
|
|
22038
|
-
|
|
22039
|
-
|
|
22040
|
-
|
|
21886
|
+
visit$1(doc, {
|
|
21887
|
+
Node: (_key, node) => {
|
|
21888
|
+
if (node === this)
|
|
21889
|
+
return visit$1.BREAK;
|
|
21890
|
+
if (node.anchor === this.source)
|
|
21891
|
+
found = node;
|
|
21892
|
+
}
|
|
21893
|
+
});
|
|
22041
21894
|
return found;
|
|
22042
21895
|
}
|
|
22043
21896
|
toJSON(_arg, ctx) {
|
|
22044
21897
|
if (!ctx)
|
|
22045
21898
|
return { source: this.source };
|
|
22046
21899
|
const { anchors, doc, maxAliasCount } = ctx;
|
|
22047
|
-
const source = this.resolve(doc
|
|
21900
|
+
const source = this.resolve(doc);
|
|
22048
21901
|
if (!source) {
|
|
22049
21902
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
22050
21903
|
throw new ReferenceError(msg);
|
|
@@ -22163,7 +22016,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22163
22016
|
if (aliasDuplicateObjects && value && typeof value === 'object') {
|
|
22164
22017
|
ref = sourceObjects.get(value);
|
|
22165
22018
|
if (ref) {
|
|
22166
|
-
|
|
22019
|
+
if (!ref.anchor)
|
|
22020
|
+
ref.anchor = onAnchor(value);
|
|
22167
22021
|
return new Alias(ref.anchor);
|
|
22168
22022
|
}
|
|
22169
22023
|
else {
|
|
@@ -22674,7 +22528,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22674
22528
|
const { blockQuote, commentString, lineWidth } = ctx.options;
|
|
22675
22529
|
// 1. Block can't end in whitespace unless the last line is non-empty.
|
|
22676
22530
|
// 2. Strings consisting of only whitespace are best rendered explicitly.
|
|
22677
|
-
if (!blockQuote || /\n[\t ]+$/.test(value)) {
|
|
22531
|
+
if (!blockQuote || /\n[\t ]+$/.test(value) || /^\s*$/.test(value)) {
|
|
22678
22532
|
return quotedString(value, ctx);
|
|
22679
22533
|
}
|
|
22680
22534
|
const indent = ctx.indent ||
|
|
@@ -22734,32 +22588,23 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22734
22588
|
start = start.replace(/\n+/g, `$&${indent}`);
|
|
22735
22589
|
}
|
|
22736
22590
|
const indentSize = indent ? '2' : '1'; // root is at -1
|
|
22737
|
-
|
|
22738
|
-
let header = (startWithSpace ? indentSize : '') + chomp;
|
|
22591
|
+
let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
|
|
22739
22592
|
if (comment) {
|
|
22740
22593
|
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
|
22741
22594
|
if (onComment)
|
|
22742
22595
|
onComment();
|
|
22743
22596
|
}
|
|
22744
|
-
if (
|
|
22745
|
-
|
|
22746
|
-
|
|
22747
|
-
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
22748
|
-
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
22749
|
-
.replace(/\n+/g, `$&${indent}`);
|
|
22750
|
-
let literalFallback = false;
|
|
22751
|
-
const foldOptions = getFoldOptions(ctx, true);
|
|
22752
|
-
if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
|
|
22753
|
-
foldOptions.onOverflow = () => {
|
|
22754
|
-
literalFallback = true;
|
|
22755
|
-
};
|
|
22756
|
-
}
|
|
22757
|
-
const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
|
|
22758
|
-
if (!literalFallback)
|
|
22759
|
-
return `>${header}\n${indent}${body}`;
|
|
22597
|
+
if (literal) {
|
|
22598
|
+
value = value.replace(/\n+/g, `$&${indent}`);
|
|
22599
|
+
return `${header}\n${indent}${start}${value}${end}`;
|
|
22760
22600
|
}
|
|
22761
|
-
value = value
|
|
22762
|
-
|
|
22601
|
+
value = value
|
|
22602
|
+
.replace(/\n+/g, '\n$&')
|
|
22603
|
+
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
22604
|
+
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
22605
|
+
.replace(/\n+/g, `$&${indent}`);
|
|
22606
|
+
const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
|
|
22607
|
+
return `${header}\n${indent}${body}`;
|
|
22763
22608
|
}
|
|
22764
22609
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
22765
22610
|
const { type, value } = item;
|
|
@@ -22768,9 +22613,10 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22768
22613
|
(inFlow && /[[\]{},]/.test(value))) {
|
|
22769
22614
|
return quotedString(value, ctx);
|
|
22770
22615
|
}
|
|
22771
|
-
if (
|
|
22616
|
+
if (!value ||
|
|
22617
|
+
/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
|
22772
22618
|
// not allowed:
|
|
22773
|
-
// - '-' or '?'
|
|
22619
|
+
// - empty string, '-' or '?'
|
|
22774
22620
|
// - start with an indicator character (except [?:-]) or /[?-] /
|
|
22775
22621
|
// - '\n ', ': ' or ' \n' anywhere
|
|
22776
22622
|
// - '#' not preceded by a non-space char
|
|
@@ -22899,12 +22745,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22899
22745
|
let obj;
|
|
22900
22746
|
if (isScalar$1(item)) {
|
|
22901
22747
|
obj = item.value;
|
|
22902
|
-
|
|
22903
|
-
if (match.length > 1) {
|
|
22904
|
-
const testMatch = match.filter(t => t.test);
|
|
22905
|
-
if (testMatch.length > 0)
|
|
22906
|
-
match = testMatch;
|
|
22907
|
-
}
|
|
22748
|
+
const match = tags.filter(t => t.identify?.(obj));
|
|
22908
22749
|
tagObj =
|
|
22909
22750
|
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
|
22910
22751
|
}
|
|
@@ -22913,7 +22754,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22913
22754
|
tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
|
|
22914
22755
|
}
|
|
22915
22756
|
if (!tagObj) {
|
|
22916
|
-
const name = obj?.constructor?.name ??
|
|
22757
|
+
const name = obj?.constructor?.name ?? typeof obj;
|
|
22917
22758
|
throw new Error(`Tag not resolved for ${name} value`);
|
|
22918
22759
|
}
|
|
22919
22760
|
return tagObj;
|
|
@@ -22928,7 +22769,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22928
22769
|
anchors.add(anchor);
|
|
22929
22770
|
props.push(`&${anchor}`);
|
|
22930
22771
|
}
|
|
22931
|
-
const tag = node.tag
|
|
22772
|
+
const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
|
|
22932
22773
|
if (tag)
|
|
22933
22774
|
props.push(doc.directives.tagString(tag));
|
|
22934
22775
|
return props.join(' ');
|
|
@@ -22954,7 +22795,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22954
22795
|
const node = isNode(item)
|
|
22955
22796
|
? item
|
|
22956
22797
|
: ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
|
|
22957
|
-
|
|
22798
|
+
if (!tagObj)
|
|
22799
|
+
tagObj = getTagObject(ctx.doc.schema.tags, node);
|
|
22958
22800
|
const props = stringifyProps(node, tagObj, ctx);
|
|
22959
22801
|
if (props.length > 0)
|
|
22960
22802
|
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
|
@@ -23116,10 +22958,54 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23116
22958
|
|
|
23117
22959
|
function warn(logLevel, warning) {
|
|
23118
22960
|
if (logLevel === 'debug' || logLevel === 'warn') {
|
|
23119
|
-
|
|
22961
|
+
if (typeof process !== 'undefined' && process.emitWarning)
|
|
22962
|
+
process.emitWarning(warning);
|
|
22963
|
+
else
|
|
22964
|
+
console.warn(warning);
|
|
23120
22965
|
}
|
|
23121
22966
|
}
|
|
23122
22967
|
|
|
22968
|
+
const MERGE_KEY = '<<';
|
|
22969
|
+
function addPairToJSMap(ctx, map, { key, value }) {
|
|
22970
|
+
if (ctx?.doc.schema.merge && isMergeKey(key)) {
|
|
22971
|
+
value = isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
22972
|
+
if (isSeq(value))
|
|
22973
|
+
for (const it of value.items)
|
|
22974
|
+
mergeToJSMap(ctx, map, it);
|
|
22975
|
+
else if (Array.isArray(value))
|
|
22976
|
+
for (const it of value)
|
|
22977
|
+
mergeToJSMap(ctx, map, it);
|
|
22978
|
+
else
|
|
22979
|
+
mergeToJSMap(ctx, map, value);
|
|
22980
|
+
}
|
|
22981
|
+
else {
|
|
22982
|
+
const jsKey = toJS(key, '', ctx);
|
|
22983
|
+
if (map instanceof Map) {
|
|
22984
|
+
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
22985
|
+
}
|
|
22986
|
+
else if (map instanceof Set) {
|
|
22987
|
+
map.add(jsKey);
|
|
22988
|
+
}
|
|
22989
|
+
else {
|
|
22990
|
+
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
22991
|
+
const jsValue = toJS(value, stringKey, ctx);
|
|
22992
|
+
if (stringKey in map)
|
|
22993
|
+
Object.defineProperty(map, stringKey, {
|
|
22994
|
+
value: jsValue,
|
|
22995
|
+
writable: true,
|
|
22996
|
+
enumerable: true,
|
|
22997
|
+
configurable: true
|
|
22998
|
+
});
|
|
22999
|
+
else
|
|
23000
|
+
map[stringKey] = jsValue;
|
|
23001
|
+
}
|
|
23002
|
+
}
|
|
23003
|
+
return map;
|
|
23004
|
+
}
|
|
23005
|
+
const isMergeKey = (key) => key === MERGE_KEY ||
|
|
23006
|
+
(isScalar$1(key) &&
|
|
23007
|
+
key.value === MERGE_KEY &&
|
|
23008
|
+
(!key.type || key.type === Scalar.PLAIN));
|
|
23123
23009
|
// If the value associated with a merge key is a single mapping node, each of
|
|
23124
23010
|
// its key/value pairs is inserted into the current mapping, unless the key
|
|
23125
23011
|
// already exists in it. If the value associated with the merge key is a
|
|
@@ -23127,35 +23013,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23127
23013
|
// of these nodes is merged in turn according to its order in the sequence.
|
|
23128
23014
|
// Keys in mapping nodes earlier in the sequence override keys specified in
|
|
23129
23015
|
// later mapping nodes. -- http://yaml.org/type/merge.html
|
|
23130
|
-
|
|
23131
|
-
const merge = {
|
|
23132
|
-
identify: value => value === MERGE_KEY ||
|
|
23133
|
-
(typeof value === 'symbol' && value.description === MERGE_KEY),
|
|
23134
|
-
default: 'key',
|
|
23135
|
-
tag: 'tag:yaml.org,2002:merge',
|
|
23136
|
-
test: /^<<$/,
|
|
23137
|
-
resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
|
|
23138
|
-
addToJSMap: addMergeToJSMap
|
|
23139
|
-
}),
|
|
23140
|
-
stringify: () => MERGE_KEY
|
|
23141
|
-
};
|
|
23142
|
-
const isMergeKey = (ctx, key) => (merge.identify(key) ||
|
|
23143
|
-
(isScalar$1(key) &&
|
|
23144
|
-
(!key.type || key.type === Scalar.PLAIN) &&
|
|
23145
|
-
merge.identify(key.value))) &&
|
|
23146
|
-
ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
|
|
23147
|
-
function addMergeToJSMap(ctx, map, value) {
|
|
23148
|
-
value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
23149
|
-
if (isSeq(value))
|
|
23150
|
-
for (const it of value.items)
|
|
23151
|
-
mergeValue(ctx, map, it);
|
|
23152
|
-
else if (Array.isArray(value))
|
|
23153
|
-
for (const it of value)
|
|
23154
|
-
mergeValue(ctx, map, it);
|
|
23155
|
-
else
|
|
23156
|
-
mergeValue(ctx, map, value);
|
|
23157
|
-
}
|
|
23158
|
-
function mergeValue(ctx, map, value) {
|
|
23016
|
+
function mergeToJSMap(ctx, map, value) {
|
|
23159
23017
|
const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
23160
23018
|
if (!isMap(source))
|
|
23161
23019
|
throw new Error('Merge sources must be maps or map aliases');
|
|
@@ -23179,41 +23037,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23179
23037
|
}
|
|
23180
23038
|
return map;
|
|
23181
23039
|
}
|
|
23182
|
-
|
|
23183
|
-
function addPairToJSMap(ctx, map, { key, value }) {
|
|
23184
|
-
if (isNode(key) && key.addToJSMap)
|
|
23185
|
-
key.addToJSMap(ctx, map, value);
|
|
23186
|
-
// TODO: Should drop this special case for bare << handling
|
|
23187
|
-
else if (isMergeKey(ctx, key))
|
|
23188
|
-
addMergeToJSMap(ctx, map, value);
|
|
23189
|
-
else {
|
|
23190
|
-
const jsKey = toJS(key, '', ctx);
|
|
23191
|
-
if (map instanceof Map) {
|
|
23192
|
-
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
23193
|
-
}
|
|
23194
|
-
else if (map instanceof Set) {
|
|
23195
|
-
map.add(jsKey);
|
|
23196
|
-
}
|
|
23197
|
-
else {
|
|
23198
|
-
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
23199
|
-
const jsValue = toJS(value, stringKey, ctx);
|
|
23200
|
-
if (stringKey in map)
|
|
23201
|
-
Object.defineProperty(map, stringKey, {
|
|
23202
|
-
value: jsValue,
|
|
23203
|
-
writable: true,
|
|
23204
|
-
enumerable: true,
|
|
23205
|
-
configurable: true
|
|
23206
|
-
});
|
|
23207
|
-
else
|
|
23208
|
-
map[stringKey] = jsValue;
|
|
23209
|
-
}
|
|
23210
|
-
}
|
|
23211
|
-
return map;
|
|
23212
|
-
}
|
|
23213
23040
|
function stringifyKey(key, jsKey, ctx) {
|
|
23214
23041
|
if (jsKey === null)
|
|
23215
23042
|
return '';
|
|
23216
|
-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
23217
23043
|
if (typeof jsKey !== 'object')
|
|
23218
23044
|
return String(jsKey);
|
|
23219
23045
|
if (isNode(key) && ctx?.doc) {
|
|
@@ -23846,7 +23672,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23846
23672
|
identify: value => typeof value === 'boolean',
|
|
23847
23673
|
default: true,
|
|
23848
23674
|
tag: 'tag:yaml.org,2002:bool',
|
|
23849
|
-
test: /^true
|
|
23675
|
+
test: /^true|false$/,
|
|
23850
23676
|
resolve: str => str === 'true',
|
|
23851
23677
|
stringify: stringifyJSON
|
|
23852
23678
|
},
|
|
@@ -23891,7 +23717,10 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23891
23717
|
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
|
23892
23718
|
*/
|
|
23893
23719
|
resolve(src, onError) {
|
|
23894
|
-
if (typeof
|
|
23720
|
+
if (typeof Buffer === 'function') {
|
|
23721
|
+
return Buffer.from(src, 'base64');
|
|
23722
|
+
}
|
|
23723
|
+
else if (typeof atob === 'function') {
|
|
23895
23724
|
// On IE 11, atob() can't handle newlines
|
|
23896
23725
|
const str = atob(src.replace(/[\n\r]/g, ''));
|
|
23897
23726
|
const buffer = new Uint8Array(str.length);
|
|
@@ -23905,11 +23734,15 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23905
23734
|
}
|
|
23906
23735
|
},
|
|
23907
23736
|
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
23908
|
-
if (!value)
|
|
23909
|
-
return '';
|
|
23910
23737
|
const buf = value; // checked earlier by binary.identify()
|
|
23911
23738
|
let str;
|
|
23912
|
-
if (typeof
|
|
23739
|
+
if (typeof Buffer === 'function') {
|
|
23740
|
+
str =
|
|
23741
|
+
buf instanceof Buffer
|
|
23742
|
+
? buf.toString('base64')
|
|
23743
|
+
: Buffer.from(buf.buffer).toString('base64');
|
|
23744
|
+
}
|
|
23745
|
+
else if (typeof btoa === 'function') {
|
|
23913
23746
|
let s = '';
|
|
23914
23747
|
for (let i = 0; i < buf.length; ++i)
|
|
23915
23748
|
s += String.fromCharCode(buf[i]);
|
|
@@ -23918,7 +23751,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23918
23751
|
else {
|
|
23919
23752
|
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
|
|
23920
23753
|
}
|
|
23921
|
-
|
|
23754
|
+
if (!type)
|
|
23755
|
+
type = Scalar.BLOCK_LITERAL;
|
|
23922
23756
|
if (type !== Scalar.QUOTE_DOUBLE) {
|
|
23923
23757
|
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
|
|
23924
23758
|
const n = Math.ceil(str.length / lineWidth);
|
|
@@ -24387,7 +24221,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24387
24221
|
}
|
|
24388
24222
|
return new Date(date);
|
|
24389
24223
|
},
|
|
24390
|
-
stringify: ({ value }) => value
|
|
24224
|
+
stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
|
|
24391
24225
|
};
|
|
24392
24226
|
|
|
24393
24227
|
const schema = [
|
|
@@ -24405,7 +24239,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24405
24239
|
floatExp,
|
|
24406
24240
|
float,
|
|
24407
24241
|
binary,
|
|
24408
|
-
merge,
|
|
24409
24242
|
omap,
|
|
24410
24243
|
pairs,
|
|
24411
24244
|
set,
|
|
@@ -24433,7 +24266,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24433
24266
|
intOct: intOct$1,
|
|
24434
24267
|
intTime,
|
|
24435
24268
|
map,
|
|
24436
|
-
merge,
|
|
24437
24269
|
null: nullTag,
|
|
24438
24270
|
omap,
|
|
24439
24271
|
pairs,
|
|
@@ -24443,20 +24275,13 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24443
24275
|
};
|
|
24444
24276
|
const coreKnownTags = {
|
|
24445
24277
|
'tag:yaml.org,2002:binary': binary,
|
|
24446
|
-
'tag:yaml.org,2002:merge': merge,
|
|
24447
24278
|
'tag:yaml.org,2002:omap': omap,
|
|
24448
24279
|
'tag:yaml.org,2002:pairs': pairs,
|
|
24449
24280
|
'tag:yaml.org,2002:set': set,
|
|
24450
24281
|
'tag:yaml.org,2002:timestamp': timestamp
|
|
24451
24282
|
};
|
|
24452
|
-
function getTags(customTags, schemaName
|
|
24453
|
-
|
|
24454
|
-
if (schemaTags && !customTags) {
|
|
24455
|
-
return addMergeTag && !schemaTags.includes(merge)
|
|
24456
|
-
? schemaTags.concat(merge)
|
|
24457
|
-
: schemaTags.slice();
|
|
24458
|
-
}
|
|
24459
|
-
let tags = schemaTags;
|
|
24283
|
+
function getTags(customTags, schemaName) {
|
|
24284
|
+
let tags = schemas.get(schemaName);
|
|
24460
24285
|
if (!tags) {
|
|
24461
24286
|
if (Array.isArray(customTags))
|
|
24462
24287
|
tags = [];
|
|
@@ -24475,21 +24300,17 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24475
24300
|
else if (typeof customTags === 'function') {
|
|
24476
24301
|
tags = customTags(tags.slice());
|
|
24477
24302
|
}
|
|
24478
|
-
|
|
24479
|
-
|
|
24480
|
-
|
|
24481
|
-
const tagObj =
|
|
24482
|
-
if (
|
|
24483
|
-
|
|
24484
|
-
|
|
24485
|
-
|
|
24486
|
-
|
|
24487
|
-
|
|
24488
|
-
|
|
24489
|
-
if (!tags.includes(tagObj))
|
|
24490
|
-
tags.push(tagObj);
|
|
24491
|
-
return tags;
|
|
24492
|
-
}, []);
|
|
24303
|
+
return tags.map(tag => {
|
|
24304
|
+
if (typeof tag !== 'string')
|
|
24305
|
+
return tag;
|
|
24306
|
+
const tagObj = tagsByName[tag];
|
|
24307
|
+
if (tagObj)
|
|
24308
|
+
return tagObj;
|
|
24309
|
+
const keys = Object.keys(tagsByName)
|
|
24310
|
+
.map(key => JSON.stringify(key))
|
|
24311
|
+
.join(', ');
|
|
24312
|
+
throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
|
|
24313
|
+
});
|
|
24493
24314
|
}
|
|
24494
24315
|
|
|
24495
24316
|
const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
@@ -24500,9 +24321,10 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24500
24321
|
: compat
|
|
24501
24322
|
? getTags(null, compat)
|
|
24502
24323
|
: null;
|
|
24324
|
+
this.merge = !!merge;
|
|
24503
24325
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
|
24504
24326
|
this.knownTags = resolveKnownTags ? coreKnownTags : {};
|
|
24505
|
-
this.tags = getTags(customTags, this.name
|
|
24327
|
+
this.tags = getTags(customTags, this.name);
|
|
24506
24328
|
this.toStringOptions = toStringDefaults ?? null;
|
|
24507
24329
|
Object.defineProperty(this, MAP, { value: map });
|
|
24508
24330
|
Object.defineProperty(this, SCALAR$1, { value: string });
|
|
@@ -24627,7 +24449,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24627
24449
|
logLevel: 'warn',
|
|
24628
24450
|
prettyErrors: true,
|
|
24629
24451
|
strict: true,
|
|
24630
|
-
stringKeys: false,
|
|
24631
24452
|
uniqueKeys: true,
|
|
24632
24453
|
version: '1.2'
|
|
24633
24454
|
}, options);
|
|
@@ -24851,7 +24672,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24851
24672
|
this.directives.yaml.version = '1.1';
|
|
24852
24673
|
else
|
|
24853
24674
|
this.directives = new Directives({ version: '1.1' });
|
|
24854
|
-
opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
24675
|
+
opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
24855
24676
|
break;
|
|
24856
24677
|
case '1.2':
|
|
24857
24678
|
case 'next':
|
|
@@ -24859,7 +24680,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24859
24680
|
this.directives.yaml.version = version;
|
|
24860
24681
|
else
|
|
24861
24682
|
this.directives = new Directives({ version });
|
|
24862
|
-
opt = { resolveKnownTags: true, schema: 'core' };
|
|
24683
|
+
opt = { merge: false, resolveKnownTags: true, schema: 'core' };
|
|
24863
24684
|
break;
|
|
24864
24685
|
case null:
|
|
24865
24686
|
if (this.directives)
|
|
@@ -25037,7 +24858,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25037
24858
|
if (atNewline) {
|
|
25038
24859
|
if (comment)
|
|
25039
24860
|
comment += token.source;
|
|
25040
|
-
else
|
|
24861
|
+
else
|
|
25041
24862
|
spaceBefore = true;
|
|
25042
24863
|
}
|
|
25043
24864
|
else
|
|
@@ -25054,7 +24875,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25054
24875
|
if (token.source.endsWith(':'))
|
|
25055
24876
|
onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
|
|
25056
24877
|
anchor = token;
|
|
25057
|
-
|
|
24878
|
+
if (start === null)
|
|
24879
|
+
start = token.offset;
|
|
25058
24880
|
atNewline = false;
|
|
25059
24881
|
hasSpace = false;
|
|
25060
24882
|
reqSpace = true;
|
|
@@ -25063,7 +24885,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25063
24885
|
if (tag)
|
|
25064
24886
|
onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
|
|
25065
24887
|
tag = token;
|
|
25066
|
-
|
|
24888
|
+
if (start === null)
|
|
24889
|
+
start = token.offset;
|
|
25067
24890
|
atNewline = false;
|
|
25068
24891
|
hasSpace = false;
|
|
25069
24892
|
reqSpace = true;
|
|
@@ -25176,7 +24999,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25176
24999
|
return false;
|
|
25177
25000
|
const isEqual = typeof uniqueKeys === 'function'
|
|
25178
25001
|
? uniqueKeys
|
|
25179
|
-
: (a, b) => a === b ||
|
|
25002
|
+
: (a, b) => a === b ||
|
|
25003
|
+
(isScalar$1(a) &&
|
|
25004
|
+
isScalar$1(b) &&
|
|
25005
|
+
a.value === b.value &&
|
|
25006
|
+
!(a.value === '<<' && ctx.schema.merge));
|
|
25180
25007
|
return items.some(pair => isEqual(pair.key, search));
|
|
25181
25008
|
}
|
|
25182
25009
|
|
|
@@ -25225,14 +25052,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25225
25052
|
onError(offset, 'BAD_INDENT', startColMsg);
|
|
25226
25053
|
}
|
|
25227
25054
|
// key value
|
|
25228
|
-
ctx.atKey = true;
|
|
25229
25055
|
const keyStart = keyProps.end;
|
|
25230
25056
|
const keyNode = key
|
|
25231
25057
|
? composeNode(ctx, key, keyProps, onError)
|
|
25232
25058
|
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
|
25233
25059
|
if (ctx.schema.compat)
|
|
25234
25060
|
flowIndentCheck(bm.indent, key, onError);
|
|
25235
|
-
ctx.atKey = false;
|
|
25236
25061
|
if (mapIncludes(ctx, map.items, keyNode))
|
|
25237
25062
|
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
|
25238
25063
|
// value properties
|
|
@@ -25292,8 +25117,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25292
25117
|
const seq = new NodeClass(ctx.schema);
|
|
25293
25118
|
if (ctx.atRoot)
|
|
25294
25119
|
ctx.atRoot = false;
|
|
25295
|
-
if (ctx.atKey)
|
|
25296
|
-
ctx.atKey = false;
|
|
25297
25120
|
let offset = bs.offset;
|
|
25298
25121
|
let commentEnd = null;
|
|
25299
25122
|
for (const { start, value } of bs.items) {
|
|
@@ -25378,8 +25201,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25378
25201
|
const atRoot = ctx.atRoot;
|
|
25379
25202
|
if (atRoot)
|
|
25380
25203
|
ctx.atRoot = false;
|
|
25381
|
-
if (ctx.atKey)
|
|
25382
|
-
ctx.atKey = false;
|
|
25383
25204
|
let offset = fc.offset + fc.start.source.length;
|
|
25384
25205
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
25385
25206
|
const collItem = fc.items[i];
|
|
@@ -25459,14 +25280,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25459
25280
|
else {
|
|
25460
25281
|
// item is a key+value pair
|
|
25461
25282
|
// key value
|
|
25462
|
-
ctx.atKey = true;
|
|
25463
25283
|
const keyStart = props.end;
|
|
25464
25284
|
const keyNode = key
|
|
25465
25285
|
? composeNode(ctx, key, props, onError)
|
|
25466
25286
|
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
|
25467
25287
|
if (isBlock(key))
|
|
25468
25288
|
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
|
25469
|
-
ctx.atKey = false;
|
|
25470
25289
|
// value properties
|
|
25471
25290
|
const valueProps = resolveProps(sep ?? [], {
|
|
25472
25291
|
flow: fcName,
|
|
@@ -25622,8 +25441,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25622
25441
|
tag = kt;
|
|
25623
25442
|
}
|
|
25624
25443
|
else {
|
|
25625
|
-
if (kt) {
|
|
25626
|
-
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection
|
|
25444
|
+
if (kt?.collection) {
|
|
25445
|
+
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
|
|
25627
25446
|
}
|
|
25628
25447
|
else {
|
|
25629
25448
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
|
|
@@ -26064,16 +25883,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26064
25883
|
const tagName = tagToken
|
|
26065
25884
|
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
|
26066
25885
|
: null;
|
|
26067
|
-
|
|
26068
|
-
|
|
26069
|
-
|
|
26070
|
-
|
|
26071
|
-
|
|
26072
|
-
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
|
26073
|
-
else if (token.type === 'scalar')
|
|
26074
|
-
tag = findScalarTagByTest(ctx, value, token, onError);
|
|
26075
|
-
else
|
|
26076
|
-
tag = ctx.schema[SCALAR$1];
|
|
25886
|
+
const tag = tagToken && tagName
|
|
25887
|
+
? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
|
|
25888
|
+
: token.type === 'scalar'
|
|
25889
|
+
? findScalarTagByTest(ctx, value, token, onError)
|
|
25890
|
+
: ctx.schema[SCALAR$1];
|
|
26077
25891
|
let scalar;
|
|
26078
25892
|
try {
|
|
26079
25893
|
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
|
@@ -26121,9 +25935,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26121
25935
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
|
26122
25936
|
return schema[SCALAR$1];
|
|
26123
25937
|
}
|
|
26124
|
-
function findScalarTagByTest({
|
|
26125
|
-
const tag = schema.tags.find(tag =>
|
|
26126
|
-
tag.test?.test(value)) || schema[SCALAR$1];
|
|
25938
|
+
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
|
25939
|
+
const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
|
|
26127
25940
|
if (schema.compat) {
|
|
26128
25941
|
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
|
26129
25942
|
schema[SCALAR$1];
|
|
@@ -26139,7 +25952,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26139
25952
|
|
|
26140
25953
|
function emptyScalarPosition(offset, before, pos) {
|
|
26141
25954
|
if (before) {
|
|
26142
|
-
|
|
25955
|
+
if (pos === null)
|
|
25956
|
+
pos = before.length;
|
|
26143
25957
|
for (let i = pos - 1; i >= 0; --i) {
|
|
26144
25958
|
let st = before[i];
|
|
26145
25959
|
switch (st.type) {
|
|
@@ -26164,7 +25978,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26164
25978
|
|
|
26165
25979
|
const CN = { composeNode, composeEmptyNode };
|
|
26166
25980
|
function composeNode(ctx, token, props, onError) {
|
|
26167
|
-
const atKey = ctx.atKey;
|
|
26168
25981
|
const { spaceBefore, comment, anchor, tag } = props;
|
|
26169
25982
|
let node;
|
|
26170
25983
|
let isSrcToken = true;
|
|
@@ -26200,14 +26013,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26200
26013
|
}
|
|
26201
26014
|
if (anchor && node.anchor === '')
|
|
26202
26015
|
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
|
|
26203
|
-
if (atKey &&
|
|
26204
|
-
ctx.options.stringKeys &&
|
|
26205
|
-
(!isScalar$1(node) ||
|
|
26206
|
-
typeof node.value !== 'string' ||
|
|
26207
|
-
(node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
|
|
26208
|
-
const msg = 'With stringKeys, all keys must be strings';
|
|
26209
|
-
onError(tag ?? token, 'NON_STRING_KEY', msg);
|
|
26210
|
-
}
|
|
26211
26016
|
if (spaceBefore)
|
|
26212
26017
|
node.spaceBefore = true;
|
|
26213
26018
|
if (comment) {
|
|
@@ -26260,7 +26065,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26260
26065
|
const opts = Object.assign({ _directives: directives }, options);
|
|
26261
26066
|
const doc = new Document(undefined, opts);
|
|
26262
26067
|
const ctx = {
|
|
26263
|
-
atKey: false,
|
|
26264
26068
|
atRoot: true,
|
|
26265
26069
|
directives: doc.directives,
|
|
26266
26070
|
options: doc.options,
|
|
@@ -28395,20 +28199,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
28395
28199
|
default: {
|
|
28396
28200
|
const bv = this.startBlockValue(map);
|
|
28397
28201
|
if (bv) {
|
|
28398
|
-
if (bv.type
|
|
28399
|
-
if (!it.explicitKey &&
|
|
28400
|
-
it.sep &&
|
|
28401
|
-
!includesToken(it.sep, 'newline')) {
|
|
28402
|
-
yield* this.pop({
|
|
28403
|
-
type: 'error',
|
|
28404
|
-
offset: this.offset,
|
|
28405
|
-
message: 'Unexpected block-seq-ind on same line with key',
|
|
28406
|
-
source: this.source
|
|
28407
|
-
});
|
|
28408
|
-
return;
|
|
28409
|
-
}
|
|
28410
|
-
}
|
|
28411
|
-
else if (atMapIndent) {
|
|
28202
|
+
if (atMapIndent && bv.type !== 'block-seq') {
|
|
28412
28203
|
map.items.push({ start });
|
|
28413
28204
|
}
|
|
28414
28205
|
this.stack.push(bv);
|
|
@@ -28779,8 +28570,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
28779
28570
|
if (!keepUndefined)
|
|
28780
28571
|
return undefined;
|
|
28781
28572
|
}
|
|
28782
|
-
if (isDocument(value) && !_replacer)
|
|
28783
|
-
return value.toString(options);
|
|
28784
28573
|
return new Document(value, _replacer, options).toString(options);
|
|
28785
28574
|
}
|
|
28786
28575
|
|