@supernova-studio/client 0.33.0 → 0.35.0
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.mts +220 -170
- package/dist/index.d.ts +220 -170
- package/dist/index.js +411 -282
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +403 -274
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/yjs/docs-editor/blocks-to-prosemirror.ts +17 -7
- package/src/yjs/docs-editor/index.ts +1 -0
- package/src/yjs/docs-editor/list-tree-builder.ts +23 -82
- package/src/yjs/docs-editor/mock.ts +304 -147
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +109 -66
package/dist/index.mjs
CHANGED
|
@@ -925,7 +925,7 @@ var PageBlockResourceFrameNodeReference = z35.object({
|
|
|
925
925
|
var PageBlockImageReference = z35.object({
|
|
926
926
|
type: PageBlockImageType,
|
|
927
927
|
resource: PageBlockImageResourceReference.optional(),
|
|
928
|
-
|
|
928
|
+
figmaNode: PageBlockResourceFrameNodeReference.optional()
|
|
929
929
|
});
|
|
930
930
|
var PageBlockColorV2 = z35.object({
|
|
931
931
|
value: z35.string(),
|
|
@@ -2061,7 +2061,6 @@ var PageBlockDefinitionProperty = z91.object({
|
|
|
2061
2061
|
name: z91.string(),
|
|
2062
2062
|
type: PageBlockDefinitionPropertyType,
|
|
2063
2063
|
description: z91.string().optional(),
|
|
2064
|
-
// TODO Docs
|
|
2065
2064
|
options: PageBlockDefinitionUntypedPropertyOptions.optional(),
|
|
2066
2065
|
variantOptions: z91.record(PageBlockDefinitionUntypedPropertyOptions).optional()
|
|
2067
2066
|
});
|
|
@@ -5020,8 +5019,12 @@ import { prosemirrorJSONToYXmlFragment } from "y-prosemirror";
|
|
|
5020
5019
|
|
|
5021
5020
|
// src/yjs/docs-editor/list-tree-builder.ts
|
|
5022
5021
|
var ListTreeBuilder = class {
|
|
5023
|
-
|
|
5024
|
-
const
|
|
5022
|
+
addWithProperty(block, multiRichTextProperty) {
|
|
5023
|
+
const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
|
|
5024
|
+
return this.add(block, multiRichTextProperty.id, parsedOptions?.multiRichTextStyle || "OL");
|
|
5025
|
+
}
|
|
5026
|
+
add(block, multiRichTextPropertyId, multiRichTextPropertyStyle) {
|
|
5027
|
+
const list = this.createList(block, multiRichTextPropertyId, multiRichTextPropertyStyle);
|
|
5025
5028
|
if (!this.rootNode) {
|
|
5026
5029
|
this.rootNode = list;
|
|
5027
5030
|
return void 0;
|
|
@@ -5067,69 +5070,9 @@ var ListTreeBuilder = class {
|
|
|
5067
5070
|
}
|
|
5068
5071
|
return currentNode;
|
|
5069
5072
|
}
|
|
5070
|
-
|
|
5071
|
-
// console.log("Next");
|
|
5072
|
-
// const list = this.createList(block, multiRichTextProperty);
|
|
5073
|
-
// if (this.currentList) {
|
|
5074
|
-
// if (this.currentList.listType === list.listType) {
|
|
5075
|
-
// // Merge items into the current list
|
|
5076
|
-
// this.currentList.children.push(...list.leadingChildren);
|
|
5077
|
-
// return undefined;
|
|
5078
|
-
// } else {
|
|
5079
|
-
// // Close the current list and start a new one
|
|
5080
|
-
// if (!this.currentParentList) {
|
|
5081
|
-
// const flushed = this.flush();
|
|
5082
|
-
// this.currentList = list;
|
|
5083
|
-
// return flushed;
|
|
5084
|
-
// } else {
|
|
5085
|
-
// this.currentList = list;
|
|
5086
|
-
// this.currentParentList.children.push(list);
|
|
5087
|
-
// this.parentMap.set(list, this.currentParentList);
|
|
5088
|
-
// return undefined;
|
|
5089
|
-
// }
|
|
5090
|
-
// }
|
|
5091
|
-
// } else {
|
|
5092
|
-
// this.currentList = list;
|
|
5093
|
-
// return undefined;
|
|
5094
|
-
// }
|
|
5095
|
-
// }
|
|
5096
|
-
// stepIn(block: PageBlockEditorModel, multiRichTextProperty: PageBlockDefinitionProperty): void {
|
|
5097
|
-
// console.log("Step in");
|
|
5098
|
-
// if (!this.currentList) {
|
|
5099
|
-
// throw new Error("Cannot step in without a list");
|
|
5100
|
-
// }
|
|
5101
|
-
// const list = this.createList(block, multiRichTextProperty);
|
|
5102
|
-
// this.currentParentList = this.currentList;
|
|
5103
|
-
// this.currentList = list;
|
|
5104
|
-
// this.currentParentList.children.push(list);
|
|
5105
|
-
// this.parentMap.set(list, this.currentParentList);
|
|
5106
|
-
// }
|
|
5107
|
-
// stepOut(block: PageBlockEditorModel, multiRichTextProperty: PageBlockDefinitionProperty): ListNode | undefined {
|
|
5108
|
-
// console.log("Step out");
|
|
5109
|
-
// if (!this.currentList) {
|
|
5110
|
-
// throw new Error("Cannot step out without a list");
|
|
5111
|
-
// }
|
|
5112
|
-
// if (!this.currentParentList) {
|
|
5113
|
-
// throw new Error("Cannot step out without a parent list");
|
|
5114
|
-
// }
|
|
5115
|
-
// const newCurrentList = this.currentParentList;
|
|
5116
|
-
// const newParent = this.parentMap.get(newCurrentList);
|
|
5117
|
-
// this.currentList = newCurrentList;
|
|
5118
|
-
// this.currentParentList = newParent;
|
|
5119
|
-
// return this.next(block, multiRichTextProperty);
|
|
5120
|
-
// }
|
|
5121
|
-
// flush(): ListNode | undefined {
|
|
5122
|
-
// const result = this.currentList;
|
|
5123
|
-
// this.currentList = undefined;
|
|
5124
|
-
// this.currentParentList = undefined;
|
|
5125
|
-
// this.parentMap.clear();
|
|
5126
|
-
// return result;
|
|
5127
|
-
// }
|
|
5128
|
-
createList(block, multiRichTextProperty) {
|
|
5073
|
+
createList(block, multiRichTextPropertyId, multiRichTextPropertyStyle) {
|
|
5129
5074
|
const blockItem = BlockParsingUtils.singleBlockItem(block);
|
|
5130
|
-
const multiRichTextValue = BlockParsingUtils.multiRichTextPropertyValue(blockItem,
|
|
5131
|
-
const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
|
|
5132
|
-
const style = parsedOptions?.multiRichTextStyle ?? "Default";
|
|
5075
|
+
const multiRichTextValue = BlockParsingUtils.multiRichTextPropertyValue(blockItem, multiRichTextPropertyId);
|
|
5133
5076
|
const leadingChildren = multiRichTextValue.value.map((t) => {
|
|
5134
5077
|
return {
|
|
5135
5078
|
type: "ListItem",
|
|
@@ -5141,7 +5084,7 @@ var ListTreeBuilder = class {
|
|
|
5141
5084
|
}
|
|
5142
5085
|
return {
|
|
5143
5086
|
type: "List",
|
|
5144
|
-
listType:
|
|
5087
|
+
listType: multiRichTextPropertyStyle === "OL" ? "Ordered" : "Unordered",
|
|
5145
5088
|
leadingChildren,
|
|
5146
5089
|
block,
|
|
5147
5090
|
children: []
|
|
@@ -5163,20 +5106,23 @@ function pageToProsemirrorDoc(page, definitions) {
|
|
|
5163
5106
|
blockBuffer.push(b);
|
|
5164
5107
|
} else if (b.type === "Section") {
|
|
5165
5108
|
if (blockBuffer.length) {
|
|
5166
|
-
children.push(...
|
|
5109
|
+
children.push(...internalBlocksToProsemirrorNodes(blockBuffer, definitionsMap));
|
|
5167
5110
|
blockBuffer = [];
|
|
5168
5111
|
}
|
|
5169
5112
|
children.push(internalSectionToProsemirrorNode(b, definitionsMap));
|
|
5170
5113
|
}
|
|
5171
5114
|
});
|
|
5172
5115
|
if (blockBuffer.length) {
|
|
5173
|
-
children.push(...
|
|
5116
|
+
children.push(...internalBlocksToProsemirrorNodes(blockBuffer, definitionsMap));
|
|
5174
5117
|
}
|
|
5175
5118
|
return {
|
|
5176
5119
|
type: "doc",
|
|
5177
5120
|
content: children
|
|
5178
5121
|
};
|
|
5179
5122
|
}
|
|
5123
|
+
function blockToProsemirrorNode(block, definition) {
|
|
5124
|
+
return internalBlockToProsemirrorNode(block, definition);
|
|
5125
|
+
}
|
|
5180
5126
|
function internalSectionToProsemirrorNode(section, definitionsMap) {
|
|
5181
5127
|
return {
|
|
5182
5128
|
type: "tabsSection",
|
|
@@ -5198,7 +5144,7 @@ function sectionItemToProsemirrorNode(sectionItem, definitionsMap) {
|
|
|
5198
5144
|
};
|
|
5199
5145
|
}
|
|
5200
5146
|
function sectionColumnToProsemirrorNode(sectionColumn, definitionsMap) {
|
|
5201
|
-
const blocks2 =
|
|
5147
|
+
const blocks2 = internalBlocksToProsemirrorNodes(sectionColumn.blocks, definitionsMap);
|
|
5202
5148
|
if (!blocks2.length) {
|
|
5203
5149
|
blocks2.push({
|
|
5204
5150
|
type: "paragraph",
|
|
@@ -5216,7 +5162,7 @@ function sectionColumnToProsemirrorNode(sectionColumn, definitionsMap) {
|
|
|
5216
5162
|
content: blocks2
|
|
5217
5163
|
};
|
|
5218
5164
|
}
|
|
5219
|
-
function
|
|
5165
|
+
function internalBlocksToProsemirrorNodes(blocks2, definitionsMap) {
|
|
5220
5166
|
const result = [];
|
|
5221
5167
|
const listTreeBuilder = new ListTreeBuilder();
|
|
5222
5168
|
blocks2.forEach((b) => {
|
|
@@ -5227,7 +5173,7 @@ function blocksToProsemirrorNodes(blocks2, definitionsMap) {
|
|
|
5227
5173
|
}
|
|
5228
5174
|
const multiRichTextProp = BlockDefinitionUtils.firstMultiRichTextProperty(definition);
|
|
5229
5175
|
if (multiRichTextProp) {
|
|
5230
|
-
const node = listTreeBuilder.
|
|
5176
|
+
const node = listTreeBuilder.addWithProperty(b, multiRichTextProp);
|
|
5231
5177
|
if (node) {
|
|
5232
5178
|
result.push(serializeAsMultiRichTextBlock(node));
|
|
5233
5179
|
}
|
|
@@ -5236,7 +5182,7 @@ function blocksToProsemirrorNodes(blocks2, definitionsMap) {
|
|
|
5236
5182
|
if (tree2) {
|
|
5237
5183
|
result.push(serializeAsMultiRichTextBlock(tree2));
|
|
5238
5184
|
}
|
|
5239
|
-
const node =
|
|
5185
|
+
const node = internalBlockToProsemirrorNode(b, definition);
|
|
5240
5186
|
node && result.push(node);
|
|
5241
5187
|
}
|
|
5242
5188
|
});
|
|
@@ -5246,7 +5192,7 @@ function blocksToProsemirrorNodes(blocks2, definitionsMap) {
|
|
|
5246
5192
|
}
|
|
5247
5193
|
return result;
|
|
5248
5194
|
}
|
|
5249
|
-
function
|
|
5195
|
+
function internalBlockToProsemirrorNode(block, definition) {
|
|
5250
5196
|
const richTextProperty = BlockDefinitionUtils.firstRichTextProperty(definition);
|
|
5251
5197
|
if (richTextProperty) {
|
|
5252
5198
|
return serializeAsRichTextBlock({
|
|
@@ -5665,7 +5611,7 @@ var blocks = [
|
|
|
5665
5611
|
layout: { type: "Column", children: ["text"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
5666
5612
|
maxColumns: 1,
|
|
5667
5613
|
defaultColumns: 1,
|
|
5668
|
-
appearance: {
|
|
5614
|
+
appearance: { isEditorPresentationDifferent: false }
|
|
5669
5615
|
}
|
|
5670
5616
|
],
|
|
5671
5617
|
defaultVariantKey: "default"
|
|
@@ -5677,7 +5623,12 @@ var blocks = [
|
|
|
5677
5623
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/text/text-HxZ9ssJR"
|
|
5678
5624
|
}
|
|
5679
5625
|
},
|
|
5680
|
-
appearance: {
|
|
5626
|
+
appearance: {
|
|
5627
|
+
isBordered: true,
|
|
5628
|
+
hasBackground: false,
|
|
5629
|
+
isEditorPresentationDifferent: false,
|
|
5630
|
+
showBlockHeaderInEditor: false
|
|
5631
|
+
}
|
|
5681
5632
|
},
|
|
5682
5633
|
{
|
|
5683
5634
|
id: "io.supernova.block.title1",
|
|
@@ -5703,7 +5654,7 @@ var blocks = [
|
|
|
5703
5654
|
layout: { type: "Column", children: ["text"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
5704
5655
|
maxColumns: 1,
|
|
5705
5656
|
defaultColumns: 1,
|
|
5706
|
-
appearance: {
|
|
5657
|
+
appearance: {}
|
|
5707
5658
|
}
|
|
5708
5659
|
],
|
|
5709
5660
|
defaultVariantKey: "default"
|
|
@@ -5715,7 +5666,12 @@ var blocks = [
|
|
|
5715
5666
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY"
|
|
5716
5667
|
}
|
|
5717
5668
|
},
|
|
5718
|
-
appearance: {
|
|
5669
|
+
appearance: {
|
|
5670
|
+
isBordered: true,
|
|
5671
|
+
hasBackground: false,
|
|
5672
|
+
isEditorPresentationDifferent: false,
|
|
5673
|
+
showBlockHeaderInEditor: false
|
|
5674
|
+
}
|
|
5719
5675
|
},
|
|
5720
5676
|
{
|
|
5721
5677
|
id: "io.supernova.block.title2",
|
|
@@ -5741,7 +5697,7 @@ var blocks = [
|
|
|
5741
5697
|
layout: { type: "Column", children: ["text"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
5742
5698
|
maxColumns: 1,
|
|
5743
5699
|
defaultColumns: 1,
|
|
5744
|
-
appearance: {
|
|
5700
|
+
appearance: {}
|
|
5745
5701
|
}
|
|
5746
5702
|
],
|
|
5747
5703
|
defaultVariantKey: "default"
|
|
@@ -5753,7 +5709,12 @@ var blocks = [
|
|
|
5753
5709
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY"
|
|
5754
5710
|
}
|
|
5755
5711
|
},
|
|
5756
|
-
appearance: {
|
|
5712
|
+
appearance: {
|
|
5713
|
+
isBordered: true,
|
|
5714
|
+
hasBackground: false,
|
|
5715
|
+
isEditorPresentationDifferent: false,
|
|
5716
|
+
showBlockHeaderInEditor: false
|
|
5717
|
+
}
|
|
5757
5718
|
},
|
|
5758
5719
|
{
|
|
5759
5720
|
id: "io.supernova.block.title3",
|
|
@@ -5779,7 +5740,7 @@ var blocks = [
|
|
|
5779
5740
|
layout: { type: "Column", children: ["text"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
5780
5741
|
maxColumns: 1,
|
|
5781
5742
|
defaultColumns: 1,
|
|
5782
|
-
appearance: {
|
|
5743
|
+
appearance: {}
|
|
5783
5744
|
}
|
|
5784
5745
|
],
|
|
5785
5746
|
defaultVariantKey: "default"
|
|
@@ -5791,7 +5752,12 @@ var blocks = [
|
|
|
5791
5752
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY"
|
|
5792
5753
|
}
|
|
5793
5754
|
},
|
|
5794
|
-
appearance: {
|
|
5755
|
+
appearance: {
|
|
5756
|
+
isBordered: true,
|
|
5757
|
+
hasBackground: false,
|
|
5758
|
+
isEditorPresentationDifferent: false,
|
|
5759
|
+
showBlockHeaderInEditor: false
|
|
5760
|
+
}
|
|
5795
5761
|
},
|
|
5796
5762
|
{
|
|
5797
5763
|
id: "io.supernova.block.title4",
|
|
@@ -5817,7 +5783,7 @@ var blocks = [
|
|
|
5817
5783
|
layout: { type: "Column", children: ["text"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
5818
5784
|
maxColumns: 1,
|
|
5819
5785
|
defaultColumns: 1,
|
|
5820
|
-
appearance: {
|
|
5786
|
+
appearance: {}
|
|
5821
5787
|
}
|
|
5822
5788
|
],
|
|
5823
5789
|
defaultVariantKey: "default"
|
|
@@ -5829,7 +5795,12 @@ var blocks = [
|
|
|
5829
5795
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY"
|
|
5830
5796
|
}
|
|
5831
5797
|
},
|
|
5832
|
-
appearance: {
|
|
5798
|
+
appearance: {
|
|
5799
|
+
isBordered: true,
|
|
5800
|
+
hasBackground: false,
|
|
5801
|
+
isEditorPresentationDifferent: false,
|
|
5802
|
+
showBlockHeaderInEditor: false
|
|
5803
|
+
}
|
|
5833
5804
|
},
|
|
5834
5805
|
{
|
|
5835
5806
|
id: "io.supernova.block.title5",
|
|
@@ -5855,7 +5826,7 @@ var blocks = [
|
|
|
5855
5826
|
layout: { type: "Column", children: ["text"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
5856
5827
|
maxColumns: 1,
|
|
5857
5828
|
defaultColumns: 1,
|
|
5858
|
-
appearance: {
|
|
5829
|
+
appearance: {}
|
|
5859
5830
|
}
|
|
5860
5831
|
],
|
|
5861
5832
|
defaultVariantKey: "default"
|
|
@@ -5867,7 +5838,12 @@ var blocks = [
|
|
|
5867
5838
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY"
|
|
5868
5839
|
}
|
|
5869
5840
|
},
|
|
5870
|
-
appearance: {
|
|
5841
|
+
appearance: {
|
|
5842
|
+
isBordered: true,
|
|
5843
|
+
hasBackground: false,
|
|
5844
|
+
isEditorPresentationDifferent: false,
|
|
5845
|
+
showBlockHeaderInEditor: false
|
|
5846
|
+
}
|
|
5871
5847
|
},
|
|
5872
5848
|
{
|
|
5873
5849
|
id: "io.supernova.block.ordered-list",
|
|
@@ -5893,7 +5869,7 @@ var blocks = [
|
|
|
5893
5869
|
layout: { type: "Column", children: ["text"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
5894
5870
|
maxColumns: 1,
|
|
5895
5871
|
defaultColumns: 1,
|
|
5896
|
-
appearance: {
|
|
5872
|
+
appearance: {}
|
|
5897
5873
|
}
|
|
5898
5874
|
],
|
|
5899
5875
|
defaultVariantKey: "default"
|
|
@@ -5905,7 +5881,12 @@ var blocks = [
|
|
|
5905
5881
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/text/list-UC5iPZLK"
|
|
5906
5882
|
}
|
|
5907
5883
|
},
|
|
5908
|
-
appearance: {
|
|
5884
|
+
appearance: {
|
|
5885
|
+
isBordered: true,
|
|
5886
|
+
hasBackground: false,
|
|
5887
|
+
isEditorPresentationDifferent: false,
|
|
5888
|
+
showBlockHeaderInEditor: false
|
|
5889
|
+
}
|
|
5909
5890
|
},
|
|
5910
5891
|
{
|
|
5911
5892
|
id: "io.supernova.block.unordered-list",
|
|
@@ -5931,7 +5912,7 @@ var blocks = [
|
|
|
5931
5912
|
layout: { type: "Column", children: ["text"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
5932
5913
|
maxColumns: 1,
|
|
5933
5914
|
defaultColumns: 1,
|
|
5934
|
-
appearance: {
|
|
5915
|
+
appearance: {}
|
|
5935
5916
|
}
|
|
5936
5917
|
],
|
|
5937
5918
|
defaultVariantKey: "default"
|
|
@@ -5943,7 +5924,12 @@ var blocks = [
|
|
|
5943
5924
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/text/list-UC5iPZLK"
|
|
5944
5925
|
}
|
|
5945
5926
|
},
|
|
5946
|
-
appearance: {
|
|
5927
|
+
appearance: {
|
|
5928
|
+
isBordered: true,
|
|
5929
|
+
hasBackground: false,
|
|
5930
|
+
isEditorPresentationDifferent: false,
|
|
5931
|
+
showBlockHeaderInEditor: false
|
|
5932
|
+
}
|
|
5947
5933
|
},
|
|
5948
5934
|
{
|
|
5949
5935
|
id: "io.supernova.block.divider",
|
|
@@ -5968,7 +5954,7 @@ var blocks = [
|
|
|
5968
5954
|
},
|
|
5969
5955
|
maxColumns: 1,
|
|
5970
5956
|
defaultColumns: 1,
|
|
5971
|
-
appearance: {
|
|
5957
|
+
appearance: {}
|
|
5972
5958
|
}
|
|
5973
5959
|
],
|
|
5974
5960
|
defaultVariantKey: "default"
|
|
@@ -5980,7 +5966,12 @@ var blocks = [
|
|
|
5980
5966
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/text/divider-tLuxooLH"
|
|
5981
5967
|
}
|
|
5982
5968
|
},
|
|
5983
|
-
appearance: {
|
|
5969
|
+
appearance: {
|
|
5970
|
+
isBordered: true,
|
|
5971
|
+
hasBackground: false,
|
|
5972
|
+
isEditorPresentationDifferent: false,
|
|
5973
|
+
showBlockHeaderInEditor: false
|
|
5974
|
+
}
|
|
5984
5975
|
},
|
|
5985
5976
|
{
|
|
5986
5977
|
id: "io.supernova.block.blockquote",
|
|
@@ -6006,7 +5997,7 @@ var blocks = [
|
|
|
6006
5997
|
layout: { type: "Column", children: ["text"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6007
5998
|
maxColumns: 1,
|
|
6008
5999
|
defaultColumns: 1,
|
|
6009
|
-
appearance: {
|
|
6000
|
+
appearance: {}
|
|
6010
6001
|
}
|
|
6011
6002
|
],
|
|
6012
6003
|
defaultVariantKey: "default"
|
|
@@ -6018,14 +6009,19 @@ var blocks = [
|
|
|
6018
6009
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/text/blockquote-zYWAsb6X"
|
|
6019
6010
|
}
|
|
6020
6011
|
},
|
|
6021
|
-
appearance: {
|
|
6012
|
+
appearance: {
|
|
6013
|
+
isBordered: true,
|
|
6014
|
+
hasBackground: false,
|
|
6015
|
+
isEditorPresentationDifferent: false,
|
|
6016
|
+
showBlockHeaderInEditor: false
|
|
6017
|
+
}
|
|
6022
6018
|
},
|
|
6023
6019
|
{
|
|
6024
6020
|
id: "io.supernova.block.callout",
|
|
6025
6021
|
name: "Callout",
|
|
6026
6022
|
description: "Highlight a section of text",
|
|
6027
6023
|
category: "Text",
|
|
6028
|
-
icon: "https://cdn-assets.supernova.io/blocks/icons/
|
|
6024
|
+
icon: "https://cdn-assets.supernova.io/blocks/icons/v3/callout.svg",
|
|
6029
6025
|
searchKeywords: ["banner", "alert", "note", "tip", "warning"],
|
|
6030
6026
|
item: {
|
|
6031
6027
|
properties: [
|
|
@@ -6044,7 +6040,7 @@ var blocks = [
|
|
|
6044
6040
|
layout: { type: "Column", children: ["text"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6045
6041
|
maxColumns: 1,
|
|
6046
6042
|
defaultColumns: 1,
|
|
6047
|
-
appearance: {
|
|
6043
|
+
appearance: {}
|
|
6048
6044
|
}
|
|
6049
6045
|
],
|
|
6050
6046
|
defaultVariantKey: "default"
|
|
@@ -6056,7 +6052,12 @@ var blocks = [
|
|
|
6056
6052
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/text/callout-ZPlZObD1"
|
|
6057
6053
|
}
|
|
6058
6054
|
},
|
|
6059
|
-
appearance: {
|
|
6055
|
+
appearance: {
|
|
6056
|
+
isBordered: true,
|
|
6057
|
+
hasBackground: false,
|
|
6058
|
+
isEditorPresentationDifferent: false,
|
|
6059
|
+
showBlockHeaderInEditor: false
|
|
6060
|
+
}
|
|
6060
6061
|
},
|
|
6061
6062
|
{
|
|
6062
6063
|
id: "io.supernova.block.image",
|
|
@@ -6082,7 +6083,7 @@ var blocks = [
|
|
|
6082
6083
|
layout: { type: "Column", children: ["image"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6083
6084
|
maxColumns: 1,
|
|
6084
6085
|
defaultColumns: 1,
|
|
6085
|
-
appearance: {
|
|
6086
|
+
appearance: {}
|
|
6086
6087
|
}
|
|
6087
6088
|
],
|
|
6088
6089
|
defaultVariantKey: "default"
|
|
@@ -6094,7 +6095,12 @@ var blocks = [
|
|
|
6094
6095
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/image-Ue8VdT8B"
|
|
6095
6096
|
}
|
|
6096
6097
|
},
|
|
6097
|
-
appearance: {
|
|
6098
|
+
appearance: {
|
|
6099
|
+
isBordered: false,
|
|
6100
|
+
hasBackground: false,
|
|
6101
|
+
isEditorPresentationDifferent: false,
|
|
6102
|
+
showBlockHeaderInEditor: false
|
|
6103
|
+
}
|
|
6098
6104
|
},
|
|
6099
6105
|
{
|
|
6100
6106
|
id: "io.supernova.block.shortcut-links",
|
|
@@ -6144,7 +6150,7 @@ var blocks = [
|
|
|
6144
6150
|
},
|
|
6145
6151
|
maxColumns: 4,
|
|
6146
6152
|
defaultColumns: 1,
|
|
6147
|
-
appearance: {
|
|
6153
|
+
appearance: {}
|
|
6148
6154
|
},
|
|
6149
6155
|
{
|
|
6150
6156
|
id: "imageOnLeft",
|
|
@@ -6174,7 +6180,7 @@ var blocks = [
|
|
|
6174
6180
|
},
|
|
6175
6181
|
maxColumns: 1,
|
|
6176
6182
|
defaultColumns: 1,
|
|
6177
|
-
appearance: {
|
|
6183
|
+
appearance: {}
|
|
6178
6184
|
},
|
|
6179
6185
|
{
|
|
6180
6186
|
id: "iconOnTop",
|
|
@@ -6189,7 +6195,7 @@ var blocks = [
|
|
|
6189
6195
|
},
|
|
6190
6196
|
maxColumns: 4,
|
|
6191
6197
|
defaultColumns: 1,
|
|
6192
|
-
appearance: {
|
|
6198
|
+
appearance: {}
|
|
6193
6199
|
},
|
|
6194
6200
|
{
|
|
6195
6201
|
id: "iconOnLeft",
|
|
@@ -6219,7 +6225,7 @@ var blocks = [
|
|
|
6219
6225
|
},
|
|
6220
6226
|
maxColumns: 2,
|
|
6221
6227
|
defaultColumns: 1,
|
|
6222
|
-
appearance: {
|
|
6228
|
+
appearance: {}
|
|
6223
6229
|
}
|
|
6224
6230
|
],
|
|
6225
6231
|
defaultVariantKey: "imageOnTop"
|
|
@@ -6231,26 +6237,31 @@ var blocks = [
|
|
|
6231
6237
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/links/shortcuts/general-jVfNifo4"
|
|
6232
6238
|
}
|
|
6233
6239
|
},
|
|
6234
|
-
appearance: {
|
|
6240
|
+
appearance: {
|
|
6241
|
+
isBordered: true,
|
|
6242
|
+
hasBackground: false,
|
|
6243
|
+
isEditorPresentationDifferent: false,
|
|
6244
|
+
showBlockHeaderInEditor: false
|
|
6245
|
+
}
|
|
6235
6246
|
},
|
|
6236
6247
|
{
|
|
6237
|
-
id: "io.supernova.block.embed",
|
|
6238
|
-
name: "
|
|
6239
|
-
description: "Embed a
|
|
6248
|
+
id: "io.supernova.block.embed-figma",
|
|
6249
|
+
name: "Figma embed",
|
|
6250
|
+
description: "Embed a Figma canvas or prototype",
|
|
6240
6251
|
category: "Media",
|
|
6241
|
-
icon: "https://cdn-assets.supernova.io/blocks/icons/embed.svg",
|
|
6242
|
-
searchKeywords: ["embed", "
|
|
6252
|
+
icon: "https://cdn-assets.supernova.io/blocks/icons/embed-figma.svg",
|
|
6253
|
+
searchKeywords: ["embed", "figma", "design", "prototype", "canvas"],
|
|
6243
6254
|
item: {
|
|
6244
6255
|
properties: [
|
|
6245
6256
|
{
|
|
6246
|
-
id: "
|
|
6247
|
-
name: "
|
|
6257
|
+
id: "embed",
|
|
6258
|
+
name: "Figma URL",
|
|
6248
6259
|
type: "EmbedURL",
|
|
6249
6260
|
options: {
|
|
6250
|
-
allowCaption:
|
|
6261
|
+
allowCaption: false,
|
|
6251
6262
|
allowResize: true,
|
|
6252
6263
|
defaultHeight: 400,
|
|
6253
|
-
urlValidationRegex: "^(https?://)?(www.)
|
|
6264
|
+
urlValidationRegex: "^(https?://)?(www.)?(figma.com)/.+$"
|
|
6254
6265
|
}
|
|
6255
6266
|
}
|
|
6256
6267
|
],
|
|
@@ -6259,16 +6270,10 @@ var blocks = [
|
|
|
6259
6270
|
{
|
|
6260
6271
|
id: "default",
|
|
6261
6272
|
name: "Default",
|
|
6262
|
-
layout: {
|
|
6263
|
-
type: "Column",
|
|
6264
|
-
children: ["embedUrl"],
|
|
6265
|
-
columnAlign: "Start",
|
|
6266
|
-
columnResizing: "Fill",
|
|
6267
|
-
gap: "Medium"
|
|
6268
|
-
},
|
|
6273
|
+
layout: { type: "Column", children: ["embed"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6269
6274
|
maxColumns: 1,
|
|
6270
6275
|
defaultColumns: 1,
|
|
6271
|
-
appearance: {
|
|
6276
|
+
appearance: {}
|
|
6272
6277
|
}
|
|
6273
6278
|
],
|
|
6274
6279
|
defaultVariantKey: "default"
|
|
@@ -6276,11 +6281,59 @@ var blocks = [
|
|
|
6276
6281
|
behavior: { dataType: "Item", items: { numberOfItems: 1, allowLinks: false } },
|
|
6277
6282
|
editorOptions: {
|
|
6278
6283
|
onboarding: {
|
|
6279
|
-
helpText: "Embed
|
|
6280
|
-
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/
|
|
6284
|
+
helpText: "Embed a Figma canvas or prototype to your documentation.",
|
|
6285
|
+
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/figma/embed-figma-GPNJsT8A"
|
|
6281
6286
|
}
|
|
6282
6287
|
},
|
|
6283
|
-
appearance: {
|
|
6288
|
+
appearance: {
|
|
6289
|
+
isBordered: true,
|
|
6290
|
+
hasBackground: false,
|
|
6291
|
+
isEditorPresentationDifferent: false,
|
|
6292
|
+
showBlockHeaderInEditor: false
|
|
6293
|
+
}
|
|
6294
|
+
},
|
|
6295
|
+
{
|
|
6296
|
+
id: "io.supernova.block.storybook",
|
|
6297
|
+
name: "Storybook",
|
|
6298
|
+
description: "Embed Storybook canvas",
|
|
6299
|
+
category: "Media",
|
|
6300
|
+
icon: "https://cdn-assets.supernova.io/blocks/icons/storybook.svg",
|
|
6301
|
+
searchKeywords: ["storybook", "story", "stories", "example", "preview", "code", "react"],
|
|
6302
|
+
item: {
|
|
6303
|
+
properties: [
|
|
6304
|
+
{
|
|
6305
|
+
id: "embed",
|
|
6306
|
+
name: "Storybook URL",
|
|
6307
|
+
type: "Storybook",
|
|
6308
|
+
options: { allowCaption: true, allowResize: true, defaultHeight: 400 }
|
|
6309
|
+
}
|
|
6310
|
+
],
|
|
6311
|
+
appearance: { isBordered: true, hasBackground: false },
|
|
6312
|
+
variants: [
|
|
6313
|
+
{
|
|
6314
|
+
id: "default",
|
|
6315
|
+
name: "Default",
|
|
6316
|
+
layout: { type: "Column", children: ["embed"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6317
|
+
maxColumns: 1,
|
|
6318
|
+
defaultColumns: 1,
|
|
6319
|
+
appearance: {}
|
|
6320
|
+
}
|
|
6321
|
+
],
|
|
6322
|
+
defaultVariantKey: "default"
|
|
6323
|
+
},
|
|
6324
|
+
behavior: { dataType: "Item", items: { numberOfItems: 1, allowLinks: false } },
|
|
6325
|
+
editorOptions: {
|
|
6326
|
+
onboarding: {
|
|
6327
|
+
helpText: "Embed a Storybook story to your documentation.",
|
|
6328
|
+
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/code/storybook-1EGPhwBl"
|
|
6329
|
+
}
|
|
6330
|
+
},
|
|
6331
|
+
appearance: {
|
|
6332
|
+
isBordered: true,
|
|
6333
|
+
hasBackground: false,
|
|
6334
|
+
isEditorPresentationDifferent: false,
|
|
6335
|
+
showBlockHeaderInEditor: false
|
|
6336
|
+
}
|
|
6284
6337
|
},
|
|
6285
6338
|
{
|
|
6286
6339
|
id: "io.supernova.block.embed-youtube",
|
|
@@ -6311,7 +6364,7 @@ var blocks = [
|
|
|
6311
6364
|
layout: { type: "Column", children: ["embed"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6312
6365
|
maxColumns: 1,
|
|
6313
6366
|
defaultColumns: 1,
|
|
6314
|
-
appearance: {
|
|
6367
|
+
appearance: {}
|
|
6315
6368
|
}
|
|
6316
6369
|
],
|
|
6317
6370
|
defaultVariantKey: "default"
|
|
@@ -6323,7 +6376,12 @@ var blocks = [
|
|
|
6323
6376
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/youtube-Gh8VUrSF"
|
|
6324
6377
|
}
|
|
6325
6378
|
},
|
|
6326
|
-
appearance: {
|
|
6379
|
+
appearance: {
|
|
6380
|
+
isBordered: true,
|
|
6381
|
+
hasBackground: false,
|
|
6382
|
+
isEditorPresentationDifferent: false,
|
|
6383
|
+
showBlockHeaderInEditor: false
|
|
6384
|
+
}
|
|
6327
6385
|
},
|
|
6328
6386
|
{
|
|
6329
6387
|
id: "io.supernova.block.embed-lottie",
|
|
@@ -6377,7 +6435,8 @@ var blocks = [
|
|
|
6377
6435
|
{
|
|
6378
6436
|
id: "default",
|
|
6379
6437
|
name: "Default",
|
|
6380
|
-
image: "https://cdn-assets.supernova.io/blocks/variants/lottie.svg",
|
|
6438
|
+
image: "https://cdn-assets.supernova.io/blocks/variants/lottie-player.svg",
|
|
6439
|
+
description: "Embed a Lottie animation to your documentation.",
|
|
6381
6440
|
layout: {
|
|
6382
6441
|
type: "Column",
|
|
6383
6442
|
children: ["url", "height", "width", "autoplay", "loop", "playerControls"],
|
|
@@ -6387,7 +6446,7 @@ var blocks = [
|
|
|
6387
6446
|
},
|
|
6388
6447
|
maxColumns: 1,
|
|
6389
6448
|
defaultColumns: 1,
|
|
6390
|
-
appearance: {
|
|
6449
|
+
appearance: {}
|
|
6391
6450
|
}
|
|
6392
6451
|
],
|
|
6393
6452
|
defaultVariantKey: "default"
|
|
@@ -6399,64 +6458,31 @@ var blocks = [
|
|
|
6399
6458
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/lottie-preview-7CqFdGv9"
|
|
6400
6459
|
}
|
|
6401
6460
|
},
|
|
6402
|
-
appearance: {
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
category: "Media",
|
|
6409
|
-
icon: "https://cdn-assets.supernova.io/blocks/icons/storybook.svg",
|
|
6410
|
-
searchKeywords: ["storybook", "story", "stories", "example", "preview", "code", "react"],
|
|
6411
|
-
item: {
|
|
6412
|
-
properties: [
|
|
6413
|
-
{
|
|
6414
|
-
id: "embed",
|
|
6415
|
-
name: "Storybook URL",
|
|
6416
|
-
type: "Storybook",
|
|
6417
|
-
options: { allowCaption: true, allowResize: true, defaultHeight: 400 }
|
|
6418
|
-
}
|
|
6419
|
-
],
|
|
6420
|
-
appearance: { isBordered: true, hasBackground: false },
|
|
6421
|
-
variants: [
|
|
6422
|
-
{
|
|
6423
|
-
id: "default",
|
|
6424
|
-
name: "Default",
|
|
6425
|
-
layout: { type: "Column", children: ["embed"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6426
|
-
maxColumns: 1,
|
|
6427
|
-
defaultColumns: 1,
|
|
6428
|
-
appearance: { isBordered: true, hasBackground: false, isEditorPresentationDifferent: false }
|
|
6429
|
-
}
|
|
6430
|
-
],
|
|
6431
|
-
defaultVariantKey: "default"
|
|
6432
|
-
},
|
|
6433
|
-
behavior: { dataType: "Item", items: { numberOfItems: 1, allowLinks: false } },
|
|
6434
|
-
editorOptions: {
|
|
6435
|
-
onboarding: {
|
|
6436
|
-
helpText: "Embed a Storybook story to your documentation.",
|
|
6437
|
-
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/code/storybook-1EGPhwBl"
|
|
6438
|
-
}
|
|
6439
|
-
},
|
|
6440
|
-
appearance: { isBordered: true, hasBackground: false }
|
|
6461
|
+
appearance: {
|
|
6462
|
+
isBordered: true,
|
|
6463
|
+
hasBackground: false,
|
|
6464
|
+
isEditorPresentationDifferent: true,
|
|
6465
|
+
showBlockHeaderInEditor: true
|
|
6466
|
+
}
|
|
6441
6467
|
},
|
|
6442
6468
|
{
|
|
6443
|
-
id: "io.supernova.block.embed
|
|
6444
|
-
name: "
|
|
6445
|
-
description: "Embed a
|
|
6469
|
+
id: "io.supernova.block.embed",
|
|
6470
|
+
name: "Embed",
|
|
6471
|
+
description: "Embed a generic URL",
|
|
6446
6472
|
category: "Media",
|
|
6447
|
-
icon: "https://cdn-assets.supernova.io/blocks/icons/embed
|
|
6448
|
-
searchKeywords: ["embed", "
|
|
6473
|
+
icon: "https://cdn-assets.supernova.io/blocks/icons/embed.svg",
|
|
6474
|
+
searchKeywords: ["embed", "url", "iframe", "site", "import"],
|
|
6449
6475
|
item: {
|
|
6450
6476
|
properties: [
|
|
6451
6477
|
{
|
|
6452
|
-
id: "
|
|
6453
|
-
name: "
|
|
6478
|
+
id: "embedUrl",
|
|
6479
|
+
name: "Embed URL",
|
|
6454
6480
|
type: "EmbedURL",
|
|
6455
6481
|
options: {
|
|
6456
|
-
allowCaption:
|
|
6482
|
+
allowCaption: true,
|
|
6457
6483
|
allowResize: true,
|
|
6458
6484
|
defaultHeight: 400,
|
|
6459
|
-
urlValidationRegex: "^(https?://)?(www.)
|
|
6485
|
+
urlValidationRegex: "^(https?://)?(www.)?.+$"
|
|
6460
6486
|
}
|
|
6461
6487
|
}
|
|
6462
6488
|
],
|
|
@@ -6465,10 +6491,16 @@ var blocks = [
|
|
|
6465
6491
|
{
|
|
6466
6492
|
id: "default",
|
|
6467
6493
|
name: "Default",
|
|
6468
|
-
layout: {
|
|
6494
|
+
layout: {
|
|
6495
|
+
type: "Column",
|
|
6496
|
+
children: ["embedUrl"],
|
|
6497
|
+
columnAlign: "Start",
|
|
6498
|
+
columnResizing: "Fill",
|
|
6499
|
+
gap: "Medium"
|
|
6500
|
+
},
|
|
6469
6501
|
maxColumns: 1,
|
|
6470
6502
|
defaultColumns: 1,
|
|
6471
|
-
appearance: {
|
|
6503
|
+
appearance: {}
|
|
6472
6504
|
}
|
|
6473
6505
|
],
|
|
6474
6506
|
defaultVariantKey: "default"
|
|
@@ -6476,11 +6508,16 @@ var blocks = [
|
|
|
6476
6508
|
behavior: { dataType: "Item", items: { numberOfItems: 1, allowLinks: false } },
|
|
6477
6509
|
editorOptions: {
|
|
6478
6510
|
onboarding: {
|
|
6479
|
-
helpText: "Embed
|
|
6480
|
-
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/
|
|
6511
|
+
helpText: "Embed any page to your documentation as an iframe.",
|
|
6512
|
+
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/embed/public-url-2ZeRQ332"
|
|
6481
6513
|
}
|
|
6482
6514
|
},
|
|
6483
|
-
appearance: {
|
|
6515
|
+
appearance: {
|
|
6516
|
+
isBordered: true,
|
|
6517
|
+
hasBackground: false,
|
|
6518
|
+
isEditorPresentationDifferent: false,
|
|
6519
|
+
showBlockHeaderInEditor: false
|
|
6520
|
+
}
|
|
6484
6521
|
},
|
|
6485
6522
|
{
|
|
6486
6523
|
id: "io.supernova.block.markdown",
|
|
@@ -6513,7 +6550,7 @@ var blocks = [
|
|
|
6513
6550
|
},
|
|
6514
6551
|
maxColumns: 1,
|
|
6515
6552
|
defaultColumns: 1,
|
|
6516
|
-
appearance: {
|
|
6553
|
+
appearance: {}
|
|
6517
6554
|
},
|
|
6518
6555
|
{
|
|
6519
6556
|
id: "bordered",
|
|
@@ -6528,7 +6565,7 @@ var blocks = [
|
|
|
6528
6565
|
},
|
|
6529
6566
|
maxColumns: 1,
|
|
6530
6567
|
defaultColumns: 1,
|
|
6531
|
-
appearance: {
|
|
6568
|
+
appearance: {}
|
|
6532
6569
|
},
|
|
6533
6570
|
{
|
|
6534
6571
|
id: "boxed",
|
|
@@ -6543,7 +6580,7 @@ var blocks = [
|
|
|
6543
6580
|
},
|
|
6544
6581
|
maxColumns: 1,
|
|
6545
6582
|
defaultColumns: 1,
|
|
6546
|
-
appearance: {
|
|
6583
|
+
appearance: {}
|
|
6547
6584
|
}
|
|
6548
6585
|
],
|
|
6549
6586
|
defaultVariantKey: "plain"
|
|
@@ -6555,7 +6592,12 @@ var blocks = [
|
|
|
6555
6592
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/code/markdown/general-B8wQVOem"
|
|
6556
6593
|
}
|
|
6557
6594
|
},
|
|
6558
|
-
appearance: {
|
|
6595
|
+
appearance: {
|
|
6596
|
+
isBordered: true,
|
|
6597
|
+
hasBackground: false,
|
|
6598
|
+
isEditorPresentationDifferent: true,
|
|
6599
|
+
showBlockHeaderInEditor: false
|
|
6600
|
+
}
|
|
6559
6601
|
},
|
|
6560
6602
|
{
|
|
6561
6603
|
id: "io.supernova.block.table",
|
|
@@ -6574,7 +6616,7 @@ var blocks = [
|
|
|
6574
6616
|
layout: { type: "Column", children: ["table"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6575
6617
|
maxColumns: 1,
|
|
6576
6618
|
defaultColumns: 1,
|
|
6577
|
-
appearance: {
|
|
6619
|
+
appearance: {}
|
|
6578
6620
|
}
|
|
6579
6621
|
],
|
|
6580
6622
|
defaultVariantKey: "default"
|
|
@@ -6586,7 +6628,12 @@ var blocks = [
|
|
|
6586
6628
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/layout/table-R8KGnxej"
|
|
6587
6629
|
}
|
|
6588
6630
|
},
|
|
6589
|
-
appearance: {
|
|
6631
|
+
appearance: {
|
|
6632
|
+
isBordered: true,
|
|
6633
|
+
hasBackground: false,
|
|
6634
|
+
isEditorPresentationDifferent: false,
|
|
6635
|
+
showBlockHeaderInEditor: false
|
|
6636
|
+
}
|
|
6590
6637
|
},
|
|
6591
6638
|
{
|
|
6592
6639
|
id: "io.supernova.block.design-tokens",
|
|
@@ -6624,7 +6671,7 @@ var blocks = [
|
|
|
6624
6671
|
layout: { type: "Column", children: ["tokens"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6625
6672
|
maxColumns: 1,
|
|
6626
6673
|
defaultColumns: 1,
|
|
6627
|
-
appearance: {
|
|
6674
|
+
appearance: {}
|
|
6628
6675
|
},
|
|
6629
6676
|
{
|
|
6630
6677
|
id: "grid",
|
|
@@ -6633,7 +6680,7 @@ var blocks = [
|
|
|
6633
6680
|
layout: { type: "Column", children: ["tokens"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6634
6681
|
maxColumns: 4,
|
|
6635
6682
|
defaultColumns: 1,
|
|
6636
|
-
appearance: {
|
|
6683
|
+
appearance: {}
|
|
6637
6684
|
}
|
|
6638
6685
|
],
|
|
6639
6686
|
defaultVariantKey: "table"
|
|
@@ -6645,14 +6692,19 @@ var blocks = [
|
|
|
6645
6692
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/token/tokens/general-84NRgxGl#section-token-group-09"
|
|
6646
6693
|
}
|
|
6647
6694
|
},
|
|
6648
|
-
appearance: {
|
|
6695
|
+
appearance: {
|
|
6696
|
+
isBordered: true,
|
|
6697
|
+
hasBackground: false,
|
|
6698
|
+
isEditorPresentationDifferent: false,
|
|
6699
|
+
showBlockHeaderInEditor: false
|
|
6700
|
+
}
|
|
6649
6701
|
},
|
|
6650
6702
|
{
|
|
6651
6703
|
id: "io.supernova.block.token-color-ramps",
|
|
6652
6704
|
name: "Color ramps",
|
|
6653
6705
|
description: "The best way to display colors",
|
|
6654
6706
|
category: "Tokens",
|
|
6655
|
-
icon: "https://cdn-assets.supernova.io/blocks/icons/
|
|
6707
|
+
icon: "https://cdn-assets.supernova.io/blocks/icons/color-ramp.svg",
|
|
6656
6708
|
searchKeywords: ["tokens", "ramp", "shades", "palette", "spectrum", "stack", "range", "swatch"],
|
|
6657
6709
|
item: {
|
|
6658
6710
|
properties: [
|
|
@@ -6672,7 +6724,7 @@ var blocks = [
|
|
|
6672
6724
|
layout: { type: "Column", children: ["tokens"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6673
6725
|
maxColumns: 2,
|
|
6674
6726
|
defaultColumns: 1,
|
|
6675
|
-
appearance: {
|
|
6727
|
+
appearance: { isEditorPresentationDifferent: true }
|
|
6676
6728
|
}
|
|
6677
6729
|
],
|
|
6678
6730
|
defaultVariantKey: "default"
|
|
@@ -6681,14 +6733,19 @@ var blocks = [
|
|
|
6681
6733
|
editorOptions: {
|
|
6682
6734
|
onboarding: { helpText: "The best way to display colors", documentationLink: "https://learn.supernova.io" }
|
|
6683
6735
|
},
|
|
6684
|
-
appearance: {
|
|
6736
|
+
appearance: {
|
|
6737
|
+
isBordered: true,
|
|
6738
|
+
hasBackground: false,
|
|
6739
|
+
isEditorPresentationDifferent: false,
|
|
6740
|
+
showBlockHeaderInEditor: false
|
|
6741
|
+
}
|
|
6685
6742
|
},
|
|
6686
6743
|
{
|
|
6687
6744
|
id: "io.supernova.block.color-accessibility-grid",
|
|
6688
6745
|
name: "Accessibility color grid",
|
|
6689
6746
|
description: "Visualize accessibility of your color tokens",
|
|
6690
6747
|
category: "Tokens",
|
|
6691
|
-
icon: "https://cdn-assets.supernova.io/blocks/icons/token-accessibility-grid.svg",
|
|
6748
|
+
icon: "https://cdn-assets.supernova.io/blocks/icons/v3/token-accessibility-grid.svg",
|
|
6692
6749
|
searchKeywords: ["tokens", "color", "accessibility", "grid", "contrast"],
|
|
6693
6750
|
item: {
|
|
6694
6751
|
properties: [
|
|
@@ -6709,7 +6766,7 @@ var blocks = [
|
|
|
6709
6766
|
layout: { type: "Column", children: ["tokens"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6710
6767
|
maxColumns: 1,
|
|
6711
6768
|
defaultColumns: 1,
|
|
6712
|
-
appearance: {
|
|
6769
|
+
appearance: { isEditorPresentationDifferent: true }
|
|
6713
6770
|
}
|
|
6714
6771
|
],
|
|
6715
6772
|
defaultVariantKey: "default"
|
|
@@ -6721,7 +6778,12 @@ var blocks = [
|
|
|
6721
6778
|
documentationLink: "https://learn.supernova.io"
|
|
6722
6779
|
}
|
|
6723
6780
|
},
|
|
6724
|
-
appearance: {
|
|
6781
|
+
appearance: {
|
|
6782
|
+
isBordered: true,
|
|
6783
|
+
hasBackground: false,
|
|
6784
|
+
isEditorPresentationDifferent: false,
|
|
6785
|
+
showBlockHeaderInEditor: false
|
|
6786
|
+
}
|
|
6725
6787
|
},
|
|
6726
6788
|
{
|
|
6727
6789
|
id: "io.supernova.block.code",
|
|
@@ -6740,21 +6802,26 @@ var blocks = [
|
|
|
6740
6802
|
layout: { type: "Column", children: ["code"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6741
6803
|
maxColumns: 1,
|
|
6742
6804
|
defaultColumns: 1,
|
|
6743
|
-
appearance: {
|
|
6805
|
+
appearance: {}
|
|
6744
6806
|
}
|
|
6745
6807
|
],
|
|
6746
6808
|
defaultVariantKey: "default"
|
|
6747
6809
|
},
|
|
6748
6810
|
behavior: { dataType: "Item", items: { numberOfItems: 1, allowLinks: false } },
|
|
6749
6811
|
editorOptions: { onboarding: { helpText: "Code descriptor." } },
|
|
6750
|
-
appearance: {
|
|
6812
|
+
appearance: {
|
|
6813
|
+
isBordered: true,
|
|
6814
|
+
hasBackground: false,
|
|
6815
|
+
isEditorPresentationDifferent: false,
|
|
6816
|
+
showBlockHeaderInEditor: false
|
|
6817
|
+
}
|
|
6751
6818
|
},
|
|
6752
6819
|
{
|
|
6753
6820
|
id: "io.supernova.block.code-react",
|
|
6754
6821
|
name: "React code",
|
|
6755
6822
|
description: "Render a code snippet",
|
|
6756
6823
|
category: "Code",
|
|
6757
|
-
icon: "https://cdn-assets.supernova.io/blocks/icons/
|
|
6824
|
+
icon: "https://cdn-assets.supernova.io/blocks/icons/v3/code-react.svg",
|
|
6758
6825
|
searchKeywords: ["code", "react", "snippet", "storybook", "editor", "example", "sandbox"],
|
|
6759
6826
|
item: {
|
|
6760
6827
|
properties: [
|
|
@@ -6780,7 +6847,7 @@ var blocks = [
|
|
|
6780
6847
|
layout: { type: "Column", children: ["code"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6781
6848
|
maxColumns: 1,
|
|
6782
6849
|
defaultColumns: 1,
|
|
6783
|
-
appearance: {
|
|
6850
|
+
appearance: {}
|
|
6784
6851
|
},
|
|
6785
6852
|
{
|
|
6786
6853
|
id: "codeTop",
|
|
@@ -6790,7 +6857,7 @@ var blocks = [
|
|
|
6790
6857
|
layout: { type: "Column", children: ["code"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6791
6858
|
maxColumns: 1,
|
|
6792
6859
|
defaultColumns: 1,
|
|
6793
|
-
appearance: {
|
|
6860
|
+
appearance: {}
|
|
6794
6861
|
},
|
|
6795
6862
|
{
|
|
6796
6863
|
id: "codeLeft",
|
|
@@ -6800,7 +6867,7 @@ var blocks = [
|
|
|
6800
6867
|
layout: { type: "Column", children: ["code"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6801
6868
|
maxColumns: 1,
|
|
6802
6869
|
defaultColumns: 1,
|
|
6803
|
-
appearance: {
|
|
6870
|
+
appearance: {}
|
|
6804
6871
|
},
|
|
6805
6872
|
{
|
|
6806
6873
|
id: "codeRight",
|
|
@@ -6810,7 +6877,7 @@ var blocks = [
|
|
|
6810
6877
|
layout: { type: "Column", children: ["code"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6811
6878
|
maxColumns: 1,
|
|
6812
6879
|
defaultColumns: 1,
|
|
6813
|
-
appearance: {
|
|
6880
|
+
appearance: {}
|
|
6814
6881
|
}
|
|
6815
6882
|
],
|
|
6816
6883
|
defaultVariantKey: "codeBottom"
|
|
@@ -6822,7 +6889,12 @@ var blocks = [
|
|
|
6822
6889
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/code/render-react-code-vxufnkFm"
|
|
6823
6890
|
}
|
|
6824
6891
|
},
|
|
6825
|
-
appearance: {
|
|
6892
|
+
appearance: {
|
|
6893
|
+
isBordered: false,
|
|
6894
|
+
hasBackground: false,
|
|
6895
|
+
isEditorPresentationDifferent: false,
|
|
6896
|
+
showBlockHeaderInEditor: false
|
|
6897
|
+
}
|
|
6826
6898
|
},
|
|
6827
6899
|
{
|
|
6828
6900
|
id: "io.supernova.block.assets",
|
|
@@ -6843,7 +6915,7 @@ var blocks = [
|
|
|
6843
6915
|
layout: { type: "Column", children: ["assets"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6844
6916
|
maxColumns: 8,
|
|
6845
6917
|
defaultColumns: 1,
|
|
6846
|
-
appearance: {
|
|
6918
|
+
appearance: { isEditorPresentationDifferent: false }
|
|
6847
6919
|
},
|
|
6848
6920
|
{
|
|
6849
6921
|
id: "square-grid",
|
|
@@ -6853,7 +6925,7 @@ var blocks = [
|
|
|
6853
6925
|
layout: { type: "Column", children: ["assets"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6854
6926
|
maxColumns: 8,
|
|
6855
6927
|
defaultColumns: 1,
|
|
6856
|
-
appearance: {
|
|
6928
|
+
appearance: { isEditorPresentationDifferent: false }
|
|
6857
6929
|
},
|
|
6858
6930
|
{
|
|
6859
6931
|
id: "borderless-grid",
|
|
@@ -6863,7 +6935,7 @@ var blocks = [
|
|
|
6863
6935
|
layout: { type: "Column", children: ["assets"], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6864
6936
|
maxColumns: 8,
|
|
6865
6937
|
defaultColumns: 1,
|
|
6866
|
-
appearance: {
|
|
6938
|
+
appearance: { isEditorPresentationDifferent: false }
|
|
6867
6939
|
}
|
|
6868
6940
|
],
|
|
6869
6941
|
defaultVariantKey: "default"
|
|
@@ -6875,7 +6947,12 @@ var blocks = [
|
|
|
6875
6947
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/asset/general-xa6EgXb2"
|
|
6876
6948
|
}
|
|
6877
6949
|
},
|
|
6878
|
-
appearance: {
|
|
6950
|
+
appearance: {
|
|
6951
|
+
isBordered: true,
|
|
6952
|
+
hasBackground: false,
|
|
6953
|
+
isEditorPresentationDifferent: false,
|
|
6954
|
+
showBlockHeaderInEditor: false
|
|
6955
|
+
}
|
|
6879
6956
|
},
|
|
6880
6957
|
{
|
|
6881
6958
|
id: "io.supernova.block.figma-frames",
|
|
@@ -6909,7 +6986,7 @@ var blocks = [
|
|
|
6909
6986
|
},
|
|
6910
6987
|
maxColumns: 1,
|
|
6911
6988
|
defaultColumns: 1,
|
|
6912
|
-
appearance: {
|
|
6989
|
+
appearance: {}
|
|
6913
6990
|
},
|
|
6914
6991
|
{
|
|
6915
6992
|
id: "plain",
|
|
@@ -6925,7 +7002,7 @@ var blocks = [
|
|
|
6925
7002
|
},
|
|
6926
7003
|
maxColumns: 1,
|
|
6927
7004
|
defaultColumns: 1,
|
|
6928
|
-
appearance: {
|
|
7005
|
+
appearance: {}
|
|
6929
7006
|
}
|
|
6930
7007
|
],
|
|
6931
7008
|
defaultVariantKey: "bordered"
|
|
@@ -6937,7 +7014,12 @@ var blocks = [
|
|
|
6937
7014
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/figma/figma-frames/general-f3IYC5dg"
|
|
6938
7015
|
}
|
|
6939
7016
|
},
|
|
6940
|
-
appearance: {
|
|
7017
|
+
appearance: {
|
|
7018
|
+
isBordered: true,
|
|
7019
|
+
hasBackground: false,
|
|
7020
|
+
isEditorPresentationDifferent: false,
|
|
7021
|
+
showBlockHeaderInEditor: false
|
|
7022
|
+
}
|
|
6941
7023
|
},
|
|
6942
7024
|
{
|
|
6943
7025
|
id: "io.supernova.block.release-notes",
|
|
@@ -6953,11 +7035,12 @@ var blocks = [
|
|
|
6953
7035
|
{
|
|
6954
7036
|
id: "default",
|
|
6955
7037
|
name: "Default",
|
|
6956
|
-
image: "https://cdn-assets.supernova.io/blocks/variants/release-notes.svg",
|
|
7038
|
+
image: "https://cdn-assets.supernova.io/blocks/variants/release-notes-2.svg",
|
|
7039
|
+
description: "Show formatted release notes from all previously released versions.",
|
|
6957
7040
|
layout: { type: "Column", children: [], columnAlign: "Start", columnResizing: "Fill", gap: "Medium" },
|
|
6958
7041
|
maxColumns: 1,
|
|
6959
7042
|
defaultColumns: 1,
|
|
6960
|
-
appearance: {
|
|
7043
|
+
appearance: {}
|
|
6961
7044
|
}
|
|
6962
7045
|
],
|
|
6963
7046
|
defaultVariantKey: "default"
|
|
@@ -6965,10 +7048,15 @@ var blocks = [
|
|
|
6965
7048
|
behavior: { dataType: "Item", items: { numberOfItems: 1, allowLinks: false } },
|
|
6966
7049
|
editorOptions: {
|
|
6967
7050
|
onboarding: {
|
|
6968
|
-
helpText: "Show formatted release notes from all
|
|
7051
|
+
helpText: "Show formatted release notes from all previously released versions."
|
|
6969
7052
|
}
|
|
6970
7053
|
},
|
|
6971
|
-
appearance: {
|
|
7054
|
+
appearance: {
|
|
7055
|
+
isBordered: true,
|
|
7056
|
+
hasBackground: false,
|
|
7057
|
+
isEditorPresentationDifferent: true,
|
|
7058
|
+
showBlockHeaderInEditor: true
|
|
7059
|
+
}
|
|
6972
7060
|
},
|
|
6973
7061
|
{
|
|
6974
7062
|
id: "io.supernova.block.component-checklist",
|
|
@@ -7013,7 +7101,7 @@ var blocks = [
|
|
|
7013
7101
|
},
|
|
7014
7102
|
maxColumns: 1,
|
|
7015
7103
|
defaultColumns: 1,
|
|
7016
|
-
appearance: {
|
|
7104
|
+
appearance: { isEditorPresentationDifferent: true }
|
|
7017
7105
|
}
|
|
7018
7106
|
],
|
|
7019
7107
|
defaultVariantKey: "default"
|
|
@@ -7025,7 +7113,12 @@ var blocks = [
|
|
|
7025
7113
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/component/component-checklist-NXepPIpZ"
|
|
7026
7114
|
}
|
|
7027
7115
|
},
|
|
7028
|
-
appearance: {
|
|
7116
|
+
appearance: {
|
|
7117
|
+
isBordered: true,
|
|
7118
|
+
hasBackground: false,
|
|
7119
|
+
isEditorPresentationDifferent: false,
|
|
7120
|
+
showBlockHeaderInEditor: false
|
|
7121
|
+
}
|
|
7029
7122
|
},
|
|
7030
7123
|
{
|
|
7031
7124
|
id: "io.supernova.block.component-checklist-all",
|
|
@@ -7064,7 +7157,7 @@ var blocks = [
|
|
|
7064
7157
|
},
|
|
7065
7158
|
maxColumns: 1,
|
|
7066
7159
|
defaultColumns: 1,
|
|
7067
|
-
appearance: {
|
|
7160
|
+
appearance: { isEditorPresentationDifferent: true }
|
|
7068
7161
|
}
|
|
7069
7162
|
],
|
|
7070
7163
|
defaultVariantKey: "default"
|
|
@@ -7076,7 +7169,12 @@ var blocks = [
|
|
|
7076
7169
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/component/component-overview-table-W8eOtJ5t"
|
|
7077
7170
|
}
|
|
7078
7171
|
},
|
|
7079
|
-
appearance: {
|
|
7172
|
+
appearance: {
|
|
7173
|
+
isBordered: true,
|
|
7174
|
+
hasBackground: false,
|
|
7175
|
+
isEditorPresentationDifferent: false,
|
|
7176
|
+
showBlockHeaderInEditor: false
|
|
7177
|
+
}
|
|
7080
7178
|
},
|
|
7081
7179
|
{
|
|
7082
7180
|
id: "io.supernova.block.component-health",
|
|
@@ -7109,7 +7207,7 @@ var blocks = [
|
|
|
7109
7207
|
},
|
|
7110
7208
|
maxColumns: 1,
|
|
7111
7209
|
defaultColumns: 1,
|
|
7112
|
-
appearance: {
|
|
7210
|
+
appearance: { isEditorPresentationDifferent: true }
|
|
7113
7211
|
}
|
|
7114
7212
|
],
|
|
7115
7213
|
defaultVariantKey: "default"
|
|
@@ -7121,7 +7219,12 @@ var blocks = [
|
|
|
7121
7219
|
documentationLink: "https://learn.supernova.io/latest/documentation/types-of-blocks/component/component-health-sezSxEED"
|
|
7122
7220
|
}
|
|
7123
7221
|
},
|
|
7124
|
-
appearance: {
|
|
7222
|
+
appearance: {
|
|
7223
|
+
isBordered: true,
|
|
7224
|
+
hasBackground: false,
|
|
7225
|
+
isEditorPresentationDifferent: false,
|
|
7226
|
+
showBlockHeaderInEditor: false
|
|
7227
|
+
}
|
|
7125
7228
|
}
|
|
7126
7229
|
];
|
|
7127
7230
|
|
|
@@ -7141,6 +7244,9 @@ function prosemirrorDocToPage(prosemirrorDoc, definitions) {
|
|
|
7141
7244
|
blocks: internalProsemirrorNodesToPageItems(prosemirrorDoc.content ?? [], definitionsById)
|
|
7142
7245
|
};
|
|
7143
7246
|
}
|
|
7247
|
+
function shallowProsemirrorNodeToBlock(prosemirrorNode, definition) {
|
|
7248
|
+
return shallowProsemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition);
|
|
7249
|
+
}
|
|
7144
7250
|
function prosemirrorNodeToSection(prosemirrorNode, definitions) {
|
|
7145
7251
|
const definitionsById = mapByUnique2(definitions, (d) => d.id);
|
|
7146
7252
|
return internalProsemirrorNodeToSection(prosemirrorNode, definitionsById);
|
|
@@ -7177,35 +7283,35 @@ function prosemirrorNodeToSectionColumns(prosemirrorNode, definitionsMap) {
|
|
|
7177
7283
|
return null;
|
|
7178
7284
|
return {
|
|
7179
7285
|
id,
|
|
7180
|
-
blocks: internalProsemirrorNodesToBlocks(prosemirrorNode.content ?? [], definitionsMap)
|
|
7286
|
+
blocks: internalProsemirrorNodesToBlocks(prosemirrorNode.content ?? [], definitionsMap, 0)
|
|
7181
7287
|
};
|
|
7182
7288
|
}
|
|
7183
7289
|
function prosemirrorNodesToBlocks(prosemirrorNodes, definitions) {
|
|
7184
7290
|
const definitionsById = mapByUnique2(definitions, (d) => d.id);
|
|
7185
|
-
return internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsById);
|
|
7291
|
+
return internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsById, 0);
|
|
7186
7292
|
}
|
|
7187
7293
|
function internalProsemirrorNodesToPageItems(prosemirrorNodes, definitionsMap) {
|
|
7188
|
-
|
|
7294
|
+
const result = [];
|
|
7295
|
+
for (const prosemirrorNode of prosemirrorNodes) {
|
|
7189
7296
|
if (prosemirrorNode.type === "tabsSection") {
|
|
7190
|
-
|
|
7297
|
+
const section = prosemirrorNodeToSection(prosemirrorNode, Array.from(definitionsMap.values()));
|
|
7298
|
+
section && result.push(section);
|
|
7191
7299
|
} else {
|
|
7192
|
-
|
|
7300
|
+
result.push(...internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, 0));
|
|
7193
7301
|
}
|
|
7194
|
-
}
|
|
7302
|
+
}
|
|
7303
|
+
return result;
|
|
7195
7304
|
}
|
|
7196
|
-
function internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsMap) {
|
|
7197
|
-
return prosemirrorNodes.
|
|
7198
|
-
return internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap);
|
|
7199
|
-
})
|
|
7305
|
+
function internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsMap, depth) {
|
|
7306
|
+
return prosemirrorNodes.flatMap((prosemirrorNode) => {
|
|
7307
|
+
return internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, depth);
|
|
7308
|
+
});
|
|
7200
7309
|
}
|
|
7201
|
-
function internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap) {
|
|
7202
|
-
|
|
7310
|
+
function internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, depth) {
|
|
7311
|
+
const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId", z152.string());
|
|
7203
7312
|
if (!definitionId) {
|
|
7204
7313
|
console.warn(`definitionId on ${prosemirrorNode.type} is required to be interpreted as a block, skipping node`);
|
|
7205
|
-
return
|
|
7206
|
-
}
|
|
7207
|
-
if (definitionId === "io.supernova.block.token-detail") {
|
|
7208
|
-
definitionId = "io.supernova.block.token-list";
|
|
7314
|
+
return [];
|
|
7209
7315
|
}
|
|
7210
7316
|
const definition = definitionsMap.get(definitionId);
|
|
7211
7317
|
if (!definition) {
|
|
@@ -7213,19 +7319,23 @@ function internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap) {
|
|
|
7213
7319
|
`Block definitionId "${definitionId}" (prosemirror node ${prosemirrorNode.type}) is not among available definitions`
|
|
7214
7320
|
);
|
|
7215
7321
|
console.warn(prosemirrorNode);
|
|
7216
|
-
return
|
|
7322
|
+
return [];
|
|
7217
7323
|
}
|
|
7218
|
-
return
|
|
7324
|
+
return prosemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition, definitionsMap, depth);
|
|
7219
7325
|
}
|
|
7220
|
-
function
|
|
7326
|
+
function prosemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition, definitionsMap, depth) {
|
|
7327
|
+
const multiRichTextProperty = BlockDefinitionUtils.firstMultiRichTextProperty(definition);
|
|
7328
|
+
if (multiRichTextProperty) {
|
|
7329
|
+
return parseAsMultiRichText(prosemirrorNode, definition, multiRichTextProperty, definitionsMap, depth);
|
|
7330
|
+
}
|
|
7331
|
+
const block = shallowProsemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition);
|
|
7332
|
+
return block ? [block] : [];
|
|
7333
|
+
}
|
|
7334
|
+
function shallowProsemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition) {
|
|
7221
7335
|
const richTextProperty = BlockDefinitionUtils.firstRichTextProperty(definition);
|
|
7222
7336
|
if (richTextProperty) {
|
|
7223
7337
|
return parseAsRichText(prosemirrorNode, definition, richTextProperty);
|
|
7224
7338
|
}
|
|
7225
|
-
const multiRichTextProperty = BlockDefinitionUtils.firstMultiRichTextProperty(definition);
|
|
7226
|
-
if (multiRichTextProperty) {
|
|
7227
|
-
return parseAsMultiRichText(prosemirrorNode, definition, multiRichTextProperty);
|
|
7228
|
-
}
|
|
7229
7339
|
const tableProperty = BlockDefinitionUtils.firstTableProperty(definition);
|
|
7230
7340
|
if (tableProperty) {
|
|
7231
7341
|
return parseAsTable(prosemirrorNode, definition, tableProperty);
|
|
@@ -7281,41 +7391,58 @@ function parseCalloutType(prosemirrorCalloutType) {
|
|
|
7281
7391
|
return "Primary";
|
|
7282
7392
|
}
|
|
7283
7393
|
}
|
|
7284
|
-
function parseAsMultiRichText(prosemirrorNode, definition, property) {
|
|
7394
|
+
function parseAsMultiRichText(prosemirrorNode, definition, property, definitionsMap, depth) {
|
|
7285
7395
|
const id = getProsemirrorBlockId(prosemirrorNode);
|
|
7286
7396
|
if (!id)
|
|
7287
|
-
return
|
|
7397
|
+
return [];
|
|
7288
7398
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
type
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7399
|
+
const result = [];
|
|
7400
|
+
const listItems = [];
|
|
7401
|
+
prosemirrorNode.content?.forEach((c) => {
|
|
7402
|
+
if (c.type !== "listItem")
|
|
7403
|
+
return;
|
|
7404
|
+
c.content?.forEach((cc) => {
|
|
7405
|
+
listItems.push(cc);
|
|
7406
|
+
});
|
|
7407
|
+
});
|
|
7408
|
+
let bufferedTextItems = [];
|
|
7409
|
+
function flushBufferedTextItems() {
|
|
7410
|
+
if (!bufferedTextItems.length)
|
|
7411
|
+
return;
|
|
7412
|
+
const idSuffix = result.length ? `-${result.length}` : "";
|
|
7413
|
+
result.push({
|
|
7414
|
+
id: id + idSuffix,
|
|
7415
|
+
type: "Block",
|
|
7416
|
+
data: {
|
|
7417
|
+
packageId: definition.id,
|
|
7418
|
+
indentLevel: depth,
|
|
7419
|
+
...variantId && { variantId },
|
|
7420
|
+
items: [
|
|
7421
|
+
{
|
|
7422
|
+
id: id + idSuffix,
|
|
7423
|
+
props: {
|
|
7424
|
+
[property.id]: {
|
|
7425
|
+
value: bufferedTextItems.map((paragraph) => {
|
|
7426
|
+
return parseRichText(paragraph.content ?? []);
|
|
7427
|
+
})
|
|
7428
|
+
}
|
|
7313
7429
|
}
|
|
7314
7430
|
}
|
|
7315
|
-
|
|
7316
|
-
|
|
7431
|
+
]
|
|
7432
|
+
}
|
|
7433
|
+
});
|
|
7434
|
+
bufferedTextItems = [];
|
|
7435
|
+
}
|
|
7436
|
+
listItems.forEach((item) => {
|
|
7437
|
+
if (item.type === "paragraph") {
|
|
7438
|
+
bufferedTextItems.push(item);
|
|
7439
|
+
return;
|
|
7317
7440
|
}
|
|
7318
|
-
|
|
7441
|
+
flushBufferedTextItems();
|
|
7442
|
+
result.push(...internalProsemirrorNodeToBlock(item, definitionsMap, depth + 1));
|
|
7443
|
+
});
|
|
7444
|
+
flushBufferedTextItems();
|
|
7445
|
+
return result;
|
|
7319
7446
|
}
|
|
7320
7447
|
function parseRichText(spans) {
|
|
7321
7448
|
return {
|
|
@@ -7773,10 +7900,12 @@ export {
|
|
|
7773
7900
|
DTOWorkspaceRole,
|
|
7774
7901
|
DocumentationPageEditorModel,
|
|
7775
7902
|
DocumentationPageV1DTO,
|
|
7903
|
+
ListTreeBuilder,
|
|
7776
7904
|
NpmRegistryInput,
|
|
7777
7905
|
PageBlockEditorModel,
|
|
7778
7906
|
PageSectionEditorModel,
|
|
7779
7907
|
WorkspaceConfigurationPayload,
|
|
7908
|
+
blockToProsemirrorNode,
|
|
7780
7909
|
buildDocPagePublishPaths,
|
|
7781
7910
|
calculateElementParentChain,
|
|
7782
7911
|
documentationElementsToHierarchyDto,
|
|
@@ -7792,10 +7921,10 @@ export {
|
|
|
7792
7921
|
pageToYXmlFragment,
|
|
7793
7922
|
pmSchema,
|
|
7794
7923
|
prosemirrorDocToPage,
|
|
7795
|
-
prosemirrorNodeToBlock,
|
|
7796
7924
|
prosemirrorNodeToSection,
|
|
7797
7925
|
prosemirrorNodesToBlocks,
|
|
7798
7926
|
serializeAsCustomBlock,
|
|
7927
|
+
shallowProsemirrorNodeToBlock,
|
|
7799
7928
|
validateSsoPayload,
|
|
7800
7929
|
yDocToPage,
|
|
7801
7930
|
yXmlFragmentToPage,
|