@tinacms/mdx 0.0.0-b1fe6d2-20241008011354 → 0.0.0-b4c6a60-20241010070518
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.browser.mjs
CHANGED
|
@@ -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",
|
|
@@ -38869,11 +38875,11 @@ var blockElement = (content3, field, imageCallback) => {
|
|
|
38869
38875
|
};
|
|
38870
38876
|
case "mdxJsxFlowElement":
|
|
38871
38877
|
if (content3.name === "table") {
|
|
38872
|
-
const
|
|
38878
|
+
const table2 = content3.props;
|
|
38873
38879
|
return {
|
|
38874
38880
|
type: "table",
|
|
38875
|
-
align:
|
|
38876
|
-
children:
|
|
38881
|
+
align: table2.align,
|
|
38882
|
+
children: table2.tableRows.map((tableRow) => {
|
|
38877
38883
|
const tr2 = {
|
|
38878
38884
|
type: "tableRow",
|
|
38879
38885
|
children: tableRow.tableCells.map(({ value }) => {
|
|
@@ -38969,6 +38975,27 @@ var blockElement = (content3, field, imageCallback) => {
|
|
|
38969
38975
|
}
|
|
38970
38976
|
]
|
|
38971
38977
|
};
|
|
38978
|
+
case "table":
|
|
38979
|
+
const table = content3.props;
|
|
38980
|
+
return {
|
|
38981
|
+
type: "table",
|
|
38982
|
+
align: table?.align,
|
|
38983
|
+
children: content3.children.map((tableRow) => {
|
|
38984
|
+
return {
|
|
38985
|
+
type: "tableRow",
|
|
38986
|
+
children: tableRow.children.map((tableCell) => {
|
|
38987
|
+
return {
|
|
38988
|
+
type: "tableCell",
|
|
38989
|
+
children: eat2(
|
|
38990
|
+
tableCell.children?.at(0)?.children || [],
|
|
38991
|
+
field,
|
|
38992
|
+
imageCallback
|
|
38993
|
+
)
|
|
38994
|
+
};
|
|
38995
|
+
})
|
|
38996
|
+
};
|
|
38997
|
+
})
|
|
38998
|
+
};
|
|
38972
38999
|
default:
|
|
38973
39000
|
throw new Error(`BlockElement: ${content3.type} is not yet supported`);
|
|
38974
39001
|
}
|
|
@@ -39188,6 +39215,7 @@ function stringifyProps2(element2, parentField, flatten2, imageCallback) {
|
|
|
39188
39215
|
if (field.list) {
|
|
39189
39216
|
throw new Error(`Rich-text list is not supported`);
|
|
39190
39217
|
} else {
|
|
39218
|
+
console.log("RICH-TEXT StringifyProps", value);
|
|
39191
39219
|
const joiner = flatten2 ? " " : "\n";
|
|
39192
39220
|
let val = "";
|
|
39193
39221
|
assertShape2(
|
|
@@ -39531,6 +39559,12 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
39531
39559
|
type: "paragraph",
|
|
39532
39560
|
children: eat3(content3.children, field, imageCallback)
|
|
39533
39561
|
};
|
|
39562
|
+
case "mermaid":
|
|
39563
|
+
return {
|
|
39564
|
+
type: "code",
|
|
39565
|
+
lang: "mermaid",
|
|
39566
|
+
value: content3.value
|
|
39567
|
+
};
|
|
39534
39568
|
case "code_block":
|
|
39535
39569
|
return {
|
|
39536
39570
|
type: "code",
|
|
@@ -39539,11 +39573,11 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
39539
39573
|
};
|
|
39540
39574
|
case "mdxJsxFlowElement":
|
|
39541
39575
|
if (content3.name === "table") {
|
|
39542
|
-
const
|
|
39576
|
+
const table2 = content3.props;
|
|
39543
39577
|
return {
|
|
39544
39578
|
type: "table",
|
|
39545
|
-
align:
|
|
39546
|
-
children:
|
|
39579
|
+
align: table2.align,
|
|
39580
|
+
children: table2.tableRows.map((tableRow) => {
|
|
39547
39581
|
const tr2 = {
|
|
39548
39582
|
type: "tableRow",
|
|
39549
39583
|
children: tableRow.tableCells.map(({ value }) => {
|
|
@@ -39610,6 +39644,27 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
39610
39644
|
}
|
|
39611
39645
|
]
|
|
39612
39646
|
};
|
|
39647
|
+
case "table":
|
|
39648
|
+
const table = content3.props;
|
|
39649
|
+
return {
|
|
39650
|
+
type: "table",
|
|
39651
|
+
align: table?.align,
|
|
39652
|
+
children: content3.children.map((tableRow) => {
|
|
39653
|
+
return {
|
|
39654
|
+
type: "tableRow",
|
|
39655
|
+
children: tableRow.children.map((tableCell) => {
|
|
39656
|
+
return {
|
|
39657
|
+
type: "tableCell",
|
|
39658
|
+
children: eat3(
|
|
39659
|
+
tableCell.children?.at(0)?.children || [],
|
|
39660
|
+
field,
|
|
39661
|
+
imageCallback
|
|
39662
|
+
)
|
|
39663
|
+
};
|
|
39664
|
+
})
|
|
39665
|
+
};
|
|
39666
|
+
})
|
|
39667
|
+
};
|
|
39613
39668
|
default:
|
|
39614
39669
|
throw new Error(`BlockElement: ${content3.type} is not yet supported`);
|
|
39615
39670
|
}
|
|
@@ -42043,32 +42098,29 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
|
|
|
42043
42098
|
switch (content4.type) {
|
|
42044
42099
|
case "table": {
|
|
42045
42100
|
return {
|
|
42046
|
-
type: "
|
|
42047
|
-
children:
|
|
42048
|
-
|
|
42049
|
-
|
|
42050
|
-
|
|
42051
|
-
|
|
42052
|
-
|
|
42053
|
-
|
|
42054
|
-
|
|
42055
|
-
|
|
42056
|
-
|
|
42057
|
-
|
|
42058
|
-
|
|
42059
|
-
|
|
42060
|
-
|
|
42061
|
-
child2.children.map(
|
|
42062
|
-
(child3) => phrasingContent(child3)
|
|
42063
|
-
)
|
|
42064
|
-
)
|
|
42065
|
-
}
|
|
42066
|
-
]
|
|
42101
|
+
type: "table",
|
|
42102
|
+
children: content4.children.map((tableRow) => {
|
|
42103
|
+
return {
|
|
42104
|
+
type: "tr",
|
|
42105
|
+
children: tableRow.children.map((tableCell) => {
|
|
42106
|
+
return {
|
|
42107
|
+
type: "td",
|
|
42108
|
+
children: [
|
|
42109
|
+
{
|
|
42110
|
+
type: "p",
|
|
42111
|
+
children: (0, import_lodash.default)(
|
|
42112
|
+
tableCell.children.map(
|
|
42113
|
+
(child) => phrasingContent(child)
|
|
42114
|
+
)
|
|
42115
|
+
)
|
|
42067
42116
|
}
|
|
42068
|
-
|
|
42069
|
-
}
|
|
42070
|
-
}
|
|
42071
|
-
}
|
|
42117
|
+
]
|
|
42118
|
+
};
|
|
42119
|
+
})
|
|
42120
|
+
};
|
|
42121
|
+
}),
|
|
42122
|
+
props: {
|
|
42123
|
+
align: content4.align?.filter((item) => !!item)
|
|
42072
42124
|
}
|
|
42073
42125
|
};
|
|
42074
42126
|
}
|
|
@@ -42087,7 +42139,7 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
|
|
|
42087
42139
|
case "heading":
|
|
42088
42140
|
return heading2(content4);
|
|
42089
42141
|
case "code":
|
|
42090
|
-
return
|
|
42142
|
+
return parseCode(content4);
|
|
42091
42143
|
case "paragraph":
|
|
42092
42144
|
return paragraph2(content4);
|
|
42093
42145
|
case "mdxJsxFlowElement":
|
|
@@ -42234,6 +42286,19 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
|
|
|
42234
42286
|
);
|
|
42235
42287
|
}
|
|
42236
42288
|
};
|
|
42289
|
+
const parseCode = (content4) => {
|
|
42290
|
+
if (content4.lang === "mermaid") {
|
|
42291
|
+
return mermaid(content4);
|
|
42292
|
+
}
|
|
42293
|
+
return code3(content4);
|
|
42294
|
+
};
|
|
42295
|
+
const mermaid = (content4) => {
|
|
42296
|
+
return {
|
|
42297
|
+
type: "mermaid",
|
|
42298
|
+
value: content4.value,
|
|
42299
|
+
children: [{ type: "text", text: "" }]
|
|
42300
|
+
};
|
|
42301
|
+
};
|
|
42237
42302
|
const code3 = (content4) => {
|
|
42238
42303
|
const extra = {};
|
|
42239
42304
|
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",
|
|
@@ -40758,11 +40764,11 @@ var blockElement = (content3, field, imageCallback) => {
|
|
|
40758
40764
|
};
|
|
40759
40765
|
case "mdxJsxFlowElement":
|
|
40760
40766
|
if (content3.name === "table") {
|
|
40761
|
-
const
|
|
40767
|
+
const table2 = content3.props;
|
|
40762
40768
|
return {
|
|
40763
40769
|
type: "table",
|
|
40764
|
-
align:
|
|
40765
|
-
children:
|
|
40770
|
+
align: table2.align,
|
|
40771
|
+
children: table2.tableRows.map((tableRow) => {
|
|
40766
40772
|
const tr2 = {
|
|
40767
40773
|
type: "tableRow",
|
|
40768
40774
|
children: tableRow.tableCells.map(({ value }) => {
|
|
@@ -40859,6 +40865,28 @@ var blockElement = (content3, field, imageCallback) => {
|
|
|
40859
40865
|
}
|
|
40860
40866
|
]
|
|
40861
40867
|
};
|
|
40868
|
+
case "table":
|
|
40869
|
+
const table = content3.props;
|
|
40870
|
+
return {
|
|
40871
|
+
type: "table",
|
|
40872
|
+
align: table == null ? void 0 : table.align,
|
|
40873
|
+
children: content3.children.map((tableRow) => {
|
|
40874
|
+
return {
|
|
40875
|
+
type: "tableRow",
|
|
40876
|
+
children: tableRow.children.map((tableCell) => {
|
|
40877
|
+
var _a3, _b;
|
|
40878
|
+
return {
|
|
40879
|
+
type: "tableCell",
|
|
40880
|
+
children: eat2(
|
|
40881
|
+
((_b = (_a3 = tableCell.children) == null ? void 0 : _a3.at(0)) == null ? void 0 : _b.children) || [],
|
|
40882
|
+
field,
|
|
40883
|
+
imageCallback
|
|
40884
|
+
)
|
|
40885
|
+
};
|
|
40886
|
+
})
|
|
40887
|
+
};
|
|
40888
|
+
})
|
|
40889
|
+
};
|
|
40862
40890
|
default:
|
|
40863
40891
|
throw new Error(`BlockElement: ${content3.type} is not yet supported`);
|
|
40864
40892
|
}
|
|
@@ -41081,6 +41109,7 @@ function stringifyProps2(element, parentField, flatten2, imageCallback) {
|
|
|
41081
41109
|
if (field.list) {
|
|
41082
41110
|
throw new Error(`Rich-text list is not supported`);
|
|
41083
41111
|
} else {
|
|
41112
|
+
console.log("RICH-TEXT StringifyProps", value);
|
|
41084
41113
|
const joiner = flatten2 ? " " : "\n";
|
|
41085
41114
|
let val = "";
|
|
41086
41115
|
assertShape2(
|
|
@@ -41426,6 +41455,12 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
41426
41455
|
type: "paragraph",
|
|
41427
41456
|
children: eat3(content3.children, field, imageCallback)
|
|
41428
41457
|
};
|
|
41458
|
+
case "mermaid":
|
|
41459
|
+
return {
|
|
41460
|
+
type: "code",
|
|
41461
|
+
lang: "mermaid",
|
|
41462
|
+
value: content3.value
|
|
41463
|
+
};
|
|
41429
41464
|
case "code_block":
|
|
41430
41465
|
return {
|
|
41431
41466
|
type: "code",
|
|
@@ -41434,11 +41469,11 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
41434
41469
|
};
|
|
41435
41470
|
case "mdxJsxFlowElement":
|
|
41436
41471
|
if (content3.name === "table") {
|
|
41437
|
-
const
|
|
41472
|
+
const table2 = content3.props;
|
|
41438
41473
|
return {
|
|
41439
41474
|
type: "table",
|
|
41440
|
-
align:
|
|
41441
|
-
children:
|
|
41475
|
+
align: table2.align,
|
|
41476
|
+
children: table2.tableRows.map((tableRow) => {
|
|
41442
41477
|
const tr2 = {
|
|
41443
41478
|
type: "tableRow",
|
|
41444
41479
|
children: tableRow.tableCells.map(({ value }) => {
|
|
@@ -41506,6 +41541,28 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
41506
41541
|
}
|
|
41507
41542
|
]
|
|
41508
41543
|
};
|
|
41544
|
+
case "table":
|
|
41545
|
+
const table = content3.props;
|
|
41546
|
+
return {
|
|
41547
|
+
type: "table",
|
|
41548
|
+
align: table == null ? void 0 : table.align,
|
|
41549
|
+
children: content3.children.map((tableRow) => {
|
|
41550
|
+
return {
|
|
41551
|
+
type: "tableRow",
|
|
41552
|
+
children: tableRow.children.map((tableCell) => {
|
|
41553
|
+
var _a3, _b;
|
|
41554
|
+
return {
|
|
41555
|
+
type: "tableCell",
|
|
41556
|
+
children: eat3(
|
|
41557
|
+
((_b = (_a3 = tableCell.children) == null ? void 0 : _a3.at(0)) == null ? void 0 : _b.children) || [],
|
|
41558
|
+
field,
|
|
41559
|
+
imageCallback
|
|
41560
|
+
)
|
|
41561
|
+
};
|
|
41562
|
+
})
|
|
41563
|
+
};
|
|
41564
|
+
})
|
|
41565
|
+
};
|
|
41509
41566
|
default:
|
|
41510
41567
|
throw new Error(`BlockElement: ${content3.type} is not yet supported`);
|
|
41511
41568
|
}
|
|
@@ -43946,32 +44003,29 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
|
|
|
43946
44003
|
switch (content4.type) {
|
|
43947
44004
|
case "table": {
|
|
43948
44005
|
return {
|
|
43949
|
-
type: "
|
|
43950
|
-
children:
|
|
43951
|
-
|
|
43952
|
-
|
|
43953
|
-
|
|
43954
|
-
|
|
43955
|
-
|
|
43956
|
-
|
|
43957
|
-
|
|
43958
|
-
|
|
43959
|
-
|
|
43960
|
-
|
|
43961
|
-
|
|
43962
|
-
|
|
43963
|
-
|
|
43964
|
-
child2.children.map(
|
|
43965
|
-
(child3) => phrasingContent(child3)
|
|
43966
|
-
)
|
|
43967
|
-
)
|
|
43968
|
-
}
|
|
43969
|
-
]
|
|
44006
|
+
type: "table",
|
|
44007
|
+
children: content4.children.map((tableRow) => {
|
|
44008
|
+
return {
|
|
44009
|
+
type: "tr",
|
|
44010
|
+
children: tableRow.children.map((tableCell) => {
|
|
44011
|
+
return {
|
|
44012
|
+
type: "td",
|
|
44013
|
+
children: [
|
|
44014
|
+
{
|
|
44015
|
+
type: "p",
|
|
44016
|
+
children: (0, import_lodash.default)(
|
|
44017
|
+
tableCell.children.map(
|
|
44018
|
+
(child) => phrasingContent(child)
|
|
44019
|
+
)
|
|
44020
|
+
)
|
|
43970
44021
|
}
|
|
43971
|
-
|
|
43972
|
-
}
|
|
43973
|
-
}
|
|
43974
|
-
}
|
|
44022
|
+
]
|
|
44023
|
+
};
|
|
44024
|
+
})
|
|
44025
|
+
};
|
|
44026
|
+
}),
|
|
44027
|
+
props: {
|
|
44028
|
+
align: (_a3 = content4.align) == null ? void 0 : _a3.filter((item) => !!item)
|
|
43975
44029
|
}
|
|
43976
44030
|
};
|
|
43977
44031
|
}
|
|
@@ -43990,7 +44044,7 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
|
|
|
43990
44044
|
case "heading":
|
|
43991
44045
|
return heading2(content4);
|
|
43992
44046
|
case "code":
|
|
43993
|
-
return
|
|
44047
|
+
return parseCode(content4);
|
|
43994
44048
|
case "paragraph":
|
|
43995
44049
|
return paragraph2(content4);
|
|
43996
44050
|
case "mdxJsxFlowElement":
|
|
@@ -44137,6 +44191,19 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
|
|
|
44137
44191
|
);
|
|
44138
44192
|
}
|
|
44139
44193
|
};
|
|
44194
|
+
const parseCode = (content4) => {
|
|
44195
|
+
if (content4.lang === "mermaid") {
|
|
44196
|
+
return mermaid(content4);
|
|
44197
|
+
}
|
|
44198
|
+
return code3(content4);
|
|
44199
|
+
};
|
|
44200
|
+
const mermaid = (content4) => {
|
|
44201
|
+
return {
|
|
44202
|
+
type: "mermaid",
|
|
44203
|
+
value: content4.value,
|
|
44204
|
+
children: [{ type: "text", text: "" }]
|
|
44205
|
+
};
|
|
44206
|
+
};
|
|
44140
44207
|
const code3 = (content4) => {
|
|
44141
44208
|
const extra = {};
|
|
44142
44209
|
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",
|
|
@@ -40741,11 +40747,11 @@ var blockElement = (content3, field, imageCallback) => {
|
|
|
40741
40747
|
};
|
|
40742
40748
|
case "mdxJsxFlowElement":
|
|
40743
40749
|
if (content3.name === "table") {
|
|
40744
|
-
const
|
|
40750
|
+
const table2 = content3.props;
|
|
40745
40751
|
return {
|
|
40746
40752
|
type: "table",
|
|
40747
|
-
align:
|
|
40748
|
-
children:
|
|
40753
|
+
align: table2.align,
|
|
40754
|
+
children: table2.tableRows.map((tableRow) => {
|
|
40749
40755
|
const tr2 = {
|
|
40750
40756
|
type: "tableRow",
|
|
40751
40757
|
children: tableRow.tableCells.map(({ value }) => {
|
|
@@ -40841,6 +40847,27 @@ var blockElement = (content3, field, imageCallback) => {
|
|
|
40841
40847
|
}
|
|
40842
40848
|
]
|
|
40843
40849
|
};
|
|
40850
|
+
case "table":
|
|
40851
|
+
const table = content3.props;
|
|
40852
|
+
return {
|
|
40853
|
+
type: "table",
|
|
40854
|
+
align: table?.align,
|
|
40855
|
+
children: content3.children.map((tableRow) => {
|
|
40856
|
+
return {
|
|
40857
|
+
type: "tableRow",
|
|
40858
|
+
children: tableRow.children.map((tableCell) => {
|
|
40859
|
+
return {
|
|
40860
|
+
type: "tableCell",
|
|
40861
|
+
children: eat2(
|
|
40862
|
+
tableCell.children?.at(0)?.children || [],
|
|
40863
|
+
field,
|
|
40864
|
+
imageCallback
|
|
40865
|
+
)
|
|
40866
|
+
};
|
|
40867
|
+
})
|
|
40868
|
+
};
|
|
40869
|
+
})
|
|
40870
|
+
};
|
|
40844
40871
|
default:
|
|
40845
40872
|
throw new Error(`BlockElement: ${content3.type} is not yet supported`);
|
|
40846
40873
|
}
|
|
@@ -41060,6 +41087,7 @@ function stringifyProps2(element, parentField, flatten2, imageCallback) {
|
|
|
41060
41087
|
if (field.list) {
|
|
41061
41088
|
throw new Error(`Rich-text list is not supported`);
|
|
41062
41089
|
} else {
|
|
41090
|
+
console.log("RICH-TEXT StringifyProps", value);
|
|
41063
41091
|
const joiner = flatten2 ? " " : "\n";
|
|
41064
41092
|
let val = "";
|
|
41065
41093
|
assertShape2(
|
|
@@ -41403,6 +41431,12 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
41403
41431
|
type: "paragraph",
|
|
41404
41432
|
children: eat3(content3.children, field, imageCallback)
|
|
41405
41433
|
};
|
|
41434
|
+
case "mermaid":
|
|
41435
|
+
return {
|
|
41436
|
+
type: "code",
|
|
41437
|
+
lang: "mermaid",
|
|
41438
|
+
value: content3.value
|
|
41439
|
+
};
|
|
41406
41440
|
case "code_block":
|
|
41407
41441
|
return {
|
|
41408
41442
|
type: "code",
|
|
@@ -41411,11 +41445,11 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
41411
41445
|
};
|
|
41412
41446
|
case "mdxJsxFlowElement":
|
|
41413
41447
|
if (content3.name === "table") {
|
|
41414
|
-
const
|
|
41448
|
+
const table2 = content3.props;
|
|
41415
41449
|
return {
|
|
41416
41450
|
type: "table",
|
|
41417
|
-
align:
|
|
41418
|
-
children:
|
|
41451
|
+
align: table2.align,
|
|
41452
|
+
children: table2.tableRows.map((tableRow) => {
|
|
41419
41453
|
const tr2 = {
|
|
41420
41454
|
type: "tableRow",
|
|
41421
41455
|
children: tableRow.tableCells.map(({ value }) => {
|
|
@@ -41482,6 +41516,27 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
41482
41516
|
}
|
|
41483
41517
|
]
|
|
41484
41518
|
};
|
|
41519
|
+
case "table":
|
|
41520
|
+
const table = content3.props;
|
|
41521
|
+
return {
|
|
41522
|
+
type: "table",
|
|
41523
|
+
align: table?.align,
|
|
41524
|
+
children: content3.children.map((tableRow) => {
|
|
41525
|
+
return {
|
|
41526
|
+
type: "tableRow",
|
|
41527
|
+
children: tableRow.children.map((tableCell) => {
|
|
41528
|
+
return {
|
|
41529
|
+
type: "tableCell",
|
|
41530
|
+
children: eat3(
|
|
41531
|
+
tableCell.children?.at(0)?.children || [],
|
|
41532
|
+
field,
|
|
41533
|
+
imageCallback
|
|
41534
|
+
)
|
|
41535
|
+
};
|
|
41536
|
+
})
|
|
41537
|
+
};
|
|
41538
|
+
})
|
|
41539
|
+
};
|
|
41485
41540
|
default:
|
|
41486
41541
|
throw new Error(`BlockElement: ${content3.type} is not yet supported`);
|
|
41487
41542
|
}
|
|
@@ -43915,32 +43970,29 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
|
|
|
43915
43970
|
switch (content4.type) {
|
|
43916
43971
|
case "table": {
|
|
43917
43972
|
return {
|
|
43918
|
-
type: "
|
|
43919
|
-
children:
|
|
43920
|
-
|
|
43921
|
-
|
|
43922
|
-
|
|
43923
|
-
|
|
43924
|
-
|
|
43925
|
-
|
|
43926
|
-
|
|
43927
|
-
|
|
43928
|
-
|
|
43929
|
-
|
|
43930
|
-
|
|
43931
|
-
|
|
43932
|
-
|
|
43933
|
-
child2.children.map(
|
|
43934
|
-
(child3) => phrasingContent(child3)
|
|
43935
|
-
)
|
|
43936
|
-
)
|
|
43937
|
-
}
|
|
43938
|
-
]
|
|
43973
|
+
type: "table",
|
|
43974
|
+
children: content4.children.map((tableRow) => {
|
|
43975
|
+
return {
|
|
43976
|
+
type: "tr",
|
|
43977
|
+
children: tableRow.children.map((tableCell) => {
|
|
43978
|
+
return {
|
|
43979
|
+
type: "td",
|
|
43980
|
+
children: [
|
|
43981
|
+
{
|
|
43982
|
+
type: "p",
|
|
43983
|
+
children: (0, import_lodash.default)(
|
|
43984
|
+
tableCell.children.map(
|
|
43985
|
+
(child) => phrasingContent(child)
|
|
43986
|
+
)
|
|
43987
|
+
)
|
|
43939
43988
|
}
|
|
43940
|
-
|
|
43941
|
-
}
|
|
43942
|
-
}
|
|
43943
|
-
}
|
|
43989
|
+
]
|
|
43990
|
+
};
|
|
43991
|
+
})
|
|
43992
|
+
};
|
|
43993
|
+
}),
|
|
43994
|
+
props: {
|
|
43995
|
+
align: content4.align?.filter((item) => !!item)
|
|
43944
43996
|
}
|
|
43945
43997
|
};
|
|
43946
43998
|
}
|
|
@@ -43959,7 +44011,7 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
|
|
|
43959
44011
|
case "heading":
|
|
43960
44012
|
return heading2(content4);
|
|
43961
44013
|
case "code":
|
|
43962
|
-
return
|
|
44014
|
+
return parseCode(content4);
|
|
43963
44015
|
case "paragraph":
|
|
43964
44016
|
return paragraph2(content4);
|
|
43965
44017
|
case "mdxJsxFlowElement":
|
|
@@ -44106,6 +44158,19 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
|
|
|
44106
44158
|
);
|
|
44107
44159
|
}
|
|
44108
44160
|
};
|
|
44161
|
+
const parseCode = (content4) => {
|
|
44162
|
+
if (content4.lang === "mermaid") {
|
|
44163
|
+
return mermaid(content4);
|
|
44164
|
+
}
|
|
44165
|
+
return code3(content4);
|
|
44166
|
+
};
|
|
44167
|
+
const mermaid = (content4) => {
|
|
44168
|
+
return {
|
|
44169
|
+
type: "mermaid",
|
|
44170
|
+
value: content4.value,
|
|
44171
|
+
children: [{ type: "text", text: "" }]
|
|
44172
|
+
};
|
|
44173
|
+
};
|
|
44109
44174
|
const code3 = (content4) => {
|
|
44110
44175
|
const extra = {};
|
|
44111
44176
|
if (content4.lang)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/parse/plate.d.ts
CHANGED
|
@@ -121,7 +121,37 @@ export type ParagraphElement = {
|
|
|
121
121
|
/**
|
|
122
122
|
* @group BlockElement
|
|
123
123
|
*/
|
|
124
|
-
export type
|
|
124
|
+
export type TableCellElement = {
|
|
125
|
+
type: 'td';
|
|
126
|
+
children: ParagraphElement[];
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* @group BlockElement
|
|
130
|
+
*/
|
|
131
|
+
export type TableRowElement = {
|
|
132
|
+
type: 'tr';
|
|
133
|
+
children: TableCellElement[];
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* @group BlockElement
|
|
137
|
+
*/
|
|
138
|
+
export type TableElement = {
|
|
139
|
+
type: 'table';
|
|
140
|
+
children: TableRowElement[];
|
|
141
|
+
props: Record<string, unknown>;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* @group MermaidElement
|
|
145
|
+
*/
|
|
146
|
+
export type MermaidElement = {
|
|
147
|
+
type: 'mermaid';
|
|
148
|
+
value: string;
|
|
149
|
+
children: [EmptyTextElement];
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* @group BlockElement
|
|
153
|
+
*/
|
|
154
|
+
export type BlockElement = BlockquoteElement | CodeBlockElement | HeadingElement | HrElement | HTMLElement | ImageElement | InvalidMarkdownElement | ListItemElement | MdxBlockElement | ParagraphElement | MermaidElement | OrderedListElement | UnorderedListElement | TableCellElement | TableRowElement | TableElement;
|
|
125
155
|
/**
|
|
126
156
|
* @group InlineElement
|
|
127
157
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/mdx",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-b4c6a60-20241010070518",
|
|
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": "0.0.0-
|
|
59
|
+
"@tinacms/schema-tools": "0.0.0-b4c6a60-20241010070518"
|
|
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": "
|
|
83
|
+
"@tinacms/scripts": "0.0.0-b4c6a60-20241010070518"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"types": "tsc",
|