tsondb 0.20.0 → 0.20.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.
Files changed (2) hide show
  1. package/dist/src/web/488.js +21 -10
  2. package/package.json +1 -1
@@ -3149,6 +3149,13 @@ const isNaturalNumber = (test)=>naturalNumberPattern.test(test);
3149
3149
  function typeSafety_assertExhaustive(_x, msg = "The switch is not exhaustive.") {
3150
3150
  throw new Error(msg);
3151
3151
  }
3152
+ const trySafe = (f, defaultValue)=>{
3153
+ try {
3154
+ return f();
3155
+ } catch {
3156
+ return defaultValue;
3157
+ }
3158
+ };
3152
3159
  const reduceSyntaxNodes = (nodes)=>nodes.reduce((reducedNodes, node, index)=>{
3153
3160
  const lastNode = index > 0 ? reducedNodes[reducedNodes.length - 1] : void 0;
3154
3161
  const newLastNode = lastNode ? mergeSyntaxNodes(lastNode, node) : null;
@@ -4136,7 +4143,12 @@ const TableRow = ({ columns, cells, cellType = "td" })=>{
4136
4143
  });
4137
4144
  };
4138
4145
  const Markdown = ({ class: className, string, outerHeadingLevel, footnoteLabelSuffix, inline })=>{
4139
- const elements = inline ? parseInlineMarkdown(string).map((node, i)=>/*#__PURE__*/ jsxRuntime_module_u(InlineMarkdown, {
4146
+ const elements = inline ? trySafe(()=>parseInlineMarkdown(string), [
4147
+ {
4148
+ type: "text",
4149
+ content: string
4150
+ }
4151
+ ]).map((node, i)=>/*#__PURE__*/ jsxRuntime_module_u(InlineMarkdown, {
4140
4152
  node: node
4141
4153
  }, `md-inline-${i.toString()}`)) : parseBlockMarkdown(string).map((node, i)=>/*#__PURE__*/ jsxRuntime_module_u(BlockMarkdown, {
4142
4154
  node: node,
@@ -5495,7 +5507,12 @@ const BlockMarkdownHighlighting = ({ node })=>{
5495
5507
  }
5496
5508
  };
5497
5509
  const MarkdownHighlighting = ({ class: className, string, inline })=>{
5498
- const blocks = inline ? parseInlineMarkdownForSyntaxHighlighting(string) : parseBlockMarkdownForSyntaxHighlighting(string);
5510
+ const blocks = inline ? trySafe(()=>parseInlineMarkdownForSyntaxHighlighting(string), [
5511
+ {
5512
+ type: "text",
5513
+ content: string
5514
+ }
5515
+ ]) : parseBlockMarkdownForSyntaxHighlighting(string);
5499
5516
  const blockElements = blocks.map((block, i)=>/*#__PURE__*/ jsxRuntime_module_u(BlockMarkdownHighlighting, {
5500
5517
  node: block
5501
5518
  }, `md-block-${i.toString()}`));
@@ -5507,12 +5524,6 @@ const MarkdownHighlighting = ({ class: className, string, inline })=>{
5507
5524
  children: blockElements
5508
5525
  });
5509
5526
  };
5510
- const TextInput = ({ type, ...props })=>"block" === type ? /*#__PURE__*/ jsxRuntime_module_u("textarea", {
5511
- ...props,
5512
- rows: 1
5513
- }) : /*#__PURE__*/ jsxRuntime_module_u("input", {
5514
- type: "text"
5515
- });
5516
5527
  const StringTypeInput = ({ type, value, disabled, onChange, inTranslationObject })=>{
5517
5528
  if ("string" != typeof value) return /*#__PURE__*/ jsxRuntime_module_u(MismatchingTypeError, {
5518
5529
  expected: "string",
@@ -5561,8 +5572,8 @@ const StringTypeInput = ({ type, value, disabled, onChange, inTranslationObject
5561
5572
  /*#__PURE__*/ jsxRuntime_module_u("div", {
5562
5573
  class: "textarea-grow-wrap",
5563
5574
  children: [
5564
- /*#__PURE__*/ jsxRuntime_module_u(TextInput, {
5565
- type: markdown,
5575
+ /*#__PURE__*/ jsxRuntime_module_u("textarea", {
5576
+ rows: 1,
5566
5577
  value: value,
5567
5578
  minLength: minLength,
5568
5579
  maxLength: maxLength,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsondb",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Lukas Obermann",