@thoughtspot/visual-embed-sdk 1.37.1-spotter-embed → 1.38.0-alpha.1
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/README.md +1 -1
- package/cjs/package.json +2 -2
- package/cjs/src/embed/app.d.ts +43 -3
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +40 -7
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +23 -6
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +7 -0
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +8 -3
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +5 -2
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +286 -1
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +5 -3
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +3 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +21 -10
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +6 -4
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +105 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +4 -4
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +5 -3
- 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 +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +32 -3
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +54 -2
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +94 -0
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +25 -51
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +24 -50
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-Cj4BVGHL.js → index-DeFzsyFF.js} +1 -1
- package/dist/{index-DnIvX1FR.js → index-NZYq1Tu3.js} +1 -2
- package/dist/src/embed/app.d.ts +43 -3
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +8 -3
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +5 -3
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -4
- 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/index.d.ts +32 -3
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +25 -51
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +614 -77
- package/dist/tsembed-react.js +758 -296
- package/dist/tsembed.es.js +153 -75
- package/dist/tsembed.js +297 -295
- package/dist/visual-embed-sdk-react-full.d.ts +194 -145
- package/dist/visual-embed-sdk-react.d.ts +194 -145
- package/dist/visual-embed-sdk.d.ts +82 -61
- package/lib/package.json +2 -2
- package/lib/src/embed/app.d.ts +43 -3
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +39 -6
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +24 -7
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +7 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +8 -3
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +5 -2
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +287 -2
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +5 -3
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +3 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +21 -10
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +6 -4
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +105 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +4 -4
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +4 -4
- 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/index.d.ts +32 -3
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +53 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +96 -2
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +25 -51
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +24 -50
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +85 -64
- package/package.json +2 -2
- package/src/embed/app.spec.ts +30 -6
- package/src/embed/app.ts +62 -9
- package/src/embed/base.ts +9 -0
- package/src/embed/bodyless-conversation.spec.ts +308 -1
- package/src/embed/bodyless-conversation.ts +13 -3
- package/src/embed/conversation.ts +5 -3
- package/src/embed/liveboard.ts +25 -10
- package/src/embed/ts-embed.spec.ts +130 -0
- package/src/embed/ts-embed.ts +6 -4
- package/src/index.ts +10 -3
- package/src/react/all-types-export.ts +1 -0
- package/src/react/index.spec.tsx +157 -1
- package/src/react/index.tsx +64 -3
- package/src/types.ts +24 -56
- package/cjs/src/pages/embed-test.page.d.ts +0 -8
- package/cjs/src/pages/embed-test.page.d.ts.map +0 -1
- package/cjs/src/pages/embed-test.page.js +0 -20
- package/cjs/src/pages/embed-test.page.js.map +0 -1
- package/cjs/src/pages/home.page.d.ts +0 -6
- package/cjs/src/pages/home.page.d.ts.map +0 -1
- package/cjs/src/pages/home.page.js +0 -12
- package/cjs/src/pages/home.page.js.map +0 -1
- package/cjs/src/pages/login.page.d.ts +0 -15
- package/cjs/src/pages/login.page.d.ts.map +0 -1
- package/cjs/src/pages/login.page.js +0 -22
- package/cjs/src/pages/login.page.js.map +0 -1
- package/cjs/src/tests/auth.test.d.ts +0 -1
- package/cjs/src/tests/auth.test.d.ts.map +0 -1
- package/cjs/src/tests/auth.test.js +0 -1
- package/cjs/src/tests/auth.test.js.map +0 -1
- package/cjs/src/tests/e2e/auth.spec.d.ts +0 -2
- package/cjs/src/tests/e2e/auth.spec.d.ts.map +0 -1
- package/cjs/src/tests/e2e/auth.spec.js +0 -54
- package/cjs/src/tests/e2e/auth.spec.js.map +0 -1
- package/dist/index-DUaG1OG2.js +0 -7447
- package/dist/index-Fhk1V_Gw.js +0 -7371
- package/dist/index-OuiZF3zE.js +0 -7371
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.38.0-alpha.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
return false;
|
|
34
34
|
};
|
|
35
|
-
const merge
|
|
35
|
+
const merge = (...objects) => objects.reduce((result, current) => {
|
|
36
36
|
if (Array.isArray(current)) {
|
|
37
37
|
throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
|
|
38
38
|
}
|
|
@@ -41,19 +41,19 @@
|
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
if (Array.isArray(result[key]) && Array.isArray(current[key])) {
|
|
44
|
-
result[key] = merge
|
|
45
|
-
? merge
|
|
44
|
+
result[key] = merge.options.mergeArrays
|
|
45
|
+
? merge.options.uniqueArrayItems
|
|
46
46
|
? Array.from(new Set(result[key].concat(current[key])))
|
|
47
47
|
: [...result[key], ...current[key]]
|
|
48
48
|
: current[key];
|
|
49
49
|
}
|
|
50
50
|
else if (isObject$1(result[key]) && isObject$1(current[key])) {
|
|
51
|
-
result[key] = merge
|
|
51
|
+
result[key] = merge(result[key], current[key]);
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
54
|
result[key] =
|
|
55
55
|
current[key] === undefined
|
|
56
|
-
? merge
|
|
56
|
+
? merge.options.allowUndefinedOverrides
|
|
57
57
|
? current[key]
|
|
58
58
|
: result[key]
|
|
59
59
|
: current[key];
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
mergeArrays: true,
|
|
67
67
|
uniqueArrayItems: true,
|
|
68
68
|
};
|
|
69
|
-
merge
|
|
70
|
-
merge
|
|
71
|
-
merge
|
|
72
|
-
const result = merge
|
|
73
|
-
merge
|
|
69
|
+
merge.options = defaultOptions;
|
|
70
|
+
merge.withOptions = (options, ...objects) => {
|
|
71
|
+
merge.options = Object.assign(Object.assign({}, defaultOptions), options);
|
|
72
|
+
const result = merge(...objects);
|
|
73
|
+
merge.options = defaultOptions;
|
|
74
74
|
return result;
|
|
75
75
|
};
|
|
76
76
|
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
function getDOMNode(domSelector) {
|
|
272
272
|
return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
|
|
273
273
|
}
|
|
274
|
-
const deepMerge = (target, source) => merge
|
|
274
|
+
const deepMerge = (target, source) => merge(target, source);
|
|
275
275
|
const getOperationNameFromQuery = (query) => {
|
|
276
276
|
const regex = /(?:query|mutation)\s+(\w+)/;
|
|
277
277
|
const matches = query.match(regex);
|
|
@@ -2005,9 +2005,12 @@
|
|
|
2005
2005
|
* @example
|
|
2006
2006
|
* ```js
|
|
2007
2007
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
2008
|
-
* { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
|
|
2008
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
|
|
2009
|
+
* ```
|
|
2010
|
+
* @example
|
|
2011
|
+
* ```js
|
|
2009
2012
|
* LiveboardEmbed.trigger(HostEvent.OpenFilter,
|
|
2010
|
-
*
|
|
2013
|
+
* { column: {columnId: '<column-GUID>'}})
|
|
2011
2014
|
* ```
|
|
2012
2015
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2013
2016
|
*/
|
|
@@ -2616,6 +2619,25 @@
|
|
|
2616
2619
|
* }]
|
|
2617
2620
|
* });
|
|
2618
2621
|
* ```
|
|
2622
|
+
* If there are multiple columns with the same name, consider
|
|
2623
|
+
* using `WORKSHEET_NAME::COLUMN_NAME` format.
|
|
2624
|
+
*
|
|
2625
|
+
* @example
|
|
2626
|
+
*
|
|
2627
|
+
* ```js
|
|
2628
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
2629
|
+
* filters: [{
|
|
2630
|
+
* column: "(Sample) Retail - Apparel::city",
|
|
2631
|
+
* oper: 'IN',
|
|
2632
|
+
* values: ["atlanta"]
|
|
2633
|
+
* },
|
|
2634
|
+
* {
|
|
2635
|
+
* column: "(Sample) Retail - Apparel::Region",
|
|
2636
|
+
* oper: 'IN',
|
|
2637
|
+
* values: ["West","Midwest"]
|
|
2638
|
+
* }]
|
|
2639
|
+
* });
|
|
2640
|
+
* ```
|
|
2619
2641
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2620
2642
|
*/
|
|
2621
2643
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
@@ -2825,54 +2847,6 @@
|
|
|
2825
2847
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
2826
2848
|
*/
|
|
2827
2849
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
2828
|
-
/**
|
|
2829
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2830
|
-
* Includes the following properties:
|
|
2831
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2832
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2833
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2834
|
-
*/
|
|
2835
|
-
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
2836
|
-
/**
|
|
2837
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2838
|
-
* Includes the following properties:
|
|
2839
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2840
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2841
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2842
|
-
*/
|
|
2843
|
-
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2844
|
-
/**
|
|
2845
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2846
|
-
* Includes the following properties:
|
|
2847
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2848
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2849
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2850
|
-
*/
|
|
2851
|
-
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
2852
|
-
/**
|
|
2853
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2854
|
-
* Includes the following properties:
|
|
2855
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2856
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2857
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2858
|
-
*/
|
|
2859
|
-
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
2860
|
-
/**
|
|
2861
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2862
|
-
* Includes the following properties:
|
|
2863
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2864
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2865
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2866
|
-
*/
|
|
2867
|
-
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2868
|
-
/**
|
|
2869
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2870
|
-
* Includes the following properties:
|
|
2871
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2872
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2873
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2874
|
-
*/
|
|
2875
|
-
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2876
2850
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2877
2851
|
/**
|
|
2878
2852
|
* The different visual modes that the data sources panel within
|
|
@@ -15054,6 +15028,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15054
15028
|
iFrame.style.width = '0';
|
|
15055
15029
|
iFrame.style.height = '0';
|
|
15056
15030
|
iFrame.style.border = '0';
|
|
15031
|
+
// Make it 'fixed' to keep it in a different stacking context.
|
|
15032
|
+
// This should solve the focus behaviours inside the iframe from
|
|
15033
|
+
// interfering with main body.
|
|
15034
|
+
iFrame.style.position = 'fixed';
|
|
15035
|
+
// Push it out of viewport.
|
|
15036
|
+
iFrame.style.top = '100vh';
|
|
15037
|
+
iFrame.style.left = '100vw';
|
|
15057
15038
|
iFrame.classList.add('prefetchIframe');
|
|
15058
15039
|
iFrame.classList.add(`prefetchIframeNum-${index}`);
|
|
15059
15040
|
document.body.appendChild(iFrame);
|
|
@@ -15425,7 +15406,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15425
15406
|
return e;
|
|
15426
15407
|
}
|
|
15427
15408
|
|
|
15428
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15409
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.38.0-alpha.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={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:"^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:"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};
|
|
15429
15410
|
|
|
15430
15411
|
/**
|
|
15431
15412
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15659,11 +15640,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15659
15640
|
* @param responder
|
|
15660
15641
|
*/
|
|
15661
15642
|
this.updateAuthToken = async (_, responder) => {
|
|
15662
|
-
const {
|
|
15663
|
-
|
|
15664
|
-
|
|
15643
|
+
const { authType } = this.embedConfig;
|
|
15644
|
+
let { autoLogin } = this.embedConfig;
|
|
15645
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise false
|
|
15646
|
+
autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === exports.AuthType.TrustedAuthTokenCookieless);
|
|
15647
|
+
if (autoLogin && authType === exports.AuthType.TrustedAuthTokenCookieless) {
|
|
15665
15648
|
try {
|
|
15666
|
-
authToken = await getAuthenticationToken(this.embedConfig);
|
|
15649
|
+
const authToken = await getAuthenticationToken(this.embedConfig);
|
|
15667
15650
|
responder({
|
|
15668
15651
|
type: exports.EmbedEvent.AuthExpire,
|
|
15669
15652
|
data: { authToken },
|
|
@@ -16817,6 +16800,31 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16817
16800
|
HomePageSearchBarMode["AI_ANSWER"] = "aiAnswer";
|
|
16818
16801
|
HomePageSearchBarMode["NONE"] = "none";
|
|
16819
16802
|
})(exports.HomePageSearchBarMode || (exports.HomePageSearchBarMode = {}));
|
|
16803
|
+
/**
|
|
16804
|
+
* Define the version of the primary navbar
|
|
16805
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
16806
|
+
*/
|
|
16807
|
+
exports.PrimaryNavbarVersion = void 0;
|
|
16808
|
+
(function (PrimaryNavbarVersion) {
|
|
16809
|
+
/**
|
|
16810
|
+
* Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
|
|
16811
|
+
* along with updates to the top navigation bar.
|
|
16812
|
+
* It serves as the foundational version of the PrimaryNavBar.
|
|
16813
|
+
*/
|
|
16814
|
+
PrimaryNavbarVersion["Sliding"] = "v3";
|
|
16815
|
+
})(exports.PrimaryNavbarVersion || (exports.PrimaryNavbarVersion = {}));
|
|
16816
|
+
/**
|
|
16817
|
+
* Define the version of the home page
|
|
16818
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
16819
|
+
*/
|
|
16820
|
+
exports.HomePage = void 0;
|
|
16821
|
+
(function (HomePage) {
|
|
16822
|
+
/**
|
|
16823
|
+
* Modular (v2) introduces the updated Modular Home Experience.
|
|
16824
|
+
* It serves as the foundational version of the home page.
|
|
16825
|
+
*/
|
|
16826
|
+
HomePage["Modular"] = "v2";
|
|
16827
|
+
})(exports.HomePage || (exports.HomePage = {}));
|
|
16820
16828
|
/**
|
|
16821
16829
|
* Embeds full ThoughtSpot experience in a host application.
|
|
16822
16830
|
* @group Embed components
|
|
@@ -16841,7 +16849,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16841
16849
|
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
16842
16850
|
};
|
|
16843
16851
|
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
16844
|
-
const { height: frameHeight
|
|
16852
|
+
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
16845
16853
|
const liveboardRelatedRoutes = [
|
|
16846
16854
|
'/pinboard/',
|
|
16847
16855
|
'/insights/pinboard/',
|
|
@@ -16871,9 +16879,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16871
16879
|
* embedded Liveboard or visualization.
|
|
16872
16880
|
*/
|
|
16873
16881
|
getEmbedParams() {
|
|
16874
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false,
|
|
16882
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
16875
16883
|
/* eslint-disable-next-line max-len */
|
|
16876
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, } = this.viewConfig;
|
|
16884
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, } = this.viewConfig;
|
|
16877
16885
|
let params = {};
|
|
16878
16886
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
16879
16887
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -16890,9 +16898,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16890
16898
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
16891
16899
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
16892
16900
|
params = this.getBaseQueryParams(params);
|
|
16893
|
-
if (modularHomeExperienceV3) {
|
|
16894
|
-
params[Param.NavigationVersion] = 'v3';
|
|
16895
|
-
}
|
|
16896
16901
|
if (hideObjectSearch) {
|
|
16897
16902
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
16898
16903
|
}
|
|
@@ -16949,6 +16954,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16949
16954
|
/* eslint-disable-next-line max-len */
|
|
16950
16955
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
16951
16956
|
}
|
|
16957
|
+
if (discoveryExperience) {
|
|
16958
|
+
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
16959
|
+
if (discoveryExperience.primaryNavbarVersion === exports.PrimaryNavbarVersion.Sliding) {
|
|
16960
|
+
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
16961
|
+
}
|
|
16962
|
+
// homePage v2 will enable the modular home page
|
|
16963
|
+
// and it will override the modularHomeExperience value
|
|
16964
|
+
if (discoveryExperience.homePage === exports.HomePage.Modular) {
|
|
16965
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
16966
|
+
}
|
|
16967
|
+
}
|
|
16952
16968
|
const queryParams = getQueryParamString(params, true);
|
|
16953
16969
|
return queryParams;
|
|
16954
16970
|
}
|
|
@@ -17128,12 +17144,6 @@ query GetEurekaVizSnapshots(
|
|
|
17128
17144
|
* @summary Liveboard & visualization embed
|
|
17129
17145
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
17130
17146
|
*/
|
|
17131
|
-
const liveboardHeightWhitelistedRoutes = [
|
|
17132
|
-
'/embed/viz/',
|
|
17133
|
-
'/embed/insights/viz/',
|
|
17134
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
17135
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
17136
|
-
];
|
|
17137
17147
|
/**
|
|
17138
17148
|
* Embed a ThoughtSpot Liveboard or visualization. When rendered it already
|
|
17139
17149
|
* waits for the authentication to complete, so you need not wait for
|
|
@@ -17150,7 +17160,6 @@ query GetEurekaVizSnapshots(
|
|
|
17150
17160
|
* @group Embed components
|
|
17151
17161
|
*/
|
|
17152
17162
|
class LiveboardEmbed extends V1Embed {
|
|
17153
|
-
// eslint-disable-next-line no-useless-constructor
|
|
17154
17163
|
constructor(domSelector, viewConfig) {
|
|
17155
17164
|
viewConfig.embedComponentType = 'LiveboardEmbed';
|
|
17156
17165
|
super(domSelector, viewConfig);
|
|
@@ -17168,13 +17177,30 @@ query GetEurekaVizSnapshots(
|
|
|
17168
17177
|
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
17169
17178
|
};
|
|
17170
17179
|
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
17171
|
-
const
|
|
17172
|
-
|
|
17180
|
+
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
17181
|
+
const liveboardRelatedRoutes = [
|
|
17182
|
+
'/pinboard/',
|
|
17183
|
+
'/insights/pinboard/',
|
|
17184
|
+
'/schedules/',
|
|
17185
|
+
'/embed/viz/',
|
|
17186
|
+
'/embed/insights/viz/',
|
|
17187
|
+
'/liveboard/',
|
|
17188
|
+
'/insights/liveboard/',
|
|
17189
|
+
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
17190
|
+
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
17191
|
+
];
|
|
17192
|
+
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
17193
|
+
// Ignore the height reset of the frame, if the navigation is
|
|
17194
|
+
// only within the liveboard page.
|
|
17173
17195
|
return;
|
|
17174
17196
|
}
|
|
17175
|
-
this.setIFrameHeight(this.defaultHeight);
|
|
17197
|
+
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
17176
17198
|
};
|
|
17177
17199
|
if (this.viewConfig.fullHeight === true) {
|
|
17200
|
+
if (this.viewConfig.vizId) {
|
|
17201
|
+
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
17202
|
+
'Using full height with vizId might lead to unexpected behavior.');
|
|
17203
|
+
}
|
|
17178
17204
|
this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
17179
17205
|
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
17180
17206
|
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
@@ -18089,6 +18115,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18089
18115
|
return { error };
|
|
18090
18116
|
}
|
|
18091
18117
|
const container = document.createElement('div');
|
|
18118
|
+
if (this.viewConfig.containerClassName) {
|
|
18119
|
+
container.className = this.viewConfig.containerClassName;
|
|
18120
|
+
}
|
|
18092
18121
|
const embed = new ConversationMessage(container, {
|
|
18093
18122
|
...this.viewConfig,
|
|
18094
18123
|
sessionId: data.sessionId,
|
|
@@ -18099,6 +18128,31 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18099
18128
|
await embed.render();
|
|
18100
18129
|
return { container, viz: embed };
|
|
18101
18130
|
}
|
|
18131
|
+
}
|
|
18132
|
+
/**
|
|
18133
|
+
* Create a conversation embed, which can be integrated inside
|
|
18134
|
+
* chatbots or other conversational interfaces.
|
|
18135
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18136
|
+
* Use {@link SpotterAgentEmbed} instead
|
|
18137
|
+
* @example
|
|
18138
|
+
* ```js
|
|
18139
|
+
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
18140
|
+
*
|
|
18141
|
+
* const conversation = new SpotterAgentEmbed({
|
|
18142
|
+
* worksheetId: 'worksheetId',
|
|
18143
|
+
* });
|
|
18144
|
+
*
|
|
18145
|
+
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
18146
|
+
*
|
|
18147
|
+
* // append the container to the DOM
|
|
18148
|
+
* document.body.appendChild(container); // or to any other element
|
|
18149
|
+
* ```
|
|
18150
|
+
* @group Embed components
|
|
18151
|
+
*/
|
|
18152
|
+
class BodylessConversation extends SpotterAgentEmbed {
|
|
18153
|
+
constructor(viewConfig) {
|
|
18154
|
+
super(viewConfig);
|
|
18155
|
+
}
|
|
18102
18156
|
}
|
|
18103
18157
|
|
|
18104
18158
|
/**
|
|
@@ -18137,7 +18191,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18137
18191
|
* });
|
|
18138
18192
|
* conversation.render();
|
|
18139
18193
|
* ```
|
|
18140
|
-
* @version SDK: 1.
|
|
18194
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18141
18195
|
*/
|
|
18142
18196
|
class SpotterEmbed extends TsEmbed {
|
|
18143
18197
|
constructor(container, viewConfig) {
|
|
@@ -18185,6 +18239,30 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18185
18239
|
await this.renderIFrame(src);
|
|
18186
18240
|
return this;
|
|
18187
18241
|
}
|
|
18242
|
+
}
|
|
18243
|
+
/**
|
|
18244
|
+
* Embed ThoughtSpot AI Conversation.
|
|
18245
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18246
|
+
* Use {@link SpotterEmbed} instead
|
|
18247
|
+
* @group Embed components
|
|
18248
|
+
* @example
|
|
18249
|
+
* ```js
|
|
18250
|
+
* const conversation = new SpotterEmbed('#tsEmbed', {
|
|
18251
|
+
* worksheetId: 'worksheetId',
|
|
18252
|
+
* searchOptions: {
|
|
18253
|
+
* searchQuery: 'searchQuery',
|
|
18254
|
+
* },
|
|
18255
|
+
* });
|
|
18256
|
+
* conversation.render();
|
|
18257
|
+
* ```
|
|
18258
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18259
|
+
*/
|
|
18260
|
+
class ConversationEmbed extends SpotterEmbed {
|
|
18261
|
+
constructor(container, viewConfig) {
|
|
18262
|
+
viewConfig.embedComponentType = 'conversation';
|
|
18263
|
+
super(container, viewConfig);
|
|
18264
|
+
this.viewConfig = viewConfig;
|
|
18265
|
+
}
|
|
18188
18266
|
}
|
|
18189
18267
|
|
|
18190
18268
|
/**
|
|
@@ -19245,7 +19323,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
19245
19323
|
return {
|
|
19246
19324
|
onAnchor: (source) => {
|
|
19247
19325
|
aliasObjects.push(source);
|
|
19248
|
-
|
|
19326
|
+
if (!prevAnchors)
|
|
19327
|
+
prevAnchors = anchorNames(doc);
|
|
19249
19328
|
const anchor = findNewAnchor(prefix, prevAnchors);
|
|
19250
19329
|
prevAnchors.add(anchor);
|
|
19251
19330
|
return anchor;
|
|
@@ -19409,36 +19488,23 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
19409
19488
|
* Resolve the value of this alias within `doc`, finding the last
|
|
19410
19489
|
* instance of the `source` anchor before this node.
|
|
19411
19490
|
*/
|
|
19412
|
-
resolve(doc
|
|
19413
|
-
let nodes;
|
|
19414
|
-
if (ctx?.aliasResolveCache) {
|
|
19415
|
-
nodes = ctx.aliasResolveCache;
|
|
19416
|
-
}
|
|
19417
|
-
else {
|
|
19418
|
-
nodes = [];
|
|
19419
|
-
visit$1(doc, {
|
|
19420
|
-
Node: (_key, node) => {
|
|
19421
|
-
if (isAlias(node) || hasAnchor(node))
|
|
19422
|
-
nodes.push(node);
|
|
19423
|
-
}
|
|
19424
|
-
});
|
|
19425
|
-
if (ctx)
|
|
19426
|
-
ctx.aliasResolveCache = nodes;
|
|
19427
|
-
}
|
|
19491
|
+
resolve(doc) {
|
|
19428
19492
|
let found = undefined;
|
|
19429
|
-
|
|
19430
|
-
|
|
19431
|
-
|
|
19432
|
-
|
|
19433
|
-
|
|
19434
|
-
|
|
19493
|
+
visit$1(doc, {
|
|
19494
|
+
Node: (_key, node) => {
|
|
19495
|
+
if (node === this)
|
|
19496
|
+
return visit$1.BREAK;
|
|
19497
|
+
if (node.anchor === this.source)
|
|
19498
|
+
found = node;
|
|
19499
|
+
}
|
|
19500
|
+
});
|
|
19435
19501
|
return found;
|
|
19436
19502
|
}
|
|
19437
19503
|
toJSON(_arg, ctx) {
|
|
19438
19504
|
if (!ctx)
|
|
19439
19505
|
return { source: this.source };
|
|
19440
19506
|
const { anchors, doc, maxAliasCount } = ctx;
|
|
19441
|
-
const source = this.resolve(doc
|
|
19507
|
+
const source = this.resolve(doc);
|
|
19442
19508
|
if (!source) {
|
|
19443
19509
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
19444
19510
|
throw new ReferenceError(msg);
|
|
@@ -19557,7 +19623,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
19557
19623
|
if (aliasDuplicateObjects && value && typeof value === 'object') {
|
|
19558
19624
|
ref = sourceObjects.get(value);
|
|
19559
19625
|
if (ref) {
|
|
19560
|
-
|
|
19626
|
+
if (!ref.anchor)
|
|
19627
|
+
ref.anchor = onAnchor(value);
|
|
19561
19628
|
return new Alias(ref.anchor);
|
|
19562
19629
|
}
|
|
19563
19630
|
else {
|
|
@@ -20128,32 +20195,23 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20128
20195
|
start = start.replace(/\n+/g, `$&${indent}`);
|
|
20129
20196
|
}
|
|
20130
20197
|
const indentSize = indent ? '2' : '1'; // root is at -1
|
|
20131
|
-
|
|
20132
|
-
let header = (startWithSpace ? indentSize : '') + chomp;
|
|
20198
|
+
let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
|
|
20133
20199
|
if (comment) {
|
|
20134
20200
|
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
|
20135
20201
|
if (onComment)
|
|
20136
20202
|
onComment();
|
|
20137
20203
|
}
|
|
20138
|
-
if (
|
|
20139
|
-
|
|
20140
|
-
|
|
20141
|
-
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
20142
|
-
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
20143
|
-
.replace(/\n+/g, `$&${indent}`);
|
|
20144
|
-
let literalFallback = false;
|
|
20145
|
-
const foldOptions = getFoldOptions(ctx, true);
|
|
20146
|
-
if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
|
|
20147
|
-
foldOptions.onOverflow = () => {
|
|
20148
|
-
literalFallback = true;
|
|
20149
|
-
};
|
|
20150
|
-
}
|
|
20151
|
-
const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
|
|
20152
|
-
if (!literalFallback)
|
|
20153
|
-
return `>${header}\n${indent}${body}`;
|
|
20204
|
+
if (literal) {
|
|
20205
|
+
value = value.replace(/\n+/g, `$&${indent}`);
|
|
20206
|
+
return `${header}\n${indent}${start}${value}${end}`;
|
|
20154
20207
|
}
|
|
20155
|
-
value = value
|
|
20156
|
-
|
|
20208
|
+
value = value
|
|
20209
|
+
.replace(/\n+/g, '\n$&')
|
|
20210
|
+
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
20211
|
+
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
20212
|
+
.replace(/\n+/g, `$&${indent}`);
|
|
20213
|
+
const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
|
|
20214
|
+
return `${header}\n${indent}${body}`;
|
|
20157
20215
|
}
|
|
20158
20216
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
20159
20217
|
const { type, value } = item;
|
|
@@ -20162,9 +20220,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20162
20220
|
(inFlow && /[[\]{},]/.test(value))) {
|
|
20163
20221
|
return quotedString(value, ctx);
|
|
20164
20222
|
}
|
|
20165
|
-
if (
|
|
20223
|
+
if (!value ||
|
|
20224
|
+
/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
|
20166
20225
|
// not allowed:
|
|
20167
|
-
// - '-' or '?'
|
|
20226
|
+
// - empty string, '-' or '?'
|
|
20168
20227
|
// - start with an indicator character (except [?:-]) or /[?-] /
|
|
20169
20228
|
// - '\n ', ': ' or ' \n' anywhere
|
|
20170
20229
|
// - '#' not preceded by a non-space char
|
|
@@ -20293,12 +20352,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20293
20352
|
let obj;
|
|
20294
20353
|
if (isScalar$1(item)) {
|
|
20295
20354
|
obj = item.value;
|
|
20296
|
-
|
|
20297
|
-
if (match.length > 1) {
|
|
20298
|
-
const testMatch = match.filter(t => t.test);
|
|
20299
|
-
if (testMatch.length > 0)
|
|
20300
|
-
match = testMatch;
|
|
20301
|
-
}
|
|
20355
|
+
const match = tags.filter(t => t.identify?.(obj));
|
|
20302
20356
|
tagObj =
|
|
20303
20357
|
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
|
20304
20358
|
}
|
|
@@ -20307,7 +20361,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20307
20361
|
tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
|
|
20308
20362
|
}
|
|
20309
20363
|
if (!tagObj) {
|
|
20310
|
-
const name = obj?.constructor?.name ??
|
|
20364
|
+
const name = obj?.constructor?.name ?? typeof obj;
|
|
20311
20365
|
throw new Error(`Tag not resolved for ${name} value`);
|
|
20312
20366
|
}
|
|
20313
20367
|
return tagObj;
|
|
@@ -20322,7 +20376,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20322
20376
|
anchors.add(anchor);
|
|
20323
20377
|
props.push(`&${anchor}`);
|
|
20324
20378
|
}
|
|
20325
|
-
const tag = node.tag
|
|
20379
|
+
const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
|
|
20326
20380
|
if (tag)
|
|
20327
20381
|
props.push(doc.directives.tagString(tag));
|
|
20328
20382
|
return props.join(' ');
|
|
@@ -20348,7 +20402,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20348
20402
|
const node = isNode(item)
|
|
20349
20403
|
? item
|
|
20350
20404
|
: ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
|
|
20351
|
-
|
|
20405
|
+
if (!tagObj)
|
|
20406
|
+
tagObj = getTagObject(ctx.doc.schema.tags, node);
|
|
20352
20407
|
const props = stringifyProps(node, tagObj, ctx);
|
|
20353
20408
|
if (props.length > 0)
|
|
20354
20409
|
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
|
@@ -20510,10 +20565,54 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20510
20565
|
|
|
20511
20566
|
function warn(logLevel, warning) {
|
|
20512
20567
|
if (logLevel === 'debug' || logLevel === 'warn') {
|
|
20513
|
-
|
|
20568
|
+
if (typeof process !== 'undefined' && process.emitWarning)
|
|
20569
|
+
process.emitWarning(warning);
|
|
20570
|
+
else
|
|
20571
|
+
console.warn(warning);
|
|
20514
20572
|
}
|
|
20515
20573
|
}
|
|
20516
20574
|
|
|
20575
|
+
const MERGE_KEY = '<<';
|
|
20576
|
+
function addPairToJSMap(ctx, map, { key, value }) {
|
|
20577
|
+
if (ctx?.doc.schema.merge && isMergeKey(key)) {
|
|
20578
|
+
value = isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
20579
|
+
if (isSeq(value))
|
|
20580
|
+
for (const it of value.items)
|
|
20581
|
+
mergeToJSMap(ctx, map, it);
|
|
20582
|
+
else if (Array.isArray(value))
|
|
20583
|
+
for (const it of value)
|
|
20584
|
+
mergeToJSMap(ctx, map, it);
|
|
20585
|
+
else
|
|
20586
|
+
mergeToJSMap(ctx, map, value);
|
|
20587
|
+
}
|
|
20588
|
+
else {
|
|
20589
|
+
const jsKey = toJS(key, '', ctx);
|
|
20590
|
+
if (map instanceof Map) {
|
|
20591
|
+
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
20592
|
+
}
|
|
20593
|
+
else if (map instanceof Set) {
|
|
20594
|
+
map.add(jsKey);
|
|
20595
|
+
}
|
|
20596
|
+
else {
|
|
20597
|
+
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
20598
|
+
const jsValue = toJS(value, stringKey, ctx);
|
|
20599
|
+
if (stringKey in map)
|
|
20600
|
+
Object.defineProperty(map, stringKey, {
|
|
20601
|
+
value: jsValue,
|
|
20602
|
+
writable: true,
|
|
20603
|
+
enumerable: true,
|
|
20604
|
+
configurable: true
|
|
20605
|
+
});
|
|
20606
|
+
else
|
|
20607
|
+
map[stringKey] = jsValue;
|
|
20608
|
+
}
|
|
20609
|
+
}
|
|
20610
|
+
return map;
|
|
20611
|
+
}
|
|
20612
|
+
const isMergeKey = (key) => key === MERGE_KEY ||
|
|
20613
|
+
(isScalar$1(key) &&
|
|
20614
|
+
key.value === MERGE_KEY &&
|
|
20615
|
+
(!key.type || key.type === Scalar.PLAIN));
|
|
20517
20616
|
// If the value associated with a merge key is a single mapping node, each of
|
|
20518
20617
|
// its key/value pairs is inserted into the current mapping, unless the key
|
|
20519
20618
|
// already exists in it. If the value associated with the merge key is a
|
|
@@ -20521,35 +20620,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20521
20620
|
// of these nodes is merged in turn according to its order in the sequence.
|
|
20522
20621
|
// Keys in mapping nodes earlier in the sequence override keys specified in
|
|
20523
20622
|
// later mapping nodes. -- http://yaml.org/type/merge.html
|
|
20524
|
-
|
|
20525
|
-
const merge = {
|
|
20526
|
-
identify: value => value === MERGE_KEY ||
|
|
20527
|
-
(typeof value === 'symbol' && value.description === MERGE_KEY),
|
|
20528
|
-
default: 'key',
|
|
20529
|
-
tag: 'tag:yaml.org,2002:merge',
|
|
20530
|
-
test: /^<<$/,
|
|
20531
|
-
resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
|
|
20532
|
-
addToJSMap: addMergeToJSMap
|
|
20533
|
-
}),
|
|
20534
|
-
stringify: () => MERGE_KEY
|
|
20535
|
-
};
|
|
20536
|
-
const isMergeKey = (ctx, key) => (merge.identify(key) ||
|
|
20537
|
-
(isScalar$1(key) &&
|
|
20538
|
-
(!key.type || key.type === Scalar.PLAIN) &&
|
|
20539
|
-
merge.identify(key.value))) &&
|
|
20540
|
-
ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
|
|
20541
|
-
function addMergeToJSMap(ctx, map, value) {
|
|
20542
|
-
value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
20543
|
-
if (isSeq(value))
|
|
20544
|
-
for (const it of value.items)
|
|
20545
|
-
mergeValue(ctx, map, it);
|
|
20546
|
-
else if (Array.isArray(value))
|
|
20547
|
-
for (const it of value)
|
|
20548
|
-
mergeValue(ctx, map, it);
|
|
20549
|
-
else
|
|
20550
|
-
mergeValue(ctx, map, value);
|
|
20551
|
-
}
|
|
20552
|
-
function mergeValue(ctx, map, value) {
|
|
20623
|
+
function mergeToJSMap(ctx, map, value) {
|
|
20553
20624
|
const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
20554
20625
|
if (!isMap(source))
|
|
20555
20626
|
throw new Error('Merge sources must be maps or map aliases');
|
|
@@ -20573,41 +20644,9 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20573
20644
|
}
|
|
20574
20645
|
return map;
|
|
20575
20646
|
}
|
|
20576
|
-
|
|
20577
|
-
function addPairToJSMap(ctx, map, { key, value }) {
|
|
20578
|
-
if (isNode(key) && key.addToJSMap)
|
|
20579
|
-
key.addToJSMap(ctx, map, value);
|
|
20580
|
-
// TODO: Should drop this special case for bare << handling
|
|
20581
|
-
else if (isMergeKey(ctx, key))
|
|
20582
|
-
addMergeToJSMap(ctx, map, value);
|
|
20583
|
-
else {
|
|
20584
|
-
const jsKey = toJS(key, '', ctx);
|
|
20585
|
-
if (map instanceof Map) {
|
|
20586
|
-
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
20587
|
-
}
|
|
20588
|
-
else if (map instanceof Set) {
|
|
20589
|
-
map.add(jsKey);
|
|
20590
|
-
}
|
|
20591
|
-
else {
|
|
20592
|
-
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
20593
|
-
const jsValue = toJS(value, stringKey, ctx);
|
|
20594
|
-
if (stringKey in map)
|
|
20595
|
-
Object.defineProperty(map, stringKey, {
|
|
20596
|
-
value: jsValue,
|
|
20597
|
-
writable: true,
|
|
20598
|
-
enumerable: true,
|
|
20599
|
-
configurable: true
|
|
20600
|
-
});
|
|
20601
|
-
else
|
|
20602
|
-
map[stringKey] = jsValue;
|
|
20603
|
-
}
|
|
20604
|
-
}
|
|
20605
|
-
return map;
|
|
20606
|
-
}
|
|
20607
20647
|
function stringifyKey(key, jsKey, ctx) {
|
|
20608
20648
|
if (jsKey === null)
|
|
20609
20649
|
return '';
|
|
20610
|
-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
20611
20650
|
if (typeof jsKey !== 'object')
|
|
20612
20651
|
return String(jsKey);
|
|
20613
20652
|
if (isNode(key) && ctx?.doc) {
|
|
@@ -21240,7 +21279,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21240
21279
|
identify: value => typeof value === 'boolean',
|
|
21241
21280
|
default: true,
|
|
21242
21281
|
tag: 'tag:yaml.org,2002:bool',
|
|
21243
|
-
test: /^true
|
|
21282
|
+
test: /^true|false$/,
|
|
21244
21283
|
resolve: str => str === 'true',
|
|
21245
21284
|
stringify: stringifyJSON
|
|
21246
21285
|
},
|
|
@@ -21285,7 +21324,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21285
21324
|
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
|
21286
21325
|
*/
|
|
21287
21326
|
resolve(src, onError) {
|
|
21288
|
-
if (typeof
|
|
21327
|
+
if (typeof Buffer === 'function') {
|
|
21328
|
+
return Buffer.from(src, 'base64');
|
|
21329
|
+
}
|
|
21330
|
+
else if (typeof atob === 'function') {
|
|
21289
21331
|
// On IE 11, atob() can't handle newlines
|
|
21290
21332
|
const str = atob(src.replace(/[\n\r]/g, ''));
|
|
21291
21333
|
const buffer = new Uint8Array(str.length);
|
|
@@ -21299,11 +21341,15 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21299
21341
|
}
|
|
21300
21342
|
},
|
|
21301
21343
|
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
21302
|
-
if (!value)
|
|
21303
|
-
return '';
|
|
21304
21344
|
const buf = value; // checked earlier by binary.identify()
|
|
21305
21345
|
let str;
|
|
21306
|
-
if (typeof
|
|
21346
|
+
if (typeof Buffer === 'function') {
|
|
21347
|
+
str =
|
|
21348
|
+
buf instanceof Buffer
|
|
21349
|
+
? buf.toString('base64')
|
|
21350
|
+
: Buffer.from(buf.buffer).toString('base64');
|
|
21351
|
+
}
|
|
21352
|
+
else if (typeof btoa === 'function') {
|
|
21307
21353
|
let s = '';
|
|
21308
21354
|
for (let i = 0; i < buf.length; ++i)
|
|
21309
21355
|
s += String.fromCharCode(buf[i]);
|
|
@@ -21312,7 +21358,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21312
21358
|
else {
|
|
21313
21359
|
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
|
|
21314
21360
|
}
|
|
21315
|
-
|
|
21361
|
+
if (!type)
|
|
21362
|
+
type = Scalar.BLOCK_LITERAL;
|
|
21316
21363
|
if (type !== Scalar.QUOTE_DOUBLE) {
|
|
21317
21364
|
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
|
|
21318
21365
|
const n = Math.ceil(str.length / lineWidth);
|
|
@@ -21781,7 +21828,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21781
21828
|
}
|
|
21782
21829
|
return new Date(date);
|
|
21783
21830
|
},
|
|
21784
|
-
stringify: ({ value }) => value
|
|
21831
|
+
stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
|
|
21785
21832
|
};
|
|
21786
21833
|
|
|
21787
21834
|
const schema = [
|
|
@@ -21799,7 +21846,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21799
21846
|
floatExp,
|
|
21800
21847
|
float,
|
|
21801
21848
|
binary,
|
|
21802
|
-
merge,
|
|
21803
21849
|
omap,
|
|
21804
21850
|
pairs,
|
|
21805
21851
|
set,
|
|
@@ -21827,7 +21873,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21827
21873
|
intOct: intOct$1,
|
|
21828
21874
|
intTime,
|
|
21829
21875
|
map,
|
|
21830
|
-
merge,
|
|
21831
21876
|
null: nullTag,
|
|
21832
21877
|
omap,
|
|
21833
21878
|
pairs,
|
|
@@ -21837,20 +21882,13 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21837
21882
|
};
|
|
21838
21883
|
const coreKnownTags = {
|
|
21839
21884
|
'tag:yaml.org,2002:binary': binary,
|
|
21840
|
-
'tag:yaml.org,2002:merge': merge,
|
|
21841
21885
|
'tag:yaml.org,2002:omap': omap,
|
|
21842
21886
|
'tag:yaml.org,2002:pairs': pairs,
|
|
21843
21887
|
'tag:yaml.org,2002:set': set,
|
|
21844
21888
|
'tag:yaml.org,2002:timestamp': timestamp
|
|
21845
21889
|
};
|
|
21846
|
-
function getTags(customTags, schemaName
|
|
21847
|
-
|
|
21848
|
-
if (schemaTags && !customTags) {
|
|
21849
|
-
return addMergeTag && !schemaTags.includes(merge)
|
|
21850
|
-
? schemaTags.concat(merge)
|
|
21851
|
-
: schemaTags.slice();
|
|
21852
|
-
}
|
|
21853
|
-
let tags = schemaTags;
|
|
21890
|
+
function getTags(customTags, schemaName) {
|
|
21891
|
+
let tags = schemas.get(schemaName);
|
|
21854
21892
|
if (!tags) {
|
|
21855
21893
|
if (Array.isArray(customTags))
|
|
21856
21894
|
tags = [];
|
|
@@ -21869,21 +21907,17 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21869
21907
|
else if (typeof customTags === 'function') {
|
|
21870
21908
|
tags = customTags(tags.slice());
|
|
21871
21909
|
}
|
|
21872
|
-
|
|
21873
|
-
|
|
21874
|
-
|
|
21875
|
-
const tagObj =
|
|
21876
|
-
if (
|
|
21877
|
-
|
|
21878
|
-
|
|
21879
|
-
|
|
21880
|
-
|
|
21881
|
-
|
|
21882
|
-
|
|
21883
|
-
if (!tags.includes(tagObj))
|
|
21884
|
-
tags.push(tagObj);
|
|
21885
|
-
return tags;
|
|
21886
|
-
}, []);
|
|
21910
|
+
return tags.map(tag => {
|
|
21911
|
+
if (typeof tag !== 'string')
|
|
21912
|
+
return tag;
|
|
21913
|
+
const tagObj = tagsByName[tag];
|
|
21914
|
+
if (tagObj)
|
|
21915
|
+
return tagObj;
|
|
21916
|
+
const keys = Object.keys(tagsByName)
|
|
21917
|
+
.map(key => JSON.stringify(key))
|
|
21918
|
+
.join(', ');
|
|
21919
|
+
throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
|
|
21920
|
+
});
|
|
21887
21921
|
}
|
|
21888
21922
|
|
|
21889
21923
|
const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
@@ -21894,9 +21928,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21894
21928
|
: compat
|
|
21895
21929
|
? getTags(null, compat)
|
|
21896
21930
|
: null;
|
|
21931
|
+
this.merge = !!merge;
|
|
21897
21932
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
|
21898
21933
|
this.knownTags = resolveKnownTags ? coreKnownTags : {};
|
|
21899
|
-
this.tags = getTags(customTags, this.name
|
|
21934
|
+
this.tags = getTags(customTags, this.name);
|
|
21900
21935
|
this.toStringOptions = toStringDefaults ?? null;
|
|
21901
21936
|
Object.defineProperty(this, MAP, { value: map });
|
|
21902
21937
|
Object.defineProperty(this, SCALAR$1, { value: string });
|
|
@@ -22021,7 +22056,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22021
22056
|
logLevel: 'warn',
|
|
22022
22057
|
prettyErrors: true,
|
|
22023
22058
|
strict: true,
|
|
22024
|
-
stringKeys: false,
|
|
22025
22059
|
uniqueKeys: true,
|
|
22026
22060
|
version: '1.2'
|
|
22027
22061
|
}, options);
|
|
@@ -22245,7 +22279,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22245
22279
|
this.directives.yaml.version = '1.1';
|
|
22246
22280
|
else
|
|
22247
22281
|
this.directives = new Directives({ version: '1.1' });
|
|
22248
|
-
opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
22282
|
+
opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
22249
22283
|
break;
|
|
22250
22284
|
case '1.2':
|
|
22251
22285
|
case 'next':
|
|
@@ -22253,7 +22287,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22253
22287
|
this.directives.yaml.version = version;
|
|
22254
22288
|
else
|
|
22255
22289
|
this.directives = new Directives({ version });
|
|
22256
|
-
opt = { resolveKnownTags: true, schema: 'core' };
|
|
22290
|
+
opt = { merge: false, resolveKnownTags: true, schema: 'core' };
|
|
22257
22291
|
break;
|
|
22258
22292
|
case null:
|
|
22259
22293
|
if (this.directives)
|
|
@@ -22431,7 +22465,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22431
22465
|
if (atNewline) {
|
|
22432
22466
|
if (comment)
|
|
22433
22467
|
comment += token.source;
|
|
22434
|
-
else
|
|
22468
|
+
else
|
|
22435
22469
|
spaceBefore = true;
|
|
22436
22470
|
}
|
|
22437
22471
|
else
|
|
@@ -22448,7 +22482,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22448
22482
|
if (token.source.endsWith(':'))
|
|
22449
22483
|
onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
|
|
22450
22484
|
anchor = token;
|
|
22451
|
-
|
|
22485
|
+
if (start === null)
|
|
22486
|
+
start = token.offset;
|
|
22452
22487
|
atNewline = false;
|
|
22453
22488
|
hasSpace = false;
|
|
22454
22489
|
reqSpace = true;
|
|
@@ -22457,7 +22492,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22457
22492
|
if (tag)
|
|
22458
22493
|
onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
|
|
22459
22494
|
tag = token;
|
|
22460
|
-
|
|
22495
|
+
if (start === null)
|
|
22496
|
+
start = token.offset;
|
|
22461
22497
|
atNewline = false;
|
|
22462
22498
|
hasSpace = false;
|
|
22463
22499
|
reqSpace = true;
|
|
@@ -22570,7 +22606,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22570
22606
|
return false;
|
|
22571
22607
|
const isEqual = typeof uniqueKeys === 'function'
|
|
22572
22608
|
? uniqueKeys
|
|
22573
|
-
: (a, b) => a === b ||
|
|
22609
|
+
: (a, b) => a === b ||
|
|
22610
|
+
(isScalar$1(a) &&
|
|
22611
|
+
isScalar$1(b) &&
|
|
22612
|
+
a.value === b.value &&
|
|
22613
|
+
!(a.value === '<<' && ctx.schema.merge));
|
|
22574
22614
|
return items.some(pair => isEqual(pair.key, search));
|
|
22575
22615
|
}
|
|
22576
22616
|
|
|
@@ -22619,14 +22659,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22619
22659
|
onError(offset, 'BAD_INDENT', startColMsg);
|
|
22620
22660
|
}
|
|
22621
22661
|
// key value
|
|
22622
|
-
ctx.atKey = true;
|
|
22623
22662
|
const keyStart = keyProps.end;
|
|
22624
22663
|
const keyNode = key
|
|
22625
22664
|
? composeNode(ctx, key, keyProps, onError)
|
|
22626
22665
|
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
|
22627
22666
|
if (ctx.schema.compat)
|
|
22628
22667
|
flowIndentCheck(bm.indent, key, onError);
|
|
22629
|
-
ctx.atKey = false;
|
|
22630
22668
|
if (mapIncludes(ctx, map.items, keyNode))
|
|
22631
22669
|
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
|
22632
22670
|
// value properties
|
|
@@ -22686,8 +22724,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22686
22724
|
const seq = new NodeClass(ctx.schema);
|
|
22687
22725
|
if (ctx.atRoot)
|
|
22688
22726
|
ctx.atRoot = false;
|
|
22689
|
-
if (ctx.atKey)
|
|
22690
|
-
ctx.atKey = false;
|
|
22691
22727
|
let offset = bs.offset;
|
|
22692
22728
|
let commentEnd = null;
|
|
22693
22729
|
for (const { start, value } of bs.items) {
|
|
@@ -22772,8 +22808,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22772
22808
|
const atRoot = ctx.atRoot;
|
|
22773
22809
|
if (atRoot)
|
|
22774
22810
|
ctx.atRoot = false;
|
|
22775
|
-
if (ctx.atKey)
|
|
22776
|
-
ctx.atKey = false;
|
|
22777
22811
|
let offset = fc.offset + fc.start.source.length;
|
|
22778
22812
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
22779
22813
|
const collItem = fc.items[i];
|
|
@@ -22853,14 +22887,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22853
22887
|
else {
|
|
22854
22888
|
// item is a key+value pair
|
|
22855
22889
|
// key value
|
|
22856
|
-
ctx.atKey = true;
|
|
22857
22890
|
const keyStart = props.end;
|
|
22858
22891
|
const keyNode = key
|
|
22859
22892
|
? composeNode(ctx, key, props, onError)
|
|
22860
22893
|
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
|
22861
22894
|
if (isBlock(key))
|
|
22862
22895
|
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
|
22863
|
-
ctx.atKey = false;
|
|
22864
22896
|
// value properties
|
|
22865
22897
|
const valueProps = resolveProps(sep ?? [], {
|
|
22866
22898
|
flow: fcName,
|
|
@@ -23016,8 +23048,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23016
23048
|
tag = kt;
|
|
23017
23049
|
}
|
|
23018
23050
|
else {
|
|
23019
|
-
if (kt) {
|
|
23020
|
-
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection
|
|
23051
|
+
if (kt?.collection) {
|
|
23052
|
+
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
|
|
23021
23053
|
}
|
|
23022
23054
|
else {
|
|
23023
23055
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
|
|
@@ -23458,16 +23490,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23458
23490
|
const tagName = tagToken
|
|
23459
23491
|
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
|
23460
23492
|
: null;
|
|
23461
|
-
|
|
23462
|
-
|
|
23463
|
-
|
|
23464
|
-
|
|
23465
|
-
|
|
23466
|
-
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
|
23467
|
-
else if (token.type === 'scalar')
|
|
23468
|
-
tag = findScalarTagByTest(ctx, value, token, onError);
|
|
23469
|
-
else
|
|
23470
|
-
tag = ctx.schema[SCALAR$1];
|
|
23493
|
+
const tag = tagToken && tagName
|
|
23494
|
+
? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
|
|
23495
|
+
: token.type === 'scalar'
|
|
23496
|
+
? findScalarTagByTest(ctx, value, token, onError)
|
|
23497
|
+
: ctx.schema[SCALAR$1];
|
|
23471
23498
|
let scalar;
|
|
23472
23499
|
try {
|
|
23473
23500
|
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
|
@@ -23515,9 +23542,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23515
23542
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
|
23516
23543
|
return schema[SCALAR$1];
|
|
23517
23544
|
}
|
|
23518
|
-
function findScalarTagByTest({
|
|
23519
|
-
const tag = schema.tags.find(tag =>
|
|
23520
|
-
tag.test?.test(value)) || schema[SCALAR$1];
|
|
23545
|
+
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
|
23546
|
+
const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
|
|
23521
23547
|
if (schema.compat) {
|
|
23522
23548
|
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
|
23523
23549
|
schema[SCALAR$1];
|
|
@@ -23533,7 +23559,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23533
23559
|
|
|
23534
23560
|
function emptyScalarPosition(offset, before, pos) {
|
|
23535
23561
|
if (before) {
|
|
23536
|
-
|
|
23562
|
+
if (pos === null)
|
|
23563
|
+
pos = before.length;
|
|
23537
23564
|
for (let i = pos - 1; i >= 0; --i) {
|
|
23538
23565
|
let st = before[i];
|
|
23539
23566
|
switch (st.type) {
|
|
@@ -23558,7 +23585,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23558
23585
|
|
|
23559
23586
|
const CN = { composeNode, composeEmptyNode };
|
|
23560
23587
|
function composeNode(ctx, token, props, onError) {
|
|
23561
|
-
const atKey = ctx.atKey;
|
|
23562
23588
|
const { spaceBefore, comment, anchor, tag } = props;
|
|
23563
23589
|
let node;
|
|
23564
23590
|
let isSrcToken = true;
|
|
@@ -23594,14 +23620,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23594
23620
|
}
|
|
23595
23621
|
if (anchor && node.anchor === '')
|
|
23596
23622
|
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
|
|
23597
|
-
if (atKey &&
|
|
23598
|
-
ctx.options.stringKeys &&
|
|
23599
|
-
(!isScalar$1(node) ||
|
|
23600
|
-
typeof node.value !== 'string' ||
|
|
23601
|
-
(node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
|
|
23602
|
-
const msg = 'With stringKeys, all keys must be strings';
|
|
23603
|
-
onError(tag ?? token, 'NON_STRING_KEY', msg);
|
|
23604
|
-
}
|
|
23605
23623
|
if (spaceBefore)
|
|
23606
23624
|
node.spaceBefore = true;
|
|
23607
23625
|
if (comment) {
|
|
@@ -23654,7 +23672,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23654
23672
|
const opts = Object.assign({ _directives: directives }, options);
|
|
23655
23673
|
const doc = new Document(undefined, opts);
|
|
23656
23674
|
const ctx = {
|
|
23657
|
-
atKey: false,
|
|
23658
23675
|
atRoot: true,
|
|
23659
23676
|
directives: doc.directives,
|
|
23660
23677
|
options: doc.options,
|
|
@@ -25789,20 +25806,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25789
25806
|
default: {
|
|
25790
25807
|
const bv = this.startBlockValue(map);
|
|
25791
25808
|
if (bv) {
|
|
25792
|
-
if (bv.type
|
|
25793
|
-
if (!it.explicitKey &&
|
|
25794
|
-
it.sep &&
|
|
25795
|
-
!includesToken(it.sep, 'newline')) {
|
|
25796
|
-
yield* this.pop({
|
|
25797
|
-
type: 'error',
|
|
25798
|
-
offset: this.offset,
|
|
25799
|
-
message: 'Unexpected block-seq-ind on same line with key',
|
|
25800
|
-
source: this.source
|
|
25801
|
-
});
|
|
25802
|
-
return;
|
|
25803
|
-
}
|
|
25804
|
-
}
|
|
25805
|
-
else if (atMapIndent) {
|
|
25809
|
+
if (atMapIndent && bv.type !== 'block-seq') {
|
|
25806
25810
|
map.items.push({ start });
|
|
25807
25811
|
}
|
|
25808
25812
|
this.stack.push(bv);
|
|
@@ -26173,8 +26177,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26173
26177
|
if (!keepUndefined)
|
|
26174
26178
|
return undefined;
|
|
26175
26179
|
}
|
|
26176
|
-
if (isDocument(value) && !_replacer)
|
|
26177
|
-
return value.toString(options);
|
|
26178
26180
|
return new Document(value, _replacer, options).toString(options);
|
|
26179
26181
|
}
|
|
26180
26182
|
|
|
@@ -26250,8 +26252,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26250
26252
|
|
|
26251
26253
|
exports.AnswerService = AnswerService;
|
|
26252
26254
|
exports.AppEmbed = AppEmbed;
|
|
26253
|
-
exports.BodylessConversation =
|
|
26254
|
-
exports.ConversationEmbed =
|
|
26255
|
+
exports.BodylessConversation = BodylessConversation;
|
|
26256
|
+
exports.ConversationEmbed = ConversationEmbed;
|
|
26255
26257
|
exports.LiveboardEmbed = LiveboardEmbed;
|
|
26256
26258
|
exports.MIXPANEL_EVENT = MIXPANEL_EVENT;
|
|
26257
26259
|
exports.PinboardEmbed = PinboardEmbed;
|