@tinacms/mdx 1.3.28 → 1.4.0

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.
@@ -46,7 +46,7 @@ var require_extend = __commonJS({
46
46
  var toStr = Object.prototype.toString;
47
47
  var defineProperty = Object.defineProperty;
48
48
  var gOPD = Object.getOwnPropertyDescriptor;
49
- var isArray3 = function isArray4(arr) {
49
+ var isArray2 = function isArray3(arr) {
50
50
  if (typeof Array.isArray === "function") {
51
51
  return Array.isArray(arr);
52
52
  }
@@ -109,10 +109,10 @@ var require_extend = __commonJS({
109
109
  src = getProperty(target, name2);
110
110
  copy = getProperty(options, name2);
111
111
  if (target !== copy) {
112
- if (deep && copy && (isPlainObject3(copy) || (copyIsArray = isArray3(copy)))) {
112
+ if (deep && copy && (isPlainObject3(copy) || (copyIsArray = isArray2(copy)))) {
113
113
  if (copyIsArray) {
114
114
  copyIsArray = false;
115
- clone = src && isArray3(src) ? src : [];
115
+ clone = src && isArray2(src) ? src : [];
116
116
  } else {
117
117
  clone = src && isPlainObject3(src) ? src : {};
118
118
  }
@@ -602,12 +602,12 @@ var require_acorn = __commonJS({
602
602
  var nonASCIIwhitespace2 = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
603
603
  var skipWhiteSpace2 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
604
604
  var ref2 = Object.prototype;
605
- var hasOwnProperty5 = ref2.hasOwnProperty;
605
+ var hasOwnProperty3 = ref2.hasOwnProperty;
606
606
  var toString3 = ref2.toString;
607
607
  var hasOwn2 = Object.hasOwn || function(obj, propName) {
608
- return hasOwnProperty5.call(obj, propName);
608
+ return hasOwnProperty3.call(obj, propName);
609
609
  };
610
- var isArray3 = Array.isArray || function(obj) {
610
+ var isArray2 = Array.isArray || function(obj) {
611
611
  return toString3.call(obj) === "[object Array]";
612
612
  };
613
613
  function wordsRegexp2(words) {
@@ -688,13 +688,13 @@ var require_acorn = __commonJS({
688
688
  if (!opts || opts.allowHashBang == null) {
689
689
  options.allowHashBang = options.ecmaVersion >= 14;
690
690
  }
691
- if (isArray3(options.onToken)) {
691
+ if (isArray2(options.onToken)) {
692
692
  var tokens = options.onToken;
693
693
  options.onToken = function(token) {
694
694
  return tokens.push(token);
695
695
  };
696
696
  }
697
- if (isArray3(options.onComment)) {
697
+ if (isArray2(options.onComment)) {
698
698
  options.onComment = pushComment2(options, options.onComment);
699
699
  }
700
700
  return options;
@@ -5571,6 +5571,82 @@ var require_acorn_jsx = __commonJS({
5571
5571
  }
5572
5572
  });
5573
5573
 
5574
+ // ../../../node_modules/.pnpm/lodash.flatten@4.4.0/node_modules/lodash.flatten/index.js
5575
+ var require_lodash = __commonJS({
5576
+ "../../../node_modules/.pnpm/lodash.flatten@4.4.0/node_modules/lodash.flatten/index.js"(exports, module) {
5577
+ var MAX_SAFE_INTEGER = 9007199254740991;
5578
+ var argsTag = "[object Arguments]";
5579
+ var funcTag = "[object Function]";
5580
+ var genTag = "[object GeneratorFunction]";
5581
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
5582
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
5583
+ var root2 = freeGlobal || freeSelf || Function("return this")();
5584
+ function arrayPush(array, values2) {
5585
+ var index2 = -1, length = values2.length, offset2 = array.length;
5586
+ while (++index2 < length) {
5587
+ array[offset2 + index2] = values2[index2];
5588
+ }
5589
+ return array;
5590
+ }
5591
+ var objectProto = Object.prototype;
5592
+ var hasOwnProperty3 = objectProto.hasOwnProperty;
5593
+ var objectToString = objectProto.toString;
5594
+ var Symbol2 = root2.Symbol;
5595
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
5596
+ var spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : void 0;
5597
+ function baseFlatten(array, depth, predicate, isStrict, result) {
5598
+ var index2 = -1, length = array.length;
5599
+ predicate || (predicate = isFlattenable);
5600
+ result || (result = []);
5601
+ while (++index2 < length) {
5602
+ var value = array[index2];
5603
+ if (depth > 0 && predicate(value)) {
5604
+ if (depth > 1) {
5605
+ baseFlatten(value, depth - 1, predicate, isStrict, result);
5606
+ } else {
5607
+ arrayPush(result, value);
5608
+ }
5609
+ } else if (!isStrict) {
5610
+ result[result.length] = value;
5611
+ }
5612
+ }
5613
+ return result;
5614
+ }
5615
+ function isFlattenable(value) {
5616
+ return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
5617
+ }
5618
+ function flatten2(array) {
5619
+ var length = array ? array.length : 0;
5620
+ return length ? baseFlatten(array, 1) : [];
5621
+ }
5622
+ function isArguments(value) {
5623
+ return isArrayLikeObject(value) && hasOwnProperty3.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
5624
+ }
5625
+ var isArray2 = Array.isArray;
5626
+ function isArrayLike(value) {
5627
+ return value != null && isLength(value.length) && !isFunction(value);
5628
+ }
5629
+ function isArrayLikeObject(value) {
5630
+ return isObjectLike(value) && isArrayLike(value);
5631
+ }
5632
+ function isFunction(value) {
5633
+ var tag = isObject2(value) ? objectToString.call(value) : "";
5634
+ return tag == funcTag || tag == genTag;
5635
+ }
5636
+ function isLength(value) {
5637
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
5638
+ }
5639
+ function isObject2(value) {
5640
+ var type = typeof value;
5641
+ return !!value && (type == "object" || type == "function");
5642
+ }
5643
+ function isObjectLike(value) {
5644
+ return !!value && typeof value == "object";
5645
+ }
5646
+ module.exports = flatten2;
5647
+ }
5648
+ });
5649
+
5574
5650
  // ../../../node_modules/.pnpm/bail@2.0.2/node_modules/bail/index.js
5575
5651
  function bail(error) {
5576
5652
  if (error) {
@@ -38204,8 +38280,8 @@ function stringifyProps(element2, parentField, flatten2, imageCallback) {
38204
38280
  `Nested rich-text element is not a valid shape for field ${field.name}`
38205
38281
  );
38206
38282
  if (field.name === "children") {
38207
- const root3 = rootElement(value, field, imageCallback);
38208
- root3.children.forEach((child) => {
38283
+ const root2 = rootElement(value, field, imageCallback);
38284
+ root2.children.forEach((child) => {
38209
38285
  children.push(child);
38210
38286
  });
38211
38287
  return;
@@ -39120,8 +39196,8 @@ function stringifyProps2(element2, parentField, flatten2, imageCallback) {
39120
39196
  `Nested rich-text element is not a valid shape for field ${field.name}`
39121
39197
  );
39122
39198
  if (field.name === "children") {
39123
- const root3 = rootElement2(value, field, imageCallback);
39124
- root3.children.forEach((child) => {
39199
+ const root2 = rootElement2(value, field, imageCallback);
39200
+ root2.children.forEach((child) => {
39125
39201
  children.push(child);
39126
39202
  });
39127
39203
  return;
@@ -41578,135 +41654,8 @@ function compact(tree) {
41578
41654
  return tree;
41579
41655
  }
41580
41656
 
41581
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
41582
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
41583
- var freeGlobal_default = freeGlobal;
41584
-
41585
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js
41586
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
41587
- var root2 = freeGlobal_default || freeSelf || Function("return this")();
41588
- var root_default = root2;
41589
-
41590
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js
41591
- var Symbol2 = root_default.Symbol;
41592
- var Symbol_default = Symbol2;
41593
-
41594
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js
41595
- var objectProto = Object.prototype;
41596
- var hasOwnProperty3 = objectProto.hasOwnProperty;
41597
- var nativeObjectToString = objectProto.toString;
41598
- var symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
41599
- function getRawTag(value) {
41600
- var isOwn = hasOwnProperty3.call(value, symToStringTag), tag = value[symToStringTag];
41601
- try {
41602
- value[symToStringTag] = void 0;
41603
- var unmasked = true;
41604
- } catch (e) {
41605
- }
41606
- var result = nativeObjectToString.call(value);
41607
- if (unmasked) {
41608
- if (isOwn) {
41609
- value[symToStringTag] = tag;
41610
- } else {
41611
- delete value[symToStringTag];
41612
- }
41613
- }
41614
- return result;
41615
- }
41616
- var getRawTag_default = getRawTag;
41617
-
41618
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js
41619
- var objectProto2 = Object.prototype;
41620
- var nativeObjectToString2 = objectProto2.toString;
41621
- function objectToString(value) {
41622
- return nativeObjectToString2.call(value);
41623
- }
41624
- var objectToString_default = objectToString;
41625
-
41626
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js
41627
- var nullTag = "[object Null]";
41628
- var undefinedTag = "[object Undefined]";
41629
- var symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
41630
- function baseGetTag(value) {
41631
- if (value == null) {
41632
- return value === void 0 ? undefinedTag : nullTag;
41633
- }
41634
- return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
41635
- }
41636
- var baseGetTag_default = baseGetTag;
41637
-
41638
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js
41639
- function isObjectLike(value) {
41640
- return value != null && typeof value == "object";
41641
- }
41642
- var isObjectLike_default = isObjectLike;
41643
-
41644
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js
41645
- var isArray2 = Array.isArray;
41646
- var isArray_default = isArray2;
41647
-
41648
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js
41649
- var argsTag = "[object Arguments]";
41650
- function baseIsArguments(value) {
41651
- return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
41652
- }
41653
- var baseIsArguments_default = baseIsArguments;
41654
-
41655
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js
41656
- var objectProto3 = Object.prototype;
41657
- var hasOwnProperty4 = objectProto3.hasOwnProperty;
41658
- var propertyIsEnumerable = objectProto3.propertyIsEnumerable;
41659
- var isArguments = baseIsArguments_default(function() {
41660
- return arguments;
41661
- }()) ? baseIsArguments_default : function(value) {
41662
- return isObjectLike_default(value) && hasOwnProperty4.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
41663
- };
41664
- var isArguments_default = isArguments;
41665
-
41666
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js
41667
- function arrayPush(array, values2) {
41668
- var index2 = -1, length = values2.length, offset2 = array.length;
41669
- while (++index2 < length) {
41670
- array[offset2 + index2] = values2[index2];
41671
- }
41672
- return array;
41673
- }
41674
- var arrayPush_default = arrayPush;
41675
-
41676
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isFlattenable.js
41677
- var spreadableSymbol = Symbol_default ? Symbol_default.isConcatSpreadable : void 0;
41678
- function isFlattenable(value) {
41679
- return isArray_default(value) || isArguments_default(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
41680
- }
41681
- var isFlattenable_default = isFlattenable;
41682
-
41683
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFlatten.js
41684
- function baseFlatten(array, depth, predicate, isStrict, result) {
41685
- var index2 = -1, length = array.length;
41686
- predicate || (predicate = isFlattenable_default);
41687
- result || (result = []);
41688
- while (++index2 < length) {
41689
- var value = array[index2];
41690
- if (depth > 0 && predicate(value)) {
41691
- if (depth > 1) {
41692
- baseFlatten(value, depth - 1, predicate, isStrict, result);
41693
- } else {
41694
- arrayPush_default(result, value);
41695
- }
41696
- } else if (!isStrict) {
41697
- result[result.length] = value;
41698
- }
41699
- }
41700
- return result;
41701
- }
41702
- var baseFlatten_default = baseFlatten;
41703
-
41704
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatten.js
41705
- function flatten(array) {
41706
- var length = array == null ? 0 : array.length;
41707
- return length ? baseFlatten_default(array, 1) : [];
41708
- }
41709
- var flatten_default = flatten;
41657
+ // src/parse/remarkToPlate.ts
41658
+ var import_lodash = __toESM(require_lodash());
41710
41659
 
41711
41660
  // src/parse/acorn.ts
41712
41661
  var extractAttributes = (attributes2, fields, imageCallback) => {
@@ -42088,7 +42037,7 @@ var directiveElement = (node2, field, imageCallback, raw) => {
42088
42037
  };
42089
42038
 
42090
42039
  // src/parse/remarkToPlate.ts
42091
- var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
42040
+ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
42092
42041
  const mdxJsxElement2 = skipMDXProcess ? (node2) => node2 : mdxJsxElement;
42093
42042
  const content3 = (content4) => {
42094
42043
  switch (content4.type) {
@@ -42108,7 +42057,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
42108
42057
  children: [
42109
42058
  {
42110
42059
  type: "p",
42111
- children: flatten_default(
42060
+ children: (0, import_lodash.default)(
42112
42061
  child2.children.map(
42113
42062
  (child3) => phrasingContent(child3)
42114
42063
  )
@@ -42154,7 +42103,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
42154
42103
  children: [
42155
42104
  {
42156
42105
  type: "lic",
42157
- children: flatten_default(
42106
+ children: (0, import_lodash.default)(
42158
42107
  content4.children.map((child) => unwrapBlockContent(child))
42159
42108
  )
42160
42109
  }
@@ -42214,7 +42163,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
42214
42163
  case "paragraph":
42215
42164
  return {
42216
42165
  type: "lic",
42217
- children: flatten_default(
42166
+ children: (0, import_lodash.default)(
42218
42167
  child.children.map((child2) => phrasingContent(child2))
42219
42168
  )
42220
42169
  };
@@ -42269,7 +42218,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
42269
42218
  const unwrapBlockContent = (content4) => {
42270
42219
  const flattenPhrasingContent = (children) => {
42271
42220
  const children2 = children.map((child) => phrasingContent(child));
42272
- return flatten_default(Array.isArray(children2) ? children2 : [children2]);
42221
+ return (0, import_lodash.default)(Array.isArray(children2) ? children2 : [children2]);
42273
42222
  };
42274
42223
  switch (content4.type) {
42275
42224
  case "heading":
@@ -42301,7 +42250,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
42301
42250
  type: "a",
42302
42251
  url: sanitizeUrl(content4.url),
42303
42252
  title: content4.title,
42304
- children: flatten_default(
42253
+ children: (0, import_lodash.default)(
42305
42254
  content4.children.map((child) => staticPhrasingContent(child))
42306
42255
  )
42307
42256
  };
@@ -42309,7 +42258,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
42309
42258
  const heading2 = (content4) => {
42310
42259
  return {
42311
42260
  type: ["h1", "h2", "h3", "h4", "h5", "h6"][content4.depth - 1],
42312
- children: flatten_default(content4.children.map(phrasingContent))
42261
+ children: (0, import_lodash.default)(content4.children.map(phrasingContent))
42313
42262
  };
42314
42263
  };
42315
42264
  const staticPhrasingContent = (content4) => {
@@ -42375,7 +42324,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
42375
42324
  const accum = [];
42376
42325
  switch (node2.type) {
42377
42326
  case "emphasis": {
42378
- const children = flatten_default(
42327
+ const children = (0, import_lodash.default)(
42379
42328
  node2.children.map(
42380
42329
  (child) => phrashingMark(child, [...marks, "italic"])
42381
42330
  )
@@ -42397,7 +42346,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
42397
42346
  break;
42398
42347
  }
42399
42348
  case "strong": {
42400
- const children = flatten_default(
42349
+ const children = (0, import_lodash.default)(
42401
42350
  node2.children.map((child) => phrashingMark(child, [...marks, "bold"]))
42402
42351
  );
42403
42352
  children.forEach((child) => {
@@ -42410,7 +42359,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
42410
42359
  break;
42411
42360
  }
42412
42361
  case "link": {
42413
- const children = flatten_default(
42362
+ const children = (0, import_lodash.default)(
42414
42363
  node2.children.map((child) => phrashingMark(child, marks))
42415
42364
  );
42416
42365
  accum.push({
@@ -42466,7 +42415,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
42466
42415
  };
42467
42416
  };
42468
42417
  const paragraph2 = (content4) => {
42469
- const children = flatten_default(content4.children.map(phrasingContent));
42418
+ const children = (0, import_lodash.default)(content4.children.map(phrasingContent));
42470
42419
  if (children.length === 1) {
42471
42420
  if (children[0]) {
42472
42421
  if (children[0].type === "html_inline") {
@@ -42484,7 +42433,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
42484
42433
  };
42485
42434
  return {
42486
42435
  type: "root",
42487
- children: root3.children.map((child) => {
42436
+ children: root2.children.map((child) => {
42488
42437
  return content3(child);
42489
42438
  })
42490
42439
  };
@@ -42660,12 +42609,3 @@ export {
42660
42609
  * @author Feross Aboukhadijeh <https://feross.org>
42661
42610
  * @license MIT
42662
42611
  */
42663
- /**
42664
- * @license
42665
- * Lodash (Custom Build) <https://lodash.com/>
42666
- * Build: `lodash modularize exports="es" -o ./`
42667
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
42668
- * Released under MIT license <https://lodash.com/license>
42669
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
42670
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
42671
- */
package/dist/index.js CHANGED
@@ -43,7 +43,7 @@ var require_extend = __commonJS({
43
43
  var toStr = Object.prototype.toString;
44
44
  var defineProperty = Object.defineProperty;
45
45
  var gOPD = Object.getOwnPropertyDescriptor;
46
- var isArray3 = function isArray4(arr) {
46
+ var isArray2 = function isArray3(arr) {
47
47
  if (typeof Array.isArray === "function") {
48
48
  return Array.isArray(arr);
49
49
  }
@@ -106,10 +106,10 @@ var require_extend = __commonJS({
106
106
  src = getProperty(target, name2);
107
107
  copy = getProperty(options, name2);
108
108
  if (target !== copy) {
109
- if (deep && copy && (isPlainObject3(copy) || (copyIsArray = isArray3(copy)))) {
109
+ if (deep && copy && (isPlainObject3(copy) || (copyIsArray = isArray2(copy)))) {
110
110
  if (copyIsArray) {
111
111
  copyIsArray = false;
112
- clone = src && isArray3(src) ? src : [];
112
+ clone = src && isArray2(src) ? src : [];
113
113
  } else {
114
114
  clone = src && isPlainObject3(src) ? src : {};
115
115
  }
@@ -599,12 +599,12 @@ var require_acorn = __commonJS({
599
599
  var nonASCIIwhitespace2 = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
600
600
  var skipWhiteSpace2 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
601
601
  var ref2 = Object.prototype;
602
- var hasOwnProperty5 = ref2.hasOwnProperty;
602
+ var hasOwnProperty3 = ref2.hasOwnProperty;
603
603
  var toString3 = ref2.toString;
604
604
  var hasOwn2 = Object.hasOwn || function(obj, propName) {
605
- return hasOwnProperty5.call(obj, propName);
605
+ return hasOwnProperty3.call(obj, propName);
606
606
  };
607
- var isArray3 = Array.isArray || function(obj) {
607
+ var isArray2 = Array.isArray || function(obj) {
608
608
  return toString3.call(obj) === "[object Array]";
609
609
  };
610
610
  function wordsRegexp2(words) {
@@ -685,13 +685,13 @@ var require_acorn = __commonJS({
685
685
  if (!opts || opts.allowHashBang == null) {
686
686
  options.allowHashBang = options.ecmaVersion >= 14;
687
687
  }
688
- if (isArray3(options.onToken)) {
688
+ if (isArray2(options.onToken)) {
689
689
  var tokens = options.onToken;
690
690
  options.onToken = function(token) {
691
691
  return tokens.push(token);
692
692
  };
693
693
  }
694
- if (isArray3(options.onComment)) {
694
+ if (isArray2(options.onComment)) {
695
695
  options.onComment = pushComment2(options, options.onComment);
696
696
  }
697
697
  return options;
@@ -5568,6 +5568,82 @@ var require_acorn_jsx = __commonJS({
5568
5568
  }
5569
5569
  });
5570
5570
 
5571
+ // ../../../node_modules/.pnpm/lodash.flatten@4.4.0/node_modules/lodash.flatten/index.js
5572
+ var require_lodash = __commonJS({
5573
+ "../../../node_modules/.pnpm/lodash.flatten@4.4.0/node_modules/lodash.flatten/index.js"(exports, module2) {
5574
+ var MAX_SAFE_INTEGER = 9007199254740991;
5575
+ var argsTag = "[object Arguments]";
5576
+ var funcTag = "[object Function]";
5577
+ var genTag = "[object GeneratorFunction]";
5578
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
5579
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
5580
+ var root2 = freeGlobal || freeSelf || Function("return this")();
5581
+ function arrayPush(array, values2) {
5582
+ var index2 = -1, length = values2.length, offset2 = array.length;
5583
+ while (++index2 < length) {
5584
+ array[offset2 + index2] = values2[index2];
5585
+ }
5586
+ return array;
5587
+ }
5588
+ var objectProto = Object.prototype;
5589
+ var hasOwnProperty3 = objectProto.hasOwnProperty;
5590
+ var objectToString = objectProto.toString;
5591
+ var Symbol2 = root2.Symbol;
5592
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
5593
+ var spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : void 0;
5594
+ function baseFlatten(array, depth, predicate, isStrict, result) {
5595
+ var index2 = -1, length = array.length;
5596
+ predicate || (predicate = isFlattenable);
5597
+ result || (result = []);
5598
+ while (++index2 < length) {
5599
+ var value = array[index2];
5600
+ if (depth > 0 && predicate(value)) {
5601
+ if (depth > 1) {
5602
+ baseFlatten(value, depth - 1, predicate, isStrict, result);
5603
+ } else {
5604
+ arrayPush(result, value);
5605
+ }
5606
+ } else if (!isStrict) {
5607
+ result[result.length] = value;
5608
+ }
5609
+ }
5610
+ return result;
5611
+ }
5612
+ function isFlattenable(value) {
5613
+ return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
5614
+ }
5615
+ function flatten2(array) {
5616
+ var length = array ? array.length : 0;
5617
+ return length ? baseFlatten(array, 1) : [];
5618
+ }
5619
+ function isArguments(value) {
5620
+ return isArrayLikeObject(value) && hasOwnProperty3.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
5621
+ }
5622
+ var isArray2 = Array.isArray;
5623
+ function isArrayLike(value) {
5624
+ return value != null && isLength(value.length) && !isFunction(value);
5625
+ }
5626
+ function isArrayLikeObject(value) {
5627
+ return isObjectLike(value) && isArrayLike(value);
5628
+ }
5629
+ function isFunction(value) {
5630
+ var tag = isObject2(value) ? objectToString.call(value) : "";
5631
+ return tag == funcTag || tag == genTag;
5632
+ }
5633
+ function isLength(value) {
5634
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
5635
+ }
5636
+ function isObject2(value) {
5637
+ var type = typeof value;
5638
+ return !!value && (type == "object" || type == "function");
5639
+ }
5640
+ function isObjectLike(value) {
5641
+ return !!value && typeof value == "object";
5642
+ }
5643
+ module2.exports = flatten2;
5644
+ }
5645
+ });
5646
+
5571
5647
  // src/index.ts
5572
5648
  var src_exports = {};
5573
5649
  __export(src_exports, {
@@ -40088,8 +40164,8 @@ function stringifyProps(element, parentField, flatten2, imageCallback) {
40088
40164
  `Nested rich-text element is not a valid shape for field ${field.name}`
40089
40165
  );
40090
40166
  if (field.name === "children") {
40091
- const root3 = rootElement(value, field, imageCallback);
40092
- root3.children.forEach((child) => {
40167
+ const root2 = rootElement(value, field, imageCallback);
40168
+ root2.children.forEach((child) => {
40093
40169
  children.push(child);
40094
40170
  });
40095
40171
  return;
@@ -41013,8 +41089,8 @@ function stringifyProps2(element, parentField, flatten2, imageCallback) {
41013
41089
  `Nested rich-text element is not a valid shape for field ${field.name}`
41014
41090
  );
41015
41091
  if (field.name === "children") {
41016
- const root3 = rootElement2(value, field, imageCallback);
41017
- root3.children.forEach((child) => {
41092
+ const root2 = rootElement2(value, field, imageCallback);
41093
+ root2.children.forEach((child) => {
41018
41094
  children.push(child);
41019
41095
  });
41020
41096
  return;
@@ -43475,135 +43551,8 @@ function compact(tree) {
43475
43551
  return tree;
43476
43552
  }
43477
43553
 
43478
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
43479
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
43480
- var freeGlobal_default = freeGlobal;
43481
-
43482
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js
43483
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
43484
- var root2 = freeGlobal_default || freeSelf || Function("return this")();
43485
- var root_default = root2;
43486
-
43487
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js
43488
- var Symbol2 = root_default.Symbol;
43489
- var Symbol_default = Symbol2;
43490
-
43491
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js
43492
- var objectProto = Object.prototype;
43493
- var hasOwnProperty3 = objectProto.hasOwnProperty;
43494
- var nativeObjectToString = objectProto.toString;
43495
- var symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
43496
- function getRawTag(value) {
43497
- var isOwn = hasOwnProperty3.call(value, symToStringTag), tag = value[symToStringTag];
43498
- try {
43499
- value[symToStringTag] = void 0;
43500
- var unmasked = true;
43501
- } catch (e) {
43502
- }
43503
- var result = nativeObjectToString.call(value);
43504
- if (unmasked) {
43505
- if (isOwn) {
43506
- value[symToStringTag] = tag;
43507
- } else {
43508
- delete value[symToStringTag];
43509
- }
43510
- }
43511
- return result;
43512
- }
43513
- var getRawTag_default = getRawTag;
43514
-
43515
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js
43516
- var objectProto2 = Object.prototype;
43517
- var nativeObjectToString2 = objectProto2.toString;
43518
- function objectToString(value) {
43519
- return nativeObjectToString2.call(value);
43520
- }
43521
- var objectToString_default = objectToString;
43522
-
43523
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js
43524
- var nullTag = "[object Null]";
43525
- var undefinedTag = "[object Undefined]";
43526
- var symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
43527
- function baseGetTag(value) {
43528
- if (value == null) {
43529
- return value === void 0 ? undefinedTag : nullTag;
43530
- }
43531
- return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
43532
- }
43533
- var baseGetTag_default = baseGetTag;
43534
-
43535
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js
43536
- function isObjectLike(value) {
43537
- return value != null && typeof value == "object";
43538
- }
43539
- var isObjectLike_default = isObjectLike;
43540
-
43541
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js
43542
- var isArray2 = Array.isArray;
43543
- var isArray_default = isArray2;
43544
-
43545
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js
43546
- var argsTag = "[object Arguments]";
43547
- function baseIsArguments(value) {
43548
- return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
43549
- }
43550
- var baseIsArguments_default = baseIsArguments;
43551
-
43552
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js
43553
- var objectProto3 = Object.prototype;
43554
- var hasOwnProperty4 = objectProto3.hasOwnProperty;
43555
- var propertyIsEnumerable = objectProto3.propertyIsEnumerable;
43556
- var isArguments = baseIsArguments_default(function() {
43557
- return arguments;
43558
- }()) ? baseIsArguments_default : function(value) {
43559
- return isObjectLike_default(value) && hasOwnProperty4.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
43560
- };
43561
- var isArguments_default = isArguments;
43562
-
43563
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js
43564
- function arrayPush(array, values2) {
43565
- var index2 = -1, length = values2.length, offset2 = array.length;
43566
- while (++index2 < length) {
43567
- array[offset2 + index2] = values2[index2];
43568
- }
43569
- return array;
43570
- }
43571
- var arrayPush_default = arrayPush;
43572
-
43573
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isFlattenable.js
43574
- var spreadableSymbol = Symbol_default ? Symbol_default.isConcatSpreadable : void 0;
43575
- function isFlattenable(value) {
43576
- return isArray_default(value) || isArguments_default(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
43577
- }
43578
- var isFlattenable_default = isFlattenable;
43579
-
43580
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFlatten.js
43581
- function baseFlatten(array, depth, predicate, isStrict, result) {
43582
- var index2 = -1, length = array.length;
43583
- predicate || (predicate = isFlattenable_default);
43584
- result || (result = []);
43585
- while (++index2 < length) {
43586
- var value = array[index2];
43587
- if (depth > 0 && predicate(value)) {
43588
- if (depth > 1) {
43589
- baseFlatten(value, depth - 1, predicate, isStrict, result);
43590
- } else {
43591
- arrayPush_default(result, value);
43592
- }
43593
- } else if (!isStrict) {
43594
- result[result.length] = value;
43595
- }
43596
- }
43597
- return result;
43598
- }
43599
- var baseFlatten_default = baseFlatten;
43600
-
43601
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatten.js
43602
- function flatten(array) {
43603
- var length = array == null ? 0 : array.length;
43604
- return length ? baseFlatten_default(array, 1) : [];
43605
- }
43606
- var flatten_default = flatten;
43554
+ // src/parse/remarkToPlate.ts
43555
+ var import_lodash = __toESM(require_lodash());
43607
43556
 
43608
43557
  // src/parse/acorn.ts
43609
43558
  var extractAttributes = (attributes2, fields, imageCallback) => {
@@ -43990,7 +43939,7 @@ var directiveElement = (node2, field, imageCallback, raw) => {
43990
43939
  };
43991
43940
 
43992
43941
  // src/parse/remarkToPlate.ts
43993
- var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
43942
+ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
43994
43943
  const mdxJsxElement2 = skipMDXProcess ? (node2) => node2 : mdxJsxElement;
43995
43944
  const content3 = (content4) => {
43996
43945
  var _a3;
@@ -44011,7 +43960,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44011
43960
  children: [
44012
43961
  {
44013
43962
  type: "p",
44014
- children: flatten_default(
43963
+ children: (0, import_lodash.default)(
44015
43964
  child2.children.map(
44016
43965
  (child3) => phrasingContent(child3)
44017
43966
  )
@@ -44057,7 +44006,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44057
44006
  children: [
44058
44007
  {
44059
44008
  type: "lic",
44060
- children: flatten_default(
44009
+ children: (0, import_lodash.default)(
44061
44010
  content4.children.map((child) => unwrapBlockContent(child))
44062
44011
  )
44063
44012
  }
@@ -44117,7 +44066,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44117
44066
  case "paragraph":
44118
44067
  return {
44119
44068
  type: "lic",
44120
- children: flatten_default(
44069
+ children: (0, import_lodash.default)(
44121
44070
  child.children.map((child2) => phrasingContent(child2))
44122
44071
  )
44123
44072
  };
@@ -44172,7 +44121,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44172
44121
  const unwrapBlockContent = (content4) => {
44173
44122
  const flattenPhrasingContent = (children) => {
44174
44123
  const children2 = children.map((child) => phrasingContent(child));
44175
- return flatten_default(Array.isArray(children2) ? children2 : [children2]);
44124
+ return (0, import_lodash.default)(Array.isArray(children2) ? children2 : [children2]);
44176
44125
  };
44177
44126
  switch (content4.type) {
44178
44127
  case "heading":
@@ -44204,7 +44153,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44204
44153
  type: "a",
44205
44154
  url: sanitizeUrl(content4.url),
44206
44155
  title: content4.title,
44207
- children: flatten_default(
44156
+ children: (0, import_lodash.default)(
44208
44157
  content4.children.map((child) => staticPhrasingContent(child))
44209
44158
  )
44210
44159
  };
@@ -44212,7 +44161,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44212
44161
  const heading2 = (content4) => {
44213
44162
  return {
44214
44163
  type: ["h1", "h2", "h3", "h4", "h5", "h6"][content4.depth - 1],
44215
- children: flatten_default(content4.children.map(phrasingContent))
44164
+ children: (0, import_lodash.default)(content4.children.map(phrasingContent))
44216
44165
  };
44217
44166
  };
44218
44167
  const staticPhrasingContent = (content4) => {
@@ -44278,7 +44227,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44278
44227
  const accum = [];
44279
44228
  switch (node2.type) {
44280
44229
  case "emphasis": {
44281
- const children = flatten_default(
44230
+ const children = (0, import_lodash.default)(
44282
44231
  node2.children.map(
44283
44232
  (child) => phrashingMark(child, [...marks, "italic"])
44284
44233
  )
@@ -44300,7 +44249,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44300
44249
  break;
44301
44250
  }
44302
44251
  case "strong": {
44303
- const children = flatten_default(
44252
+ const children = (0, import_lodash.default)(
44304
44253
  node2.children.map((child) => phrashingMark(child, [...marks, "bold"]))
44305
44254
  );
44306
44255
  children.forEach((child) => {
@@ -44313,7 +44262,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44313
44262
  break;
44314
44263
  }
44315
44264
  case "link": {
44316
- const children = flatten_default(
44265
+ const children = (0, import_lodash.default)(
44317
44266
  node2.children.map((child) => phrashingMark(child, marks))
44318
44267
  );
44319
44268
  accum.push({
@@ -44369,7 +44318,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44369
44318
  };
44370
44319
  };
44371
44320
  const paragraph2 = (content4) => {
44372
- const children = flatten_default(content4.children.map(phrasingContent));
44321
+ const children = (0, import_lodash.default)(content4.children.map(phrasingContent));
44373
44322
  if (children.length === 1) {
44374
44323
  if (children[0]) {
44375
44324
  if (children[0].type === "html_inline") {
@@ -44387,7 +44336,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44387
44336
  };
44388
44337
  return {
44389
44338
  type: "root",
44390
- children: root3.children.map((child) => {
44339
+ children: root2.children.map((child) => {
44391
44340
  return content3(child);
44392
44341
  })
44393
44342
  };
@@ -44565,12 +44514,3 @@ var replaceAll = (string3, target, value) => {
44565
44514
  * @author Feross Aboukhadijeh <https://feross.org>
44566
44515
  * @license MIT
44567
44516
  */
44568
- /**
44569
- * @license
44570
- * Lodash (Custom Build) <https://lodash.com/>
44571
- * Build: `lodash modularize exports="es" -o ./`
44572
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
44573
- * Released under MIT license <https://lodash.com/license>
44574
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
44575
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
44576
- */
package/dist/index.mjs CHANGED
@@ -46,7 +46,7 @@ var require_extend = __commonJS({
46
46
  var toStr = Object.prototype.toString;
47
47
  var defineProperty = Object.defineProperty;
48
48
  var gOPD = Object.getOwnPropertyDescriptor;
49
- var isArray3 = function isArray4(arr) {
49
+ var isArray2 = function isArray3(arr) {
50
50
  if (typeof Array.isArray === "function") {
51
51
  return Array.isArray(arr);
52
52
  }
@@ -109,10 +109,10 @@ var require_extend = __commonJS({
109
109
  src = getProperty(target, name2);
110
110
  copy = getProperty(options, name2);
111
111
  if (target !== copy) {
112
- if (deep && copy && (isPlainObject3(copy) || (copyIsArray = isArray3(copy)))) {
112
+ if (deep && copy && (isPlainObject3(copy) || (copyIsArray = isArray2(copy)))) {
113
113
  if (copyIsArray) {
114
114
  copyIsArray = false;
115
- clone = src && isArray3(src) ? src : [];
115
+ clone = src && isArray2(src) ? src : [];
116
116
  } else {
117
117
  clone = src && isPlainObject3(src) ? src : {};
118
118
  }
@@ -602,12 +602,12 @@ var require_acorn = __commonJS({
602
602
  var nonASCIIwhitespace2 = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
603
603
  var skipWhiteSpace2 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
604
604
  var ref2 = Object.prototype;
605
- var hasOwnProperty5 = ref2.hasOwnProperty;
605
+ var hasOwnProperty3 = ref2.hasOwnProperty;
606
606
  var toString3 = ref2.toString;
607
607
  var hasOwn2 = Object.hasOwn || function(obj, propName) {
608
- return hasOwnProperty5.call(obj, propName);
608
+ return hasOwnProperty3.call(obj, propName);
609
609
  };
610
- var isArray3 = Array.isArray || function(obj) {
610
+ var isArray2 = Array.isArray || function(obj) {
611
611
  return toString3.call(obj) === "[object Array]";
612
612
  };
613
613
  function wordsRegexp2(words) {
@@ -688,13 +688,13 @@ var require_acorn = __commonJS({
688
688
  if (!opts || opts.allowHashBang == null) {
689
689
  options.allowHashBang = options.ecmaVersion >= 14;
690
690
  }
691
- if (isArray3(options.onToken)) {
691
+ if (isArray2(options.onToken)) {
692
692
  var tokens = options.onToken;
693
693
  options.onToken = function(token) {
694
694
  return tokens.push(token);
695
695
  };
696
696
  }
697
- if (isArray3(options.onComment)) {
697
+ if (isArray2(options.onComment)) {
698
698
  options.onComment = pushComment2(options, options.onComment);
699
699
  }
700
700
  return options;
@@ -5571,6 +5571,82 @@ var require_acorn_jsx = __commonJS({
5571
5571
  }
5572
5572
  });
5573
5573
 
5574
+ // ../../../node_modules/.pnpm/lodash.flatten@4.4.0/node_modules/lodash.flatten/index.js
5575
+ var require_lodash = __commonJS({
5576
+ "../../../node_modules/.pnpm/lodash.flatten@4.4.0/node_modules/lodash.flatten/index.js"(exports, module) {
5577
+ var MAX_SAFE_INTEGER = 9007199254740991;
5578
+ var argsTag = "[object Arguments]";
5579
+ var funcTag = "[object Function]";
5580
+ var genTag = "[object GeneratorFunction]";
5581
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
5582
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
5583
+ var root2 = freeGlobal || freeSelf || Function("return this")();
5584
+ function arrayPush(array, values2) {
5585
+ var index2 = -1, length = values2.length, offset2 = array.length;
5586
+ while (++index2 < length) {
5587
+ array[offset2 + index2] = values2[index2];
5588
+ }
5589
+ return array;
5590
+ }
5591
+ var objectProto = Object.prototype;
5592
+ var hasOwnProperty3 = objectProto.hasOwnProperty;
5593
+ var objectToString = objectProto.toString;
5594
+ var Symbol2 = root2.Symbol;
5595
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
5596
+ var spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : void 0;
5597
+ function baseFlatten(array, depth, predicate, isStrict, result) {
5598
+ var index2 = -1, length = array.length;
5599
+ predicate || (predicate = isFlattenable);
5600
+ result || (result = []);
5601
+ while (++index2 < length) {
5602
+ var value = array[index2];
5603
+ if (depth > 0 && predicate(value)) {
5604
+ if (depth > 1) {
5605
+ baseFlatten(value, depth - 1, predicate, isStrict, result);
5606
+ } else {
5607
+ arrayPush(result, value);
5608
+ }
5609
+ } else if (!isStrict) {
5610
+ result[result.length] = value;
5611
+ }
5612
+ }
5613
+ return result;
5614
+ }
5615
+ function isFlattenable(value) {
5616
+ return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
5617
+ }
5618
+ function flatten2(array) {
5619
+ var length = array ? array.length : 0;
5620
+ return length ? baseFlatten(array, 1) : [];
5621
+ }
5622
+ function isArguments(value) {
5623
+ return isArrayLikeObject(value) && hasOwnProperty3.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
5624
+ }
5625
+ var isArray2 = Array.isArray;
5626
+ function isArrayLike(value) {
5627
+ return value != null && isLength(value.length) && !isFunction(value);
5628
+ }
5629
+ function isArrayLikeObject(value) {
5630
+ return isObjectLike(value) && isArrayLike(value);
5631
+ }
5632
+ function isFunction(value) {
5633
+ var tag = isObject2(value) ? objectToString.call(value) : "";
5634
+ return tag == funcTag || tag == genTag;
5635
+ }
5636
+ function isLength(value) {
5637
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
5638
+ }
5639
+ function isObject2(value) {
5640
+ var type = typeof value;
5641
+ return !!value && (type == "object" || type == "function");
5642
+ }
5643
+ function isObjectLike(value) {
5644
+ return !!value && typeof value == "object";
5645
+ }
5646
+ module.exports = flatten2;
5647
+ }
5648
+ });
5649
+
5574
5650
  // ../../../node_modules/.pnpm/bail@2.0.2/node_modules/bail/index.js
5575
5651
  function bail(error) {
5576
5652
  if (error) {
@@ -40076,8 +40152,8 @@ function stringifyProps(element, parentField, flatten2, imageCallback) {
40076
40152
  `Nested rich-text element is not a valid shape for field ${field.name}`
40077
40153
  );
40078
40154
  if (field.name === "children") {
40079
- const root3 = rootElement(value, field, imageCallback);
40080
- root3.children.forEach((child) => {
40155
+ const root2 = rootElement(value, field, imageCallback);
40156
+ root2.children.forEach((child) => {
40081
40157
  children.push(child);
40082
40158
  });
40083
40159
  return;
@@ -40992,8 +41068,8 @@ function stringifyProps2(element, parentField, flatten2, imageCallback) {
40992
41068
  `Nested rich-text element is not a valid shape for field ${field.name}`
40993
41069
  );
40994
41070
  if (field.name === "children") {
40995
- const root3 = rootElement2(value, field, imageCallback);
40996
- root3.children.forEach((child) => {
41071
+ const root2 = rootElement2(value, field, imageCallback);
41072
+ root2.children.forEach((child) => {
40997
41073
  children.push(child);
40998
41074
  });
40999
41075
  return;
@@ -43450,135 +43526,8 @@ function compact(tree) {
43450
43526
  return tree;
43451
43527
  }
43452
43528
 
43453
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
43454
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
43455
- var freeGlobal_default = freeGlobal;
43456
-
43457
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js
43458
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
43459
- var root2 = freeGlobal_default || freeSelf || Function("return this")();
43460
- var root_default = root2;
43461
-
43462
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js
43463
- var Symbol2 = root_default.Symbol;
43464
- var Symbol_default = Symbol2;
43465
-
43466
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js
43467
- var objectProto = Object.prototype;
43468
- var hasOwnProperty3 = objectProto.hasOwnProperty;
43469
- var nativeObjectToString = objectProto.toString;
43470
- var symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
43471
- function getRawTag(value) {
43472
- var isOwn = hasOwnProperty3.call(value, symToStringTag), tag = value[symToStringTag];
43473
- try {
43474
- value[symToStringTag] = void 0;
43475
- var unmasked = true;
43476
- } catch (e) {
43477
- }
43478
- var result = nativeObjectToString.call(value);
43479
- if (unmasked) {
43480
- if (isOwn) {
43481
- value[symToStringTag] = tag;
43482
- } else {
43483
- delete value[symToStringTag];
43484
- }
43485
- }
43486
- return result;
43487
- }
43488
- var getRawTag_default = getRawTag;
43489
-
43490
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js
43491
- var objectProto2 = Object.prototype;
43492
- var nativeObjectToString2 = objectProto2.toString;
43493
- function objectToString(value) {
43494
- return nativeObjectToString2.call(value);
43495
- }
43496
- var objectToString_default = objectToString;
43497
-
43498
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js
43499
- var nullTag = "[object Null]";
43500
- var undefinedTag = "[object Undefined]";
43501
- var symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
43502
- function baseGetTag(value) {
43503
- if (value == null) {
43504
- return value === void 0 ? undefinedTag : nullTag;
43505
- }
43506
- return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
43507
- }
43508
- var baseGetTag_default = baseGetTag;
43509
-
43510
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js
43511
- function isObjectLike(value) {
43512
- return value != null && typeof value == "object";
43513
- }
43514
- var isObjectLike_default = isObjectLike;
43515
-
43516
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js
43517
- var isArray2 = Array.isArray;
43518
- var isArray_default = isArray2;
43519
-
43520
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js
43521
- var argsTag = "[object Arguments]";
43522
- function baseIsArguments(value) {
43523
- return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
43524
- }
43525
- var baseIsArguments_default = baseIsArguments;
43526
-
43527
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js
43528
- var objectProto3 = Object.prototype;
43529
- var hasOwnProperty4 = objectProto3.hasOwnProperty;
43530
- var propertyIsEnumerable = objectProto3.propertyIsEnumerable;
43531
- var isArguments = baseIsArguments_default(function() {
43532
- return arguments;
43533
- }()) ? baseIsArguments_default : function(value) {
43534
- return isObjectLike_default(value) && hasOwnProperty4.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
43535
- };
43536
- var isArguments_default = isArguments;
43537
-
43538
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js
43539
- function arrayPush(array, values2) {
43540
- var index2 = -1, length = values2.length, offset2 = array.length;
43541
- while (++index2 < length) {
43542
- array[offset2 + index2] = values2[index2];
43543
- }
43544
- return array;
43545
- }
43546
- var arrayPush_default = arrayPush;
43547
-
43548
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isFlattenable.js
43549
- var spreadableSymbol = Symbol_default ? Symbol_default.isConcatSpreadable : void 0;
43550
- function isFlattenable(value) {
43551
- return isArray_default(value) || isArguments_default(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
43552
- }
43553
- var isFlattenable_default = isFlattenable;
43554
-
43555
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFlatten.js
43556
- function baseFlatten(array, depth, predicate, isStrict, result) {
43557
- var index2 = -1, length = array.length;
43558
- predicate || (predicate = isFlattenable_default);
43559
- result || (result = []);
43560
- while (++index2 < length) {
43561
- var value = array[index2];
43562
- if (depth > 0 && predicate(value)) {
43563
- if (depth > 1) {
43564
- baseFlatten(value, depth - 1, predicate, isStrict, result);
43565
- } else {
43566
- arrayPush_default(result, value);
43567
- }
43568
- } else if (!isStrict) {
43569
- result[result.length] = value;
43570
- }
43571
- }
43572
- return result;
43573
- }
43574
- var baseFlatten_default = baseFlatten;
43575
-
43576
- // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatten.js
43577
- function flatten(array) {
43578
- var length = array == null ? 0 : array.length;
43579
- return length ? baseFlatten_default(array, 1) : [];
43580
- }
43581
- var flatten_default = flatten;
43529
+ // src/parse/remarkToPlate.ts
43530
+ var import_lodash = __toESM(require_lodash());
43582
43531
 
43583
43532
  // src/parse/acorn.ts
43584
43533
  var extractAttributes = (attributes2, fields, imageCallback) => {
@@ -43960,7 +43909,7 @@ var directiveElement = (node2, field, imageCallback, raw) => {
43960
43909
  };
43961
43910
 
43962
43911
  // src/parse/remarkToPlate.ts
43963
- var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
43912
+ var remarkToSlate = (root2, field, imageCallback, raw, skipMDXProcess) => {
43964
43913
  const mdxJsxElement2 = skipMDXProcess ? (node2) => node2 : mdxJsxElement;
43965
43914
  const content3 = (content4) => {
43966
43915
  switch (content4.type) {
@@ -43980,7 +43929,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
43980
43929
  children: [
43981
43930
  {
43982
43931
  type: "p",
43983
- children: flatten_default(
43932
+ children: (0, import_lodash.default)(
43984
43933
  child2.children.map(
43985
43934
  (child3) => phrasingContent(child3)
43986
43935
  )
@@ -44026,7 +43975,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44026
43975
  children: [
44027
43976
  {
44028
43977
  type: "lic",
44029
- children: flatten_default(
43978
+ children: (0, import_lodash.default)(
44030
43979
  content4.children.map((child) => unwrapBlockContent(child))
44031
43980
  )
44032
43981
  }
@@ -44086,7 +44035,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44086
44035
  case "paragraph":
44087
44036
  return {
44088
44037
  type: "lic",
44089
- children: flatten_default(
44038
+ children: (0, import_lodash.default)(
44090
44039
  child.children.map((child2) => phrasingContent(child2))
44091
44040
  )
44092
44041
  };
@@ -44141,7 +44090,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44141
44090
  const unwrapBlockContent = (content4) => {
44142
44091
  const flattenPhrasingContent = (children) => {
44143
44092
  const children2 = children.map((child) => phrasingContent(child));
44144
- return flatten_default(Array.isArray(children2) ? children2 : [children2]);
44093
+ return (0, import_lodash.default)(Array.isArray(children2) ? children2 : [children2]);
44145
44094
  };
44146
44095
  switch (content4.type) {
44147
44096
  case "heading":
@@ -44173,7 +44122,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44173
44122
  type: "a",
44174
44123
  url: sanitizeUrl(content4.url),
44175
44124
  title: content4.title,
44176
- children: flatten_default(
44125
+ children: (0, import_lodash.default)(
44177
44126
  content4.children.map((child) => staticPhrasingContent(child))
44178
44127
  )
44179
44128
  };
@@ -44181,7 +44130,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44181
44130
  const heading2 = (content4) => {
44182
44131
  return {
44183
44132
  type: ["h1", "h2", "h3", "h4", "h5", "h6"][content4.depth - 1],
44184
- children: flatten_default(content4.children.map(phrasingContent))
44133
+ children: (0, import_lodash.default)(content4.children.map(phrasingContent))
44185
44134
  };
44186
44135
  };
44187
44136
  const staticPhrasingContent = (content4) => {
@@ -44247,7 +44196,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44247
44196
  const accum = [];
44248
44197
  switch (node2.type) {
44249
44198
  case "emphasis": {
44250
- const children = flatten_default(
44199
+ const children = (0, import_lodash.default)(
44251
44200
  node2.children.map(
44252
44201
  (child) => phrashingMark(child, [...marks, "italic"])
44253
44202
  )
@@ -44269,7 +44218,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44269
44218
  break;
44270
44219
  }
44271
44220
  case "strong": {
44272
- const children = flatten_default(
44221
+ const children = (0, import_lodash.default)(
44273
44222
  node2.children.map((child) => phrashingMark(child, [...marks, "bold"]))
44274
44223
  );
44275
44224
  children.forEach((child) => {
@@ -44282,7 +44231,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44282
44231
  break;
44283
44232
  }
44284
44233
  case "link": {
44285
- const children = flatten_default(
44234
+ const children = (0, import_lodash.default)(
44286
44235
  node2.children.map((child) => phrashingMark(child, marks))
44287
44236
  );
44288
44237
  accum.push({
@@ -44338,7 +44287,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44338
44287
  };
44339
44288
  };
44340
44289
  const paragraph2 = (content4) => {
44341
- const children = flatten_default(content4.children.map(phrasingContent));
44290
+ const children = (0, import_lodash.default)(content4.children.map(phrasingContent));
44342
44291
  if (children.length === 1) {
44343
44292
  if (children[0]) {
44344
44293
  if (children[0].type === "html_inline") {
@@ -44356,7 +44305,7 @@ var remarkToSlate = (root3, field, imageCallback, raw, skipMDXProcess) => {
44356
44305
  };
44357
44306
  return {
44358
44307
  type: "root",
44359
- children: root3.children.map((child) => {
44308
+ children: root2.children.map((child) => {
44360
44309
  return content3(child);
44361
44310
  })
44362
44311
  };
@@ -44532,12 +44481,3 @@ export {
44532
44481
  * @author Feross Aboukhadijeh <https://feross.org>
44533
44482
  * @license MIT
44534
44483
  */
44535
- /**
44536
- * @license
44537
- * Lodash (Custom Build) <https://lodash.com/>
44538
- * Build: `lodash modularize exports="es" -o ./`
44539
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
44540
- * Released under MIT license <https://lodash.com/license>
44541
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
44542
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
44543
- */
@@ -7,7 +7,7 @@ import type * as Md from 'mdast';
7
7
  import type * as Plate from './plate';
8
8
  import type { RichTextType } from '@tinacms/schema-tools';
9
9
  import type { MdxJsxTextElement, MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
10
- import { ContainerDirective } from 'mdast-util-directive';
10
+ import type { ContainerDirective } from 'mdast-util-directive';
11
11
  export type { Position, PositionItem } from './plate';
12
12
  declare module 'mdast' {
13
13
  interface StaticPhrasingContentMap {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/mdx",
3
- "version": "1.3.28",
3
+ "version": "1.4.0",
4
4
  "typings": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "browser": "dist/index.browser.mjs",
@@ -30,7 +30,7 @@
30
30
  "acorn": "8.8.2",
31
31
  "ccount": "2.0.1",
32
32
  "estree-util-is-identifier-name": "2.1.0",
33
- "lodash-es": "4.17.21",
33
+ "lodash.flatten": "4.4.0",
34
34
  "mdast-util-compact": "4.1.1",
35
35
  "mdast-util-directive": "2.2.4",
36
36
  "mdast-util-from-markdown": "1.3.0",
@@ -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.4.19"
59
+ "@tinacms/schema-tools": "1.6.0"
60
60
  },
61
61
  "publishConfig": {
62
62
  "registry": "https://registry.npmjs.org"
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/estree": "1.0.0",
70
- "@types/lodash-es": "4.17.6",
70
+ "@types/lodash.flatten": "^4.4.9",
71
71
  "@types/mdast": "^3.0.10",
72
72
  "@types/node": "^14.18.21",
73
73
  "@types/prettier": "^2.6.3",
@@ -77,10 +77,10 @@
77
77
  "jest-file-snapshot": "^0.5.0",
78
78
  "ts-node": "^10.8.2",
79
79
  "typedoc-plugin-markdown": "^3.13.6",
80
- "typescript": "^5.5.3",
80
+ "typescript": "^5.5.4",
81
81
  "vite": "^4.3.9",
82
82
  "vitest": "^0.32.2",
83
- "@tinacms/scripts": "1.1.6"
83
+ "@tinacms/scripts": "1.2.0"
84
84
  },
85
85
  "scripts": {
86
86
  "types": "tsc",