@readme/markdown 6.75.0-beta.57 → 6.75.0-beta.59

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.
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+
3
+ import './style.scss';
4
+
5
+ const Card = ({ children }) => <div className="Card">{children}</div>;
6
+
7
+ const CardsGrid = ({ columns = 2, children }) => {
8
+ columns = columns >= 2 ? columns : 2;
9
+ return (
10
+ <div className="CardsGrid" style={{ gridTemplateColumns: `repeat(${columns}, 1fr)` }}>
11
+ {React.Children.map(children, e => (
12
+ <Card>{e}</Card>
13
+ ))}
14
+ </div>
15
+ );
16
+ };
17
+
18
+ export default CardsGrid;
@@ -0,0 +1,12 @@
1
+ .CardsGrid {
2
+ display: grid;
3
+ gap: 20px;
4
+
5
+ .Card {
6
+ padding: 10px;
7
+ backdrop-filter: blur(20px);
8
+ border: 1px solid rgba(black, 0.1);
9
+ border-radius: 5px;
10
+ box-shadow: 0 1px 2px #{rgba(black, 0.05)}, 0 2px 5px #{rgba(black, 0.02)};
11
+ }
12
+ }
@@ -35,7 +35,19 @@ const Embed = ({
35
35
  ...attrs
36
36
  }: EmbedProps) => {
37
37
  if (typeof iframe !== 'boolean') iframe = iframe === 'true';
38
- if (html === 'false') html = undefined;
38
+
39
+ if (html) {
40
+ try {
41
+ if (html !== decodeURIComponent(html)) {
42
+ html = decodeURIComponent(html);
43
+ } else if (html === 'false') {
44
+ html = undefined;
45
+ }
46
+ } catch (e) {
47
+ // html wasn't HTML apparently
48
+ html = undefined;
49
+ }
50
+ }
39
51
 
40
52
  if (iframe) {
41
53
  return <iframe {...attrs} src={url} style={{ border: 'none', display: 'flex', margin: 'auto' }} />;
@@ -54,7 +66,7 @@ const Embed = ({
54
66
  return (
55
67
  <div className={classes.join(' ')}>
56
68
  {html ? (
57
- <div className="embed-media" dangerouslySetInnerHTML={{ __html: decodeURIComponent(html) }} />
69
+ <div className="embed-media" dangerouslySetInnerHTML={{ __html: html }} />
58
70
  ) : (
59
71
  <a className="embed-link" href={url} rel="noopener noreferrer" target="_blank">
60
72
  {!image || <img alt={title} className="embed-img" loading={lazy ? 'lazy' : undefined} src={image} />}
@@ -1,5 +1,6 @@
1
1
  export { default as Anchor } from './Anchor';
2
2
  export { default as Callout } from './Callout';
3
+ export { default as Cards } from './CardsGrid';
3
4
  export { default as Code } from './Code';
4
5
  export { default as CodeTabs } from './CodeTabs';
5
6
  export { default as Embed } from './Embed';
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './style.scss';
3
+ declare const CardsGrid: ({ columns, children }: {
4
+ columns?: number;
5
+ children: any;
6
+ }) => React.JSX.Element;
7
+ export default CardsGrid;
@@ -1,5 +1,6 @@
1
1
  export { default as Anchor } from './Anchor';
2
2
  export { default as Callout } from './Callout';
3
+ export { default as Cards } from './CardsGrid';
3
4
  export { default as Code } from './Code';
4
5
  export { default as CodeTabs } from './CodeTabs';
5
6
  export { default as Embed } from './Embed';
package/dist/main.css CHANGED
@@ -1,3 +1,4 @@
1
+ .CardsGrid{display:grid;gap:20px}.CardsGrid .Card{padding:10px;backdrop-filter:blur(20px);border:1px solid rgba(0,0,0,.1);border-radius:5px;box-shadow:0 1px 2px rgba(0, 0, 0, 0.05),0 2px 5px rgba(0, 0, 0, 0.02)}
1
2
  /* BASICS */
2
3
 
3
4
  .CodeMirror {
package/dist/main.js CHANGED
@@ -13984,6 +13984,7 @@ __webpack_require__.r(components_namespaceObject);
13984
13984
  __webpack_require__.d(components_namespaceObject, {
13985
13985
  Anchor: () => (components_Anchor),
13986
13986
  Callout: () => (components_Callout),
13987
+ Cards: () => (components_CardsGrid),
13987
13988
  Code: () => (components_Code),
13988
13989
  CodeTabs: () => (components_CodeTabs),
13989
13990
  Embed: () => (components_Embed),
@@ -14211,6 +14212,16 @@ const Callout = (props) => {
14211
14212
  };
14212
14213
  /* harmony default export */ const components_Callout = (Callout);
14213
14214
 
14215
+ ;// CONCATENATED MODULE: ./components/CardsGrid/index.tsx
14216
+
14217
+
14218
+ const Card = ({ children }) => external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "Card" }, children);
14219
+ const CardsGrid = ({ columns = 2, children }) => {
14220
+ columns = columns >= 2 ? columns : 2;
14221
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "CardsGrid", style: { gridTemplateColumns: `repeat(${columns}, 1fr)` } }, external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().Children.map(children, e => (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Card, null, e)))));
14222
+ };
14223
+ /* harmony default export */ const components_CardsGrid = (CardsGrid);
14224
+
14214
14225
  // EXTERNAL MODULE: ./node_modules/copy-to-clipboard/index.js
14215
14226
  var copy_to_clipboard = __webpack_require__(7965);
14216
14227
  var copy_to_clipboard_default = /*#__PURE__*/__webpack_require__.n(copy_to_clipboard);
@@ -14306,8 +14317,20 @@ const Embed = (_a) => {
14306
14317
  var { lazy = true, url, html, providerName, providerUrl, title, iframe, image, favicon } = _a, attrs = __rest(_a, ["lazy", "url", "html", "providerName", "providerUrl", "title", "iframe", "image", "favicon"]);
14307
14318
  if (typeof iframe !== 'boolean')
14308
14319
  iframe = iframe === 'true';
14309
- if (html === 'false')
14310
- html = undefined;
14320
+ if (html) {
14321
+ try {
14322
+ if (html !== decodeURIComponent(html)) {
14323
+ html = decodeURIComponent(html);
14324
+ }
14325
+ else if (html === 'false') {
14326
+ html = undefined;
14327
+ }
14328
+ }
14329
+ catch (e) {
14330
+ // html wasn't HTML apparently
14331
+ html = undefined;
14332
+ }
14333
+ }
14311
14334
  if (iframe) {
14312
14335
  return external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("iframe", Object.assign({}, attrs, { src: url, style: { border: 'none', display: 'flex', margin: 'auto' } }));
14313
14336
  }
@@ -14319,7 +14342,7 @@ const Embed = (_a) => {
14319
14342
  if (!providerName)
14320
14343
  providerName = providerUrl;
14321
14344
  const classes = ['embed', image ? 'embed_hasImg' : ''];
14322
- return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: classes.join(' ') }, html ? (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "embed-media", dangerouslySetInnerHTML: { __html: decodeURIComponent(html) } })) : (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("a", { className: "embed-link", href: url, rel: "noopener noreferrer", target: "_blank" },
14345
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: classes.join(' ') }, html ? (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "embed-media", dangerouslySetInnerHTML: { __html: html } })) : (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("a", { className: "embed-link", href: url, rel: "noopener noreferrer", target: "_blank" },
14323
14346
  !image || external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("img", { alt: title, className: "embed-img", loading: lazy ? 'lazy' : undefined, src: image }),
14324
14347
  title && title !== '@embed' ? (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "embed-body" },
14325
14348
  !favicon || external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Favicon, { alt: providerName, src: favicon }),
@@ -14497,6 +14520,7 @@ function TableOfContents({ children }) {
14497
14520
 
14498
14521
 
14499
14522
 
14523
+
14500
14524
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.to-primitive.js
14501
14525
  var es_symbol_to_primitive = __webpack_require__(6611);
14502
14526
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
package/dist/main.node.js CHANGED
@@ -8997,6 +8997,7 @@ __webpack_require__.r(components_namespaceObject);
8997
8997
  __webpack_require__.d(components_namespaceObject, {
8998
8998
  Anchor: () => (components_Anchor),
8999
8999
  Callout: () => (components_Callout),
9000
+ Cards: () => (components_CardsGrid),
9000
9001
  Code: () => (components_Code),
9001
9002
  CodeTabs: () => (components_CodeTabs),
9002
9003
  Embed: () => (components_Embed),
@@ -9157,6 +9158,16 @@ const Callout = (props) => {
9157
9158
  };
9158
9159
  /* harmony default export */ const components_Callout = (Callout);
9159
9160
 
9161
+ ;// CONCATENATED MODULE: ./components/CardsGrid/index.tsx
9162
+
9163
+
9164
+ const Card = ({ children }) => external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "Card" }, children);
9165
+ const CardsGrid = ({ columns = 2, children }) => {
9166
+ columns = columns >= 2 ? columns : 2;
9167
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "CardsGrid", style: { gridTemplateColumns: `repeat(${columns}, 1fr)` } }, external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().Children.map(children, e => (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Card, null, e)))));
9168
+ };
9169
+ /* harmony default export */ const components_CardsGrid = (CardsGrid);
9170
+
9160
9171
  // EXTERNAL MODULE: ./node_modules/copy-to-clipboard/index.js
9161
9172
  var copy_to_clipboard = __webpack_require__(965);
9162
9173
  var copy_to_clipboard_default = /*#__PURE__*/__webpack_require__.n(copy_to_clipboard);
@@ -9252,8 +9263,20 @@ const Embed = (_a) => {
9252
9263
  var { lazy = true, url, html, providerName, providerUrl, title, iframe, image, favicon } = _a, attrs = __rest(_a, ["lazy", "url", "html", "providerName", "providerUrl", "title", "iframe", "image", "favicon"]);
9253
9264
  if (typeof iframe !== 'boolean')
9254
9265
  iframe = iframe === 'true';
9255
- if (html === 'false')
9256
- html = undefined;
9266
+ if (html) {
9267
+ try {
9268
+ if (html !== decodeURIComponent(html)) {
9269
+ html = decodeURIComponent(html);
9270
+ }
9271
+ else if (html === 'false') {
9272
+ html = undefined;
9273
+ }
9274
+ }
9275
+ catch (e) {
9276
+ // html wasn't HTML apparently
9277
+ html = undefined;
9278
+ }
9279
+ }
9257
9280
  if (iframe) {
9258
9281
  return external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("iframe", Object.assign({}, attrs, { src: url, style: { border: 'none', display: 'flex', margin: 'auto' } }));
9259
9282
  }
@@ -9265,7 +9288,7 @@ const Embed = (_a) => {
9265
9288
  if (!providerName)
9266
9289
  providerName = providerUrl;
9267
9290
  const classes = ['embed', image ? 'embed_hasImg' : ''];
9268
- return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: classes.join(' ') }, html ? (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "embed-media", dangerouslySetInnerHTML: { __html: decodeURIComponent(html) } })) : (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("a", { className: "embed-link", href: url, rel: "noopener noreferrer", target: "_blank" },
9291
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: classes.join(' ') }, html ? (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "embed-media", dangerouslySetInnerHTML: { __html: html } })) : (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("a", { className: "embed-link", href: url, rel: "noopener noreferrer", target: "_blank" },
9269
9292
  !image || external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("img", { alt: title, className: "embed-img", loading: lazy ? 'lazy' : undefined, src: image }),
9270
9293
  title && title !== '@embed' ? (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "embed-body" },
9271
9294
  !favicon || external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Favicon, { alt: providerName, src: favicon }),
@@ -14387,6 +14410,7 @@ function TableOfContents({ children }) {
14387
14410
 
14388
14411
 
14389
14412
 
14413
+
14390
14414
  ;// CONCATENATED MODULE: ./options.js
14391
14415
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14392
14416
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@readme/markdown",
3
3
  "description": "ReadMe's React-based Markdown parser",
4
4
  "author": "Rafe Goldberg <rafe@readme.io>",
5
- "version": "6.75.0-beta.57",
5
+ "version": "6.75.0-beta.59",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",