@sendbird/actionbook-core 0.10.8 → 0.10.9
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 +14 -9
- package/dist/index.js.map +1 -1
- package/dist/ui/index.js +18 -26
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4692,7 +4692,7 @@ var END_ACTION_TEXTS = /* @__PURE__ */ new Set([
|
|
|
4692
4692
|
function isEndActionTag(tagType, resourceId, text2) {
|
|
4693
4693
|
return tagType === "handoff" || END_ACTION_RESOURCE_IDS.has(resourceId) || END_ACTION_TEXTS.has(text2.toLowerCase());
|
|
4694
4694
|
}
|
|
4695
|
-
function extractInlineItems(content, blockIndex) {
|
|
4695
|
+
function extractInlineItems(content, blockIndex, listItemPath = []) {
|
|
4696
4696
|
const items = [];
|
|
4697
4697
|
for (const node of content) {
|
|
4698
4698
|
if (node.type === "jumpPoint") {
|
|
@@ -4709,22 +4709,26 @@ function extractInlineItems(content, blockIndex) {
|
|
|
4709
4709
|
label: endAction ? `End ${node.text}` : node.text,
|
|
4710
4710
|
blockIndex,
|
|
4711
4711
|
children: [],
|
|
4712
|
-
meta: {
|
|
4712
|
+
meta: {
|
|
4713
|
+
tagType: node.tagType,
|
|
4714
|
+
resourceId: node.resourceId,
|
|
4715
|
+
...listItemPath.length > 0 && { listItemPath: [...listItemPath] }
|
|
4716
|
+
}
|
|
4713
4717
|
});
|
|
4714
4718
|
}
|
|
4715
4719
|
}
|
|
4716
4720
|
return items;
|
|
4717
4721
|
}
|
|
4718
|
-
function extractBlockItems(blocks, startIndex, depth) {
|
|
4722
|
+
function extractBlockItems(blocks, startIndex, depth, listItemPath = [], fixedBlockIndex) {
|
|
4719
4723
|
if (depth > MAX_DEPTH6) return [];
|
|
4720
4724
|
const items = [];
|
|
4721
4725
|
for (let i = 0; i < blocks.length; i++) {
|
|
4722
4726
|
const block = blocks[i];
|
|
4723
|
-
const blockIndex = startIndex + i;
|
|
4727
|
+
const blockIndex = fixedBlockIndex ?? startIndex + i;
|
|
4724
4728
|
switch (block.type) {
|
|
4725
4729
|
case "heading": {
|
|
4726
4730
|
const label = textContent(block) || `Heading ${block.level}`;
|
|
4727
|
-
const inlineItems = extractInlineItems(block.content, blockIndex);
|
|
4731
|
+
const inlineItems = extractInlineItems(block.content, blockIndex, listItemPath);
|
|
4728
4732
|
items.push({
|
|
4729
4733
|
type: "heading",
|
|
4730
4734
|
label,
|
|
@@ -4735,7 +4739,7 @@ function extractBlockItems(blocks, startIndex, depth) {
|
|
|
4735
4739
|
break;
|
|
4736
4740
|
}
|
|
4737
4741
|
case "paragraph": {
|
|
4738
|
-
const inlineItems = extractInlineItems(block.content, blockIndex);
|
|
4742
|
+
const inlineItems = extractInlineItems(block.content, blockIndex, listItemPath);
|
|
4739
4743
|
items.push(...inlineItems);
|
|
4740
4744
|
break;
|
|
4741
4745
|
}
|
|
@@ -4771,14 +4775,15 @@ function extractBlockItems(blocks, startIndex, depth) {
|
|
|
4771
4775
|
}
|
|
4772
4776
|
case "bulletList":
|
|
4773
4777
|
case "orderedList": {
|
|
4774
|
-
for (
|
|
4775
|
-
const
|
|
4778
|
+
for (let liIdx = 0; liIdx < block.content.length; liIdx++) {
|
|
4779
|
+
const li = block.content[liIdx];
|
|
4780
|
+
const childItems = extractBlockItems(li.content, blockIndex, depth + 1, [...listItemPath, liIdx], blockIndex);
|
|
4776
4781
|
items.push(...childItems);
|
|
4777
4782
|
}
|
|
4778
4783
|
break;
|
|
4779
4784
|
}
|
|
4780
4785
|
case "blockquote": {
|
|
4781
|
-
const childItems = extractBlockItems(block.content, blockIndex, depth + 1);
|
|
4786
|
+
const childItems = extractBlockItems(block.content, blockIndex, depth + 1, listItemPath, blockIndex);
|
|
4782
4787
|
items.push(...childItems);
|
|
4783
4788
|
break;
|
|
4784
4789
|
}
|