@tinacms/mdx 0.0.0-b1fe6d2-20241008011354 → 0.0.0-c5dad82-20241009225242
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 +70 -31
- package/dist/index.js +72 -31
- package/dist/index.mjs +70 -31
- package/dist/parse/plate.d.ts +23 -1
- package/package.json +3 -3
package/dist/index.browser.mjs
CHANGED
|
@@ -38869,11 +38869,11 @@ var blockElement = (content3, field, imageCallback) => {
|
|
|
38869
38869
|
};
|
|
38870
38870
|
case "mdxJsxFlowElement":
|
|
38871
38871
|
if (content3.name === "table") {
|
|
38872
|
-
const
|
|
38872
|
+
const table2 = content3.props;
|
|
38873
38873
|
return {
|
|
38874
38874
|
type: "table",
|
|
38875
|
-
align:
|
|
38876
|
-
children:
|
|
38875
|
+
align: table2.align,
|
|
38876
|
+
children: table2.tableRows.map((tableRow) => {
|
|
38877
38877
|
const tr2 = {
|
|
38878
38878
|
type: "tableRow",
|
|
38879
38879
|
children: tableRow.tableCells.map(({ value }) => {
|
|
@@ -38969,6 +38969,27 @@ var blockElement = (content3, field, imageCallback) => {
|
|
|
38969
38969
|
}
|
|
38970
38970
|
]
|
|
38971
38971
|
};
|
|
38972
|
+
case "table":
|
|
38973
|
+
const table = content3.props;
|
|
38974
|
+
return {
|
|
38975
|
+
type: "table",
|
|
38976
|
+
align: table?.align,
|
|
38977
|
+
children: content3.children.map((tableRow) => {
|
|
38978
|
+
return {
|
|
38979
|
+
type: "tableRow",
|
|
38980
|
+
children: tableRow.children.map((tableCell) => {
|
|
38981
|
+
return {
|
|
38982
|
+
type: "tableCell",
|
|
38983
|
+
children: eat2(
|
|
38984
|
+
tableCell.children?.at(0)?.children || [],
|
|
38985
|
+
field,
|
|
38986
|
+
imageCallback
|
|
38987
|
+
)
|
|
38988
|
+
};
|
|
38989
|
+
})
|
|
38990
|
+
};
|
|
38991
|
+
})
|
|
38992
|
+
};
|
|
38972
38993
|
default:
|
|
38973
38994
|
throw new Error(`BlockElement: ${content3.type} is not yet supported`);
|
|
38974
38995
|
}
|
|
@@ -39539,11 +39560,11 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
39539
39560
|
};
|
|
39540
39561
|
case "mdxJsxFlowElement":
|
|
39541
39562
|
if (content3.name === "table") {
|
|
39542
|
-
const
|
|
39563
|
+
const table2 = content3.props;
|
|
39543
39564
|
return {
|
|
39544
39565
|
type: "table",
|
|
39545
|
-
align:
|
|
39546
|
-
children:
|
|
39566
|
+
align: table2.align,
|
|
39567
|
+
children: table2.tableRows.map((tableRow) => {
|
|
39547
39568
|
const tr2 = {
|
|
39548
39569
|
type: "tableRow",
|
|
39549
39570
|
children: tableRow.tableCells.map(({ value }) => {
|
|
@@ -39610,6 +39631,27 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
39610
39631
|
}
|
|
39611
39632
|
]
|
|
39612
39633
|
};
|
|
39634
|
+
case "table":
|
|
39635
|
+
const table = content3.props;
|
|
39636
|
+
return {
|
|
39637
|
+
type: "table",
|
|
39638
|
+
align: table?.align,
|
|
39639
|
+
children: content3.children.map((tableRow) => {
|
|
39640
|
+
return {
|
|
39641
|
+
type: "tableRow",
|
|
39642
|
+
children: tableRow.children.map((tableCell) => {
|
|
39643
|
+
return {
|
|
39644
|
+
type: "tableCell",
|
|
39645
|
+
children: eat3(
|
|
39646
|
+
tableCell.children?.at(0)?.children || [],
|
|
39647
|
+
field,
|
|
39648
|
+
imageCallback
|
|
39649
|
+
)
|
|
39650
|
+
};
|
|
39651
|
+
})
|
|
39652
|
+
};
|
|
39653
|
+
})
|
|
39654
|
+
};
|
|
39613
39655
|
default:
|
|
39614
39656
|
throw new Error(`BlockElement: ${content3.type} is not yet supported`);
|
|
39615
39657
|
}
|
|
@@ -42043,32 +42085,29 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
|
|
|
42043
42085
|
switch (content4.type) {
|
|
42044
42086
|
case "table": {
|
|
42045
42087
|
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
|
-
]
|
|
42088
|
+
type: "table",
|
|
42089
|
+
children: content4.children.map((tableRow) => {
|
|
42090
|
+
return {
|
|
42091
|
+
type: "tr",
|
|
42092
|
+
children: tableRow.children.map((tableCell) => {
|
|
42093
|
+
return {
|
|
42094
|
+
type: "td",
|
|
42095
|
+
children: [
|
|
42096
|
+
{
|
|
42097
|
+
type: "p",
|
|
42098
|
+
children: (0, import_lodash.default)(
|
|
42099
|
+
tableCell.children.map(
|
|
42100
|
+
(child) => phrasingContent(child)
|
|
42101
|
+
)
|
|
42102
|
+
)
|
|
42067
42103
|
}
|
|
42068
|
-
|
|
42069
|
-
}
|
|
42070
|
-
}
|
|
42071
|
-
}
|
|
42104
|
+
]
|
|
42105
|
+
};
|
|
42106
|
+
})
|
|
42107
|
+
};
|
|
42108
|
+
}),
|
|
42109
|
+
props: {
|
|
42110
|
+
align: content4.align?.filter((item) => !!item)
|
|
42072
42111
|
}
|
|
42073
42112
|
};
|
|
42074
42113
|
}
|
package/dist/index.js
CHANGED
|
@@ -40758,11 +40758,11 @@ var blockElement = (content3, field, imageCallback) => {
|
|
|
40758
40758
|
};
|
|
40759
40759
|
case "mdxJsxFlowElement":
|
|
40760
40760
|
if (content3.name === "table") {
|
|
40761
|
-
const
|
|
40761
|
+
const table2 = content3.props;
|
|
40762
40762
|
return {
|
|
40763
40763
|
type: "table",
|
|
40764
|
-
align:
|
|
40765
|
-
children:
|
|
40764
|
+
align: table2.align,
|
|
40765
|
+
children: table2.tableRows.map((tableRow) => {
|
|
40766
40766
|
const tr2 = {
|
|
40767
40767
|
type: "tableRow",
|
|
40768
40768
|
children: tableRow.tableCells.map(({ value }) => {
|
|
@@ -40859,6 +40859,28 @@ var blockElement = (content3, field, imageCallback) => {
|
|
|
40859
40859
|
}
|
|
40860
40860
|
]
|
|
40861
40861
|
};
|
|
40862
|
+
case "table":
|
|
40863
|
+
const table = content3.props;
|
|
40864
|
+
return {
|
|
40865
|
+
type: "table",
|
|
40866
|
+
align: table == null ? void 0 : table.align,
|
|
40867
|
+
children: content3.children.map((tableRow) => {
|
|
40868
|
+
return {
|
|
40869
|
+
type: "tableRow",
|
|
40870
|
+
children: tableRow.children.map((tableCell) => {
|
|
40871
|
+
var _a3, _b;
|
|
40872
|
+
return {
|
|
40873
|
+
type: "tableCell",
|
|
40874
|
+
children: eat2(
|
|
40875
|
+
((_b = (_a3 = tableCell.children) == null ? void 0 : _a3.at(0)) == null ? void 0 : _b.children) || [],
|
|
40876
|
+
field,
|
|
40877
|
+
imageCallback
|
|
40878
|
+
)
|
|
40879
|
+
};
|
|
40880
|
+
})
|
|
40881
|
+
};
|
|
40882
|
+
})
|
|
40883
|
+
};
|
|
40862
40884
|
default:
|
|
40863
40885
|
throw new Error(`BlockElement: ${content3.type} is not yet supported`);
|
|
40864
40886
|
}
|
|
@@ -41434,11 +41456,11 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
41434
41456
|
};
|
|
41435
41457
|
case "mdxJsxFlowElement":
|
|
41436
41458
|
if (content3.name === "table") {
|
|
41437
|
-
const
|
|
41459
|
+
const table2 = content3.props;
|
|
41438
41460
|
return {
|
|
41439
41461
|
type: "table",
|
|
41440
|
-
align:
|
|
41441
|
-
children:
|
|
41462
|
+
align: table2.align,
|
|
41463
|
+
children: table2.tableRows.map((tableRow) => {
|
|
41442
41464
|
const tr2 = {
|
|
41443
41465
|
type: "tableRow",
|
|
41444
41466
|
children: tableRow.tableCells.map(({ value }) => {
|
|
@@ -41506,6 +41528,28 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
41506
41528
|
}
|
|
41507
41529
|
]
|
|
41508
41530
|
};
|
|
41531
|
+
case "table":
|
|
41532
|
+
const table = content3.props;
|
|
41533
|
+
return {
|
|
41534
|
+
type: "table",
|
|
41535
|
+
align: table == null ? void 0 : table.align,
|
|
41536
|
+
children: content3.children.map((tableRow) => {
|
|
41537
|
+
return {
|
|
41538
|
+
type: "tableRow",
|
|
41539
|
+
children: tableRow.children.map((tableCell) => {
|
|
41540
|
+
var _a3, _b;
|
|
41541
|
+
return {
|
|
41542
|
+
type: "tableCell",
|
|
41543
|
+
children: eat3(
|
|
41544
|
+
((_b = (_a3 = tableCell.children) == null ? void 0 : _a3.at(0)) == null ? void 0 : _b.children) || [],
|
|
41545
|
+
field,
|
|
41546
|
+
imageCallback
|
|
41547
|
+
)
|
|
41548
|
+
};
|
|
41549
|
+
})
|
|
41550
|
+
};
|
|
41551
|
+
})
|
|
41552
|
+
};
|
|
41509
41553
|
default:
|
|
41510
41554
|
throw new Error(`BlockElement: ${content3.type} is not yet supported`);
|
|
41511
41555
|
}
|
|
@@ -43946,32 +43990,29 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
|
|
|
43946
43990
|
switch (content4.type) {
|
|
43947
43991
|
case "table": {
|
|
43948
43992
|
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
|
-
]
|
|
43993
|
+
type: "table",
|
|
43994
|
+
children: content4.children.map((tableRow) => {
|
|
43995
|
+
return {
|
|
43996
|
+
type: "tr",
|
|
43997
|
+
children: tableRow.children.map((tableCell) => {
|
|
43998
|
+
return {
|
|
43999
|
+
type: "td",
|
|
44000
|
+
children: [
|
|
44001
|
+
{
|
|
44002
|
+
type: "p",
|
|
44003
|
+
children: (0, import_lodash.default)(
|
|
44004
|
+
tableCell.children.map(
|
|
44005
|
+
(child) => phrasingContent(child)
|
|
44006
|
+
)
|
|
44007
|
+
)
|
|
43970
44008
|
}
|
|
43971
|
-
|
|
43972
|
-
}
|
|
43973
|
-
}
|
|
43974
|
-
}
|
|
44009
|
+
]
|
|
44010
|
+
};
|
|
44011
|
+
})
|
|
44012
|
+
};
|
|
44013
|
+
}),
|
|
44014
|
+
props: {
|
|
44015
|
+
align: (_a3 = content4.align) == null ? void 0 : _a3.filter((item) => !!item)
|
|
43975
44016
|
}
|
|
43976
44017
|
};
|
|
43977
44018
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -40741,11 +40741,11 @@ var blockElement = (content3, field, imageCallback) => {
|
|
|
40741
40741
|
};
|
|
40742
40742
|
case "mdxJsxFlowElement":
|
|
40743
40743
|
if (content3.name === "table") {
|
|
40744
|
-
const
|
|
40744
|
+
const table2 = content3.props;
|
|
40745
40745
|
return {
|
|
40746
40746
|
type: "table",
|
|
40747
|
-
align:
|
|
40748
|
-
children:
|
|
40747
|
+
align: table2.align,
|
|
40748
|
+
children: table2.tableRows.map((tableRow) => {
|
|
40749
40749
|
const tr2 = {
|
|
40750
40750
|
type: "tableRow",
|
|
40751
40751
|
children: tableRow.tableCells.map(({ value }) => {
|
|
@@ -40841,6 +40841,27 @@ var blockElement = (content3, field, imageCallback) => {
|
|
|
40841
40841
|
}
|
|
40842
40842
|
]
|
|
40843
40843
|
};
|
|
40844
|
+
case "table":
|
|
40845
|
+
const table = content3.props;
|
|
40846
|
+
return {
|
|
40847
|
+
type: "table",
|
|
40848
|
+
align: table?.align,
|
|
40849
|
+
children: content3.children.map((tableRow) => {
|
|
40850
|
+
return {
|
|
40851
|
+
type: "tableRow",
|
|
40852
|
+
children: tableRow.children.map((tableCell) => {
|
|
40853
|
+
return {
|
|
40854
|
+
type: "tableCell",
|
|
40855
|
+
children: eat2(
|
|
40856
|
+
tableCell.children?.at(0)?.children || [],
|
|
40857
|
+
field,
|
|
40858
|
+
imageCallback
|
|
40859
|
+
)
|
|
40860
|
+
};
|
|
40861
|
+
})
|
|
40862
|
+
};
|
|
40863
|
+
})
|
|
40864
|
+
};
|
|
40844
40865
|
default:
|
|
40845
40866
|
throw new Error(`BlockElement: ${content3.type} is not yet supported`);
|
|
40846
40867
|
}
|
|
@@ -41411,11 +41432,11 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
41411
41432
|
};
|
|
41412
41433
|
case "mdxJsxFlowElement":
|
|
41413
41434
|
if (content3.name === "table") {
|
|
41414
|
-
const
|
|
41435
|
+
const table2 = content3.props;
|
|
41415
41436
|
return {
|
|
41416
41437
|
type: "table",
|
|
41417
|
-
align:
|
|
41418
|
-
children:
|
|
41438
|
+
align: table2.align,
|
|
41439
|
+
children: table2.tableRows.map((tableRow) => {
|
|
41419
41440
|
const tr2 = {
|
|
41420
41441
|
type: "tableRow",
|
|
41421
41442
|
children: tableRow.tableCells.map(({ value }) => {
|
|
@@ -41482,6 +41503,27 @@ var blockElement2 = (content3, field, imageCallback) => {
|
|
|
41482
41503
|
}
|
|
41483
41504
|
]
|
|
41484
41505
|
};
|
|
41506
|
+
case "table":
|
|
41507
|
+
const table = content3.props;
|
|
41508
|
+
return {
|
|
41509
|
+
type: "table",
|
|
41510
|
+
align: table?.align,
|
|
41511
|
+
children: content3.children.map((tableRow) => {
|
|
41512
|
+
return {
|
|
41513
|
+
type: "tableRow",
|
|
41514
|
+
children: tableRow.children.map((tableCell) => {
|
|
41515
|
+
return {
|
|
41516
|
+
type: "tableCell",
|
|
41517
|
+
children: eat3(
|
|
41518
|
+
tableCell.children?.at(0)?.children || [],
|
|
41519
|
+
field,
|
|
41520
|
+
imageCallback
|
|
41521
|
+
)
|
|
41522
|
+
};
|
|
41523
|
+
})
|
|
41524
|
+
};
|
|
41525
|
+
})
|
|
41526
|
+
};
|
|
41485
41527
|
default:
|
|
41486
41528
|
throw new Error(`BlockElement: ${content3.type} is not yet supported`);
|
|
41487
41529
|
}
|
|
@@ -43915,32 +43957,29 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
|
|
|
43915
43957
|
switch (content4.type) {
|
|
43916
43958
|
case "table": {
|
|
43917
43959
|
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
|
-
]
|
|
43960
|
+
type: "table",
|
|
43961
|
+
children: content4.children.map((tableRow) => {
|
|
43962
|
+
return {
|
|
43963
|
+
type: "tr",
|
|
43964
|
+
children: tableRow.children.map((tableCell) => {
|
|
43965
|
+
return {
|
|
43966
|
+
type: "td",
|
|
43967
|
+
children: [
|
|
43968
|
+
{
|
|
43969
|
+
type: "p",
|
|
43970
|
+
children: (0, import_lodash.default)(
|
|
43971
|
+
tableCell.children.map(
|
|
43972
|
+
(child) => phrasingContent(child)
|
|
43973
|
+
)
|
|
43974
|
+
)
|
|
43939
43975
|
}
|
|
43940
|
-
|
|
43941
|
-
}
|
|
43942
|
-
}
|
|
43943
|
-
}
|
|
43976
|
+
]
|
|
43977
|
+
};
|
|
43978
|
+
})
|
|
43979
|
+
};
|
|
43980
|
+
}),
|
|
43981
|
+
props: {
|
|
43982
|
+
align: content4.align?.filter((item) => !!item)
|
|
43944
43983
|
}
|
|
43945
43984
|
};
|
|
43946
43985
|
}
|
package/dist/parse/plate.d.ts
CHANGED
|
@@ -121,7 +121,29 @@ 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 BlockElement
|
|
145
|
+
*/
|
|
146
|
+
export type BlockElement = BlockquoteElement | CodeBlockElement | HeadingElement | HrElement | HTMLElement | ImageElement | InvalidMarkdownElement | ListItemElement | MdxBlockElement | ParagraphElement | OrderedListElement | UnorderedListElement | TableCellElement | TableRowElement | TableElement;
|
|
125
147
|
/**
|
|
126
148
|
* @group InlineElement
|
|
127
149
|
*/
|
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-c5dad82-20241009225242",
|
|
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": "
|
|
59
|
+
"@tinacms/schema-tools": "1.6.5"
|
|
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-c5dad82-20241009225242"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"types": "tsc",
|