react-markdown-table-ts 0.4.14 → 0.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +74 -62
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +59 -47
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -1,6 +1,63 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import React__default, { forwardRef, useContext, useRef, useMemo, useEffect } from 'react';
|
3
3
|
|
4
|
+
/******************************************************************************
|
5
|
+
Copyright (c) Microsoft Corporation.
|
6
|
+
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
8
|
+
purpose with or without fee is hereby granted.
|
9
|
+
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
11
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
12
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
13
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
14
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
15
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
16
|
+
PERFORMANCE OF THIS SOFTWARE.
|
17
|
+
***************************************************************************** */
|
18
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
19
|
+
|
20
|
+
var extendStatics = function(d, b) {
|
21
|
+
extendStatics = Object.setPrototypeOf ||
|
22
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
23
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
24
|
+
return extendStatics(d, b);
|
25
|
+
};
|
26
|
+
|
27
|
+
function __extends(d, b) {
|
28
|
+
if (typeof b !== "function" && b !== null)
|
29
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
30
|
+
extendStatics(d, b);
|
31
|
+
function __() { this.constructor = d; }
|
32
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
33
|
+
}
|
34
|
+
|
35
|
+
var __assign = function() {
|
36
|
+
__assign = Object.assign || function __assign(t) {
|
37
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
38
|
+
s = arguments[i];
|
39
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
40
|
+
}
|
41
|
+
return t;
|
42
|
+
};
|
43
|
+
return __assign.apply(this, arguments);
|
44
|
+
};
|
45
|
+
|
46
|
+
function __spreadArray(to, from, pack) {
|
47
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
48
|
+
if (ar || !(i in from)) {
|
49
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
50
|
+
ar[i] = from[i];
|
51
|
+
}
|
52
|
+
}
|
53
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
54
|
+
}
|
55
|
+
|
56
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
57
|
+
var e = new Error(message);
|
58
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
59
|
+
};
|
60
|
+
|
4
61
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
5
62
|
|
6
63
|
function getDefaultExportFromCjs (x) {
|
@@ -4004,52 +4061,6 @@ var Prism$1 = /*@__PURE__*/getDefaultExportFromCjs(prismExports);
|
|
4004
4061
|
|
4005
4062
|
}());
|
4006
4063
|
|
4007
|
-
/******************************************************************************
|
4008
|
-
Copyright (c) Microsoft Corporation.
|
4009
|
-
|
4010
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
4011
|
-
purpose with or without fee is hereby granted.
|
4012
|
-
|
4013
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
4014
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
4015
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
4016
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
4017
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
4018
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
4019
|
-
PERFORMANCE OF THIS SOFTWARE.
|
4020
|
-
***************************************************************************** */
|
4021
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
4022
|
-
|
4023
|
-
var extendStatics = function(d, b) {
|
4024
|
-
extendStatics = Object.setPrototypeOf ||
|
4025
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
4026
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
4027
|
-
return extendStatics(d, b);
|
4028
|
-
};
|
4029
|
-
|
4030
|
-
function __extends(d, b) {
|
4031
|
-
if (typeof b !== "function" && b !== null)
|
4032
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
4033
|
-
extendStatics(d, b);
|
4034
|
-
function __() { this.constructor = d; }
|
4035
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
4036
|
-
}
|
4037
|
-
|
4038
|
-
function __spreadArray(to, from, pack) {
|
4039
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
4040
|
-
if (ar || !(i in from)) {
|
4041
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
4042
|
-
ar[i] = from[i];
|
4043
|
-
}
|
4044
|
-
}
|
4045
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
4046
|
-
}
|
4047
|
-
|
4048
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
4049
|
-
var e = new Error(message);
|
4050
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
4051
|
-
};
|
4052
|
-
|
4053
4064
|
// src/validation.ts
|
4054
4065
|
/**
|
4055
4066
|
* Custom error class for handling Markdown table generation errors.
|
@@ -11803,6 +11814,7 @@ var COPY_BUTTON_STYLES = {
|
|
11803
11814
|
display: 'flex',
|
11804
11815
|
alignItems: 'center',
|
11805
11816
|
justifyContent: 'center',
|
11817
|
+
zIndex: 1,
|
11806
11818
|
'&:hover': {
|
11807
11819
|
backgroundColor: 'rgba(255, 255, 255, 0.2)',
|
11808
11820
|
},
|
@@ -11864,7 +11876,7 @@ var MarkdownTable = function (_a) {
|
|
11864
11876
|
var handleCopy = function () {
|
11865
11877
|
navigator.clipboard.writeText(markdownTableSyntax);
|
11866
11878
|
};
|
11867
|
-
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("style", { children: theme === 'light' ? LIGHT_THEME_CSS : DARK_THEME_CSS }), jsxRuntimeExports.jsxs("div", { style: { position: 'relative' }, children: [jsxRuntimeExports.jsx("button", { onClick: handleCopy, style: COPY_BUTTON_STYLES, title: "Copy to clipboard", "aria-label": "Copy to clipboard", children: jsxRuntimeExports.jsx(ContentCopyIcon, { fontSize: "small" }) }), jsxRuntimeExports.jsx("pre", { ref: preElementRef, className: "".concat(className, " language-markdown line-numbers ").concat(theme === 'dark' ? 'dark-theme' : ''), style: preStyle, children: jsxRuntimeExports.jsx("code", { className: "language-markdown", role: "code", children: markdownTableSyntax }) })] })] }));
|
11879
|
+
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("style", { children: theme === 'light' ? LIGHT_THEME_CSS : DARK_THEME_CSS }), jsxRuntimeExports.jsxs("div", { style: { position: 'relative' }, children: [jsxRuntimeExports.jsx("button", { onClick: handleCopy, style: __assign(__assign({}, COPY_BUTTON_STYLES), { color: theme === 'light' ? '#000' : '#fff' }), title: "Copy to clipboard", "aria-label": "Copy to clipboard", children: jsxRuntimeExports.jsx(ContentCopyIcon, { fontSize: "small" }) }), jsxRuntimeExports.jsx("pre", { ref: preElementRef, className: "".concat(className, " language-markdown line-numbers ").concat(theme === 'dark' ? 'dark-theme' : ''), style: preStyle, children: jsxRuntimeExports.jsx("code", { className: "language-markdown", role: "code", children: markdownTableSyntax }) })] })] }));
|
11868
11880
|
};
|
11869
11881
|
|
11870
11882
|
export { MarkdownTable };
|