@tinacms/mdx 0.0.0-942e18f-20250102010803 → 0.0.0-95a293c-20250401070633

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.
@@ -23382,7 +23382,9 @@ function mdxJsxFromMarkdown2({ patterns }) {
23382
23382
  if (attribute.name === "") {
23383
23383
  attribute.name = "_value";
23384
23384
  }
23385
- attribute.value = parseEntities(this.resume(), { nonTerminated: false });
23385
+ attribute.value = parseEntities(this.resume(), {
23386
+ nonTerminated: false
23387
+ });
23386
23388
  }
23387
23389
  }
23388
23390
  };
@@ -23634,7 +23636,9 @@ var mdxJsxToMarkdown2 = function(options) {
23634
23636
  if (!emptyChildren) {
23635
23637
  tracker.shift(2);
23636
23638
  value += tracker.move("\n");
23637
- value += tracker.move(containerFlow(node2, context, tracker.current()));
23639
+ value += tracker.move(
23640
+ containerFlow(node2, context, tracker.current())
23641
+ );
23638
23642
  value += tracker.move("\n");
23639
23643
  }
23640
23644
  } else {
@@ -38618,7 +38622,7 @@ var eat2 = (c, field, imageCallback) => {
38618
38622
  }
38619
38623
  if (markToProcess === "inlineCode") {
38620
38624
  if (nonMatchingSiblingIndex) {
38621
- throw new Error(`Marks inside inline code are not supported`);
38625
+ throw new Error("Marks inside inline code are not supported");
38622
38626
  }
38623
38627
  const node2 = {
38624
38628
  type: markToProcess,
@@ -38653,7 +38657,8 @@ var cleanNode = (node2, mark) => {
38653
38657
  const markToClear = {
38654
38658
  strong: "bold",
38655
38659
  emphasis: "italic",
38656
- inlineCode: "code"
38660
+ inlineCode: "code",
38661
+ delete: "strikethrough"
38657
38662
  }[mark];
38658
38663
  Object.entries(node2).map(([key, value]) => {
38659
38664
  if (key !== markToClear) {
@@ -39111,6 +39116,9 @@ var getMarks = (content3) => {
39111
39116
  if (content3.code) {
39112
39117
  marks.push("inlineCode");
39113
39118
  }
39119
+ if (content3.strikethrough) {
39120
+ marks.push("delete");
39121
+ }
39114
39122
  return marks;
39115
39123
  };
39116
39124
 
@@ -39555,7 +39563,8 @@ var cleanNode2 = (node2, mark) => {
39555
39563
  const markToClear = {
39556
39564
  strong: "bold",
39557
39565
  emphasis: "italic",
39558
- inlineCode: "code"
39566
+ inlineCode: "code",
39567
+ delete: "strikethrough"
39559
39568
  }[mark];
39560
39569
  Object.entries(node2).map(([key, value]) => {
39561
39570
  if (key !== markToClear) {
@@ -42031,7 +42040,9 @@ function mdxJsx2(options = {}) {
42031
42040
  { locations: true }
42032
42041
  );
42033
42042
  } else if (options.acornOptions || options.addResult) {
42034
- throw new Error("Expected an `acorn` instance passed in as `options.acorn`");
42043
+ throw new Error(
42044
+ "Expected an `acorn` instance passed in as `options.acorn`"
42045
+ );
42035
42046
  }
42036
42047
  const patterns = options.patterns || [];
42037
42048
  const flowRules = {};
@@ -42767,6 +42778,8 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
42767
42778
  switch (content4.type) {
42768
42779
  case "text":
42769
42780
  return text7(content4);
42781
+ case "delete":
42782
+ return phrashingMark(content4);
42770
42783
  case "link":
42771
42784
  return link2(content4);
42772
42785
  case "image":
@@ -42792,7 +42805,9 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
42792
42805
  content4.position
42793
42806
  );
42794
42807
  default:
42795
- throw new Error(`PhrasingContent: ${content4.type} is not yet supported`);
42808
+ throw new Error(
42809
+ `PhrasingContent: ${content4.type} is not yet supported`
42810
+ );
42796
42811
  }
42797
42812
  };
42798
42813
  const breakContent = () => {
@@ -42831,6 +42846,17 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
42831
42846
  });
42832
42847
  break;
42833
42848
  }
42849
+ case "delete": {
42850
+ const children = (0, import_lodash.default)(
42851
+ node2.children.map(
42852
+ (child) => phrashingMark(child, [...marks, "strikethrough"])
42853
+ )
42854
+ );
42855
+ children.forEach((child) => {
42856
+ accum.push(child);
42857
+ });
42858
+ break;
42859
+ }
42834
42860
  case "strong": {
42835
42861
  const children = (0, import_lodash.default)(
42836
42862
  node2.children.map((child) => phrashingMark(child, [...marks, "bold"]))
package/dist/index.js CHANGED
@@ -5921,12 +5921,12 @@ var require_lodash = __commonJS({
5921
5921
  });
5922
5922
 
5923
5923
  // src/index.ts
5924
- var src_exports = {};
5925
- __export(src_exports, {
5924
+ var index_exports = {};
5925
+ __export(index_exports, {
5926
5926
  parseMDX: () => parseMDX,
5927
5927
  stringifyMDX: () => stringifyMDX
5928
5928
  });
5929
- module.exports = __toCommonJS(src_exports);
5929
+ module.exports = __toCommonJS(index_exports);
5930
5930
 
5931
5931
  // ../../../node_modules/.pnpm/bail@2.0.2/node_modules/bail/index.js
5932
5932
  function bail(error) {
@@ -25261,7 +25261,9 @@ function mdxJsxFromMarkdown2({ patterns }) {
25261
25261
  if (attribute.name === "") {
25262
25262
  attribute.name = "_value";
25263
25263
  }
25264
- attribute.value = parseEntities(this.resume(), { nonTerminated: false });
25264
+ attribute.value = parseEntities(this.resume(), {
25265
+ nonTerminated: false
25266
+ });
25265
25267
  }
25266
25268
  }
25267
25269
  };
@@ -25514,7 +25516,9 @@ var mdxJsxToMarkdown2 = function(options) {
25514
25516
  if (!emptyChildren) {
25515
25517
  tracker.shift(2);
25516
25518
  value += tracker.move("\n");
25517
- value += tracker.move(containerFlow(node2, context, tracker.current()));
25519
+ value += tracker.move(
25520
+ containerFlow(node2, context, tracker.current())
25521
+ );
25518
25522
  value += tracker.move("\n");
25519
25523
  }
25520
25524
  } else {
@@ -40504,7 +40508,7 @@ var eat2 = (c, field, imageCallback) => {
40504
40508
  }
40505
40509
  if (markToProcess === "inlineCode") {
40506
40510
  if (nonMatchingSiblingIndex) {
40507
- throw new Error(`Marks inside inline code are not supported`);
40511
+ throw new Error("Marks inside inline code are not supported");
40508
40512
  }
40509
40513
  const node2 = {
40510
40514
  type: markToProcess,
@@ -40539,7 +40543,8 @@ var cleanNode = (node2, mark) => {
40539
40543
  const markToClear = {
40540
40544
  strong: "bold",
40541
40545
  emphasis: "italic",
40542
- inlineCode: "code"
40546
+ inlineCode: "code",
40547
+ delete: "strikethrough"
40543
40548
  }[mark];
40544
40549
  Object.entries(node2).map(([key, value]) => {
40545
40550
  if (key !== markToClear) {
@@ -41003,6 +41008,9 @@ var getMarks = (content3) => {
41003
41008
  if (content3.code) {
41004
41009
  marks.push("inlineCode");
41005
41010
  }
41011
+ if (content3.strikethrough) {
41012
+ marks.push("delete");
41013
+ }
41006
41014
  return marks;
41007
41015
  };
41008
41016
 
@@ -41451,7 +41459,8 @@ var cleanNode2 = (node2, mark) => {
41451
41459
  const markToClear = {
41452
41460
  strong: "bold",
41453
41461
  emphasis: "italic",
41454
- inlineCode: "code"
41462
+ inlineCode: "code",
41463
+ delete: "strikethrough"
41455
41464
  }[mark];
41456
41465
  Object.entries(node2).map(([key, value]) => {
41457
41466
  if (key !== markToClear) {
@@ -43930,7 +43939,9 @@ function mdxJsx2(options = {}) {
43930
43939
  { locations: true }
43931
43940
  );
43932
43941
  } else if (options.acornOptions || options.addResult) {
43933
- throw new Error("Expected an `acorn` instance passed in as `options.acorn`");
43942
+ throw new Error(
43943
+ "Expected an `acorn` instance passed in as `options.acorn`"
43944
+ );
43934
43945
  }
43935
43946
  const patterns = options.patterns || [];
43936
43947
  const flowRules = {};
@@ -44673,6 +44684,8 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
44673
44684
  switch (content4.type) {
44674
44685
  case "text":
44675
44686
  return text7(content4);
44687
+ case "delete":
44688
+ return phrashingMark(content4);
44676
44689
  case "link":
44677
44690
  return link2(content4);
44678
44691
  case "image":
@@ -44698,7 +44711,9 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
44698
44711
  content4.position
44699
44712
  );
44700
44713
  default:
44701
- throw new Error(`PhrasingContent: ${content4.type} is not yet supported`);
44714
+ throw new Error(
44715
+ `PhrasingContent: ${content4.type} is not yet supported`
44716
+ );
44702
44717
  }
44703
44718
  };
44704
44719
  const breakContent = () => {
@@ -44737,6 +44752,17 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
44737
44752
  });
44738
44753
  break;
44739
44754
  }
44755
+ case "delete": {
44756
+ const children = (0, import_lodash.default)(
44757
+ node2.children.map(
44758
+ (child) => phrashingMark(child, [...marks, "strikethrough"])
44759
+ )
44760
+ );
44761
+ children.forEach((child) => {
44762
+ accum.push(child);
44763
+ });
44764
+ break;
44765
+ }
44740
44766
  case "strong": {
44741
44767
  const children = (0, import_lodash.default)(
44742
44768
  node2.children.map((child) => phrashingMark(child, [...marks, "bold"]))
package/dist/index.mjs CHANGED
@@ -25252,7 +25252,9 @@ function mdxJsxFromMarkdown2({ patterns }) {
25252
25252
  if (attribute.name === "") {
25253
25253
  attribute.name = "_value";
25254
25254
  }
25255
- attribute.value = parseEntities(this.resume(), { nonTerminated: false });
25255
+ attribute.value = parseEntities(this.resume(), {
25256
+ nonTerminated: false
25257
+ });
25256
25258
  }
25257
25259
  }
25258
25260
  };
@@ -25504,7 +25506,9 @@ var mdxJsxToMarkdown2 = function(options) {
25504
25506
  if (!emptyChildren) {
25505
25507
  tracker.shift(2);
25506
25508
  value += tracker.move("\n");
25507
- value += tracker.move(containerFlow(node2, context, tracker.current()));
25509
+ value += tracker.move(
25510
+ containerFlow(node2, context, tracker.current())
25511
+ );
25508
25512
  value += tracker.move("\n");
25509
25513
  }
25510
25514
  } else {
@@ -40488,7 +40492,7 @@ var eat2 = (c, field, imageCallback) => {
40488
40492
  }
40489
40493
  if (markToProcess === "inlineCode") {
40490
40494
  if (nonMatchingSiblingIndex) {
40491
- throw new Error(`Marks inside inline code are not supported`);
40495
+ throw new Error("Marks inside inline code are not supported");
40492
40496
  }
40493
40497
  const node2 = {
40494
40498
  type: markToProcess,
@@ -40523,7 +40527,8 @@ var cleanNode = (node2, mark) => {
40523
40527
  const markToClear = {
40524
40528
  strong: "bold",
40525
40529
  emphasis: "italic",
40526
- inlineCode: "code"
40530
+ inlineCode: "code",
40531
+ delete: "strikethrough"
40527
40532
  }[mark];
40528
40533
  Object.entries(node2).map(([key, value]) => {
40529
40534
  if (key !== markToClear) {
@@ -40981,6 +40986,9 @@ var getMarks = (content3) => {
40981
40986
  if (content3.code) {
40982
40987
  marks.push("inlineCode");
40983
40988
  }
40989
+ if (content3.strikethrough) {
40990
+ marks.push("delete");
40991
+ }
40984
40992
  return marks;
40985
40993
  };
40986
40994
 
@@ -41425,7 +41433,8 @@ var cleanNode2 = (node2, mark) => {
41425
41433
  const markToClear = {
41426
41434
  strong: "bold",
41427
41435
  emphasis: "italic",
41428
- inlineCode: "code"
41436
+ inlineCode: "code",
41437
+ delete: "strikethrough"
41429
41438
  }[mark];
41430
41439
  Object.entries(node2).map(([key, value]) => {
41431
41440
  if (key !== markToClear) {
@@ -43901,7 +43910,9 @@ function mdxJsx2(options = {}) {
43901
43910
  { locations: true }
43902
43911
  );
43903
43912
  } else if (options.acornOptions || options.addResult) {
43904
- throw new Error("Expected an `acorn` instance passed in as `options.acorn`");
43913
+ throw new Error(
43914
+ "Expected an `acorn` instance passed in as `options.acorn`"
43915
+ );
43905
43916
  }
43906
43917
  const patterns = options.patterns || [];
43907
43918
  const flowRules = {};
@@ -44637,6 +44648,8 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
44637
44648
  switch (content4.type) {
44638
44649
  case "text":
44639
44650
  return text7(content4);
44651
+ case "delete":
44652
+ return phrashingMark(content4);
44640
44653
  case "link":
44641
44654
  return link2(content4);
44642
44655
  case "image":
@@ -44662,7 +44675,9 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
44662
44675
  content4.position
44663
44676
  );
44664
44677
  default:
44665
- throw new Error(`PhrasingContent: ${content4.type} is not yet supported`);
44678
+ throw new Error(
44679
+ `PhrasingContent: ${content4.type} is not yet supported`
44680
+ );
44666
44681
  }
44667
44682
  };
44668
44683
  const breakContent = () => {
@@ -44701,6 +44716,17 @@ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
44701
44716
  });
44702
44717
  break;
44703
44718
  }
44719
+ case "delete": {
44720
+ const children = (0, import_lodash.default)(
44721
+ node2.children.map(
44722
+ (child) => phrashingMark(child, [...marks, "strikethrough"])
44723
+ )
44724
+ );
44725
+ children.forEach((child) => {
44726
+ accum.push(child);
44727
+ });
44728
+ break;
44729
+ }
44704
44730
  case "strong": {
44705
44731
  const children = (0, import_lodash.default)(
44706
44732
  node2.children.map((child) => phrashingMark(child, [...marks, "bold"]))
@@ -5,5 +5,3 @@ import type { RootElement } from '../../parse/plate';
5
5
  export declare const preProcess: (tree: RootElement, field: RichTextField, imageCallback: (url: string) => string) => Md.Root;
6
6
  export declare const rootElement: (content: Plate.RootElement, field: RichTextField, imageCallback: (url: string) => string) => Md.Root;
7
7
  export declare const blockElement: (content: Plate.BlockElement, field: RichTextField, imageCallback: (url: string) => string) => Md.Content | null;
8
- export type Marks = 'strong' | 'emphasis' | 'inlineCode';
9
- export declare const getMarks: (content: Plate.InlineElement) => Marks[];
@@ -0,0 +1,2 @@
1
+ import type { RichTextField } from '@tinacms/schema-tools';
2
+ export declare const field: RichTextField;
@@ -181,6 +181,7 @@ export type TextElement = {
181
181
  bold?: boolean;
182
182
  italic?: boolean;
183
183
  code?: boolean;
184
+ strikethrough?: boolean;
184
185
  };
185
186
  /**
186
187
  * @remarks
@@ -32,5 +32,5 @@ export type Pattern = {
32
32
  export declare const toTinaMarkdown: (tree: Md.Root, field: RichTextType) => string;
33
33
  export declare const rootElement: (content: Plate.RootElement, field: RichTextType, imageCallback: (url: string) => string) => Md.Root;
34
34
  export declare const blockElement: (content: Plate.BlockElement, field: RichTextType, imageCallback: (url: string) => string) => Md.Content | null;
35
- export type Marks = 'strong' | 'emphasis' | 'inlineCode';
35
+ export type Marks = 'strong' | 'emphasis' | 'inlineCode' | 'delete';
36
36
  export declare const getMarks: (content: Plate.InlineElement) => Marks[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/mdx",
3
- "version": "0.0.0-942e18f-20250102010803",
3
+ "version": "0.0.0-95a293c-20250401070633",
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.9"
59
+ "@tinacms/schema-tools": "0.0.0-95a293c-20250401070633"
60
60
  },
61
61
  "publishConfig": {
62
62
  "registry": "https://registry.npmjs.org"
@@ -69,7 +69,7 @@
69
69
  "@types/estree": "1.0.0",
70
70
  "@types/lodash.flatten": "^4.4.9",
71
71
  "@types/mdast": "^3.0.15",
72
- "@types/node": "^22.9.0",
72
+ "@types/node": "^22.13.1",
73
73
  "@types/prettier": "^2.7.3",
74
74
  "@types/unist": "^2.0.11",
75
75
  "c8": "^7.14.0",
@@ -77,10 +77,10 @@
77
77
  "jest-file-snapshot": "^0.5.0",
78
78
  "ts-node": "^10.9.2",
79
79
  "typedoc-plugin-markdown": "^3.17.1",
80
- "typescript": "^5.6.3",
81
- "vite": "^4.5.5",
80
+ "typescript": "^5.7.3",
81
+ "vite": "^4.5.9",
82
82
  "vitest": "^0.32.4",
83
- "@tinacms/scripts": "1.3.1"
83
+ "@tinacms/scripts": "0.0.0-95a293c-20250401070633"
84
84
  },
85
85
  "scripts": {
86
86
  "types": "tsc",