@superinterface/react 3.5.2 → 3.5.3
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.cjs +142 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +142 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1070,7 +1070,147 @@ var import_react26 = require("react");
|
|
|
1070
1070
|
var import_mdx = require("@mdx-js/mdx");
|
|
1071
1071
|
var import_react27 = require("@mdx-js/react");
|
|
1072
1072
|
var runtime = __toESM(require("react/jsx-runtime"), 1);
|
|
1073
|
-
|
|
1073
|
+
// src/lib/recma/recmaFallbackComponentPlugin.ts
|
|
1074
|
+
var import_estree_util_visit = require("estree-util-visit");
|
|
1075
|
+
var recmaFallbackComponentPlugin = function() {
|
|
1076
|
+
return function(tree) {
|
|
1077
|
+
(0, import_estree_util_visit.visit)(tree, function(node) {
|
|
1078
|
+
if (node.type === "VariableDeclaration" && node.kind === "const") {
|
|
1079
|
+
var varDecl = node;
|
|
1080
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1081
|
+
try {
|
|
1082
|
+
for(var _iterator = varDecl.declarations[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1083
|
+
var declarator = _step.value;
|
|
1084
|
+
var _declarator_init;
|
|
1085
|
+
if (declarator.id.type === "ObjectPattern" && ((_declarator_init = declarator.init) === null || _declarator_init === void 0 ? void 0 : _declarator_init.type) === "Identifier" && declarator.init.name === "_components") {
|
|
1086
|
+
varDecl.kind = "let";
|
|
1087
|
+
return import_estree_util_visit.SKIP;
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
} catch (err) {
|
|
1091
|
+
_didIteratorError = true;
|
|
1092
|
+
_iteratorError = err;
|
|
1093
|
+
} finally{
|
|
1094
|
+
try {
|
|
1095
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
1096
|
+
_iterator.return();
|
|
1097
|
+
}
|
|
1098
|
+
} finally{
|
|
1099
|
+
if (_didIteratorError) {
|
|
1100
|
+
throw _iteratorError;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
return import_estree_util_visit.CONTINUE;
|
|
1106
|
+
});
|
|
1107
|
+
(0, import_estree_util_visit.visit)(tree, function(node) {
|
|
1108
|
+
var _node_id;
|
|
1109
|
+
if (node.type === "FunctionDeclaration" && ((_node_id = node.id) === null || _node_id === void 0 ? void 0 : _node_id.type) === "Identifier" && node.id.name === "_missingMdxReference") {
|
|
1110
|
+
var funcNode = node;
|
|
1111
|
+
funcNode.body = {
|
|
1112
|
+
type: "BlockStatement",
|
|
1113
|
+
body: [
|
|
1114
|
+
{
|
|
1115
|
+
type: "IfStatement",
|
|
1116
|
+
test: {
|
|
1117
|
+
type: "Identifier",
|
|
1118
|
+
name: "component"
|
|
1119
|
+
},
|
|
1120
|
+
consequent: {
|
|
1121
|
+
type: "ReturnStatement",
|
|
1122
|
+
argument: {
|
|
1123
|
+
type: "FunctionExpression",
|
|
1124
|
+
id: null,
|
|
1125
|
+
params: [
|
|
1126
|
+
{
|
|
1127
|
+
type: "Identifier",
|
|
1128
|
+
name: "props"
|
|
1129
|
+
}
|
|
1130
|
+
],
|
|
1131
|
+
body: {
|
|
1132
|
+
type: "BlockStatement",
|
|
1133
|
+
body: [
|
|
1134
|
+
{
|
|
1135
|
+
type: "ReturnStatement",
|
|
1136
|
+
argument: {
|
|
1137
|
+
type: "BinaryExpression",
|
|
1138
|
+
operator: "+",
|
|
1139
|
+
left: {
|
|
1140
|
+
type: "BinaryExpression",
|
|
1141
|
+
operator: "+",
|
|
1142
|
+
left: {
|
|
1143
|
+
type: "Literal",
|
|
1144
|
+
value: "<"
|
|
1145
|
+
},
|
|
1146
|
+
right: {
|
|
1147
|
+
type: "Identifier",
|
|
1148
|
+
name: "id"
|
|
1149
|
+
}
|
|
1150
|
+
},
|
|
1151
|
+
right: {
|
|
1152
|
+
type: "BinaryExpression",
|
|
1153
|
+
operator: "+",
|
|
1154
|
+
left: {
|
|
1155
|
+
type: "Literal",
|
|
1156
|
+
value: "></"
|
|
1157
|
+
},
|
|
1158
|
+
right: {
|
|
1159
|
+
type: "BinaryExpression",
|
|
1160
|
+
operator: "+",
|
|
1161
|
+
left: {
|
|
1162
|
+
type: "Identifier",
|
|
1163
|
+
name: "id"
|
|
1164
|
+
},
|
|
1165
|
+
right: {
|
|
1166
|
+
type: "Literal",
|
|
1167
|
+
value: ">"
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
]
|
|
1174
|
+
},
|
|
1175
|
+
generator: false,
|
|
1176
|
+
async: false
|
|
1177
|
+
}
|
|
1178
|
+
},
|
|
1179
|
+
alternate: null
|
|
1180
|
+
}
|
|
1181
|
+
]
|
|
1182
|
+
};
|
|
1183
|
+
return import_estree_util_visit.SKIP;
|
|
1184
|
+
}
|
|
1185
|
+
return import_estree_util_visit.CONTINUE;
|
|
1186
|
+
});
|
|
1187
|
+
(0, import_estree_util_visit.visit)(tree, function(node) {
|
|
1188
|
+
if (node.type === "IfStatement") {
|
|
1189
|
+
var ifNode = node;
|
|
1190
|
+
if (ifNode.test.type === "UnaryExpression" && ifNode.test.operator === "!" && ifNode.test.argument.type === "Identifier") {
|
|
1191
|
+
var componentName = ifNode.test.argument.name;
|
|
1192
|
+
if (ifNode.consequent.type === "ExpressionStatement" && ifNode.consequent.expression.type === "CallExpression" && ifNode.consequent.expression.callee.type === "Identifier" && ifNode.consequent.expression.callee.name === "_missingMdxReference") {
|
|
1193
|
+
var assignmentExpr = {
|
|
1194
|
+
type: "AssignmentExpression",
|
|
1195
|
+
operator: "=",
|
|
1196
|
+
left: {
|
|
1197
|
+
type: "Identifier",
|
|
1198
|
+
name: componentName
|
|
1199
|
+
},
|
|
1200
|
+
right: ifNode.consequent.expression
|
|
1201
|
+
};
|
|
1202
|
+
ifNode.consequent = {
|
|
1203
|
+
type: "ExpressionStatement",
|
|
1204
|
+
expression: assignmentExpr
|
|
1205
|
+
};
|
|
1206
|
+
return import_estree_util_visit.SKIP;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
return import_estree_util_visit.CONTINUE;
|
|
1211
|
+
});
|
|
1212
|
+
};
|
|
1213
|
+
};
|
|
1074
1214
|
// src/hooks/markdown/useMarkdownContext/index.ts
|
|
1075
1215
|
var import_react25 = require("react");
|
|
1076
1216
|
// src/contexts/markdown/MarkdownContext/index.ts
|
|
@@ -2947,7 +3087,7 @@ var TextContent = function(param) {
|
|
|
2947
3087
|
outputFormat: "function-body",
|
|
2948
3088
|
remarkPlugins: remarkPlugins,
|
|
2949
3089
|
recmaPlugins: [
|
|
2950
|
-
|
|
3090
|
+
recmaFallbackComponentPlugin
|
|
2951
3091
|
],
|
|
2952
3092
|
providerImportSource: "@mdx-js/react"
|
|
2953
3093
|
})
|