@tinacms/mdx 0.0.0-8eeb2df-20241010045955 → 0.0.0-a5bc4cd-20241024211559

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.
@@ -38861,6 +38861,12 @@ var blockElement = (content3, field, imageCallback) => {
38861
38861
  type: "paragraph",
38862
38862
  children: eat2(content3.children, field, imageCallback)
38863
38863
  };
38864
+ case "mermaid":
38865
+ return {
38866
+ type: "code",
38867
+ lang: "mermaid",
38868
+ value: content3.value
38869
+ };
38864
38870
  case "code_block":
38865
38871
  return {
38866
38872
  type: "code",
@@ -39552,6 +39558,12 @@ var blockElement2 = (content3, field, imageCallback) => {
39552
39558
  type: "paragraph",
39553
39559
  children: eat3(content3.children, field, imageCallback)
39554
39560
  };
39561
+ case "mermaid":
39562
+ return {
39563
+ type: "code",
39564
+ lang: "mermaid",
39565
+ value: content3.value
39566
+ };
39555
39567
  case "code_block":
39556
39568
  return {
39557
39569
  type: "code",
@@ -42126,7 +42138,7 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
42126
42138
  case "heading":
42127
42139
  return heading2(content4);
42128
42140
  case "code":
42129
- return code3(content4);
42141
+ return parseCode(content4);
42130
42142
  case "paragraph":
42131
42143
  return paragraph2(content4);
42132
42144
  case "mdxJsxFlowElement":
@@ -42273,6 +42285,19 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
42273
42285
  );
42274
42286
  }
42275
42287
  };
42288
+ const parseCode = (content4) => {
42289
+ if (content4.lang === "mermaid") {
42290
+ return mermaid(content4);
42291
+ }
42292
+ return code3(content4);
42293
+ };
42294
+ const mermaid = (content4) => {
42295
+ return {
42296
+ type: "mermaid",
42297
+ value: content4.value,
42298
+ children: [{ type: "text", text: "" }]
42299
+ };
42300
+ };
42276
42301
  const code3 = (content4) => {
42277
42302
  const extra = {};
42278
42303
  if (content4.lang)
package/dist/index.js CHANGED
@@ -40750,6 +40750,12 @@ var blockElement = (content3, field, imageCallback) => {
40750
40750
  type: "paragraph",
40751
40751
  children: eat2(content3.children, field, imageCallback)
40752
40752
  };
40753
+ case "mermaid":
40754
+ return {
40755
+ type: "code",
40756
+ lang: "mermaid",
40757
+ value: content3.value
40758
+ };
40753
40759
  case "code_block":
40754
40760
  return {
40755
40761
  type: "code",
@@ -41448,6 +41454,12 @@ var blockElement2 = (content3, field, imageCallback) => {
41448
41454
  type: "paragraph",
41449
41455
  children: eat3(content3.children, field, imageCallback)
41450
41456
  };
41457
+ case "mermaid":
41458
+ return {
41459
+ type: "code",
41460
+ lang: "mermaid",
41461
+ value: content3.value
41462
+ };
41451
41463
  case "code_block":
41452
41464
  return {
41453
41465
  type: "code",
@@ -44031,7 +44043,7 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
44031
44043
  case "heading":
44032
44044
  return heading2(content4);
44033
44045
  case "code":
44034
- return code3(content4);
44046
+ return parseCode(content4);
44035
44047
  case "paragraph":
44036
44048
  return paragraph2(content4);
44037
44049
  case "mdxJsxFlowElement":
@@ -44178,6 +44190,19 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
44178
44190
  );
44179
44191
  }
44180
44192
  };
44193
+ const parseCode = (content4) => {
44194
+ if (content4.lang === "mermaid") {
44195
+ return mermaid(content4);
44196
+ }
44197
+ return code3(content4);
44198
+ };
44199
+ const mermaid = (content4) => {
44200
+ return {
44201
+ type: "mermaid",
44202
+ value: content4.value,
44203
+ children: [{ type: "text", text: "" }]
44204
+ };
44205
+ };
44181
44206
  const code3 = (content4) => {
44182
44207
  const extra = {};
44183
44208
  if (content4.lang)
package/dist/index.mjs CHANGED
@@ -40733,6 +40733,12 @@ var blockElement = (content3, field, imageCallback) => {
40733
40733
  type: "paragraph",
40734
40734
  children: eat2(content3.children, field, imageCallback)
40735
40735
  };
40736
+ case "mermaid":
40737
+ return {
40738
+ type: "code",
40739
+ lang: "mermaid",
40740
+ value: content3.value
40741
+ };
40736
40742
  case "code_block":
40737
40743
  return {
40738
40744
  type: "code",
@@ -41424,6 +41430,12 @@ var blockElement2 = (content3, field, imageCallback) => {
41424
41430
  type: "paragraph",
41425
41431
  children: eat3(content3.children, field, imageCallback)
41426
41432
  };
41433
+ case "mermaid":
41434
+ return {
41435
+ type: "code",
41436
+ lang: "mermaid",
41437
+ value: content3.value
41438
+ };
41427
41439
  case "code_block":
41428
41440
  return {
41429
41441
  type: "code",
@@ -43998,7 +44010,7 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
43998
44010
  case "heading":
43999
44011
  return heading2(content4);
44000
44012
  case "code":
44001
- return code3(content4);
44013
+ return parseCode(content4);
44002
44014
  case "paragraph":
44003
44015
  return paragraph2(content4);
44004
44016
  case "mdxJsxFlowElement":
@@ -44145,6 +44157,19 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
44145
44157
  );
44146
44158
  }
44147
44159
  };
44160
+ const parseCode = (content4) => {
44161
+ if (content4.lang === "mermaid") {
44162
+ return mermaid(content4);
44163
+ }
44164
+ return code3(content4);
44165
+ };
44166
+ const mermaid = (content4) => {
44167
+ return {
44168
+ type: "mermaid",
44169
+ value: content4.value,
44170
+ children: [{ type: "text", text: "" }]
44171
+ };
44172
+ };
44148
44173
  const code3 = (content4) => {
44149
44174
  const extra = {};
44150
44175
  if (content4.lang)
@@ -0,0 +1,2 @@
1
+ import type { RichTextField } from '@tinacms/schema-tools';
2
+ export declare const field: RichTextField;
@@ -0,0 +1 @@
1
+ export {};
@@ -140,10 +140,18 @@ export type TableElement = {
140
140
  children: TableRowElement[];
141
141
  props: Record<string, unknown>;
142
142
  };
143
+ /**
144
+ * @group MermaidElement
145
+ */
146
+ export type MermaidElement = {
147
+ type: 'mermaid';
148
+ value: string;
149
+ children: [EmptyTextElement];
150
+ };
143
151
  /**
144
152
  * @group BlockElement
145
153
  */
146
- export type BlockElement = BlockquoteElement | CodeBlockElement | HeadingElement | HrElement | HTMLElement | ImageElement | InvalidMarkdownElement | ListItemElement | MdxBlockElement | ParagraphElement | OrderedListElement | UnorderedListElement | TableCellElement | TableRowElement | TableElement;
154
+ export type BlockElement = BlockquoteElement | CodeBlockElement | HeadingElement | HrElement | HTMLElement | ImageElement | InvalidMarkdownElement | ListItemElement | MdxBlockElement | ParagraphElement | MermaidElement | OrderedListElement | UnorderedListElement | TableCellElement | TableRowElement | TableElement;
147
155
  /**
148
156
  * @group InlineElement
149
157
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/mdx",
3
- "version": "0.0.0-8eeb2df-20241010045955",
3
+ "version": "0.0.0-a5bc4cd-20241024211559",
4
4
  "typings": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "browser": "dist/index.browser.mjs",
@@ -56,7 +56,7 @@
56
56
  "unist-util-visit": "4.1.2",
57
57
  "uvu": "0.5.6",
58
58
  "vfile-message": "3.1.4",
59
- "@tinacms/schema-tools": "1.6.5"
59
+ "@tinacms/schema-tools": "0.0.0-a5bc4cd-20241024211559"
60
60
  },
61
61
  "publishConfig": {
62
62
  "registry": "https://registry.npmjs.org"
@@ -80,7 +80,7 @@
80
80
  "typescript": "^5.6.2",
81
81
  "vite": "^4.5.5",
82
82
  "vitest": "^0.32.4",
83
- "@tinacms/scripts": "0.0.0-8eeb2df-20241010045955"
83
+ "@tinacms/scripts": "1.3.0"
84
84
  },
85
85
  "scripts": {
86
86
  "types": "tsc",