@thoughtspot/visual-embed-sdk 1.36.8 → 1.36.9-PA

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/cjs/package.json +23 -18
  2. package/cjs/src/embed/bodyless-conversation.d.ts +16 -0
  3. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  4. package/cjs/src/embed/bodyless-conversation.js +1 -1
  5. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  6. package/cjs/src/embed/search-bar.d.ts +1 -1
  7. package/cjs/src/embed/search.d.ts +1 -1
  8. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  9. package/cjs/src/embed/ts-embed.js +14 -2
  10. package/cjs/src/embed/ts-embed.js.map +1 -1
  11. package/cjs/src/embed/ts-embed.spec.js +111 -0
  12. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  13. package/cjs/src/index.d.ts +2 -2
  14. package/cjs/src/index.d.ts.map +1 -1
  15. package/cjs/src/index.js +2 -1
  16. package/cjs/src/index.js.map +1 -1
  17. package/cjs/src/pages/embed-test.page.d.ts +8 -0
  18. package/cjs/src/pages/embed-test.page.d.ts.map +1 -0
  19. package/cjs/src/pages/embed-test.page.js +20 -0
  20. package/cjs/src/pages/embed-test.page.js.map +1 -0
  21. package/cjs/src/pages/home.page.d.ts +6 -0
  22. package/cjs/src/pages/home.page.d.ts.map +1 -0
  23. package/cjs/src/pages/home.page.js +12 -0
  24. package/cjs/src/pages/home.page.js.map +1 -0
  25. package/cjs/src/pages/login.page.d.ts +15 -0
  26. package/cjs/src/pages/login.page.d.ts.map +1 -0
  27. package/cjs/src/pages/login.page.js +22 -0
  28. package/cjs/src/pages/login.page.js.map +1 -0
  29. package/cjs/src/react/index.d.ts +1 -1
  30. package/cjs/src/react/index.d.ts.map +1 -1
  31. package/cjs/src/react/index.js +8 -3
  32. package/cjs/src/react/index.js.map +1 -1
  33. package/cjs/src/tests/auth.test.d.ts +1 -0
  34. package/cjs/src/tests/auth.test.d.ts.map +1 -0
  35. package/cjs/src/tests/auth.test.js +1 -0
  36. package/cjs/src/tests/auth.test.js.map +1 -0
  37. package/cjs/src/tests/e2e/auth.spec.d.ts +2 -0
  38. package/cjs/src/tests/e2e/auth.spec.d.ts.map +1 -0
  39. package/cjs/src/tests/e2e/auth.spec.js +54 -0
  40. package/cjs/src/tests/e2e/auth.spec.js.map +1 -0
  41. package/cjs/src/types.d.ts +81 -10
  42. package/cjs/src/types.d.ts.map +1 -1
  43. package/cjs/src/types.js +45 -9
  44. package/cjs/src/types.js.map +1 -1
  45. package/dist/index-BEyovSez.js +7370 -0
  46. package/dist/{index-BnVGyY5S.js → index-BJx3m5_V.js} +1 -1
  47. package/dist/index-CpzF_6NO.js +7440 -0
  48. package/dist/index-Dg18PU5Z.js +7370 -0
  49. package/dist/index-Do_T8J8z.js +7370 -0
  50. package/dist/index-KdQfn0ah.js +7440 -0
  51. package/dist/src/embed/bodyless-conversation.d.ts +16 -0
  52. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  53. package/dist/src/embed/search-bar.d.ts +1 -1
  54. package/dist/src/embed/search.d.ts +1 -1
  55. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  56. package/dist/src/index.d.ts +2 -2
  57. package/dist/src/index.d.ts.map +1 -1
  58. package/dist/src/pages/embed-test.page.d.ts +8 -0
  59. package/dist/src/pages/embed-test.page.d.ts.map +1 -0
  60. package/dist/src/pages/home.page.d.ts +6 -0
  61. package/dist/src/pages/home.page.d.ts.map +1 -0
  62. package/dist/src/pages/login.page.d.ts +15 -0
  63. package/dist/src/pages/login.page.d.ts.map +1 -0
  64. package/dist/src/react/index.d.ts +1 -1
  65. package/dist/src/react/index.d.ts.map +1 -1
  66. package/dist/src/tests/auth.test.d.ts +1 -0
  67. package/dist/src/tests/auth.test.d.ts.map +1 -0
  68. package/dist/src/tests/e2e/auth.spec.d.ts +2 -0
  69. package/dist/src/tests/e2e/auth.spec.d.ts.map +1 -0
  70. package/dist/src/types.d.ts +81 -10
  71. package/dist/src/types.d.ts.map +1 -1
  72. package/dist/tsembed-react.es.js +68 -16
  73. package/dist/tsembed-react.js +252 -130
  74. package/dist/tsembed.es.js +63 -15
  75. package/dist/tsembed.js +246 -128
  76. package/dist/visual-embed-sdk-react-full.d.ts +99 -13
  77. package/dist/visual-embed-sdk-react.d.ts +99 -13
  78. package/dist/visual-embed-sdk.d.ts +99 -13
  79. package/lib/package.json +23 -18
  80. package/lib/src/embed/bodyless-conversation.d.ts +16 -0
  81. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  82. package/lib/src/embed/bodyless-conversation.js +1 -1
  83. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  84. package/lib/src/embed/search-bar.d.ts +1 -1
  85. package/lib/src/embed/search.d.ts +1 -1
  86. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  87. package/lib/src/embed/ts-embed.js +14 -2
  88. package/lib/src/embed/ts-embed.js.map +1 -1
  89. package/lib/src/embed/ts-embed.spec.js +111 -0
  90. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  91. package/lib/src/index.d.ts +2 -2
  92. package/lib/src/index.d.ts.map +1 -1
  93. package/lib/src/index.js +2 -2
  94. package/lib/src/index.js.map +1 -1
  95. package/lib/src/pages/embed-test.page.d.ts +8 -0
  96. package/lib/src/pages/embed-test.page.d.ts.map +1 -0
  97. package/lib/src/pages/embed-test.page.js +16 -0
  98. package/lib/src/pages/embed-test.page.js.map +1 -0
  99. package/lib/src/pages/home.page.d.ts +6 -0
  100. package/lib/src/pages/home.page.d.ts.map +1 -0
  101. package/lib/src/pages/home.page.js +8 -0
  102. package/lib/src/pages/home.page.js.map +1 -0
  103. package/lib/src/pages/login.page.d.ts +15 -0
  104. package/lib/src/pages/login.page.d.ts.map +1 -0
  105. package/lib/src/pages/login.page.js +18 -0
  106. package/lib/src/pages/login.page.js.map +1 -0
  107. package/lib/src/react/index.d.ts +1 -1
  108. package/lib/src/react/index.d.ts.map +1 -1
  109. package/lib/src/react/index.js +7 -3
  110. package/lib/src/react/index.js.map +1 -1
  111. package/lib/src/tests/auth.test.d.ts +1 -0
  112. package/lib/src/tests/auth.test.d.ts.map +1 -0
  113. package/lib/src/tests/auth.test.js +1 -0
  114. package/lib/src/tests/auth.test.js.map +1 -0
  115. package/lib/src/tests/e2e/auth.spec.d.ts +2 -0
  116. package/lib/src/tests/e2e/auth.spec.d.ts.map +1 -0
  117. package/lib/src/tests/e2e/auth.spec.js +52 -0
  118. package/lib/src/tests/e2e/auth.spec.js.map +1 -0
  119. package/lib/src/types.d.ts +81 -10
  120. package/lib/src/types.d.ts.map +1 -1
  121. package/lib/src/types.js +44 -8
  122. package/lib/src/types.js.map +1 -1
  123. package/lib/src/visual-embed-sdk.d.ts +101 -14
  124. package/package.json +23 -18
  125. package/src/embed/bodyless-conversation.ts +1 -1
  126. package/src/embed/search-bar.tsx +1 -1
  127. package/src/embed/search.ts +1 -1
  128. package/src/embed/ts-embed.spec.ts +118 -0
  129. package/src/embed/ts-embed.ts +15 -0
  130. package/src/index.ts +2 -0
  131. package/src/react/index.tsx +10 -6
  132. package/src/types.ts +83 -10
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.36.8 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.36.9-PA */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -31,7 +31,7 @@
31
31
  }
32
32
  return false;
33
33
  };
34
- const merge = (...objects) => objects.reduce((result, current) => {
34
+ const merge$1 = (...objects) => objects.reduce((result, current) => {
35
35
  if (Array.isArray(current)) {
36
36
  throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
37
37
  }
@@ -40,19 +40,19 @@
40
40
  return;
41
41
  }
42
42
  if (Array.isArray(result[key]) && Array.isArray(current[key])) {
43
- result[key] = merge.options.mergeArrays
44
- ? merge.options.uniqueArrayItems
43
+ result[key] = merge$1.options.mergeArrays
44
+ ? merge$1.options.uniqueArrayItems
45
45
  ? Array.from(new Set(result[key].concat(current[key])))
46
46
  : [...result[key], ...current[key]]
47
47
  : current[key];
48
48
  }
49
49
  else if (isObject$1(result[key]) && isObject$1(current[key])) {
50
- result[key] = merge(result[key], current[key]);
50
+ result[key] = merge$1(result[key], current[key]);
51
51
  }
52
52
  else {
53
53
  result[key] =
54
54
  current[key] === undefined
55
- ? merge.options.allowUndefinedOverrides
55
+ ? merge$1.options.allowUndefinedOverrides
56
56
  ? current[key]
57
57
  : result[key]
58
58
  : current[key];
@@ -65,11 +65,11 @@
65
65
  mergeArrays: true,
66
66
  uniqueArrayItems: true,
67
67
  };
68
- merge.options = defaultOptions;
69
- merge.withOptions = (options, ...objects) => {
70
- merge.options = Object.assign(Object.assign({}, defaultOptions), options);
71
- const result = merge(...objects);
72
- merge.options = defaultOptions;
68
+ merge$1.options = defaultOptions;
69
+ merge$1.withOptions = (options, ...objects) => {
70
+ merge$1.options = Object.assign(Object.assign({}, defaultOptions), options);
71
+ const result = merge$1(...objects);
72
+ merge$1.options = defaultOptions;
73
73
  return result;
74
74
  };
75
75
 
@@ -270,7 +270,7 @@
270
270
  function getDOMNode(domSelector) {
271
271
  return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
272
272
  }
273
- const deepMerge = (target, source) => merge(target, source);
273
+ const deepMerge = (target, source) => merge$1(target, source);
274
274
  const getOperationNameFromQuery = (query) => {
275
275
  const regex = /(?:query|mutation)\s+(\w+)/;
276
276
  const matches = query.match(regex);
@@ -683,6 +683,35 @@
683
683
  */
684
684
  HomepageModule["Learning"] = "LEARNING";
685
685
  })(exports.HomepageModule || (exports.HomepageModule = {}));
686
+ /**
687
+ * List page columns that can be hidden.
688
+ * **Note**: This option is applicable only in full app embedding.
689
+ * @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
690
+ */
691
+ // eslint-disable-next-line no-shadow
692
+ exports.ListPageColumns = void 0;
693
+ (function (ListPageColumns) {
694
+ /**
695
+ * Favourite
696
+ */
697
+ ListPageColumns["Favourite"] = "FAVOURITE";
698
+ /**
699
+ * Tags
700
+ */
701
+ ListPageColumns["Tags"] = "TAGS";
702
+ /**
703
+ * Author
704
+ */
705
+ ListPageColumns["Author"] = "AUTHOR";
706
+ /**
707
+ * Last viewed/Last modified
708
+ */
709
+ ListPageColumns["DateSort"] = "DATE_SORT";
710
+ /**
711
+ * Share
712
+ */
713
+ ListPageColumns["Share"] = "SHARE";
714
+ })(exports.ListPageColumns || (exports.ListPageColumns = {}));
686
715
  /**
687
716
  * Event types emitted by the embedded ThoughtSpot application.
688
717
  *
@@ -1673,16 +1702,19 @@
1673
1702
  /**
1674
1703
  * Emits when a table visualization is rendered in
1675
1704
  * the ThoughtSpot embedded app.
1705
+ *
1676
1706
  * You can also use this event as a hook to trigger host events
1677
1707
  * such as `HostEvent.TransformTableVizData` on the table visualization.
1678
1708
  * The event payload contains the data used in the rendered table.
1679
1709
  * You can extract the relevant data from the payload
1680
1710
  * stored in `payload.data.data.columnDataLite`.
1711
+ *
1681
1712
  * `columnDataLite` is a multidimensional array that contains
1682
1713
  * data values for each column, which was used in the query to
1683
1714
  * generate the table visualization. To find and modify specific cell data,
1684
1715
  * you can either loop through the array or directly access a cell if
1685
1716
  * you know its position and data index.
1717
+ *
1686
1718
  * In the following code sample, the first cell in the first column
1687
1719
  * (`columnDataLite[0].dataValue[0]`) is set to `new fob`.
1688
1720
  * Note that any changes made to the data in the payload will only update the
@@ -1692,6 +1724,7 @@
1692
1724
  * payload in the `columnDataLite` is passed on to
1693
1725
  * `HostEvent.TransformTableVizData` and trigger an update to
1694
1726
  * the table visualization.
1727
+ *
1695
1728
  * If the Row-Level Security (RLS) rules are applied on the
1696
1729
  * Worksheet or Model, exercise caution when changing column
1697
1730
  * or table cell values to maintain data security.
@@ -1706,7 +1739,7 @@
1706
1739
  * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
1707
1740
  * })
1708
1741
  * ```
1709
- * @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
1742
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
1710
1743
  */
1711
1744
  EmbedEvent["TableVizRendered"] = "TableVizRendered";
1712
1745
  /**
@@ -1719,7 +1752,7 @@
1719
1752
  * console.log('payload', payload);
1720
1753
  * })
1721
1754
  *```
1722
- * @version SDK : 1.36.0 | ThoughtSpot : 10.8.0.cl
1755
+ * @version SDK : 1.38.0 | ThoughtSpot : 10.8.0.cl
1723
1756
  */
1724
1757
  EmbedEvent["CreateLiveboard"] = "createLiveboard";
1725
1758
  /**
@@ -2168,7 +2201,7 @@
2168
2201
  * ```js
2169
2202
  * liveboardEmbed.trigger(HostEvent.Remove)
2170
2203
  * ```
2171
- * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
2204
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
2172
2205
  */
2173
2206
  HostEvent["Remove"] = "delete";
2174
2207
  /**
@@ -2716,7 +2749,7 @@
2716
2749
  * ```js
2717
2750
  * liveboardEmbed.trigger(HostEvent.InfoSuccess, data);
2718
2751
  *```
2719
- * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
2752
+ * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2720
2753
  */
2721
2754
  HostEvent["InfoSuccess"] = "InfoSuccess";
2722
2755
  /**
@@ -2763,7 +2796,7 @@
2763
2796
  * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
2764
2797
  * })
2765
2798
  * ```
2766
- * @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
2799
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
2767
2800
  */
2768
2801
  HostEvent["TransformTableVizData"] = "TransformTableVizData";
2769
2802
  })(exports.HostEvent || (exports.HostEvent = {}));
@@ -2818,6 +2851,7 @@
2818
2851
  Param["livedBoardEmbed"] = "isLiveboardEmbed";
2819
2852
  Param["searchEmbed"] = "isSearchEmbed";
2820
2853
  Param["vizEmbed"] = "isVizEmbed";
2854
+ Param["StringIDsUrl"] = "overrideStringIDsUrl";
2821
2855
  Param["Version"] = "sdkVersion";
2822
2856
  Param["ViewPortHeight"] = "viewPortHeight";
2823
2857
  Param["ViewPortWidth"] = "viewPortWidth";
@@ -2873,6 +2907,7 @@
2873
2907
  Param["HideSageAnswerHeader"] = "hideSageAnswerHeader";
2874
2908
  Param["HideSearchBar"] = "hideSearchBar";
2875
2909
  Param["ClientLogLevel"] = "clientLogLevel";
2910
+ Param["ExposeTranslationIDs"] = "exposeTranslationIDs";
2876
2911
  Param["OverrideNativeConsole"] = "overrideConsoleLogs";
2877
2912
  Param["enableAskSage"] = "enableAskSage";
2878
2913
  Param["CollapseSearchBarInitially"] = "collapseSearchBarInitially";
@@ -2900,6 +2935,7 @@
2900
2935
  Param["preAuthCache"] = "preAuthCache";
2901
2936
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
2902
2937
  Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
2938
+ Param["PrimaryAction"] = "primaryAction";
2903
2939
  })(Param || (Param = {}));
2904
2940
  /**
2905
2941
  * ThoughtSpot application pages include actions and menu commands
@@ -3066,7 +3102,7 @@
3066
3102
  * The **Collapse data panel** icon on the Search page.
3067
3103
  * Collapses the data panel view.
3068
3104
  *
3069
- * @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl, 10.7.0.sw
3105
+ * @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
3070
3106
  *
3071
3107
  * @example
3072
3108
  * ```js
@@ -4130,8 +4166,8 @@
4130
4166
  PrefetchFeatures["VizEmbed"] = "VizEmbed";
4131
4167
  })(exports.PrefetchFeatures || (exports.PrefetchFeatures = {}));
4132
4168
  /**
4133
- * Enum for options to change context trigger
4134
- * BOTH_CLICKS option is introduced in 10.7
4169
+ * Enum for options to change context trigger.
4170
+ * The `BOTH_CLICKS` option is available from 10.8.0.cl.
4135
4171
  */
4136
4172
  exports.ContextMenuTriggerOptions = void 0;
4137
4173
  (function (ContextMenuTriggerOptions) {
@@ -15267,7 +15303,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15267
15303
  return e;
15268
15304
  }
15269
15305
 
15270
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.8";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":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"6.3.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15306
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.9-PA";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"^18.3.1","react-dom":"^18.3.1"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^18.3.1","react-dom":"^18.3.1","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4","@types/react":"^18.2.37","@types/react-dom":"^18.2.15"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15271
15307
 
15272
15308
  /**
15273
15309
  * Reloads the ThoughtSpot iframe.
@@ -15741,6 +15777,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15741
15777
  ? (_b = this.viewConfig) === null || _b === void 0 ? void 0 : _b.hiddenHomeLeftNavItems
15742
15778
  : [],
15743
15779
  customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
15780
+ hiddenListColumns: this.viewConfig.hiddenListColumns || [],
15744
15781
  };
15745
15782
  }
15746
15783
  async getAppInitData() {
@@ -15766,7 +15803,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15766
15803
  * @returns queryParams
15767
15804
  */
15768
15805
  getBaseQueryParams(queryParams = {}) {
15769
- var _a, _b;
15806
+ var _a, _b, _c, _d;
15770
15807
  let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
15771
15808
  // The below check is needed because TS Cloud firewall, blocks
15772
15809
  // localhost/127.0.0.1 in any url param.
@@ -15803,7 +15840,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15803
15840
  if (this.embedConfig.currencyFormat) {
15804
15841
  queryParams[Param.CurrencyFormat] = this.embedConfig.currencyFormat;
15805
15842
  }
15806
- const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, } = this.viewConfig;
15843
+ const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, primaryAction, } = this.viewConfig;
15807
15844
  const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
15808
15845
  const additionalFlags = {
15809
15846
  ...additionalFlagsFromInit,
@@ -15817,12 +15854,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15817
15854
  this.handleError('You cannot have both hidden Tabs and visible Tabs');
15818
15855
  return queryParams;
15819
15856
  }
15857
+ if (primaryAction) {
15858
+ queryParams[Param.PrimaryAction] = primaryAction;
15859
+ }
15820
15860
  if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
15821
15861
  queryParams[Param.DisableActions] = disabledActions;
15822
15862
  }
15823
15863
  if (disabledActionReason) {
15824
15864
  queryParams[Param.DisableActionReason] = disabledActionReason;
15825
15865
  }
15866
+ if (exposeTranslationIDs) {
15867
+ queryParams[Param.ExposeTranslationIDs] = exposeTranslationIDs;
15868
+ }
15826
15869
  queryParams[Param.HideActions] = [...this.defaultHiddenActions, ...(hiddenActions !== null && hiddenActions !== void 0 ? hiddenActions : [])];
15827
15870
  if (Array.isArray(visibleActions)) {
15828
15871
  queryParams[Param.VisibleActions] = visibleActions;
@@ -15852,6 +15895,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15852
15895
  if (spriteUrl) {
15853
15896
  queryParams[Param.IconSpriteUrl] = spriteUrl.replace('https://', '');
15854
15897
  }
15898
+ const stringIDsUrl = ((_c = customizations === null || customizations === void 0 ? void 0 : customizations.content) === null || _c === void 0 ? void 0 : _c.stringIDsUrl)
15899
+ || ((_d = embedCustomizations === null || embedCustomizations === void 0 ? void 0 : embedCustomizations.content) === null || _d === void 0 ? void 0 : _d.stringIDsUrl);
15900
+ if (stringIDsUrl) {
15901
+ queryParams[Param.StringIDsUrl] = stringIDsUrl;
15902
+ }
15855
15903
  if (showAlerts !== undefined) {
15856
15904
  queryParams[Param.ShowAlerts] = showAlerts;
15857
15905
  }
@@ -17914,7 +17962,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
17914
17962
  acGenNo: data.stateKey.generationNumber,
17915
17963
  });
17916
17964
  await embed.render();
17917
- return { container };
17965
+ return { container, viz: embed };
17918
17966
  }
17919
17967
  }
17920
17968
 
@@ -19934,23 +19982,32 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
19934
19982
  start = start.replace(/\n+/g, `$&${indent}`);
19935
19983
  }
19936
19984
  const indentSize = indent ? '2' : '1'; // root is at -1
19937
- let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
19985
+ // Leading | or > is added later
19986
+ let header = (startWithSpace ? indentSize : '') + chomp;
19938
19987
  if (comment) {
19939
19988
  header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
19940
19989
  if (onComment)
19941
19990
  onComment();
19942
19991
  }
19943
- if (literal) {
19944
- value = value.replace(/\n+/g, `$&${indent}`);
19945
- return `${header}\n${indent}${start}${value}${end}`;
19992
+ if (!literal) {
19993
+ const foldedValue = value
19994
+ .replace(/\n+/g, '\n$&')
19995
+ .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
19996
+ // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
19997
+ .replace(/\n+/g, `$&${indent}`);
19998
+ let literalFallback = false;
19999
+ const foldOptions = getFoldOptions(ctx, true);
20000
+ if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
20001
+ foldOptions.onOverflow = () => {
20002
+ literalFallback = true;
20003
+ };
20004
+ }
20005
+ const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
20006
+ if (!literalFallback)
20007
+ return `>${header}\n${indent}${body}`;
19946
20008
  }
19947
- value = value
19948
- .replace(/\n+/g, '\n$&')
19949
- .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
19950
- // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
19951
- .replace(/\n+/g, `$&${indent}`);
19952
- const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
19953
- return `${header}\n${indent}${body}`;
20009
+ value = value.replace(/\n+/g, `$&${indent}`);
20010
+ return `|${header}\n${indent}${start}${value}${end}`;
19954
20011
  }
19955
20012
  function plainString(item, ctx, onComment, onChompKeep) {
19956
20013
  const { type, value } = item;
@@ -20091,7 +20148,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20091
20148
  let obj;
20092
20149
  if (isScalar$1(item)) {
20093
20150
  obj = item.value;
20094
- const match = tags.filter(t => t.identify?.(obj));
20151
+ let match = tags.filter(t => t.identify?.(obj));
20152
+ if (match.length > 1) {
20153
+ const testMatch = match.filter(t => t.test);
20154
+ if (testMatch.length > 0)
20155
+ match = testMatch;
20156
+ }
20095
20157
  tagObj =
20096
20158
  match.find(t => t.format === item.format) ?? match.find(t => !t.format);
20097
20159
  }
@@ -20304,54 +20366,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20304
20366
 
20305
20367
  function warn(logLevel, warning) {
20306
20368
  if (logLevel === 'debug' || logLevel === 'warn') {
20307
- if (typeof process !== 'undefined' && process.emitWarning)
20308
- process.emitWarning(warning);
20309
- else
20310
- console.warn(warning);
20369
+ console.warn(warning);
20311
20370
  }
20312
20371
  }
20313
20372
 
20314
- const MERGE_KEY = '<<';
20315
- function addPairToJSMap(ctx, map, { key, value }) {
20316
- if (ctx?.doc.schema.merge && isMergeKey(key)) {
20317
- value = isAlias(value) ? value.resolve(ctx.doc) : value;
20318
- if (isSeq(value))
20319
- for (const it of value.items)
20320
- mergeToJSMap(ctx, map, it);
20321
- else if (Array.isArray(value))
20322
- for (const it of value)
20323
- mergeToJSMap(ctx, map, it);
20324
- else
20325
- mergeToJSMap(ctx, map, value);
20326
- }
20327
- else {
20328
- const jsKey = toJS(key, '', ctx);
20329
- if (map instanceof Map) {
20330
- map.set(jsKey, toJS(value, jsKey, ctx));
20331
- }
20332
- else if (map instanceof Set) {
20333
- map.add(jsKey);
20334
- }
20335
- else {
20336
- const stringKey = stringifyKey(key, jsKey, ctx);
20337
- const jsValue = toJS(value, stringKey, ctx);
20338
- if (stringKey in map)
20339
- Object.defineProperty(map, stringKey, {
20340
- value: jsValue,
20341
- writable: true,
20342
- enumerable: true,
20343
- configurable: true
20344
- });
20345
- else
20346
- map[stringKey] = jsValue;
20347
- }
20348
- }
20349
- return map;
20350
- }
20351
- const isMergeKey = (key) => key === MERGE_KEY ||
20352
- (isScalar$1(key) &&
20353
- key.value === MERGE_KEY &&
20354
- (!key.type || key.type === Scalar.PLAIN));
20355
20373
  // If the value associated with a merge key is a single mapping node, each of
20356
20374
  // its key/value pairs is inserted into the current mapping, unless the key
20357
20375
  // already exists in it. If the value associated with the merge key is a
@@ -20359,7 +20377,35 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20359
20377
  // of these nodes is merged in turn according to its order in the sequence.
20360
20378
  // Keys in mapping nodes earlier in the sequence override keys specified in
20361
20379
  // later mapping nodes. -- http://yaml.org/type/merge.html
20362
- function mergeToJSMap(ctx, map, value) {
20380
+ const MERGE_KEY = '<<';
20381
+ const merge = {
20382
+ identify: value => value === MERGE_KEY ||
20383
+ (typeof value === 'symbol' && value.description === MERGE_KEY),
20384
+ default: 'key',
20385
+ tag: 'tag:yaml.org,2002:merge',
20386
+ test: /^<<$/,
20387
+ resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
20388
+ addToJSMap: addMergeToJSMap
20389
+ }),
20390
+ stringify: () => MERGE_KEY
20391
+ };
20392
+ const isMergeKey = (ctx, key) => (merge.identify(key) ||
20393
+ (isScalar$1(key) &&
20394
+ (!key.type || key.type === Scalar.PLAIN) &&
20395
+ merge.identify(key.value))) &&
20396
+ ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
20397
+ function addMergeToJSMap(ctx, map, value) {
20398
+ value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
20399
+ if (isSeq(value))
20400
+ for (const it of value.items)
20401
+ mergeValue(ctx, map, it);
20402
+ else if (Array.isArray(value))
20403
+ for (const it of value)
20404
+ mergeValue(ctx, map, it);
20405
+ else
20406
+ mergeValue(ctx, map, value);
20407
+ }
20408
+ function mergeValue(ctx, map, value) {
20363
20409
  const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
20364
20410
  if (!isMap(source))
20365
20411
  throw new Error('Merge sources must be maps or map aliases');
@@ -20383,6 +20429,37 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20383
20429
  }
20384
20430
  return map;
20385
20431
  }
20432
+
20433
+ function addPairToJSMap(ctx, map, { key, value }) {
20434
+ if (isNode(key) && key.addToJSMap)
20435
+ key.addToJSMap(ctx, map, value);
20436
+ // TODO: Should drop this special case for bare << handling
20437
+ else if (isMergeKey(ctx, key))
20438
+ addMergeToJSMap(ctx, map, value);
20439
+ else {
20440
+ const jsKey = toJS(key, '', ctx);
20441
+ if (map instanceof Map) {
20442
+ map.set(jsKey, toJS(value, jsKey, ctx));
20443
+ }
20444
+ else if (map instanceof Set) {
20445
+ map.add(jsKey);
20446
+ }
20447
+ else {
20448
+ const stringKey = stringifyKey(key, jsKey, ctx);
20449
+ const jsValue = toJS(value, stringKey, ctx);
20450
+ if (stringKey in map)
20451
+ Object.defineProperty(map, stringKey, {
20452
+ value: jsValue,
20453
+ writable: true,
20454
+ enumerable: true,
20455
+ configurable: true
20456
+ });
20457
+ else
20458
+ map[stringKey] = jsValue;
20459
+ }
20460
+ }
20461
+ return map;
20462
+ }
20386
20463
  function stringifyKey(key, jsKey, ctx) {
20387
20464
  if (jsKey === null)
20388
20465
  return '';
@@ -21018,7 +21095,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21018
21095
  identify: value => typeof value === 'boolean',
21019
21096
  default: true,
21020
21097
  tag: 'tag:yaml.org,2002:bool',
21021
- test: /^true|false$/,
21098
+ test: /^true$|^false$/,
21022
21099
  resolve: str => str === 'true',
21023
21100
  stringify: stringifyJSON
21024
21101
  },
@@ -21063,10 +21140,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21063
21140
  * document.querySelector('#photo').src = URL.createObjectURL(blob)
21064
21141
  */
21065
21142
  resolve(src, onError) {
21066
- if (typeof Buffer === 'function') {
21067
- return Buffer.from(src, 'base64');
21068
- }
21069
- else if (typeof atob === 'function') {
21143
+ if (typeof atob === 'function') {
21070
21144
  // On IE 11, atob() can't handle newlines
21071
21145
  const str = atob(src.replace(/[\n\r]/g, ''));
21072
21146
  const buffer = new Uint8Array(str.length);
@@ -21080,15 +21154,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21080
21154
  }
21081
21155
  },
21082
21156
  stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
21157
+ if (!value)
21158
+ return '';
21083
21159
  const buf = value; // checked earlier by binary.identify()
21084
21160
  let str;
21085
- if (typeof Buffer === 'function') {
21086
- str =
21087
- buf instanceof Buffer
21088
- ? buf.toString('base64')
21089
- : Buffer.from(buf.buffer).toString('base64');
21090
- }
21091
- else if (typeof btoa === 'function') {
21161
+ if (typeof btoa === 'function') {
21092
21162
  let s = '';
21093
21163
  for (let i = 0; i < buf.length; ++i)
21094
21164
  s += String.fromCharCode(buf[i]);
@@ -21567,7 +21637,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21567
21637
  }
21568
21638
  return new Date(date);
21569
21639
  },
21570
- stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
21640
+ stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? ''
21571
21641
  };
21572
21642
 
21573
21643
  const schema = [
@@ -21585,6 +21655,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21585
21655
  floatExp,
21586
21656
  float,
21587
21657
  binary,
21658
+ merge,
21588
21659
  omap,
21589
21660
  pairs,
21590
21661
  set,
@@ -21612,6 +21683,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21612
21683
  intOct: intOct$1,
21613
21684
  intTime,
21614
21685
  map,
21686
+ merge,
21615
21687
  null: nullTag,
21616
21688
  omap,
21617
21689
  pairs,
@@ -21621,13 +21693,20 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21621
21693
  };
21622
21694
  const coreKnownTags = {
21623
21695
  'tag:yaml.org,2002:binary': binary,
21696
+ 'tag:yaml.org,2002:merge': merge,
21624
21697
  'tag:yaml.org,2002:omap': omap,
21625
21698
  'tag:yaml.org,2002:pairs': pairs,
21626
21699
  'tag:yaml.org,2002:set': set,
21627
21700
  'tag:yaml.org,2002:timestamp': timestamp
21628
21701
  };
21629
- function getTags(customTags, schemaName) {
21630
- let tags = schemas.get(schemaName);
21702
+ function getTags(customTags, schemaName, addMergeTag) {
21703
+ const schemaTags = schemas.get(schemaName);
21704
+ if (schemaTags && !customTags) {
21705
+ return addMergeTag && !schemaTags.includes(merge)
21706
+ ? schemaTags.concat(merge)
21707
+ : schemaTags.slice();
21708
+ }
21709
+ let tags = schemaTags;
21631
21710
  if (!tags) {
21632
21711
  if (Array.isArray(customTags))
21633
21712
  tags = [];
@@ -21646,17 +21725,21 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21646
21725
  else if (typeof customTags === 'function') {
21647
21726
  tags = customTags(tags.slice());
21648
21727
  }
21649
- return tags.map(tag => {
21650
- if (typeof tag !== 'string')
21651
- return tag;
21652
- const tagObj = tagsByName[tag];
21653
- if (tagObj)
21654
- return tagObj;
21655
- const keys = Object.keys(tagsByName)
21656
- .map(key => JSON.stringify(key))
21657
- .join(', ');
21658
- throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
21659
- });
21728
+ if (addMergeTag)
21729
+ tags = tags.concat(merge);
21730
+ return tags.reduce((tags, tag) => {
21731
+ const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
21732
+ if (!tagObj) {
21733
+ const tagName = JSON.stringify(tag);
21734
+ const keys = Object.keys(tagsByName)
21735
+ .map(key => JSON.stringify(key))
21736
+ .join(', ');
21737
+ throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
21738
+ }
21739
+ if (!tags.includes(tagObj))
21740
+ tags.push(tagObj);
21741
+ return tags;
21742
+ }, []);
21660
21743
  }
21661
21744
 
21662
21745
  const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
@@ -21667,10 +21750,9 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21667
21750
  : compat
21668
21751
  ? getTags(null, compat)
21669
21752
  : null;
21670
- this.merge = !!merge;
21671
21753
  this.name = (typeof schema === 'string' && schema) || 'core';
21672
21754
  this.knownTags = resolveKnownTags ? coreKnownTags : {};
21673
- this.tags = getTags(customTags, this.name);
21755
+ this.tags = getTags(customTags, this.name, merge);
21674
21756
  this.toStringOptions = toStringDefaults ?? null;
21675
21757
  Object.defineProperty(this, MAP, { value: map });
21676
21758
  Object.defineProperty(this, SCALAR$1, { value: string });
@@ -21795,6 +21877,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21795
21877
  logLevel: 'warn',
21796
21878
  prettyErrors: true,
21797
21879
  strict: true,
21880
+ stringKeys: false,
21798
21881
  uniqueKeys: true,
21799
21882
  version: '1.2'
21800
21883
  }, options);
@@ -22018,7 +22101,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22018
22101
  this.directives.yaml.version = '1.1';
22019
22102
  else
22020
22103
  this.directives = new Directives({ version: '1.1' });
22021
- opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
22104
+ opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
22022
22105
  break;
22023
22106
  case '1.2':
22024
22107
  case 'next':
@@ -22026,7 +22109,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22026
22109
  this.directives.yaml.version = version;
22027
22110
  else
22028
22111
  this.directives = new Directives({ version });
22029
- opt = { merge: false, resolveKnownTags: true, schema: 'core' };
22112
+ opt = { resolveKnownTags: true, schema: 'core' };
22030
22113
  break;
22031
22114
  case null:
22032
22115
  if (this.directives)
@@ -22204,7 +22287,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22204
22287
  if (atNewline) {
22205
22288
  if (comment)
22206
22289
  comment += token.source;
22207
- else
22290
+ else if (!found || indicator !== 'seq-item-ind')
22208
22291
  spaceBefore = true;
22209
22292
  }
22210
22293
  else
@@ -22345,11 +22428,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22345
22428
  return false;
22346
22429
  const isEqual = typeof uniqueKeys === 'function'
22347
22430
  ? uniqueKeys
22348
- : (a, b) => a === b ||
22349
- (isScalar$1(a) &&
22350
- isScalar$1(b) &&
22351
- a.value === b.value &&
22352
- !(a.value === '<<' && ctx.schema.merge));
22431
+ : (a, b) => a === b || (isScalar$1(a) && isScalar$1(b) && a.value === b.value);
22353
22432
  return items.some(pair => isEqual(pair.key, search));
22354
22433
  }
22355
22434
 
@@ -22398,12 +22477,14 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22398
22477
  onError(offset, 'BAD_INDENT', startColMsg);
22399
22478
  }
22400
22479
  // key value
22480
+ ctx.atKey = true;
22401
22481
  const keyStart = keyProps.end;
22402
22482
  const keyNode = key
22403
22483
  ? composeNode(ctx, key, keyProps, onError)
22404
22484
  : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
22405
22485
  if (ctx.schema.compat)
22406
22486
  flowIndentCheck(bm.indent, key, onError);
22487
+ ctx.atKey = false;
22407
22488
  if (mapIncludes(ctx, map.items, keyNode))
22408
22489
  onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
22409
22490
  // value properties
@@ -22463,6 +22544,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22463
22544
  const seq = new NodeClass(ctx.schema);
22464
22545
  if (ctx.atRoot)
22465
22546
  ctx.atRoot = false;
22547
+ if (ctx.atKey)
22548
+ ctx.atKey = false;
22466
22549
  let offset = bs.offset;
22467
22550
  let commentEnd = null;
22468
22551
  for (const { start, value } of bs.items) {
@@ -22547,6 +22630,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22547
22630
  const atRoot = ctx.atRoot;
22548
22631
  if (atRoot)
22549
22632
  ctx.atRoot = false;
22633
+ if (ctx.atKey)
22634
+ ctx.atKey = false;
22550
22635
  let offset = fc.offset + fc.start.source.length;
22551
22636
  for (let i = 0; i < fc.items.length; ++i) {
22552
22637
  const collItem = fc.items[i];
@@ -22626,12 +22711,14 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22626
22711
  else {
22627
22712
  // item is a key+value pair
22628
22713
  // key value
22714
+ ctx.atKey = true;
22629
22715
  const keyStart = props.end;
22630
22716
  const keyNode = key
22631
22717
  ? composeNode(ctx, key, props, onError)
22632
22718
  : composeEmptyNode(ctx, keyStart, start, null, props, onError);
22633
22719
  if (isBlock(key))
22634
22720
  onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
22721
+ ctx.atKey = false;
22635
22722
  // value properties
22636
22723
  const valueProps = resolveProps(sep ?? [], {
22637
22724
  flow: fcName,
@@ -22787,8 +22874,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22787
22874
  tag = kt;
22788
22875
  }
22789
22876
  else {
22790
- if (kt?.collection) {
22791
- onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
22877
+ if (kt) {
22878
+ onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
22792
22879
  }
22793
22880
  else {
22794
22881
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
@@ -23229,11 +23316,16 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23229
23316
  const tagName = tagToken
23230
23317
  ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
23231
23318
  : null;
23232
- const tag = tagToken && tagName
23233
- ? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
23234
- : token.type === 'scalar'
23235
- ? findScalarTagByTest(ctx, value, token, onError)
23236
- : ctx.schema[SCALAR$1];
23319
+ let tag;
23320
+ if (ctx.options.stringKeys && ctx.atKey) {
23321
+ tag = ctx.schema[SCALAR$1];
23322
+ }
23323
+ else if (tagName)
23324
+ tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
23325
+ else if (token.type === 'scalar')
23326
+ tag = findScalarTagByTest(ctx, value, token, onError);
23327
+ else
23328
+ tag = ctx.schema[SCALAR$1];
23237
23329
  let scalar;
23238
23330
  try {
23239
23331
  const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
@@ -23281,8 +23373,9 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23281
23373
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
23282
23374
  return schema[SCALAR$1];
23283
23375
  }
23284
- function findScalarTagByTest({ directives, schema }, value, token, onError) {
23285
- const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
23376
+ function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
23377
+ const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
23378
+ tag.test?.test(value)) || schema[SCALAR$1];
23286
23379
  if (schema.compat) {
23287
23380
  const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
23288
23381
  schema[SCALAR$1];
@@ -23324,6 +23417,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23324
23417
 
23325
23418
  const CN = { composeNode, composeEmptyNode };
23326
23419
  function composeNode(ctx, token, props, onError) {
23420
+ const atKey = ctx.atKey;
23327
23421
  const { spaceBefore, comment, anchor, tag } = props;
23328
23422
  let node;
23329
23423
  let isSrcToken = true;
@@ -23359,6 +23453,14 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23359
23453
  }
23360
23454
  if (anchor && node.anchor === '')
23361
23455
  onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
23456
+ if (atKey &&
23457
+ ctx.options.stringKeys &&
23458
+ (!isScalar$1(node) ||
23459
+ typeof node.value !== 'string' ||
23460
+ (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
23461
+ const msg = 'With stringKeys, all keys must be strings';
23462
+ onError(tag ?? token, 'NON_STRING_KEY', msg);
23463
+ }
23362
23464
  if (spaceBefore)
23363
23465
  node.spaceBefore = true;
23364
23466
  if (comment) {
@@ -23411,6 +23513,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23411
23513
  const opts = Object.assign({ _directives: directives }, options);
23412
23514
  const doc = new Document(undefined, opts);
23413
23515
  const ctx = {
23516
+ atKey: false,
23414
23517
  atRoot: true,
23415
23518
  directives: doc.directives,
23416
23519
  options: doc.options,
@@ -25545,7 +25648,20 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25545
25648
  default: {
25546
25649
  const bv = this.startBlockValue(map);
25547
25650
  if (bv) {
25548
- if (atMapIndent && bv.type !== 'block-seq') {
25651
+ if (bv.type === 'block-seq') {
25652
+ if (!it.explicitKey &&
25653
+ it.sep &&
25654
+ !includesToken(it.sep, 'newline')) {
25655
+ yield* this.pop({
25656
+ type: 'error',
25657
+ offset: this.offset,
25658
+ message: 'Unexpected block-seq-ind on same line with key',
25659
+ source: this.source
25660
+ });
25661
+ return;
25662
+ }
25663
+ }
25664
+ else if (atMapIndent) {
25549
25665
  map.items.push({ start });
25550
25666
  }
25551
25667
  this.stack.push(bv);
@@ -25916,6 +26032,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25916
26032
  if (!keepUndefined)
25917
26033
  return undefined;
25918
26034
  }
26035
+ if (isDocument(value) && !_replacer)
26036
+ return value.toString(options);
25919
26037
  return new Document(value, _replacer, options).toString(options);
25920
26038
  }
25921
26039