@patternfly/quickstarts 2.3.0 → 2.3.1
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/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.d.ts +1 -1
- package/dist/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.d.ts +1 -1
- package/dist/index.es.js +13 -12
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +13 -12
- package/dist/index.js.map +1 -1
- package/dist/quickstarts-base.css +24 -24
- package/dist/quickstarts-full.es.js +13 -12
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts.css +24 -24
- package/dist/quickstarts.min.css +1 -1
- package/package.json +1 -1
- package/src/ConsoleShared/src/components/markdown-extensions/MarkdownCopyClipboard.tsx +2 -2
- package/src/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.tsx +5 -11
- package/src/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.tsx +5 -11
package/dist/index.js
CHANGED
|
@@ -1243,12 +1243,13 @@ const CopyClipboard = ({ element, rootSelector, docContext, }) => {
|
|
|
1243
1243
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1244
1244
|
const [showSuccessContent, setShowSuccessContent] = React__namespace.useState(false);
|
|
1245
1245
|
const textToCopy = React__namespace.useMemo(() => {
|
|
1246
|
+
var _a;
|
|
1246
1247
|
const copyTextId = element.getAttribute(MARKDOWN_COPY_BUTTON_ID);
|
|
1247
|
-
return docContext.querySelector(`${rootSelector} [${MARKDOWN_SNIPPET_ID}="${copyTextId}"]`).innerText;
|
|
1248
|
+
return (_a = docContext.querySelector(`${rootSelector} [${MARKDOWN_SNIPPET_ID}="${copyTextId}"]`)) === null || _a === void 0 ? void 0 : _a.innerText;
|
|
1248
1249
|
}, [element, docContext, rootSelector]);
|
|
1249
1250
|
useEventListener(element, 'click', React__namespace.useCallback(() => {
|
|
1250
1251
|
navigator.clipboard
|
|
1251
|
-
.writeText(textToCopy)
|
|
1252
|
+
.writeText(textToCopy.trim())
|
|
1252
1253
|
.then(() => {
|
|
1253
1254
|
setShowSuccessContent(true);
|
|
1254
1255
|
})
|
|
@@ -1275,16 +1276,16 @@ const useInlineCopyClipboardShowdownExtension = () => {
|
|
|
1275
1276
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1276
1277
|
return React__namespace.useMemo(() => ({
|
|
1277
1278
|
type: 'lang',
|
|
1278
|
-
regex:
|
|
1279
|
-
replace: (text, group,
|
|
1280
|
-
if (!group ||
|
|
1279
|
+
regex: /`([^`](.*?)[^`])`{{copy}}/g,
|
|
1280
|
+
replace: (text, group, _, groupId) => {
|
|
1281
|
+
if (!group || isNaN(groupId)) {
|
|
1281
1282
|
return text;
|
|
1282
1283
|
}
|
|
1283
1284
|
return removeTemplateWhitespace(`<span class="pf-c-clipboard-copy pf-m-inline">
|
|
1284
|
-
<span class="pf-c-clipboard-copy__text" ${MARKDOWN_SNIPPET_ID}="${
|
|
1285
|
+
<span class="pf-c-clipboard-copy__text" ${MARKDOWN_SNIPPET_ID}="${groupId}">${group}</span>
|
|
1285
1286
|
<span class="pf-c-clipboard-copy__actions">
|
|
1286
1287
|
<span class="pf-c-clipboard-copy__actions-item">
|
|
1287
|
-
<button class="pf-c-button pf-m-plain" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${
|
|
1288
|
+
<button class="pf-c-button pf-m-plain" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${groupId}">
|
|
1288
1289
|
${server.renderToStaticMarkup(React__namespace.createElement(CopyIcon__default['default'], null))}
|
|
1289
1290
|
</button>
|
|
1290
1291
|
</span>
|
|
@@ -1298,16 +1299,16 @@ const useMultilineCopyClipboardShowdownExtension = () => {
|
|
|
1298
1299
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1299
1300
|
return React__namespace.useMemo(() => ({
|
|
1300
1301
|
type: 'lang',
|
|
1301
|
-
regex: /```[\n]((
|
|
1302
|
-
replace: (text, group,
|
|
1303
|
-
if (!group ||
|
|
1302
|
+
regex: /```[\n]\s*((((?!```).)*?\n)+)\s*```{{copy}}/g,
|
|
1303
|
+
replace: (text, group, _1, _2, groupId) => {
|
|
1304
|
+
if (!group || isNaN(groupId)) {
|
|
1304
1305
|
return text;
|
|
1305
1306
|
}
|
|
1306
1307
|
return `<div class="pf-c-code-block">
|
|
1307
1308
|
<div class="pf-c-code-block__header">
|
|
1308
1309
|
<div class="pf-c-code-block__actions">
|
|
1309
1310
|
<div class="pf-c-code-block__actions-item">
|
|
1310
|
-
<button class="pf-c-button pf-m-plain" type="button" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${
|
|
1311
|
+
<button class="pf-c-button pf-m-plain" type="button" aria-label="${getResource('Copy to clipboard')}" ${MARKDOWN_COPY_BUTTON_ID}="${groupId}">
|
|
1311
1312
|
${server.renderToStaticMarkup(React__namespace.createElement(CopyIcon__default['default'], null))}
|
|
1312
1313
|
</button>
|
|
1313
1314
|
</div>
|
|
@@ -1316,7 +1317,7 @@ const useMultilineCopyClipboardShowdownExtension = () => {
|
|
|
1316
1317
|
<div class="pf-c-code-block__content">
|
|
1317
1318
|
<pre class="pf-c-code-block__pre pfext-code-block__pre">
|
|
1318
1319
|
<code class="pf-c-code-block__code"
|
|
1319
|
-
${MARKDOWN_SNIPPET_ID}="${
|
|
1320
|
+
${MARKDOWN_SNIPPET_ID}="${groupId}">${group.trim()}</code>
|
|
1320
1321
|
</pre>
|
|
1321
1322
|
</div>
|
|
1322
1323
|
</div>`;
|