@supernova-studio/client 0.9.2 → 0.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/client",
3
- "version": "0.9.2",
3
+ "version": "0.10.0",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,11 @@
1
+ import { DesignSystem, ObjectMeta } from "@supernova-studio/model";
2
+ import { z } from "zod";
3
+
4
+ export const DesignSystemDTO = DesignSystem.omit({
5
+ name: true,
6
+ description: true,
7
+ }).extend({
8
+ meta: ObjectMeta,
9
+ });
10
+
11
+ export type DesignSystemDTO = z.infer<typeof DesignSystemDTO>;
@@ -1,3 +1,4 @@
1
+ export * from "./design-system";
1
2
  export * from "./documentation-v1";
2
3
  export * from "./documentation-v2";
3
4
  export * from "./documentation";
@@ -13,6 +13,8 @@ import {
13
13
  PageBlockItemTableCell,
14
14
  PageBlockItemTableValue,
15
15
  PageBlockItemTableRow,
16
+ PageBlockDefinitionRichTextOptions,
17
+ PageBlockDefinitionMutiRichTextOptions,
16
18
  } from "@supernova-studio/model";
17
19
  import { PageBlockEditorModel } from "./model/block";
18
20
  import { ProsemirrorNode, ProsemirrorMark } from "./prosemirror/types";
@@ -149,7 +151,8 @@ function serializeAsRichTextBlock(input: InputWithProperty): ProsemirrorNode {
149
151
 
150
152
  const enrichedInput: RichTextInputWithValue = { ...input, richTextPropertyValue: textPropertyValue };
151
153
 
152
- const style = richTextProperty.options?.richTextStyle ?? "Default";
154
+ const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
155
+ const style = parsedOptions?.richTextStyle ?? "Default";
153
156
 
154
157
  switch (style) {
155
158
  case "Callout":
@@ -214,14 +217,15 @@ function serializeAsCallout(input: RichTextInputWithValue): ProsemirrorNode {
214
217
  //
215
218
 
216
219
  function serializeAsMultiRichTextBlock(input: InputWithProperty): ProsemirrorNode {
217
- const { block, definition, property: richTextProperty } = input;
220
+ const { block, definition, property: multiRichTextProperty } = input;
218
221
 
219
222
  const blockItem = BlockParsingUtils.singleBlockItem(block);
220
- const textPropertyValue = BlockParsingUtils.multiRichTextPropertyValue(blockItem, richTextProperty.id);
223
+ const textPropertyValue = BlockParsingUtils.multiRichTextPropertyValue(blockItem, multiRichTextProperty.id);
221
224
 
222
225
  const enrichedInput: MultiRichTextInputWithValue = { ...input, multiRichTextPropertyValue: textPropertyValue };
223
226
 
224
- const style = richTextProperty.options?.multiRichTextStyle ?? "Default";
227
+ const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
228
+ const style = parsedOptions?.multiRichTextStyle ?? "Default";
225
229
 
226
230
  switch (style) {
227
231
  case "Default":