@surrealdb/ui 1.0.26 → 1.0.28

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/fonts.d.ts CHANGED
@@ -89,15 +89,15 @@ declare module "@mantine/core" {
89
89
  }
90
90
 
91
91
  declare module "@mantine/core" {
92
- type ExtendedCustomColors = "obsidian" | "slate" | import("@mantine/core").DefaultMantineColor;
93
- interface MantineThemeColorsOverride {
94
- colors: Record<ExtendedCustomColors, import("@mantine/core").MantineColorsTuple>;
92
+ type ExtendedCustomSizes = import("@mantine/core").DefaultMantineSize | "2xl" | "3xl";
93
+ interface MantineThemeSizesOverride {
94
+ spacing: Record<ExtendedCustomSizes, string>;
95
95
  }
96
96
  }
97
97
 
98
98
  declare module "@mantine/core" {
99
- type ExtendedCustomSizes = import("@mantine/core").DefaultMantineSize | "2xl" | "3xl";
100
- interface MantineThemeSizesOverride {
101
- spacing: Record<ExtendedCustomSizes, string>;
99
+ type ExtendedCustomColors = "obsidian" | "slate" | import("@mantine/core").DefaultMantineColor;
100
+ interface MantineThemeColorsOverride {
101
+ colors: Record<ExtendedCustomColors, import("@mantine/core").MantineColorsTuple>;
102
102
  }
103
103
  }
package/dist/ui.d.ts CHANGED
@@ -821,6 +821,10 @@ export declare interface MarkdownProps {
821
821
  components?: Partial<Record<string, React_2.ComponentType<unknown>>>;
822
822
  }
823
823
 
824
+ declare type NodeOfType<T extends AnyNode["type"]> = Extract<AnyNode, {
825
+ type: T;
826
+ }>;
827
+
824
828
  /**
825
829
  * Note/Callout component with variants: note, important, warning, caution
826
830
  */
@@ -844,11 +848,6 @@ export declare interface ParagraphNode {
844
848
  style?: string;
845
849
  }
846
850
 
847
- /**
848
- * Parse markdown string to AST
849
- */
850
- export declare function parse(markdown: string): Root;
851
-
852
851
  /**
853
852
  * Parse HTML-style attributes from a string
854
853
  * Handles: name="value", name='value', name=value
@@ -898,6 +897,11 @@ export declare function parseLink(text: string, startIndex: number): {
898
897
 
899
898
  export declare function parseList(state: ParserState): void;
900
899
 
900
+ /**
901
+ * Parse markdown string to AST
902
+ */
903
+ export declare function parseMarkdown(markdown: string): Root;
904
+
901
905
  export declare function parseParagraph(state: ParserState): void;
902
906
 
903
907
  export declare interface ParserState {
@@ -1606,7 +1610,7 @@ export declare function useSwitch(initialState?: boolean, callbacks?: {
1606
1610
  */
1607
1611
  export declare function visit(tree: Root | AnyNode, visitor: Visitor): void;
1608
1612
 
1609
- export declare function visit<T extends AnyNode>(tree: Root | AnyNode, nodeType: T["type"], visitor: TypeVisitor<T>): void;
1613
+ export declare function visit<T extends AnyNode["type"]>(tree: Root | AnyNode, nodeType: T, visitor: TypeVisitor<NodeOfType<T>>): void;
1610
1614
 
1611
1615
  /**
1612
1616
  * Generic visitor function
@@ -1709,15 +1713,15 @@ declare module "@mantine/core" {
1709
1713
  }
1710
1714
 
1711
1715
  declare module "@mantine/core" {
1712
- type ExtendedCustomColors = "obsidian" | "slate" | import("@mantine/core").DefaultMantineColor;
1713
- interface MantineThemeColorsOverride {
1714
- colors: Record<ExtendedCustomColors, import("@mantine/core").MantineColorsTuple>;
1716
+ type ExtendedCustomSizes = import("@mantine/core").DefaultMantineSize | "2xl" | "3xl";
1717
+ interface MantineThemeSizesOverride {
1718
+ spacing: Record<ExtendedCustomSizes, string>;
1715
1719
  }
1716
1720
  }
1717
1721
 
1718
1722
  declare module "@mantine/core" {
1719
- type ExtendedCustomSizes = import("@mantine/core").DefaultMantineSize | "2xl" | "3xl";
1720
- interface MantineThemeSizesOverride {
1721
- spacing: Record<ExtendedCustomSizes, string>;
1723
+ type ExtendedCustomColors = "obsidian" | "slate" | import("@mantine/core").DefaultMantineColor;
1724
+ interface MantineThemeColorsOverride {
1725
+ colors: Record<ExtendedCustomColors, import("@mantine/core").MantineColorsTuple>;
1722
1726
  }
1723
1727
  }
package/dist/ui.js CHANGED
@@ -2978,7 +2978,7 @@ function tQ(O, e, i) {
2978
2978
  type: "code",
2979
2979
  value: e
2980
2980
  };
2981
- return i && (t.lang = i), O.title && (t.title = O.title), O.runnable && (t.runnable = O.runnable), O.class && (t.className = O.class), O.id && (t.id = O.id), O.style && (t.style = O.style), t;
2981
+ return i && (t.lang = i), "title" in O && (t.title = O.title), "runnable" in O && (t.runnable = O.runnable), "class" in O && (t.className = O.class), "id" in O && (t.id = O.id), "style" in O && (t.style = O.style), t;
2982
2982
  }
2983
2983
  function QQ(O) {
2984
2984
  const t = O.lines[O.currentIndex].trim().match(/^```(\w+)?\s*(.*)$/), Q = t?.[1], a = t?.[2] || "";
@@ -3136,7 +3136,7 @@ function u2(O) {
3136
3136
  src: O.src || "",
3137
3137
  alt: O.alt || ""
3138
3138
  };
3139
- return O.title && (e.title = O.title), O.darkSrc && (e.darkSrc = O.darkSrc), O.class && (e.className = O.class), O.id && (e.id = O.id), O.style && (e.style = O.style), e;
3139
+ return "title" in O && (e.title = O.title), "darkSrc" in O && (e.darkSrc = O.darkSrc), "class" in O && (e.className = O.class), "id" in O && (e.id = O.id), "style" in O && (e.style = O.style), e;
3140
3140
  }
3141
3141
  function PQ(O, e) {
3142
3142
  if (e + 1 >= O.length || O[e] !== "!" || O[e + 1] !== "[")
@@ -3557,7 +3557,7 @@ function VQ(O) {
3557
3557
  type: "details",
3558
3558
  children: []
3559
3559
  };
3560
- return O.class && (e.className = O.class), O.id && (e.id = O.id), O.style && (e.style = O.style), e;
3560
+ return "class" in O && (e.className = O.class), "id" in O && (e.id = O.id), "style" in O && (e.style = O.style), e;
3561
3561
  }
3562
3562
  function xQ(O, e) {
3563
3563
  const i = VQ(e);
@@ -3609,7 +3609,7 @@ function wQ(O) {
3609
3609
  type: "summary",
3610
3610
  children: []
3611
3611
  };
3612
- return O.class && (e.className = O.class), O.id && (e.id = O.id), O.style && (e.style = O.style), e;
3612
+ return "class" in O && (e.className = O.class), "id" in O && (e.id = O.id), "style" in O && (e.style = O.style), e;
3613
3613
  }
3614
3614
  function yQ(O, e) {
3615
3615
  const i = wQ(e);
@@ -3671,7 +3671,7 @@ function RQ(O) {
3671
3671
  if (s) {
3672
3672
  if (a === "br") {
3673
3673
  const l = { type: "break" };
3674
- c.class && (l.className = c.class), c.id && (l.id = c.id), c.style && (l.style = c.style);
3674
+ "class" in c && (l.className = c.class), "id" in c && (l.id = c.id), "style" in c && (l.style = c.style);
3675
3675
  const P = {
3676
3676
  type: "paragraph",
3677
3677
  children: [l]
@@ -7758,7 +7758,7 @@ function $6({
7758
7758
  I,
7759
7759
  {
7760
7760
  pos: "relative",
7761
- "data-loading": !0,
7761
+ "data-loading": $ === "loading",
7762
7762
  ...c,
7763
7763
  w: "100%",
7764
7764
  className: t1(ee.container, c.className),
@@ -7912,7 +7912,7 @@ function l6() {
7912
7912
  // List items
7913
7913
  listItem: ({ node: O, children: e }) => {
7914
7914
  const i = {};
7915
- return O.className && (i.className = O.className), O.id && (i.id = O.id), O.style && (i.style = O.style), /* @__PURE__ */ T(Fe.Item, { ...i, children: e });
7915
+ return "className" in O && (i.className = O.className), "id" in O && (i.id = O.id), "style" in O && (i.style = O.style), /* @__PURE__ */ T(Fe.Item, { ...i, children: e });
7916
7916
  },
7917
7917
  // Blockquote with note detection
7918
7918
  blockquote: ({ node: O, children: e }) => O.noteKind ? /* @__PURE__ */ T(
@@ -7939,10 +7939,10 @@ function l6() {
7939
7939
  // Code blocks
7940
7940
  code: ({ node: O }) => {
7941
7941
  const e = O.value, i = {};
7942
- return O.className && (i.className = O.className), O.id && (i.id = O.id), O.style && (i.style = O.style), i.mb = "sm", O.runnable ? /* @__PURE__ */ T(
7942
+ return "className" in O && (i.className = O.className), "id" in O && (i.id = O.id), "style" in O && (i.style = O.style), i.mb = "sm", "runnable" in O ? /* @__PURE__ */ T(
7943
7943
  $6,
7944
7944
  {
7945
- runnable: O.runnable,
7945
+ runnable: O.runnable ?? "",
7946
7946
  value: e,
7947
7947
  lang: O.lang,
7948
7948
  title: O.title,
@@ -8026,11 +8026,11 @@ function l6() {
8026
8026
  // Details and Summary elements
8027
8027
  details: ({ node: O, children: e }) => {
8028
8028
  const i = {};
8029
- return O.className && (i.className = O.className), O.id && (i.id = O.id), O.style && (i.style = O.style), /* @__PURE__ */ T(fe, { ...i, children: e });
8029
+ return "className" in O && (i.className = O.className), "id" in O && (i.id = O.id), "style" in O && (i.style = O.style), /* @__PURE__ */ T(fe, { ...i, children: e });
8030
8030
  },
8031
8031
  summary: ({ node: O, children: e }) => {
8032
8032
  const i = {};
8033
- return O.className && (i.className = O.className), O.id && (i.id = O.id), O.style && (i.style = O.style), /* @__PURE__ */ T(fe.Summary, { ...i, children: e });
8033
+ return "className" in O && (i.className = O.className), "id" in O && (i.id = O.id), "style" in O && (i.style = O.style), /* @__PURE__ */ T(fe.Summary, { ...i, children: e });
8034
8034
  },
8035
8035
  // Images - use ThemedImage if darkSrc is present, otherwise use Mantine Image
8036
8036
  image: ({ node: O }) => {
@@ -8038,7 +8038,7 @@ function l6() {
8038
8038
  src: O.src,
8039
8039
  alt: O.alt
8040
8040
  };
8041
- return O.title && (i.title = O.title), O.className && (i.className = O.className), O.id && (i.id = O.id), O.style && (i.style = O.style), e ? /* @__PURE__ */ T(
8041
+ return "title" in O && (i.title = O.title), "className" in O && (i.className = O.className), "id" in O && (i.id = O.id), "style" in O && (i.style = O.style), e ? /* @__PURE__ */ T(
8042
8042
  n6,
8043
8043
  {
8044
8044
  ...i,
@@ -8809,7 +8809,6 @@ export {
8809
8809
  fs as iconXml,
8810
8810
  uQ as isEmojiCodePoint,
8811
8811
  iQ as isSelfClosingTag,
8812
- zQ as parse,
8813
8812
  X2 as parseAttributes,
8814
8813
  eQ as parseBlockquote,
8815
8814
  QQ as parseCodeBlock,
@@ -8823,6 +8822,7 @@ export {
8823
8822
  PO as parseInlines,
8824
8823
  XQ as parseLink,
8825
8824
  i5 as parseList,
8825
+ zQ as parseMarkdown,
8826
8826
  hQ as parseParagraph,
8827
8827
  SQ as parseStrong,
8828
8828
  yQ as parseSummaryTag,