@perses-dev/markdown-plugin 0.7.0

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 (109) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +41 -0
  3. package/__mf/css/async/263.73e51bf7.css +1 -0
  4. package/__mf/css/async/341.73e51bf7.css +1 -0
  5. package/__mf/css/async/759.73e51bf7.css +1 -0
  6. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  7. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  8. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  9. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  10. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  11. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  12. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  13. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  14. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  15. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  16. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  17. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  18. package/__mf/js/823.1c3cab09.js +5 -0
  19. package/__mf/js/Markdown.2bf7b9f8.js +5 -0
  20. package/__mf/js/async/125.a930b4a6.js +73 -0
  21. package/__mf/js/async/125.a930b4a6.js.LICENSE.txt +19 -0
  22. package/__mf/js/async/173.c939f26e.js +2 -0
  23. package/__mf/js/async/173.c939f26e.js.LICENSE.txt +19 -0
  24. package/__mf/js/async/214.08f3138d.js +1 -0
  25. package/__mf/js/async/224.e5d8921f.js +1 -0
  26. package/__mf/js/async/238.54061f0f.js +1 -0
  27. package/__mf/js/async/260.68c927ec.js +1 -0
  28. package/__mf/js/async/292.f37a44ec.js +1 -0
  29. package/__mf/js/async/373.4a8ae42b.js +1 -0
  30. package/__mf/js/async/488.b2e1eb2c.js +1 -0
  31. package/__mf/js/async/610.823ffbd3.js +10 -0
  32. package/__mf/js/async/610.823ffbd3.js.LICENSE.txt +27 -0
  33. package/__mf/js/async/620.e414f8fc.js +2 -0
  34. package/__mf/js/async/620.e414f8fc.js.LICENSE.txt +9 -0
  35. package/__mf/js/async/694.085ef40d.js +1 -0
  36. package/__mf/js/async/738.07a61f29.js +1 -0
  37. package/__mf/js/async/739.0bdabdbe.js +12 -0
  38. package/__mf/js/async/739.0bdabdbe.js.LICENSE.txt +1 -0
  39. package/__mf/js/async/740.55ee1510.js +1 -0
  40. package/__mf/js/async/75.997d663c.js +1 -0
  41. package/__mf/js/async/764.ffcbb9fc.js +138 -0
  42. package/__mf/js/async/770.21976fa2.js +1 -0
  43. package/__mf/js/async/790.b67b98e2.js +1 -0
  44. package/__mf/js/async/870.823064df.js +29 -0
  45. package/__mf/js/async/870.823064df.js.LICENSE.txt +59 -0
  46. package/__mf/js/async/930.4808c4b5.js +1 -0
  47. package/__mf/js/async/960.8479da60.js +2 -0
  48. package/__mf/js/async/960.8479da60.js.LICENSE.txt +8 -0
  49. package/__mf/js/async/964.61ccf551.js +2 -0
  50. package/__mf/js/async/964.61ccf551.js.LICENSE.txt +9 -0
  51. package/__mf/js/async/981.56846457.js +2 -0
  52. package/__mf/js/async/981.56846457.js.LICENSE.txt +8 -0
  53. package/__mf/js/async/996.8e208dcc.js +2 -0
  54. package/__mf/js/async/996.8e208dcc.js.LICENSE.txt +24 -0
  55. package/__mf/js/async/__federation_expose_Markdown.26edf002.js +1 -0
  56. package/__mf/js/async/lib-router.1eb11eab.js +2 -0
  57. package/__mf/js/async/lib-router.1eb11eab.js.LICENSE.txt +32 -0
  58. package/__mf/js/main.fd04fdc6.js +1 -0
  59. package/lib/Markdown.d.ts +7 -0
  60. package/lib/Markdown.d.ts.map +1 -0
  61. package/lib/Markdown.js +31 -0
  62. package/lib/Markdown.js.map +1 -0
  63. package/lib/MarkdownPanel.d.ts +6 -0
  64. package/lib/MarkdownPanel.d.ts.map +1 -0
  65. package/lib/MarkdownPanel.js +94 -0
  66. package/lib/MarkdownPanel.js.map +1 -0
  67. package/lib/MarkdownPanelOptionsEditor.d.ts +6 -0
  68. package/lib/MarkdownPanelOptionsEditor.d.ts.map +1 -0
  69. package/lib/MarkdownPanelOptionsEditor.js +50 -0
  70. package/lib/MarkdownPanelOptionsEditor.js.map +1 -0
  71. package/lib/bootstrap.d.ts +2 -0
  72. package/lib/bootstrap.d.ts.map +1 -0
  73. package/lib/bootstrap.js +19 -0
  74. package/lib/bootstrap.js.map +1 -0
  75. package/lib/cjs/Markdown.js +37 -0
  76. package/lib/cjs/MarkdownPanel.js +148 -0
  77. package/lib/cjs/MarkdownPanelOptionsEditor.js +58 -0
  78. package/lib/cjs/bootstrap.js +26 -0
  79. package/lib/cjs/env.d.js +14 -0
  80. package/lib/cjs/getPluginModule.js +27 -0
  81. package/lib/cjs/index-federation.js +55 -0
  82. package/lib/cjs/index.js +28 -0
  83. package/lib/cjs/markdown-panel-model.js +27 -0
  84. package/lib/cjs/setup-tests.js +19 -0
  85. package/lib/env.d.js +15 -0
  86. package/lib/env.d.js.map +1 -0
  87. package/lib/getPluginModule.d.ts +6 -0
  88. package/lib/getPluginModule.d.ts.map +1 -0
  89. package/lib/getPluginModule.js +16 -0
  90. package/lib/getPluginModule.js.map +1 -0
  91. package/lib/index-federation.d.ts +1 -0
  92. package/lib/index-federation.d.ts.map +1 -0
  93. package/lib/index-federation.js +15 -0
  94. package/lib/index-federation.js.map +1 -0
  95. package/lib/index.d.ts +6 -0
  96. package/lib/index.d.ts.map +1 -0
  97. package/lib/index.js +7 -0
  98. package/lib/index.js.map +1 -0
  99. package/lib/markdown-panel-model.d.ts +12 -0
  100. package/lib/markdown-panel-model.d.ts.map +1 -0
  101. package/lib/markdown-panel-model.js +19 -0
  102. package/lib/markdown-panel-model.js.map +1 -0
  103. package/lib/setup-tests.d.ts +2 -0
  104. package/lib/setup-tests.d.ts.map +1 -0
  105. package/lib/setup-tests.js +17 -0
  106. package/lib/setup-tests.js.map +1 -0
  107. package/mf-manifest.json +322 -0
  108. package/mf-stats.json +367 -0
  109. package/package.json +56 -0
@@ -0,0 +1,37 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "Markdown", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return Markdown;
21
+ }
22
+ });
23
+ const _markdownpanelmodel = require("./markdown-panel-model");
24
+ const _MarkdownPanel = require("./MarkdownPanel");
25
+ const _MarkdownPanelOptionsEditor = require("./MarkdownPanelOptionsEditor");
26
+ const Markdown = {
27
+ PanelComponent: _MarkdownPanel.MarkdownPanel,
28
+ supportedQueryTypes: [],
29
+ panelOptionsEditorComponents: [
30
+ {
31
+ label: 'Markdown',
32
+ content: _MarkdownPanelOptionsEditor.MarkdownPanelOptionsEditor
33
+ }
34
+ ],
35
+ createInitialOptions: _markdownpanelmodel.createInitialMarkdownPanelOptions,
36
+ hideQueryEditor: true
37
+ };
@@ -0,0 +1,148 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "MarkdownPanel", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return MarkdownPanel;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _material = require("@mui/material");
25
+ const _components = require("@perses-dev/components");
26
+ const _pluginsystem = require("@perses-dev/plugin-system");
27
+ const _dompurify = /*#__PURE__*/ _interop_require_default(require("dompurify"));
28
+ const _marked = require("marked");
29
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
30
+ function _interop_require_default(obj) {
31
+ return obj && obj.__esModule ? obj : {
32
+ default: obj
33
+ };
34
+ }
35
+ function _getRequireWildcardCache(nodeInterop) {
36
+ if (typeof WeakMap !== "function") return null;
37
+ var cacheBabelInterop = new WeakMap();
38
+ var cacheNodeInterop = new WeakMap();
39
+ return (_getRequireWildcardCache = function(nodeInterop) {
40
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
41
+ })(nodeInterop);
42
+ }
43
+ function _interop_require_wildcard(obj, nodeInterop) {
44
+ if (!nodeInterop && obj && obj.__esModule) {
45
+ return obj;
46
+ }
47
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
48
+ return {
49
+ default: obj
50
+ };
51
+ }
52
+ var cache = _getRequireWildcardCache(nodeInterop);
53
+ if (cache && cache.has(obj)) {
54
+ return cache.get(obj);
55
+ }
56
+ var newObj = {
57
+ __proto__: null
58
+ };
59
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
60
+ for(var key in obj){
61
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
62
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
63
+ if (desc && (desc.get || desc.set)) {
64
+ Object.defineProperty(newObj, key, desc);
65
+ } else {
66
+ newObj[key] = obj[key];
67
+ }
68
+ }
69
+ }
70
+ newObj.default = obj;
71
+ if (cache) {
72
+ cache.set(obj, newObj);
73
+ }
74
+ return newObj;
75
+ }
76
+ function createMarkdownPanelStyles(theme, chartsTheme) {
77
+ return {
78
+ padding: `${chartsTheme.container.padding.default}px`,
79
+ // Make the content scrollable
80
+ height: '100%',
81
+ overflowY: 'auto',
82
+ // Ignore top margin on the first element.
83
+ '& :first-of-type': {
84
+ marginTop: 0
85
+ },
86
+ // Styles for headers
87
+ '& h1': {
88
+ fontSize: '2em'
89
+ },
90
+ // Styles for <code>
91
+ '& code': {
92
+ fontSize: '0.85em'
93
+ },
94
+ '& :not(pre) code': {
95
+ padding: '0.2em 0.4em',
96
+ backgroundColor: theme.palette.grey[100],
97
+ borderRadius: '4px'
98
+ },
99
+ '& pre': {
100
+ padding: '1.2em',
101
+ backgroundColor: theme.palette.grey[100],
102
+ borderRadius: '4px'
103
+ },
104
+ // Styles for <table>
105
+ '& table, & th, & td': {
106
+ padding: '0.6em',
107
+ border: `1px solid ${theme.palette.grey[300]}`,
108
+ borderCollapse: 'collapse'
109
+ },
110
+ // Styles for <li>
111
+ '& li + li': {
112
+ marginTop: '0.25em'
113
+ },
114
+ // Styles for <a>
115
+ '& a': {
116
+ color: theme.palette.primary.main
117
+ }
118
+ };
119
+ }
120
+ // Convert markdown to HTML
121
+ // Supports original markdown and GitHub Flavored markdown
122
+ function markdownToHTML(text) {
123
+ return _marked.marked.parse(text, {
124
+ gfm: true,
125
+ async: false
126
+ });
127
+ }
128
+ // Prevent XSS attacks by removing the vectors for attacks
129
+ function sanitizeHTML(html) {
130
+ return _dompurify.default.sanitize(html);
131
+ }
132
+ function MarkdownPanel(props) {
133
+ const { spec: { text } } = props;
134
+ const chartsTheme = (0, _components.useChartsTheme)();
135
+ const textAfterVariableReplacement = (0, _pluginsystem.useReplaceVariablesInString)(text);
136
+ const html = (0, _react.useMemo)(()=>markdownToHTML(textAfterVariableReplacement ?? ''), [
137
+ textAfterVariableReplacement
138
+ ]);
139
+ const sanitizedHTML = (0, _react.useMemo)(()=>sanitizeHTML(html), [
140
+ html
141
+ ]);
142
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
143
+ sx: (theme)=>createMarkdownPanelStyles(theme, chartsTheme),
144
+ dangerouslySetInnerHTML: {
145
+ __html: sanitizedHTML
146
+ }
147
+ });
148
+ }
@@ -0,0 +1,58 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "MarkdownPanelOptionsEditor", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return MarkdownPanelOptionsEditor;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _material = require("@mui/material");
25
+ const MARKDOWN_GUIDE_URL = 'https://commonmark.org/help/';
26
+ const TEXT_INPUT_NUM_ROWS = 20;
27
+ function MarkdownPanelOptionsEditor(props) {
28
+ const { onChange, value: { text } } = props;
29
+ const handleChange = (e)=>{
30
+ onChange({
31
+ text: e.target.value
32
+ });
33
+ };
34
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
35
+ spacing: 1,
36
+ children: [
37
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Link, {
38
+ sx: {
39
+ alignSelf: 'end',
40
+ textDecoration: 'none'
41
+ },
42
+ href: MARKDOWN_GUIDE_URL,
43
+ target: "_blank",
44
+ rel: "noopener",
45
+ children: "Markdown Guide"
46
+ }),
47
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
48
+ label: "Text",
49
+ // Multiline
50
+ multiline: true,
51
+ rows: TEXT_INPUT_NUM_ROWS,
52
+ // Value
53
+ value: text,
54
+ onChange: handleChange
55
+ })
56
+ ]
57
+ });
58
+ }
@@ -0,0 +1,26 @@
1
+ // Copyright 2024 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ const _jsxruntime = require("react/jsx-runtime");
18
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
19
+ const _client = /*#__PURE__*/ _interop_require_default(require("react-dom/client"));
20
+ function _interop_require_default(obj) {
21
+ return obj && obj.__esModule ? obj : {
22
+ default: obj
23
+ };
24
+ }
25
+ const root = _client.default.createRoot(document.getElementById('root'));
26
+ root.render(/*#__PURE__*/ (0, _jsxruntime.jsx)(_react.default.StrictMode, {}));
@@ -0,0 +1,14 @@
1
+ // Copyright 2024 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ /// <reference types="@rsbuild/core/types" />
14
+ "use strict";
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getPluginModule", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return getPluginModule;
9
+ }
10
+ });
11
+ const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
12
+ function _interop_require_default(obj) {
13
+ return obj && obj.__esModule ? obj : {
14
+ default: obj
15
+ };
16
+ }
17
+ function getPluginModule() {
18
+ const { name, version, perses } = _packagejson.default;
19
+ return {
20
+ kind: 'PluginModule',
21
+ metadata: {
22
+ name,
23
+ version
24
+ },
25
+ spec: perses
26
+ };
27
+ }
@@ -0,0 +1,55 @@
1
+ // Copyright 2024 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ function _getRequireWildcardCache(nodeInterop) {
15
+ if (typeof WeakMap !== "function") return null;
16
+ var cacheBabelInterop = new WeakMap();
17
+ var cacheNodeInterop = new WeakMap();
18
+ return (_getRequireWildcardCache = function(nodeInterop) {
19
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
20
+ })(nodeInterop);
21
+ }
22
+ function _interop_require_wildcard(obj, nodeInterop) {
23
+ if (!nodeInterop && obj && obj.__esModule) {
24
+ return obj;
25
+ }
26
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
27
+ return {
28
+ default: obj
29
+ };
30
+ }
31
+ var cache = _getRequireWildcardCache(nodeInterop);
32
+ if (cache && cache.has(obj)) {
33
+ return cache.get(obj);
34
+ }
35
+ var newObj = {
36
+ __proto__: null
37
+ };
38
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
39
+ for(var key in obj){
40
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
41
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
42
+ if (desc && (desc.get || desc.set)) {
43
+ Object.defineProperty(newObj, key, desc);
44
+ } else {
45
+ newObj[key] = obj[key];
46
+ }
47
+ }
48
+ }
49
+ newObj.default = obj;
50
+ if (cache) {
51
+ cache.set(obj, newObj);
52
+ }
53
+ return newObj;
54
+ }
55
+ Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getPluginModule", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _getPluginModule.getPluginModule;
9
+ }
10
+ });
11
+ const _getPluginModule = require("./getPluginModule");
12
+ _export_star(require("./Markdown"), exports);
13
+ _export_star(require("./markdown-panel-model"), exports);
14
+ _export_star(require("./MarkdownPanel"), exports);
15
+ _export_star(require("./MarkdownPanelOptionsEditor"), exports);
16
+ function _export_star(from, to) {
17
+ Object.keys(from).forEach(function(k) {
18
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
19
+ Object.defineProperty(to, k, {
20
+ enumerable: true,
21
+ get: function() {
22
+ return from[k];
23
+ }
24
+ });
25
+ }
26
+ });
27
+ return from;
28
+ }
@@ -0,0 +1,27 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "createInitialMarkdownPanelOptions", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return createInitialMarkdownPanelOptions;
21
+ }
22
+ });
23
+ function createInitialMarkdownPanelOptions() {
24
+ return {
25
+ text: ''
26
+ };
27
+ }
@@ -0,0 +1,19 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ require("@testing-library/jest-dom");
18
+ // Always mock e-charts during tests since we don't have a proper canvas in jsdom
19
+ jest.mock('echarts/core');
package/lib/env.d.js ADDED
@@ -0,0 +1,15 @@
1
+ // Copyright 2024 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ /// <reference types="@rsbuild/core/types" />
14
+
15
+ //# sourceMappingURL=env.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/env.d.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/// <reference types=\"@rsbuild/core/types\" />\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,6CAA6C"}
@@ -0,0 +1,6 @@
1
+ import { PluginModuleResource } from '@perses-dev/plugin-system';
2
+ /**
3
+ * Returns the plugin module information from package.json
4
+ */
5
+ export declare function getPluginModule(): PluginModuleResource;
6
+ //# sourceMappingURL=getPluginModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPluginModule.d.ts","sourceRoot":"","sources":["../../src/getPluginModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AAGnF;;GAEG;AACH,wBAAgB,eAAe,IAAI,oBAAoB,CAUtD"}
@@ -0,0 +1,16 @@
1
+ import packageJson from '../package.json';
2
+ /**
3
+ * Returns the plugin module information from package.json
4
+ */ export function getPluginModule() {
5
+ const { name, version, perses } = packageJson;
6
+ return {
7
+ kind: 'PluginModule',
8
+ metadata: {
9
+ name,
10
+ version
11
+ },
12
+ spec: perses
13
+ };
14
+ }
15
+
16
+ //# sourceMappingURL=getPluginModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["import { PluginModuleResource, PluginModuleSpec } from '@perses-dev/plugin-system';\nimport packageJson from '../package.json';\n\n/**\n * Returns the plugin module information from package.json\n */\nexport function getPluginModule(): PluginModuleResource {\n const { name, version, perses } = packageJson;\n return {\n kind: 'PluginModule',\n metadata: {\n name,\n version,\n },\n spec: perses as PluginModuleSpec,\n };\n}\n"],"names":["packageJson","getPluginModule","name","version","perses","kind","metadata","spec"],"mappings":"AACA,OAAOA,iBAAiB,kBAAkB;AAE1C;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGJ;IAClC,OAAO;QACLK,MAAM;QACNC,UAAU;YACRJ;YACAC;QACF;QACAI,MAAMH;IACR;AACF"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index-federation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-federation.d.ts","sourceRoot":"","sources":["../../src/index-federation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ // Copyright 2024 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import('./bootstrap');
14
+
15
+ //# sourceMappingURL=index-federation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index-federation.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport('./bootstrap');\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,MAAM,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export { getPluginModule } from './getPluginModule';
2
+ export * from './Markdown';
3
+ export * from './markdown-panel-model';
4
+ export * from './MarkdownPanel';
5
+ export * from './MarkdownPanelOptionsEditor';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export { getPluginModule } from './getPluginModule';
2
+ export * from './Markdown';
3
+ export * from './markdown-panel-model';
4
+ export * from './MarkdownPanel';
5
+ export * from './MarkdownPanelOptionsEditor';
6
+
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getPluginModule } from './getPluginModule';\nexport * from './Markdown';\nexport * from './markdown-panel-model';\nexport * from './MarkdownPanel';\nexport * from './MarkdownPanelOptionsEditor';\n"],"names":["getPluginModule"],"mappings":"AAAA,SAASA,eAAe,QAAQ,oBAAoB;AACpD,cAAc,aAAa;AAC3B,cAAc,yBAAyB;AACvC,cAAc,kBAAkB;AAChC,cAAc,+BAA+B"}
@@ -0,0 +1,12 @@
1
+ import { Definition } from '@perses-dev/core';
2
+ /**
3
+ * The schema for a Markdown panel.
4
+ */
5
+ export interface MarkdownPanelDefinition extends Definition<MarkdownPanelOptions> {
6
+ kind: 'Markdown';
7
+ }
8
+ export interface MarkdownPanelOptions {
9
+ text: string;
10
+ }
11
+ export declare function createInitialMarkdownPanelOptions(): MarkdownPanelOptions;
12
+ //# sourceMappingURL=markdown-panel-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-panel-model.d.ts","sourceRoot":"","sources":["../../src/markdown-panel-model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,UAAU,CAAC,oBAAoB,CAAC;IAC/E,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,iCAAiC,IAAI,oBAAoB,CAExE"}
@@ -0,0 +1,19 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export function createInitialMarkdownPanelOptions() {
14
+ return {
15
+ text: ''
16
+ };
17
+ }
18
+
19
+ //# sourceMappingURL=markdown-panel-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/markdown-panel-model.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Definition } from '@perses-dev/core';\n\n/**\n * The schema for a Markdown panel.\n */\nexport interface MarkdownPanelDefinition extends Definition<MarkdownPanelOptions> {\n kind: 'Markdown';\n}\n\nexport interface MarkdownPanelOptions {\n text: string;\n}\n\nexport function createInitialMarkdownPanelOptions(): MarkdownPanelOptions {\n return { text: '' };\n}\n"],"names":["createInitialMarkdownPanelOptions","text"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAejC,OAAO,SAASA;IACd,OAAO;QAAEC,MAAM;IAAG;AACpB"}
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom';
2
+ //# sourceMappingURL=setup-tests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-tests.d.ts","sourceRoot":"","sources":["../../src/setup-tests.ts"],"names":[],"mappings":"AAaA,OAAO,2BAA2B,CAAC"}
@@ -0,0 +1,17 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import '@testing-library/jest-dom';
14
+ // Always mock e-charts during tests since we don't have a proper canvas in jsdom
15
+ jest.mock('echarts/core');
16
+
17
+ //# sourceMappingURL=setup-tests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/setup-tests.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport '@testing-library/jest-dom';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n"],"names":["jest","mock"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,4BAA4B;AAEnC,iFAAiF;AACjFA,KAAKC,IAAI,CAAC"}