@sendbird/actionbook-core 0.10.6 → 0.10.7

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
@@ -1,5 +1,5 @@
1
- import { B as BlockNode, a as BlockquoteNode, b as BoldMark, L as ListItemNode, c as BulletListNode, C as CodeMark, D as DocumentNode, H as HardBreakNode, I as InlineNode, d as HeadingNode, e as HorizontalRuleNode, f as ItalicMark, J as JinjaIfBranch, g as JinjaIfBlockNode, h as JinjaIfInlineNode, i as JumpPointNode, j as LinkMark, N as NoteBlockNode, O as OrderedListNode, P as ParagraphNode, R as ResourceTagType, k as ResourceTagNode, S as StrikethroughMark, T as TableRowNode, l as TableNode, m as TableCellNode, M as Mark, n as TextNode, U as UnderlineMark, A as AstNode, o as NodePath, p as LintRule, q as LintContext, r as LintResult, s as LlmLintRule, t as LlmCompletionEndpoint, u as LintSection } from './types-DK_GhIWZ.js';
2
- export { v as JSONContent, w as JUMP_POINT_ID_PATTERN, x as LintSeverity, y as RESOURCE_TAG_TYPES, z as fromProseMirrorJSON } from './types-DK_GhIWZ.js';
1
+ import { B as BlockNode, a as BlockquoteNode, b as BoldMark, L as ListItemNode, c as BulletListNode, C as CodeMark, D as DocumentNode, H as HardBreakNode, I as InlineNode, d as HeadingNode, e as HorizontalRuleNode, f as ItalicMark, J as JinjaIfBranch, g as JinjaIfBlockNode, h as JinjaIfInlineNode, i as JumpPointNode, j as LinkMark, N as NoteBlockNode, O as OrderedListNode, P as ParagraphNode, R as ResourceTagType, k as ResourceTagNode, S as StrikethroughMark, T as TableRowNode, l as TableNode, m as TableCellNode, M as Mark, n as TextNode, U as UnderlineMark, A as AstNode, o as NodePath, p as LintRule, q as LintContext, r as LintResult, s as LlmLintRule, t as LlmCompletionEndpoint, u as LintSection } from './types-BQ95zx4j.js';
2
+ export { v as JSONContent, w as JUMP_POINT_ID_PATTERN, x as LintSeverity, y as RESOURCE_TAG_TYPES, z as fromProseMirrorJSON } from './types-BQ95zx4j.js';
3
3
  import { Root } from 'mdast';
4
4
 
5
5
  declare const bold: () => BoldMark;
package/dist/index.js CHANGED
@@ -2434,13 +2434,21 @@ function blockToMdast(node, depth = 0) {
2434
2434
  ];
2435
2435
  }
2436
2436
  case "orderedList": {
2437
- const items = node.content.map((li) => listItemToMdast(li, depth + 1));
2437
+ const spread = node.spread ?? false;
2438
+ let counter = node.start;
2439
+ const items = node.content.map((li) => {
2440
+ const mdastLi = listItemToMdast(li, depth + 1);
2441
+ if (li.value != null) counter = li.value;
2442
+ mdastLi._ordinalValue = counter;
2443
+ counter++;
2444
+ return mdastLi;
2445
+ });
2438
2446
  return [
2439
2447
  {
2440
2448
  type: "list",
2441
2449
  ordered: true,
2442
- start: node.start,
2443
- spread: node.spread ?? false,
2450
+ start: node.content[0]?.value ?? node.start,
2451
+ spread,
2444
2452
  children: items
2445
2453
  }
2446
2454
  ];
@@ -2940,10 +2948,24 @@ function linkHandler(node, parent, state, info) {
2940
2948
  const titlePart = title ? ` "${title.replace(/"/g, '\\"')}"` : "";
2941
2949
  return `[${childrenText}](${url}${titlePart})`;
2942
2950
  }
2951
+ function listItemHandler(node, parent, state, info) {
2952
+ const value = node._ordinalValue;
2953
+ if (value != null && parent && parent.ordered) {
2954
+ const list = parent;
2955
+ const savedStart = list.start;
2956
+ const idx = list.children.indexOf(node);
2957
+ list.start = value - idx;
2958
+ const result = defaultHandlers3.listItem(node, parent, state, info);
2959
+ list.start = savedStart;
2960
+ return result;
2961
+ }
2962
+ return defaultHandlers3.listItem(node, parent, state, info);
2963
+ }
2943
2964
  function serializeToMarkdown(doc2) {
2944
2965
  const mdastTree = toMdast(doc2);
2945
2966
  const raw = toMarkdown(mdastTree, {
2946
2967
  bullet: "-",
2968
+ bulletOrdered: ".",
2947
2969
  rule: "-",
2948
2970
  listItemIndent: "one",
2949
2971
  incrementListMarker: true,
@@ -2959,6 +2981,7 @@ function serializeToMarkdown(doc2) {
2959
2981
  handlers: {
2960
2982
  text: textHandler,
2961
2983
  link: linkHandler,
2984
+ listItem: listItemHandler,
2962
2985
  ...resourceTagToMarkdown().handlers,
2963
2986
  ...jumpPointToMarkdown().handlers
2964
2987
  },
@@ -3174,6 +3197,10 @@ function convertPMListItem(node, depth = 0) {
3174
3197
  if (typeof checked === "boolean") {
3175
3198
  base.checked = checked;
3176
3199
  }
3200
+ const value = node.attrs?.value;
3201
+ if (value != null) {
3202
+ base.value = value;
3203
+ }
3177
3204
  return base;
3178
3205
  }
3179
3206
  function fromProseMirrorJSON(pmJSON) {