@brillout/docpress 0.4.15 → 0.4.16

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.d.ts CHANGED
@@ -150,9 +150,10 @@ type DivSize = {
150
150
  };
151
151
  declare function Sponsors(): JSX.Element;
152
152
 
153
- declare function CodeBlock({ children, lineBreak }: {
153
+ type LineBreak = 'white-space' | 'break-word';
154
+ declare function CodeBlockTransformer({ children, lineBreak }: {
154
155
  children: any;
155
- lineBreak?: 'white-space' | 'break-word';
156
+ lineBreak: LineBreak;
156
157
  }): JSX.Element;
157
158
 
158
- export { CodeBlock, Config, Construction, Emoji, EmojiName, HeadingDefinition, HeadingDetachedDefinition, HorizontalLine, ImportMeta, Info, Link, Note, P, ReadingRecommendation, RepoLink, Sponsor, Sponsors, Warning, assert, assertUsage, assertWarning, crawlAllFiles, determineSectionTitle, determineSectionUrlHash, filter, isBrowser, isRepoLink, jsxToTextContent, objectAssign };
159
+ export { CodeBlockTransformer, Config, Construction, Emoji, EmojiName, HeadingDefinition, HeadingDetachedDefinition, HorizontalLine, ImportMeta, Info, Link, Note, P, ReadingRecommendation, RepoLink, Sponsor, Sponsors, Warning, assert, assertUsage, assertWarning, crawlAllFiles, determineSectionTitle, determineSectionUrlHash, filter, isBrowser, isRepoLink, jsxToTextContent, objectAssign };
package/dist/index.js CHANGED
@@ -582,28 +582,20 @@ function isIndividual(sponsor) {
582
582
  return "username" in sponsor;
583
583
  }
584
584
 
585
- // src/components/CodeBlock.tsx
585
+ // src/components/CodeBlockTransformer.tsx
586
586
  import React9 from "react";
587
- function CodeBlock({ children, lineBreak }) {
587
+ function CodeBlockTransformer({ children, lineBreak }) {
588
588
  assert(
589
589
  lineBreak === "white-space" || lineBreak === "break-word",
590
- "`lineBreak` is currently the only use case for <CodeBlock>"
590
+ "`lineBreak` is currently the only use case for <CodeBlockTransformer>"
591
591
  );
592
- const style = {};
593
- if (lineBreak) {
594
- style.whiteSpace = "break-spaces";
595
- style.paddingRight = "16px !important";
596
- if (lineBreak === "break-word") {
597
- style.wordWrap = "break-word";
598
- style.wordBreak = "break-all";
599
- }
600
- }
601
- return /* @__PURE__ */ React9.createElement("pre", null, /* @__PURE__ */ React9.createElement("code", {
602
- style
603
- }, children));
592
+ const className = `with-line-break_${lineBreak}`;
593
+ return /* @__PURE__ */ React9.createElement("div", {
594
+ className
595
+ }, children);
604
596
  }
605
597
  export {
606
- CodeBlock,
598
+ CodeBlockTransformer,
607
599
  Construction,
608
600
  Emoji,
609
601
  FeatureList,
@@ -300,4 +300,15 @@ blockquote > div.paragraph:first-child::before {
300
300
  margin-right: 4px;
301
301
  }
302
302
 
303
+ /* src/components/CodeBlockTransformer.css */
304
+ .with-line-break_white-space code,
305
+ .with-line-break_break-word code {
306
+ white-space: break-spaces;
307
+ padding-right: 16px !important;
308
+ }
309
+ .with-line-break_break-word code {
310
+ word-wrap: break-word;
311
+ word-break: break-all;
312
+ }
313
+
303
314
  /* src/css/index.css */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.4.15",
3
+ "version": "0.4.16",
4
4
  "scripts": {
5
5
  "// Check types while developing": "",
6
6
  "types": "tsc --noEmit --watch",