@looker/code-editor 0.1.30 → 0.1.31

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 (66) hide show
  1. package/CHANGELOG.md +112 -148
  2. package/README.md +13 -13
  3. package/lib/CodeCopy/CodeCopy.d.ts +2 -2
  4. package/lib/CodeCopy/CodeCopy.js.map +1 -1
  5. package/lib/CodeCopy/index.js.map +1 -1
  6. package/lib/CodeDisplay/CodeDisplay.js +5 -5
  7. package/lib/CodeDisplay/CodeDisplay.js.map +1 -1
  8. package/lib/CodeDisplay/CodeWrapper.js.map +1 -1
  9. package/lib/CodeDisplay/LineItem.js.map +1 -1
  10. package/lib/CodeDisplay/index.js.map +1 -1
  11. package/lib/CodeDisplay/types.d.ts +1 -1
  12. package/lib/CodeDisplay/types.js.map +1 -1
  13. package/lib/CodeEditor/CodeEditor.js.map +1 -1
  14. package/lib/CodeEditor/index.js.map +1 -1
  15. package/lib/Markdown/Markdown.d.ts +2 -1
  16. package/lib/Markdown/Markdown.js +1 -1
  17. package/lib/Markdown/Markdown.js.map +1 -1
  18. package/lib/Markdown/TableCell.js.map +1 -1
  19. package/lib/Markdown/common.js +10 -14
  20. package/lib/Markdown/common.js.map +1 -1
  21. package/lib/Markdown/index.js.map +1 -1
  22. package/lib/Markdown/utils.js.map +1 -1
  23. package/lib/esm/CodeCopy/CodeCopy.js +7 -15
  24. package/lib/esm/CodeCopy/CodeCopy.js.map +1 -1
  25. package/lib/esm/CodeCopy/index.js +1 -16
  26. package/lib/esm/CodeCopy/index.js.map +1 -1
  27. package/lib/esm/CodeDisplay/CodeDisplay.js +22 -32
  28. package/lib/esm/CodeDisplay/CodeDisplay.js.map +1 -1
  29. package/lib/esm/CodeDisplay/CodeWrapper.js +6 -14
  30. package/lib/esm/CodeDisplay/CodeWrapper.js.map +1 -1
  31. package/lib/esm/CodeDisplay/LineItem.js +3 -11
  32. package/lib/esm/CodeDisplay/LineItem.js.map +1 -1
  33. package/lib/esm/CodeDisplay/index.js +1 -12
  34. package/lib/esm/CodeDisplay/index.js.map +1 -1
  35. package/lib/esm/CodeDisplay/types.js.map +1 -1
  36. package/lib/esm/CodeEditor/CodeEditor.js +6 -14
  37. package/lib/esm/CodeEditor/CodeEditor.js.map +1 -1
  38. package/lib/esm/CodeEditor/index.js +1 -12
  39. package/lib/esm/CodeEditor/index.js.map +1 -1
  40. package/lib/esm/Markdown/Markdown.js +32 -40
  41. package/lib/esm/Markdown/Markdown.js.map +1 -1
  42. package/lib/esm/Markdown/TableCell.js +4 -12
  43. package/lib/esm/Markdown/TableCell.js.map +1 -1
  44. package/lib/esm/Markdown/common.js +17 -29
  45. package/lib/esm/Markdown/common.js.map +1 -1
  46. package/lib/esm/Markdown/index.js +1 -16
  47. package/lib/esm/Markdown/index.js.map +1 -1
  48. package/lib/esm/Markdown/utils.js +10 -24
  49. package/lib/esm/Markdown/utils.js.map +1 -1
  50. package/lib/esm/index.js +4 -49
  51. package/lib/esm/index.js.map +1 -1
  52. package/lib/esm/test-data/codeBlob.js +1 -8
  53. package/lib/esm/test-data/codeBlob.js.map +1 -1
  54. package/lib/esm/test-data/index.js +1 -12
  55. package/lib/esm/test-data/index.js.map +1 -1
  56. package/lib/esm/utils/index.js +1 -24
  57. package/lib/esm/utils/index.js.map +1 -1
  58. package/lib/esm/utils/utils.js +19 -29
  59. package/lib/esm/utils/utils.js.map +1 -1
  60. package/lib/index.js.map +1 -1
  61. package/lib/test-data/codeBlob.js +1 -2
  62. package/lib/test-data/codeBlob.js.map +1 -1
  63. package/lib/test-data/index.js.map +1 -1
  64. package/lib/utils/index.js.map +1 -1
  65. package/lib/utils/utils.js.map +1 -1
  66. package/package.json +17 -17
@@ -1,17 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.MDTable = exports.MDParagraph = exports.MDListItem = exports.MDList = exports.MDHeading = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _styledComponents = _interopRequireDefault(require("styled-components"));
9
- var _components = require("@looker/components");
10
1
  var _excluded = ["ordered"];
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
2
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
3
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
- var MDHeading = (0, _styledComponents.default)(_components.Heading).attrs(_ref => {
4
+ import React from 'react';
5
+ import styled from 'styled-components';
6
+ import { Heading, Paragraph, Table } from '@looker/components';
7
+ export var MDHeading = styled(Heading).attrs(_ref => {
15
8
  var {
16
9
  mb = 'xsmall',
17
10
  pt = 'xsmall'
@@ -22,10 +15,9 @@ var MDHeading = (0, _styledComponents.default)(_components.Heading).attrs(_ref =
22
15
  };
23
16
  }).withConfig({
24
17
  displayName: "common__MDHeading",
25
- componentId: "sc-i00oep-0"
18
+ componentId: "i00oep-0"
26
19
  })([""]);
27
- exports.MDHeading = MDHeading;
28
- var MDParagraph = (0, _styledComponents.default)(_components.Paragraph).attrs(_ref2 => {
20
+ export var MDParagraph = styled(Paragraph).attrs(_ref2 => {
29
21
  var {
30
22
  mb = 'large'
31
23
  } = _ref2;
@@ -34,51 +26,48 @@ var MDParagraph = (0, _styledComponents.default)(_components.Paragraph).attrs(_r
34
26
  };
35
27
  }).withConfig({
36
28
  displayName: "common__MDParagraph",
37
- componentId: "sc-i00oep-1"
29
+ componentId: "i00oep-1"
38
30
  })(["color:", ";max-width:600px;"], _ref3 => {
39
31
  var {
40
32
  theme
41
33
  } = _ref3;
42
34
  return theme.colors.text5;
43
35
  });
44
- exports.MDParagraph = MDParagraph;
45
- var OListInternal = _styledComponents.default.ol.withConfig({
36
+ var OListInternal = styled.ol.withConfig({
46
37
  displayName: "common__OListInternal",
47
- componentId: "sc-i00oep-2"
38
+ componentId: "i00oep-2"
48
39
  })(["color:", ";max-width:600px;margin-bottom:20px;"], _ref4 => {
49
40
  var {
50
41
  theme
51
42
  } = _ref4;
52
43
  return theme.colors.text5;
53
44
  });
54
- var UListInternal = _styledComponents.default.ul.withConfig({
45
+ var UListInternal = styled.ul.withConfig({
55
46
  displayName: "common__UListInternal",
56
- componentId: "sc-i00oep-3"
47
+ componentId: "i00oep-3"
57
48
  })(["color:", ";max-width:600px;margin-bottom:20px;"], _ref5 => {
58
49
  var {
59
50
  theme
60
51
  } = _ref5;
61
52
  return theme.colors.text5;
62
53
  });
63
- var MDList = _ref6 => {
54
+ export var MDList = _ref6 => {
64
55
  var {
65
56
  ordered
66
57
  } = _ref6,
67
58
  rest = _objectWithoutProperties(_ref6, _excluded);
68
- return ordered ? _react.default.createElement(OListInternal, rest) : _react.default.createElement(UListInternal, rest);
59
+ return ordered ? React.createElement(OListInternal, rest) : React.createElement(UListInternal, rest);
69
60
  };
70
- exports.MDList = MDList;
71
- var MDListItem = _styledComponents.default.li.withConfig({
61
+ export var MDListItem = styled.li.withConfig({
72
62
  displayName: "common__MDListItem",
73
- componentId: "sc-i00oep-4"
63
+ componentId: "i00oep-4"
74
64
  })(["color:", ";max-width:600px;margin-bottom:4px;line-height:1.5;"], _ref7 => {
75
65
  var {
76
66
  theme
77
67
  } = _ref7;
78
68
  return theme.colors.text5;
79
69
  });
80
- exports.MDListItem = MDListItem;
81
- var MDTable = (0, _styledComponents.default)(_components.Table).attrs(_ref8 => {
70
+ export var MDTable = styled(Table).attrs(_ref8 => {
82
71
  var {
83
72
  mb = 'large'
84
73
  } = _ref8;
@@ -87,7 +76,6 @@ var MDTable = (0, _styledComponents.default)(_components.Table).attrs(_ref8 => {
87
76
  };
88
77
  }).withConfig({
89
78
  displayName: "common__MDTable",
90
- componentId: "sc-i00oep-5"
79
+ componentId: "i00oep-5"
91
80
  })([""]);
92
- exports.MDTable = MDTable;
93
81
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","names":["_react","_interopRequireDefault","require","_styledComponents","_components","_excluded","obj","__esModule","default","_objectWithoutProperties","source","excluded","target","_objectWithoutPropertiesLoose","key","i","Object","getOwnPropertySymbols","sourceSymbolKeys","length","indexOf","prototype","propertyIsEnumerable","call","sourceKeys","keys","MDHeading","styled","Heading","attrs","_ref","mb","pt","withConfig","displayName","componentId","exports","MDParagraph","Paragraph","_ref2","_ref3","theme","colors","text5","OListInternal","ol","_ref4","UListInternal","ul","_ref5","MDList","_ref6","ordered","rest","createElement","MDListItem","li","_ref7","MDTable","Table","_ref8"],"sources":["../../../src/Markdown/common.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport React from 'react'\nimport styled from 'styled-components'\nimport { Paragraph, Table, Heading } from '@looker/components'\nimport type {\n HeadingProps,\n ParagraphProps,\n TableProps,\n} from '@looker/components'\n\n/**\n * Common styled components used by DocMarkdown\n */\n\nexport const MDHeading = styled(Heading).attrs(\n ({ mb = 'xsmall', pt = 'xsmall' }: HeadingProps) => ({ mb, pt })\n)<HeadingProps>``\n\nexport const MDParagraph = styled(Paragraph).attrs(\n ({ mb = 'large' }: ParagraphProps) => ({\n mb,\n })\n)<ParagraphProps>`\n color: ${({ theme }) => theme.colors.text5};\n max-width: 600px;\n`\n\nconst OListInternal = styled.ol`\n color: ${({ theme }) => theme.colors.text5};\n max-width: 600px;\n margin-bottom: 20px;\n`\n\nconst UListInternal = styled.ul`\n color: ${({ theme }) => theme.colors.text5};\n max-width: 600px;\n margin-bottom: 20px;\n`\n\nexport const MDList: React.FC<any> = ({ ordered, ...rest }) => {\n return ordered ? <OListInternal {...rest} /> : <UListInternal {...rest} />\n}\n\nexport const MDListItem = styled.li`\n color: ${({ theme }) => theme.colors.text5};\n max-width: 600px;\n margin-bottom: 4px;\n line-height: 1.5;\n`\n\nexport const MDTable = styled(Table).attrs(({ mb = 'large' }: TableProps) => ({\n mb,\n}))``\n"],"mappings":";;;;;;AAyBA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAA8D,IAAAG,SAAA;AAAA,SAAAJ,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,MAAA,EAAAC,QAAA,QAAAD,MAAA,yBAAAE,MAAA,GAAAC,6BAAA,CAAAH,MAAA,EAAAC,QAAA,O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CAACC,KAAK;AAAA,EAI3C;AAAAP,OAAA,CAAAmB,UAAA,GAAAA,UAAA;AAEM,IAAMG,OAAO,GAAG,IAAA/B,yBAAM,EAACgC,iBAAK,CAAC,CAAC9B,KAAK,CAAC+B,KAAA;EAAA,IAAC;IAAE7B,EAAE,GAAG;EAAoB,CAAC,GAAA6B,KAAA;EAAA,OAAM;IAC5E7B;EACF,CAAC;AAAA,CAAC,CAAC,CAAAE,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,QAAE;AAAAC,OAAA,CAAAsB,OAAA,GAAAA,OAAA"}
1
+ {"version":3,"file":"common.js","names":["React","styled","Heading","Paragraph","Table","MDHeading","attrs","_ref","mb","pt","withConfig","displayName","componentId","MDParagraph","_ref2","_ref3","theme","colors","text5","OListInternal","ol","_ref4","UListInternal","ul","_ref5","MDList","_ref6","ordered","rest","_objectWithoutProperties","_excluded","createElement","MDListItem","li","_ref7","MDTable","_ref8"],"sources":["../../../src/Markdown/common.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport React from 'react';\nimport styled from 'styled-components';\nimport { Heading, Paragraph, Table } from '@looker/components';\nimport type {\n HeadingProps,\n ParagraphProps,\n TableProps,\n} from '@looker/components';\n\n/**\n * Common styled components used by DocMarkdown\n */\n\nexport const MDHeading = styled(Heading).attrs(\n ({ mb = 'xsmall', pt = 'xsmall' }: HeadingProps) => ({ mb, pt })\n)<HeadingProps>``;\n\nexport const MDParagraph = styled(Paragraph).attrs(\n ({ mb = 'large' }: ParagraphProps) => ({\n mb,\n })\n)<ParagraphProps>`\n color: ${({ theme }) => theme.colors.text5};\n max-width: 600px;\n`;\n\nconst OListInternal = styled.ol`\n color: ${({ theme }) => theme.colors.text5};\n max-width: 600px;\n margin-bottom: 20px;\n`;\n\nconst UListInternal = styled.ul`\n color: ${({ theme }) => theme.colors.text5};\n max-width: 600px;\n margin-bottom: 20px;\n`;\n\nexport const MDList: React.FC<any> = ({ ordered, ...rest }) => {\n return ordered ? <OListInternal {...rest} /> : <UListInternal {...rest} />;\n};\n\nexport const MDListItem = styled.li`\n color: ${({ theme }) => theme.colors.text5};\n max-width: 600px;\n margin-bottom: 4px;\n line-height: 1.5;\n`;\n\nexport const MDTable = styled(Table).attrs(({ mb = 'large' }: TableProps) => ({\n mb,\n}))``;\n"],"mappings":";;;AAyBA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAASC,OAAO,EAAEC,SAAS,EAAEC,KAAK,QAAQ,oBAAoB;AAW9D,OAAO,IAAMC,SAAS,GAAGJ,MAAM,CAACC,OAAO,CAAC,CAACI,KAAK,CAC5CC,IAAA;EAAA,IAAC;IAAEC,EAAE,GAAG,QAAQ;IAAEC,EAAE,GAAG;EAAuB,CAAC,GAAAF,IAAA;EAAA,OAAM;IAAEC,EAAE;IAAEC;EAAG,CAAC;AAAA,CACjE,CAAC,CAAAC,UAAA;EAAAC,WAAA;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AC,GAAAkB,KAAA;EAAA,OAAKlB,KAAK,CAACC,MAAM,CAACC,KAAK;AAAA,EAI3C;AAED,OAAO,IAAMiB,OAAO,GAAGlC,MAAM,CAACG,KAAK,CAAC,CAACE,KAAK,CAAC8B,KAAA;EAAA,IAAC;IAAE5B,EAAE,GAAG;EAAoB,CAAC,GAAA4B,KAAA;EAAA,OAAM;IAC5E5B;EACF,CAAC;AAAA,CAAC,CAAC,CAAAE,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,QAAE"}
@@ -1,17 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _Markdown = require("./Markdown");
7
- Object.keys(_Markdown).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _Markdown[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function get() {
13
- return _Markdown[key];
14
- }
15
- });
16
- });
1
+ export * from './Markdown';
17
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_Markdown","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../src/Markdown/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './Markdown'\n"],"mappings":";;;;;AAyBA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/Markdown/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './Markdown';\n"],"mappings":"AAyBA,cAAc,YAAY"}
@@ -1,16 +1,9 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.removeMarkTags = exports.removeCodeLanguageTags = exports.regReplaceAll = exports.qualifyMarkdownText = exports.prepareCodeText = exports.getCodeLanguageFromTaggedText = exports.addMarkTags = exports.addCodeLanguageTags = void 0;
7
- var _utils = require("../utils");
8
- var regReplaceAll = (content, pattern, replacementFunc) => {
1
+ import { instanceOfPrismLanguage } from '../utils';
2
+ export var regReplaceAll = (content, pattern, replacementFunc) => {
9
3
  var target = new RegExp(pattern, 'gi');
10
4
  return content.replace(target, replacementFunc);
11
5
  };
12
- exports.regReplaceAll = regReplaceAll;
13
- var addMarkTags = (content, searchPattern) => {
6
+ export var addMarkTags = (content, searchPattern) => {
14
7
  var markedContent;
15
8
  try {
16
9
  var replacement = match => "<mark>".concat(match, "</mark>");
@@ -20,12 +13,10 @@ var addMarkTags = (content, searchPattern) => {
20
13
  }
21
14
  return markedContent;
22
15
  };
23
- exports.addMarkTags = addMarkTags;
24
- var removeMarkTags = markedText => {
16
+ export var removeMarkTags = markedText => {
25
17
  return markedText.replace(/<\/?mark>/g, '');
26
18
  };
27
- exports.removeMarkTags = removeMarkTags;
28
- var addCodeLanguageTags = content => {
19
+ export var addCodeLanguageTags = content => {
29
20
  var languageTaggedContent;
30
21
  try {
31
22
  var searchPattern = /```([A-Za-z]+)$/gm;
@@ -38,15 +29,14 @@ var addCodeLanguageTags = content => {
38
29
  }
39
30
  return languageTaggedContent;
40
31
  };
41
- exports.addCodeLanguageTags = addCodeLanguageTags;
42
- var removeCodeLanguageTags = content => {
32
+ export var removeCodeLanguageTags = content => {
43
33
  var untaggedContent;
44
34
  try {
45
35
  var replacement = () => '';
46
36
  var searchPattern = /<(.*)\/>$/gm;
47
37
  var match = searchPattern.exec(content);
48
38
  var language = match && match[1];
49
- if (language && (0, _utils.instanceOfPrismLanguage)(language)) {
39
+ if (language && instanceOfPrismLanguage(language)) {
50
40
  untaggedContent = regReplaceAll(content, '<' + language + '/>\n', replacement);
51
41
  } else {
52
42
  untaggedContent = content;
@@ -56,14 +46,12 @@ var removeCodeLanguageTags = content => {
56
46
  }
57
47
  return untaggedContent;
58
48
  };
59
- exports.removeCodeLanguageTags = removeCodeLanguageTags;
60
- var getCodeLanguageFromTaggedText = content => {
49
+ export var getCodeLanguageFromTaggedText = content => {
61
50
  var searchPattern = /<(.*)\/>$/gm;
62
51
  var match = searchPattern.exec(content);
63
52
  return match ? match[1] : 'markup';
64
53
  };
65
- exports.getCodeLanguageFromTaggedText = getCodeLanguageFromTaggedText;
66
- var prepareCodeText = content => {
54
+ export var prepareCodeText = content => {
67
55
  var text = content;
68
56
  var language = getCodeLanguageFromTaggedText(text);
69
57
  text = removeCodeLanguageTags(text);
@@ -74,8 +62,7 @@ var prepareCodeText = content => {
74
62
  language
75
63
  };
76
64
  };
77
- exports.prepareCodeText = prepareCodeText;
78
- var qualifyMarkdownText = (content, pattern) => {
65
+ export var qualifyMarkdownText = (content, pattern) => {
79
66
  var qualifiedContent;
80
67
  if (pattern !== '') {
81
68
  qualifiedContent = addMarkTags(content, pattern);
@@ -83,5 +70,4 @@ var qualifyMarkdownText = (content, pattern) => {
83
70
  qualifiedContent = addCodeLanguageTags(qualifiedContent || content);
84
71
  return qualifiedContent;
85
72
  };
86
- exports.qualifyMarkdownText = qualifyMarkdownText;
87
73
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["_utils","require","regReplaceAll","content","pattern","replacementFunc","target","RegExp","replace","exports","addMarkTags","searchPattern","markedContent","replacement","match","concat","e","removeMarkTags","markedText","addCodeLanguageTags","languageTaggedContent","exec","language","removeCodeLanguageTags","untaggedContent","instanceOfPrismLanguage","getCodeLanguageFromTaggedText","prepareCodeText","text","trim","qualifyMarkdownText","qualifiedContent"],"sources":["../../../src/Markdown/utils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport { instanceOfPrismLanguage } from '../utils'\n\nexport const regReplaceAll = (\n content: string,\n pattern: string,\n replacementFunc: any\n) => {\n const target = new RegExp(pattern, 'gi')\n return content.replace(target, replacementFunc)\n}\n/**\n * Adds <mark> tags around text if search pattern is detected\n * @param content - the main content to render\n * @param searchPattern - the search pattern to consider\n * @returns - a 'marked' string to be rendered by markdown component\n */\nexport const addMarkTags = (content: string, searchPattern: string) => {\n let markedContent\n try {\n const replacement = (match: string) => `<mark>${match}</mark>`\n markedContent = regReplaceAll(content, searchPattern, replacement)\n } catch (e) {\n markedContent = content\n }\n return markedContent\n}\n\n/**\n * Removes <mark><mark/> tags from markdown text. The mark tag is removed from code styled\n * text as the code renderer cannot differentiate <mark><mark/> from the code text.\n * @param markedText - the markdown text input that contains <mark /> tags\n */\nexport const removeMarkTags = (markedText: string) => {\n return markedText.replace(/<\\/?mark>/g, '')\n}\n\n/**\n * Checks the input for code block decorators, the programming language used (```json), and returns a language tag\n * that is later used to inform syntax highlighting rules\n * @param content - the code blob to render\n * @returns - code blob string with code language tag\n */\nexport const addCodeLanguageTags = (content: string) => {\n let languageTaggedContent: string\n try {\n const searchPattern = /```([A-Za-z]+)$/gm\n const match = searchPattern.exec(content)\n const language = match && match[1]\n const replacement = () => `\\`\\`\\`\\n<${language}/>`\n languageTaggedContent = content.replace(searchPattern, replacement)\n } catch (e) {\n languageTaggedContent = content\n }\n return languageTaggedContent\n}\n\n/**\n * Removes the code language tag from the code blob text before text presentation to screen\n * @param content - code blob text with language tag\n * @returns - code blob text without language tag\n */\nexport const removeCodeLanguageTags = (content: string) => {\n let untaggedContent\n try {\n const replacement = () => ''\n const searchPattern = /<(.*)\\/>$/gm\n const match = searchPattern.exec(content)\n const language = match && match[1]\n if (language && instanceOfPrismLanguage(language)) {\n untaggedContent = regReplaceAll(\n content,\n '<' + language + '/>\\n',\n replacement\n )\n } else {\n untaggedContent = content\n }\n } catch (e) {\n untaggedContent = content\n }\n return untaggedContent\n}\n\n/**\n * Extracts the syntax highlighting language, if specified\n * @param content - language tagged code blob\n * @returns - syntax highlighting language\n */\nexport const getCodeLanguageFromTaggedText = (content: string): string => {\n const searchPattern = /<(.*)\\/>$/gm\n const match = searchPattern.exec(content)\n return match ? match[1] : 'markup'\n}\n\n/**\n * Removes tags that were applied for syntax highlighting or search pattern matching and returns just the code blob text\n * @param content - code blob text to render\n * @returns - rendered code text\n */\nexport const prepareCodeText = (content: string) => {\n let text = content\n const language = getCodeLanguageFromTaggedText(text)\n text = removeCodeLanguageTags(text)\n text = removeMarkTags(text)\n text = text.trim()\n return { text, language }\n}\n\n/**\n * Returns a 'qualified markdown' text, a string which contains search pattern match and syntax highlighting qualifiers used by this package\n * @param content The content to qualify\n * @param pattern The regex pattern to search\n * @returns qualified content\n */\nexport const qualifyMarkdownText = (\n content: string,\n pattern: string\n): string => {\n let qualifiedContent\n if (pattern !== '') {\n qualifiedContent = addMarkTags(content, pattern)\n }\n qualifiedContent = addCodeLanguageTags(qualifiedContent || content)\n return qualifiedContent\n}\n"],"mappings":";;;;;;AAyBA,IAAAA,MAAA,GAAAC,OAAA;AAEO,IAAMC,aAAa,GAAGA,CAC3BC,OAAe,EACfC,OAAe,EACfC,eAAoB,KACjB;EACH,IAAMC,MAAM,GAAG,IAAIC,MAAM,CAACH,OAAO,EAAE,IAAI,CAAC;EACxC,OAAOD,OAAO,CAACK,OAAO,CAACF,MAAM,EAAED,eAAe,CAAC;AACjD,CAAC;AAAAI,OAAA,CAAAP,aAAA,GAAAA,aAAA;AAOM,IAAMQ,WAAW,GAAGA,CAACP,OAAe,EAAEQ,aAAqB,KAAK;EACrE,IAAIC,aAAa;EACjB,IAAI;IACF,IAAMC,WAAW,GAAIC,KAAa,aAAAC,MAAA,CAAcD,KAAK,YAAS;IAC9DF,aAAa,GAAGV,aAAa,CAACC,OAAO,EAAEQ,aAAa,EAAEE,WAAW,CAAC;EACpE,CAAC,CAAC,OAAOG,CAAC,EAAE;IACVJ,aAAa,GAAGT,OAAO;EACzB;EACA,OAAOS,aAAa;AACtB,CAAC;AAAAH,OAAA,CAAAC,WAAA,GAAAA,WAAA;AAOM,IAAMO,cAAc,GAAIC,UAAkB,IAAK;EACpD,OAAOA,UAAU,CAACV,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;AAC7C,CAAC;AAAAC,OAAA,CAAAQ,cAAA,GAAAA,cAAA;AAQM,IAAME,mBAAmB,GAAIhB,OAAe,IAAK;EACtD,IAAIiB,qBAA6B;EACjC,IAAI;IACF,IAAMT,aAAa,GAAG,mBAAmB;IACzC,IAAMG,KAAK,GAAGH,aAAa,CAACU,IAAI,CAAClB,OAAO,CAAC;IACzC,IAAMmB,QAAQ,GAAGR,KAAK,IAAIA,KAAK,CAAC,CAAC,CAAC;IAClC,IAAMD,W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AAI,GAAGzB,OAAO;EAClB,IAAMmB,QAAQ,GAAGI,6BAA6B,CAACE,IAAI,CAAC;EACpDA,IAAI,GAAGL,sBAAsB,CAACK,IAAI,CAAC;EACnCA,IAAI,GAAGX,cAAc,CAACW,IAAI,CAAC;EAC3BA,IAAI,GAAGA,IAAI,CAACC,IAAI,EAAE;EAClB,OAAO;IAAED,IAAI;IAAEN;EAAS,CAAC;AAC3B,CAAC;AAAAb,OAAA,CAAAkB,eAAA,GAAAA,eAAA;AAQM,IAAMG,mBAAmB,GAAGA,CACjC3B,OAAe,EACfC,OAAe,KACJ;EACX,IAAI2B,gBAAgB;EACpB,IAAI3B,OAAO,KAAK,EAAE,EAAE;IAClB2B,gBAAgB,GAAGrB,WAAW,CAACP,OAAO,EAAEC,OAAO,CAAC;EAClD;EACA2B,gBAAgB,GAAGZ,mBAAmB,CAACY,gBAAgB,IAAI5B,OAAO,CAAC;EACnE,OAAO4B,gBAAgB;AACzB,CAAC;AAAAtB,OAAA,CAAAqB,mBAAA,GAAAA,mBAAA"}
1
+ {"version":3,"file":"utils.js","names":["instanceOfPrismLanguage","regReplaceAll","content","pattern","replacementFunc","target","RegExp","replace","addMarkTags","searchPattern","markedContent","replacement","match","concat","e","removeMarkTags","markedText","addCodeLanguageTags","languageTaggedContent","exec","language","removeCodeLanguageTags","untaggedContent","getCodeLanguageFromTaggedText","prepareCodeText","text","trim","qualifyMarkdownText","qualifiedContent"],"sources":["../../../src/Markdown/utils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport { instanceOfPrismLanguage } from '../utils';\n\nexport const regReplaceAll = (\n content: string,\n pattern: string,\n replacementFunc: any\n) => {\n const target = new RegExp(pattern, 'gi');\n return content.replace(target, replacementFunc);\n};\n/**\n * Adds <mark> tags around text if search pattern is detected\n * @param content - the main content to render\n * @param searchPattern - the search pattern to consider\n * @returns - a 'marked' string to be rendered by markdown component\n */\nexport const addMarkTags = (content: string, searchPattern: string) => {\n let markedContent;\n try {\n const replacement = (match: string) => `<mark>${match}</mark>`;\n markedContent = regReplaceAll(content, searchPattern, replacement);\n } catch (e) {\n markedContent = content;\n }\n return markedContent;\n};\n\n/**\n * Removes <mark><mark/> tags from markdown text. The mark tag is removed from code styled\n * text as the code renderer cannot differentiate <mark><mark/> from the code text.\n * @param markedText - the markdown text input that contains <mark /> tags\n */\nexport const removeMarkTags = (markedText: string) => {\n return markedText.replace(/<\\/?mark>/g, '');\n};\n\n/**\n * Checks the input for code block decorators, the programming language used (```json), and returns a language tag\n * that is later used to inform syntax highlighting rules\n * @param content - the code blob to render\n * @returns - code blob string with code language tag\n */\nexport const addCodeLanguageTags = (content: string) => {\n let languageTaggedContent: string;\n try {\n const searchPattern = /```([A-Za-z]+)$/gm;\n const match = searchPattern.exec(content);\n const language = match && match[1];\n const replacement = () => `\\`\\`\\`\\n<${language}/>`;\n languageTaggedContent = content.replace(searchPattern, replacement);\n } catch (e) {\n languageTaggedContent = content;\n }\n return languageTaggedContent;\n};\n\n/**\n * Removes the code language tag from the code blob text before text presentation to screen\n * @param content - code blob text with language tag\n * @returns - code blob text without language tag\n */\nexport const removeCodeLanguageTags = (content: string) => {\n let untaggedContent;\n try {\n const replacement = () => '';\n const searchPattern = /<(.*)\\/>$/gm;\n const match = searchPattern.exec(content);\n const language = match && match[1];\n if (language && instanceOfPrismLanguage(language)) {\n untaggedContent = regReplaceAll(\n content,\n '<' + language + '/>\\n',\n replacement\n );\n } else {\n untaggedContent = content;\n }\n } catch (e) {\n untaggedContent = content;\n }\n return untaggedContent;\n};\n\n/**\n * Extracts the syntax highlighting language, if specified\n * @param content - language tagged code blob\n * @returns - syntax highlighting language\n */\nexport const getCodeLanguageFromTaggedText = (content: string): string => {\n const searchPattern = /<(.*)\\/>$/gm;\n const match = searchPattern.exec(content);\n return match ? match[1] : 'markup';\n};\n\n/**\n * Removes tags that were applied for syntax highlighting or search pattern matching and returns just the code blob text\n * @param content - code blob text to render\n * @returns - rendered code text\n */\nexport const prepareCodeText = (content: string) => {\n let text = content;\n const language = getCodeLanguageFromTaggedText(text);\n text = removeCodeLanguageTags(text);\n text = removeMarkTags(text);\n text = text.trim();\n return { text, language };\n};\n\n/**\n * Returns a 'qualified markdown' text, a string which contains search pattern match and syntax highlighting qualifiers used by this package\n * @param content The content to qualify\n * @param pattern The regex pattern to search\n * @returns qualified content\n */\nexport const qualifyMarkdownText = (\n content: string,\n pattern: string\n): string => {\n let qualifiedContent;\n if (pattern !== '') {\n qualifiedContent = addMarkTags(content, pattern);\n }\n qualifiedContent = addCodeLanguageTags(qualifiedContent || content);\n return qualifiedContent;\n};\n"],"mappings":"AAyBA,SAASA,uBAAuB,QAAQ,UAAU;AAElD,OAAO,IAAMC,aAAa,GAAGA,CAC3BC,OAAe,EACfC,OAAe,EACfC,eAAoB,KACjB;EACH,IAAMC,MAAM,GAAG,IAAIC,MAAM,CAACH,OAAO,EAAE,IAAI,CAAC;EACxC,OAAOD,OAAO,CAACK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HANGED
@@ -1,50 +1,5 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _CodeCopy = require("./CodeCopy");
7
- Object.keys(_CodeCopy).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _CodeCopy[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function get() {
13
- return _CodeCopy[key];
14
- }
15
- });
16
- });
17
- var _CodeDisplay = require("./CodeDisplay");
18
- Object.keys(_CodeDisplay).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _CodeDisplay[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function get() {
24
- return _CodeDisplay[key];
25
- }
26
- });
27
- });
28
- var _CodeEditor = require("./CodeEditor");
29
- Object.keys(_CodeEditor).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _CodeEditor[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function get() {
35
- return _CodeEditor[key];
36
- }
37
- });
38
- });
39
- var _Markdown = require("./Markdown");
40
- Object.keys(_Markdown).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _Markdown[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function get() {
46
- return _Markdown[key];
47
- }
48
- });
49
- });
1
+ export * from './CodeCopy';
2
+ export * from './CodeDisplay';
3
+ export * from './CodeEditor';
4
+ export * from './Markdown';
50
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_CodeCopy","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_CodeDisplay","_CodeEditor","_Markdown"],"sources":["../../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './CodeCopy'\nexport * from './CodeDisplay'\nexport * from './CodeEditor'\nexport * from './Markdown'\n"],"mappings":";;;;;AAyBA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,YAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,YAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,YAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,YAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,WAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,WAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,WAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAE,WAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,SAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,SAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,SAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAG,SAAA,CAAAP,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './CodeCopy';\nexport * from './CodeDisplay';\nexport * from './CodeEditor';\nexport * from './Markdown';\n"],"mappings":"AAyBA,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,cAAc,YAAY"}
@@ -1,9 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.pythonTestCode = void 0;
7
- var pythonTestCode = "# GET /lookml_models -> Sequence[models.LookmlModel]\ndef all_lookml_models(\n self,\n # Requested fields.\n fields: Optional[str] = None,\n transport_options: Optional[transport.TransportOptions] = None,\n) -> Sequence[models.LookmlModel]:\n \"\"\"Get All LookML Models\"\"\"\n response = self.get(\n f\"/lookml_models\",\n Sequence[models.LookmlModel],\n query_params={\"fields\": fields},\n transport_options=transport_options\n )\n assert isinstance(response, list)\n return response";
8
- exports.pythonTestCode = pythonTestCode;
1
+ export var pythonTestCode = "# GET /lookml_models -> Sequence[models.LookmlModel]\ndef all_lookml_models(\n self,\n # Requested fields.\n fields: Optional[str] = None,\n transport_options: Optional[transport.TransportOptions] = None,\n) -> Sequence[models.LookmlModel]:\n \"\"\"Get All LookML Models\"\"\"\n response = self.get(\n f\"/lookml_models\",\n Sequence[models.LookmlModel],\n query_params={\"fields\": fields},\n transport_options=transport_options\n )\n assert isinstance(response, list)\n return response";
9
2
  //# sourceMappingURL=codeBlob.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codeBlob.js","names":["pythonTestCode","exports"],"sources":["../../../src/test-data/codeBlob.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport const pythonTestCode = `# GET /lookml_models -> Sequence[models.LookmlModel]\ndef all_lookml_models(\n self,\n # Requested fields.\n fields: Optional[str] = None,\n transport_options: Optional[transport.TransportOptions] = None,\n) -> Sequence[models.LookmlModel]:\n \"\"\"Get All LookML Models\"\"\"\n response = self.get(\n f\"/lookml_models\",\n Sequence[models.LookmlModel],\n query_params={\"fields\": fields},\n transport_options=transport_options\n )\n assert isinstance(response, list)\n return response`\n"],"mappings":";;;;;;AAyBO,IAAMA,cAAc,2jBAeP;AAAAC,OAAA,CAAAD,cAAA,GAAAA,cAAA"}
1
+ {"version":3,"file":"codeBlob.js","names":["pythonTestCode"],"sources":["../../../src/test-data/codeBlob.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport const pythonTestCode = `# GET /lookml_models -> Sequence[models.LookmlModel]\ndef all_lookml_models(\n self,\n # Requested fields.\n fields: Optional[str] = None,\n transport_options: Optional[transport.TransportOptions] = None,\n) -> Sequence[models.LookmlModel]:\n \"\"\"Get All LookML Models\"\"\"\n response = self.get(\n f\"/lookml_models\",\n Sequence[models.LookmlModel],\n query_params={\"fields\": fields},\n transport_options=transport_options\n )\n assert isinstance(response, list)\n return response`;\n"],"mappings":"AAyBA,OAAO,IAAMA,cAAc,2jBAeP"}
@@ -1,13 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "pythonTestCode", {
7
- enumerable: true,
8
- get: function get() {
9
- return _codeBlob.pythonTestCode;
10
- }
11
- });
12
- var _codeBlob = require("./codeBlob");
1
+ export { pythonTestCode } from './codeBlob';
13
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_codeBlob","require"],"sources":["../../../src/test-data/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { pythonTestCode } from './codeBlob'\n"],"mappings":";;;;;;;;;;;AAyBA,IAAAA,SAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["pythonTestCode"],"sources":["../../../src/test-data/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { pythonTestCode } from './codeBlob';\n"],"mappings":"AAyBA,SAASA,cAAc,QAAQ,YAAY"}
@@ -1,25 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "getOverriddenTheme", {
7
- enumerable: true,
8
- get: function get() {
9
- return _utils.getOverriddenTheme;
10
- }
11
- });
12
- Object.defineProperty(exports, "getPrismLanguage", {
13
- enumerable: true,
14
- get: function get() {
15
- return _utils.getPrismLanguage;
16
- }
17
- });
18
- Object.defineProperty(exports, "instanceOfPrismLanguage", {
19
- enumerable: true,
20
- get: function get() {
21
- return _utils.instanceOfPrismLanguage;
22
- }
23
- });
24
- var _utils = require("./utils");
1
+ export { getPrismLanguage, getOverriddenTheme, instanceOfPrismLanguage } from './utils';
25
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_utils","require"],"sources":["../../../src/utils/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport {\n getPrismLanguage,\n getOverriddenTheme,\n instanceOfPrismLanguage,\n} from './utils'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAAA,MAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["getPrismLanguage","getOverriddenTheme","instanceOfPrismLanguage"],"sources":["../../../src/utils/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport {\n getPrismLanguage,\n getOverriddenTheme,\n instanceOfPrismLanguage,\n} from './utils';\n"],"mappings":"AAyBA,SACEA,gBAAgB,EAChBC,kBAAkB,EAClBC,uBAAuB,QAClB,SAAS"}
@@ -1,20 +1,12 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.instanceOfPrismLanguage = exports.getPrismLanguage = exports.getOverriddenTheme = void 0;
7
- var _components = require("@looker/components");
8
- var _prismReactRenderer = require("prism-react-renderer");
9
- var _vsDark = _interopRequireDefault(require("prism-react-renderer/themes/vsDark"));
10
- var _github = _interopRequireDefault(require("prism-react-renderer/themes/github"));
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- var instanceOfPrismLanguage = languageName => {
1
+ import { theme } from '@looker/components';
2
+ import { Prism } from 'prism-react-renderer';
3
+ import blockTheme from 'prism-react-renderer/themes/vsDark';
4
+ import inlineTheme from 'prism-react-renderer/themes/github';
5
+ export var instanceOfPrismLanguage = languageName => {
13
6
  var extraHighlightingEngines = ['kotlin', 'csharp', 'swift', 'ruby'];
14
- return Object.keys(_prismReactRenderer.Prism.languages).includes(languageName) || extraHighlightingEngines.includes(languageName);
7
+ return Object.keys(Prism.languages).includes(languageName) || extraHighlightingEngines.includes(languageName);
15
8
  };
16
- exports.instanceOfPrismLanguage = instanceOfPrismLanguage;
17
- var getPrismLanguage = language => {
9
+ export var getPrismLanguage = language => {
18
10
  language = language.toLowerCase();
19
11
  if (language === 'golang') {
20
12
  language = 'go';
@@ -23,23 +15,21 @@ var getPrismLanguage = language => {
23
15
  }
24
16
  return instanceOfPrismLanguage(language) ? language : 'markup';
25
17
  };
26
- exports.getPrismLanguage = getPrismLanguage;
27
- var getOverriddenTheme = (transparent, inline) => {
18
+ export var getOverriddenTheme = (transparent, inline) => {
28
19
  if (inline) {
29
- _github.default.plain.backgroundColor = _components.theme.colors.ui1;
30
- _github.default.plain.border = "1px solid ".concat(_components.theme.colors.ui2);
31
- _github.default.plain.borderRadius = '4px';
32
- _github.default.plain.padding = '4px';
33
- _github.default.plain.fontSize = _components.theme.fontSizes.small;
34
- return _github.default;
20
+ inlineTheme.plain.backgroundColor = theme.colors.ui1;
21
+ inlineTheme.plain.border = "1px solid ".concat(theme.colors.ui2);
22
+ inlineTheme.plain.borderRadius = '4px';
23
+ inlineTheme.plain.padding = '4px';
24
+ inlineTheme.plain.fontSize = theme.fontSizes.small;
25
+ return inlineTheme;
35
26
  } else if (transparent) {
36
- _vsDark.default.plain.backgroundColor = 'none';
37
- _vsDark.default.plain.padding = '0px';
27
+ blockTheme.plain.backgroundColor = 'none';
28
+ blockTheme.plain.padding = '0px';
38
29
  } else {
39
- _vsDark.default.plain.backgroundColor = _components.theme.colors.text;
40
- _vsDark.default.plain.padding = '1rem';
30
+ blockTheme.plain.backgroundColor = theme.colors.text;
31
+ blockTheme.plain.padding = '1rem';
41
32
  }
42
- return _vsDark.default;
33
+ return blockTheme;
43
34
  };
44
- exports.getOverriddenTheme = getOverriddenTheme;
45
35
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["_components","require","_prismReactRenderer","_vsDark","_interopRequireDefault","_github","obj","__esModule","default","instanceOfPrismLanguage","languageName","extraHighlightingEngines","Object","keys","Prism","languages","includes","exports","getPrismLanguage","language","toLowerCase","getOverriddenTheme","transparent","inline","inlineTheme","plain","backgroundColor","theme","colors","ui1","border","concat","ui2","borderRadius","padding","fontSize","fontSizes","small","blockTheme","text"],"sources":["../../../src/utils/utils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport { theme } from '@looker/components'\nimport type { Language } from 'prism-react-renderer'\nimport { Prism } from 'prism-react-renderer'\nimport blockTheme from 'prism-react-renderer/themes/vsDark'\nimport inlineTheme from 'prism-react-renderer/themes/github'\n\n/**\n * checks whether input is supported syntax highlighting language\n * @param languageName - string lang name to test\n * @returns boolean\n */\nexport const instanceOfPrismLanguage = (languageName: string) => {\n const extraHighlightingEngines = ['kotlin', 'csharp', 'swift', 'ruby']\n return (\n Object.keys(Prism.languages).includes(languageName) ||\n extraHighlightingEngines.includes(languageName)\n )\n}\n\n/**\n * gets highlighter language type for input language name\n * @param language sdk language to be highlighted\n * @returns prism language if it exists\n */\nexport const getPrismLanguage = (language: string): Language => {\n language = language.toLowerCase()\n // TODO revert back to `go` in generator language definitions instead of using this\n if (language === 'golang') {\n language = 'go'\n } else if (language === 'c#') {\n language = 'csharp'\n }\n return instanceOfPrismLanguage(language) ? (language as Language) : 'markup'\n}\n\n/**\n * applies package overrides to the default theme. Inline CodeDisplay uses githubLight theme, else uses vsCodeDark theme.\n * @returns modified prism theme object\n */\nexport const getOverriddenTheme = (transparent: boolean, inline: boolean) => {\n if (inline) {\n inlineTheme.plain.backgroundColor = theme.colors.ui1\n inlineTheme.plain.border = `1px solid ${theme.colors.ui2}`\n inlineTheme.plain.borderRadius = '4px'\n inlineTheme.plain.padding = '4px'\n inlineTheme.plain.fontSize = theme.fontSizes.small\n return inlineTheme\n } else if (transparent) {\n blockTheme.plain.backgroundColor = 'none'\n blockTheme.plain.padding = '0px'\n } else {\n blockTheme.plain.backgroundColor = theme.colors.text\n blockTheme.plain.padding = '1rem'\n }\n return blockTheme\n}\n"],"mappings":";;;;;;AAyBA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA4D,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAOrD,IAAMG,uBAAuB,GAAIC,YAAoB,IAAK;EAC/D,IAAMC,wBAAwB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC;EACtE,OACEC,MAAM,CAACC,IAAI,CAACC,yBAAK,CAACC,SAAS,CAAC,CAACC,QAAQ,CAACN,YAAY,CAAC,IACnDC,wBAAwB,CAACK,QAAQ,CAACN,YAAY,CAAC;AAEnD,CAAC;AAAAO,OAAA,CAAAR,uBAAA,GAAAA,uBAAA;AAOM,IAAMS,gBAAgB,GAAIC,QAAgB,IAAe;EAC9DA,QAAQ,GAAGA,QAAQ,CAACC,WAAW,EAAE;EAEjC,IAAID,QAAQ,KAAK,QAAQ,EAAE;IACzBA,QAAQ,GAAG,IAAI;EACjB,CAAC,MAAM,IAAIA,QAAQ,KAAK,IAAI,EAAE;IAC5BA,QAAQ,GAAG,QAAQ;EACrB;EACA,OAAOV,uBAAuB,CAACU,QAAQ,CAAC,GAAIA,QAAQ,GAAgB,QAAQ;AAC9E,CAAC;AAAAF,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAMM,IAAMG,kBAAkB,GAAGA,CAACC,WAAoB,EAAEC,MAAe,KAAK;EAC3E,IAAIA,MAAM,EAAE;IACVC,eAAW,CAACC,KAAK,CAACC,eAAe,GAAGC,iBAAK,CAACC,MAAM,CAACC,GAAG;IACpDL,eAAW,CAACC,KAAK,CAACK,MAAM,gBAAAC,MAAA,CAAgBJ,iBAAK,CAACC,MAAM,CAACI,GAAG,CAAE;IAC1DR,eAAW,CAACC,KAAK,CAACQ,YAAY,GAAG,KAAK;IACtCT,eAAW,CAACC,KAAK,CAACS,OAAO,GAAG,KAAK;IACjCV,eAAW,CAACC,KAAK,CAACU,QAAQ,GAAGR,iBAAK,CAACS,SAAS,CAACC,KAAK;IAClD,OAAOb,eAAW;EACpB,CAAC,MAAM,IAAIF,WAAW,EAAE;IACtBgB,eAAU,CAACb,KAAK,CAACC,eAAe,GAAG,MAAM;IACzCY,eAAU,CAACb,KAAK,CAACS,OAAO,GAAG,KAAK;EAClC,CAAC,MAAM;IACLI,eAAU,CAACb,KAAK,CAACC,eAAe,GAAGC,iBAAK,CAACC,MAAM,CAACW,IAAI;IACpDD,eAAU,CAACb,KAAK,CAACS,OAAO,GAAG,MAAM;EACnC;EACA,OAAOI,eAAU;AACnB,CAAC;AAAArB,OAAA,CAAAI,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"file":"utils.js","names":["theme","Prism","blockTheme","inlineTheme","instanceOfPrismLanguage","languageName","extraHighlightingEngines","Object","keys","languages","includes","getPrismLanguage","language","toLowerCase","getOverriddenTheme","transparent","inline","plain","backgroundColor","colors","ui1","border","concat","ui2","borderRadius","padding","fontSize","fontSizes","small","text"],"sources":["../../../src/utils/utils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport { theme } from '@looker/components';\nimport type { Language } from 'prism-react-renderer';\nimport { Prism } from 'prism-react-renderer';\nimport blockTheme from 'prism-react-renderer/themes/vsDark';\nimport inlineTheme from 'prism-react-renderer/themes/github';\n\n/**\n * checks whether input is supported syntax highlighting language\n * @param languageName - string lang name to test\n * @returns boolean\n */\nexport const instanceOfPrismLanguage = (languageName: string) => {\n const extraHighlightingEngines = ['kotlin', 'csharp', 'swift', 'ruby'];\n return (\n Object.keys(Prism.languages).includes(languageName) ||\n extraHighlightingEngines.includes(languageName)\n );\n};\n\n/**\n * gets highlighter language type for input language name\n * @param language sdk language to be highlighted\n * @returns prism language if it exists\n */\nexport const getPrismLanguage = (language: string): Language => {\n language = language.toLowerCase();\n // TODO revert back to `go` in generator language definitions instead of using this\n if (language === 'golang') {\n language = 'go';\n } else if (language === 'c#') {\n language = 'csharp';\n }\n return instanceOfPrismLanguage(language) ? (language as Language) : 'markup';\n};\n\n/**\n * applies package overrides to the default theme. Inline CodeDisplay uses githubLight theme, else uses vsCodeDark theme.\n * @returns modified prism theme object\n */\nexport const getOverriddenTheme = (transparent: boolean, inline: boolean) => {\n if (inline) {\n inlineTheme.plain.backgroundColor = theme.colors.ui1;\n inlineTheme.plain.border = `1px solid ${theme.colors.ui2}`;\n inlineTheme.plain.borderRadius = '4px';\n inlineTheme.plain.padding = '4px';\n inlineTheme.plain.fontSize = theme.fontSizes.small;\n return inlineTheme;\n } else if (transparent) {\n blockTheme.plain.backgroundColor = 'none';\n blockTheme.plain.padding = '0px';\n } else {\n blockTheme.plain.backgroundColor = theme.colors.text;\n blockTheme.plain.padding = '1rem';\n }\n return blockTheme;\n};\n"],"mappings":"AAyBA,SAASA,KAAK,QAAQ,oBAAoB;AAE1C,SAASC,KAAK,QAAQ,sBAAsB;AAC5C,OAAOC,UAAU,MAAM,oCAAoC;AAC3D,OAAOC,WAAW,MAAM,oCAAoC;AAO5D,OAAO,IAAMC,uBAAuB,GAAIC,YAAoB,IAAK;EAC/D,IAAMC,wBAAwB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC;EACtE,OACEC,MAAM,CAACC,IAAI,CAACP,KAAK,CAACQ,SAAS,CAAC,CAACC,QAAQ,CAACL,YAAY,CAAC,IACnDC,wBAAwB,CAACI,QAAQ,CAACL,YAAY,CAAC;AAEnD,CAAC;AAOD,OAAO,IAAMM,gBAAgB,GAAIC,QAAgB,IAAe;EAC9DA,QAAQ,GAAGA,QAAQ,CAACC,WAAW,CAAC,CAAC;EAEjC,IAAID,QAAQ,KAAK,QAAQ,EAAE;IACzBA,QAAQ,GAAG,IAAI;EACjB,CAAC,MAAM,IAAIA,QAAQ,KAAK,IAAI,EAAE;IAC5BA,QAAQ,GAAG,QAAQ;EACrB;EACA,OAAOR,uBAAuB,CAACQ,QAAQ,CAAC,GAAIA,QAAQ,GAAgB,QAAQ;AAC9E,CAAC;AAMD,OAAO,IAAME,kBAAkB,GAAGA,CAACC,WAAoB,EAAEC,MAAe,KAAK;EAC3E,IAAIA,MAAM,EAAE;IACVb,WAAW,CAACc,KAAK,CAACC,eAAe,GAAGlB,KAAK,CAACmB,MAAM,CAACC,GAAG;IACpDjB,WAAW,CAACc,KAAK,CAACI,MAAM,gBAAAC,MAAA,CAAgBtB,KAAK,CAACmB,MAAM,CAACI,GAAG,CAAE;IAC1DpB,WAAW,CAACc,KAAK,CAACO,YAAY,GAAG,KAAK;IACtCrB,WAAW,CAACc,KAAK,CAACQ,OAAO,GAAG,KAAK;IACjCtB,WAAW,CAACc,KAAK,CAACS,QAAQ,GAAG1B,KAAK,CAAC2B,SAAS,CAACC,KAAK;IAClD,OAAOzB,WAAW;EACpB,CAAC,MAAM,IAAIY,WAAW,EAAE;IACtBb,UAAU,CAACe,KAAK,CAACC,eAAe,GAAG,MAAM;IACzChB,UAAU,CAACe,KAAK,CAACQ,OAAO,GAAG,KAAK;EAClC,CAAC,MAAM;IACLvB,UAAU,CAACe,KAAK,CAACC,eAAe,GAAGlB,KAAK,CAACmB,MAAM,CAACU,IAAI;IACpD3B,UAAU,CAACe,KAAK,CAACQ,OAAO,GAAG,MAAM;EACnC;EACA,OAAOvB,UAAU;AACnB,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_CodeCopy","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_CodeDisplay","_CodeEditor","_Markdown"],"sources":["../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './CodeCopy'\nexport * from './CodeDisplay'\nexport * from './CodeEditor'\nexport * from './Markdown'\n"],"mappings":";;;;;AAyBA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,YAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,YAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,YAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,YAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,WAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,WAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,WAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAE,WAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,SAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,SAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,SAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAG,SAAA,CAAAP,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_CodeCopy","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_CodeDisplay","_CodeEditor","_Markdown"],"sources":["../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH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,SAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,SAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,SAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAG,SAAA,CAAAP,GAAA;IAAA;EAAA;AAAA"}
@@ -4,6 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.pythonTestCode = void 0;
7
- var pythonTestCode = "# GET /lookml_models -> Sequence[models.LookmlModel]\ndef all_lookml_models(\n self,\n # Requested fields.\n fields: Optional[str] = None,\n transport_options: Optional[transport.TransportOptions] = None,\n) -> Sequence[models.LookmlModel]:\n \"\"\"Get All LookML Models\"\"\"\n response = self.get(\n f\"/lookml_models\",\n Sequence[models.LookmlModel],\n query_params={\"fields\": fields},\n transport_options=transport_options\n )\n assert isinstance(response, list)\n return response";
8
- exports.pythonTestCode = pythonTestCode;
7
+ var pythonTestCode = exports.pythonTestCode = "# GET /lookml_models -> Sequence[models.LookmlModel]\ndef all_lookml_models(\n self,\n # Requested fields.\n fields: Optional[str] = None,\n transport_options: Optional[transport.TransportOptions] = None,\n) -> Sequence[models.LookmlModel]:\n \"\"\"Get All LookML Models\"\"\"\n response = self.get(\n f\"/lookml_models\",\n Sequence[models.LookmlModel],\n query_params={\"fields\": fields},\n transport_options=transport_options\n )\n assert isinstance(response, list)\n return response";
9
8
  //# sourceMappingURL=codeBlob.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codeBlob.js","names":["pythonTestCode","exports"],"sources":["../../src/test-data/codeBlob.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport const pythonTestCode = `# GET /lookml_models -> Sequence[models.LookmlModel]\ndef all_lookml_models(\n self,\n # Requested fields.\n fields: Optional[str] = None,\n transport_options: Optional[transport.TransportOptions] = None,\n) -> Sequence[models.LookmlModel]:\n \"\"\"Get All LookML Models\"\"\"\n response = self.get(\n f\"/lookml_models\",\n Sequence[models.LookmlModel],\n query_params={\"fields\": fields},\n transport_options=transport_options\n )\n assert isinstance(response, list)\n return response`\n"],"mappings":";;;;;;AAyBO,IAAMA,cAAc,2jBAeP;AAAAC,OAAA,CAAAD,cAAA,GAAAA,cAAA"}
1
+ {"version":3,"file":"codeBlob.js","names":["pythonTestCode","exports"],"sources":["../../src/test-data/codeBlob.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport const pythonTestCode = `# GET /lookml_models -> Sequence[models.LookmlModel]\ndef all_lookml_models(\n self,\n # Requested fields.\n fields: Optional[str] = None,\n transport_options: Optional[transport.TransportOptions] = None,\n) -> Sequence[models.LookmlModel]:\n \"\"\"Get All LookML Models\"\"\"\n response = self.get(\n f\"/lookml_models\",\n Sequence[models.LookmlModel],\n query_params={\"fields\": fields},\n transport_options=transport_options\n )\n assert isinstance(response, list)\n return response`;\n"],"mappings":";;;;;;AAyBO,IAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,2jBAeP"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_codeBlob","require"],"sources":["../../src/test-data/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { pythonTestCode } from './codeBlob'\n"],"mappings":";;;;;;;;;;;AAyBA,IAAAA,SAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["_codeBlob","require"],"sources":["../../src/test-data/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { pythonTestCode } from './codeBlob';\n"],"mappings":";;;;;;;;;;;AAyBA,IAAAA,SAAA,GAAAC,OAAA"}