@supernova-studio/client 0.0.4 → 0.0.5
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/package.json
CHANGED
|
@@ -86,27 +86,27 @@ export function serializeAsRichTextBlock(input: Input): ProsemirrorNode {
|
|
|
86
86
|
|
|
87
87
|
const enrichedInput: InputWithValue = { ...input, richTextPropertyValue: textPropertyValue };
|
|
88
88
|
|
|
89
|
-
const style = richTextProperty.options?.style ??
|
|
89
|
+
const style = richTextProperty.options?.style ?? "Default";
|
|
90
90
|
|
|
91
91
|
switch (style) {
|
|
92
|
-
case
|
|
92
|
+
case "Callout":
|
|
93
93
|
return serializeAsCallout(enrichedInput);
|
|
94
|
-
case
|
|
94
|
+
case "Default":
|
|
95
95
|
return serializeAsParagraph(enrichedInput);
|
|
96
96
|
|
|
97
|
-
case
|
|
97
|
+
case "Quote":
|
|
98
98
|
return serializeAsBlockquote(enrichedInput);
|
|
99
99
|
|
|
100
|
-
case
|
|
101
|
-
case
|
|
102
|
-
case
|
|
103
|
-
case
|
|
104
|
-
case
|
|
100
|
+
case "Title1":
|
|
101
|
+
case "Title2":
|
|
102
|
+
case "Title3":
|
|
103
|
+
case "Title4":
|
|
104
|
+
case "Title5":
|
|
105
105
|
return serializeAsHeading(enrichedInput);
|
|
106
106
|
|
|
107
107
|
// Todo: verify
|
|
108
|
-
case
|
|
109
|
-
case
|
|
108
|
+
case "OL":
|
|
109
|
+
case "UL":
|
|
110
110
|
throw new Error(`Not allowed!`);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -174,22 +174,22 @@ function richTextHeadingLevel(property: PageBlockDefinitionProperty): number | u
|
|
|
174
174
|
if (!style) return undefined;
|
|
175
175
|
|
|
176
176
|
switch (style) {
|
|
177
|
-
case
|
|
177
|
+
case "Title1":
|
|
178
178
|
return 1;
|
|
179
|
-
case
|
|
179
|
+
case "Title2":
|
|
180
180
|
return 2;
|
|
181
|
-
case
|
|
181
|
+
case "Title3":
|
|
182
182
|
return 3;
|
|
183
|
-
case
|
|
183
|
+
case "Title4":
|
|
184
184
|
return 4;
|
|
185
|
-
case
|
|
185
|
+
case "Title5":
|
|
186
186
|
return 5;
|
|
187
187
|
|
|
188
|
-
case
|
|
189
|
-
case
|
|
190
|
-
case
|
|
191
|
-
case
|
|
192
|
-
case
|
|
188
|
+
case "OL":
|
|
189
|
+
case "UL":
|
|
190
|
+
case "Callout":
|
|
191
|
+
case "Default":
|
|
192
|
+
case "Quote":
|
|
193
193
|
return undefined;
|
|
194
194
|
}
|
|
195
195
|
}
|
package/src/docs-editor/utils.ts
CHANGED
|
@@ -45,19 +45,19 @@ export const SDKBlockParsingUtils = {
|
|
|
45
45
|
|
|
46
46
|
export const BlockDefinitionUtils = {
|
|
47
47
|
firstRichTextProperty(definition: PageBlockDefinition) {
|
|
48
|
-
const property = definition.item.properties.find(p => p.type ===
|
|
48
|
+
const property = definition.item.properties.find(p => p.type === "RichText");
|
|
49
49
|
if (property) return property;
|
|
50
50
|
return undefined;
|
|
51
51
|
},
|
|
52
52
|
|
|
53
53
|
firstTableProperty(definition: PageBlockDefinition) {
|
|
54
|
-
const property = definition.item.properties.find(p => p.type ===
|
|
54
|
+
const property = definition.item.properties.find(p => p.type === "RichText");
|
|
55
55
|
if (property) return property;
|
|
56
56
|
return undefined;
|
|
57
57
|
},
|
|
58
58
|
|
|
59
59
|
richTextProperty(definition: PageBlockDefinition, propertyKey: string) {
|
|
60
|
-
return this.property(definition, propertyKey,
|
|
60
|
+
return this.property(definition, propertyKey, "RichText");
|
|
61
61
|
},
|
|
62
62
|
|
|
63
63
|
property(
|