@brillout/docpress 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.d.ts CHANGED
@@ -152,7 +152,7 @@ declare function Sponsors(): JSX.Element;
152
152
 
153
153
  declare function CodeBlock({ children, lineBreak }: {
154
154
  children: any;
155
- lineBreak?: true;
155
+ lineBreak?: 'white-space' | 'break-word';
156
156
  }): JSX.Element;
157
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 };
package/dist/index.js CHANGED
@@ -585,15 +585,18 @@ function isIndividual(sponsor) {
585
585
  // src/components/CodeBlock.tsx
586
586
  import React9 from "react";
587
587
  function CodeBlock({ children, lineBreak }) {
588
- assert(lineBreak, "`lineBreak: true` is currently the only use case for <CodeBlock>");
588
+ assert(
589
+ lineBreak === "white-space" || lineBreak === "break-word",
590
+ "`lineBreak` is currently the only use case for <CodeBlock>"
591
+ );
589
592
  const style = {};
590
593
  if (lineBreak) {
591
- objectAssign(style, {
592
- wordWrap: "break-word",
593
- wordBreak: "break-all",
594
- whiteSpace: "initial",
595
- paddingRight: "16px !important"
596
- });
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
+ }
597
600
  }
598
601
  return /* @__PURE__ */ React9.createElement("pre", null, /* @__PURE__ */ React9.createElement("code", {
599
602
  style
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.4.14",
3
+ "version": "0.4.15",
4
4
  "scripts": {
5
5
  "// Check types while developing": "",
6
6
  "types": "tsc --noEmit --watch",