@sendbird/actionbook-core 0.10.7 → 0.10.8

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.js CHANGED
@@ -2934,6 +2934,14 @@ var gfmNoAutolinkToMarkdown = () => ({
2934
2934
  function isEmptyParagraph(node) {
2935
2935
  return node.type === "paragraph" && (!("children" in node) || !node.children || node.children.length === 0);
2936
2936
  }
2937
+ var JINJA_TAG_RE = /^\{%\s*(if|elif|else|endif)\b/;
2938
+ function isJinjaTagParagraph(node) {
2939
+ if (node.type !== "paragraph") return false;
2940
+ const children = node.children;
2941
+ if (!children || children.length !== 1) return false;
2942
+ const child = children[0];
2943
+ return child.type === "text" && typeof child.value === "string" && JINJA_TAG_RE.test(child.value);
2944
+ }
2937
2945
  function textHandler(node, parent, state, info) {
2938
2946
  const originalUnsafe = state.unsafe;
2939
2947
  state.unsafe = originalUnsafe.filter((p) => !(p.character === "_" && !p.atBreak));
@@ -2976,7 +2984,10 @@ function serializeToMarkdown(doc2) {
2976
2984
  // Empty paragraphs represent blank-line spacers.
2977
2985
  // Reduce the separator after an empty paragraph from \n\n to \n
2978
2986
  // so that 1 empty paragraph = 1 extra blank line in the output.
2979
- (left) => isEmptyParagraph(left) ? 0 : null
2987
+ (left) => isEmptyParagraph(left) ? 0 : null,
2988
+ // Consecutive paragraphs: single newline instead of blank line
2989
+ // (skip jinja tag paragraphs — they need blank lines for proper roundtrip)
2990
+ (left, right) => left.type === "paragraph" && right.type === "paragraph" && !isJinjaTagParagraph(left) && !isJinjaTagParagraph(right) ? 0 : null
2980
2991
  ],
2981
2992
  handlers: {
2982
2993
  text: textHandler,
@@ -3737,6 +3748,11 @@ function tokenize(input) {
3737
3748
  i++;
3738
3749
  continue;
3739
3750
  }
3751
+ if (input[i] === ",") {
3752
+ tokens.push({ type: "COMMA", value: "," });
3753
+ i++;
3754
+ continue;
3755
+ }
3740
3756
  return { tokens: [], error: `Unexpected character: ${input[i]}` };
3741
3757
  }
3742
3758
  tokens.push({ type: "EOF", value: "" });
@@ -3867,6 +3883,17 @@ var Parser = class {
3867
3883
  return null;
3868
3884
  case "IDENT": {
3869
3885
  this.advance();
3886
+ if (this.peek().type === "LPAREN") {
3887
+ this.advance();
3888
+ while (this.peek().type !== "RPAREN" && this.peek().type !== "EOF") {
3889
+ this.orExpr();
3890
+ if (this.peek().type === "COMMA") {
3891
+ this.advance();
3892
+ }
3893
+ }
3894
+ this.expect("RPAREN");
3895
+ return null;
3896
+ }
3870
3897
  return this.resolveVariable(t.value);
3871
3898
  }
3872
3899
  case "LPAREN": {