@xyd-js/content 0.0.0-build-ba549ac-20251203173500 → 0.0.0-build-83b15db-20251213220910
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/CHANGELOG.md +7 -7
- package/dist/index.d.ts +2 -1
- package/dist/index.js +36 -25
- package/dist/index.js.map +1 -1
- package/dist/md.js +48 -32
- package/dist/md.js.map +1 -1
- package/dist/vite.js +48 -32
- package/dist/vite.js.map +1 -1
- package/package.json +7 -7
- package/packages/md/plugins/developer-writing/mdCodeRehype.ts +3 -1
- package/packages/md/plugins/utils/injectCodeMeta.ts +3 -0
- package/src/fs.test.ts +42 -0
- package/src/fs.ts +11 -0
package/dist/md.js
CHANGED
|
@@ -28,22 +28,22 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
mod
|
|
29
29
|
));
|
|
30
30
|
|
|
31
|
-
// ../../node_modules/.pnpm/react@19.2.
|
|
31
|
+
// ../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js
|
|
32
32
|
var require_react_production = __commonJS({
|
|
33
|
-
"../../node_modules/.pnpm/react@19.2.
|
|
33
|
+
"../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js"(exports) {
|
|
34
34
|
"use strict";
|
|
35
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
|
|
36
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
37
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
38
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
39
|
-
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
40
|
-
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer");
|
|
41
|
-
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
42
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
43
|
-
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
44
|
-
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
45
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
46
|
-
var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
|
|
35
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
36
|
+
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
37
|
+
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
38
|
+
var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
|
|
39
|
+
var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
|
|
40
|
+
var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
|
|
41
|
+
var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
|
|
42
|
+
var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
43
|
+
var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
|
|
44
|
+
var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
|
|
45
|
+
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
46
|
+
var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
|
|
47
47
|
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
48
48
|
function getIteratorFn(maybeIterable) {
|
|
49
49
|
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
@@ -465,13 +465,13 @@ var require_react_production = __commonJS({
|
|
|
465
465
|
exports.useTransition = function() {
|
|
466
466
|
return ReactSharedInternals.H.useTransition();
|
|
467
467
|
};
|
|
468
|
-
exports.version = "19.2.
|
|
468
|
+
exports.version = "19.2.3";
|
|
469
469
|
}
|
|
470
470
|
});
|
|
471
471
|
|
|
472
|
-
// ../../node_modules/.pnpm/react@19.2.
|
|
472
|
+
// ../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.development.js
|
|
473
473
|
var require_react_development = __commonJS({
|
|
474
|
-
"../../node_modules/.pnpm/react@19.2.
|
|
474
|
+
"../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.development.js"(exports, module) {
|
|
475
475
|
"use strict";
|
|
476
476
|
"production" !== process.env.NODE_ENV && (function() {
|
|
477
477
|
function defineDeprecationWarning(methodName, info) {
|
|
@@ -938,7 +938,7 @@ var require_react_development = __commonJS({
|
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
940
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
941
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
|
941
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
|
942
942
|
isMounted: function() {
|
|
943
943
|
return false;
|
|
944
944
|
},
|
|
@@ -981,7 +981,7 @@ var require_react_development = __commonJS({
|
|
|
981
981
|
deprecatedAPIs.constructor = PureComponent;
|
|
982
982
|
assign(deprecatedAPIs, Component.prototype);
|
|
983
983
|
deprecatedAPIs.isPureReactComponent = true;
|
|
984
|
-
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
|
|
984
|
+
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
|
|
985
985
|
H: null,
|
|
986
986
|
A: null,
|
|
987
987
|
T: null,
|
|
@@ -1435,15 +1435,15 @@ var require_react_development = __commonJS({
|
|
|
1435
1435
|
exports.useTransition = function() {
|
|
1436
1436
|
return resolveDispatcher().useTransition();
|
|
1437
1437
|
};
|
|
1438
|
-
exports.version = "19.2.
|
|
1438
|
+
exports.version = "19.2.3";
|
|
1439
1439
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1440
1440
|
})();
|
|
1441
1441
|
}
|
|
1442
1442
|
});
|
|
1443
1443
|
|
|
1444
|
-
// ../../node_modules/.pnpm/react@19.2.
|
|
1444
|
+
// ../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js
|
|
1445
1445
|
var require_react = __commonJS({
|
|
1446
|
-
"../../node_modules/.pnpm/react@19.2.
|
|
1446
|
+
"../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js"(exports, module) {
|
|
1447
1447
|
"use strict";
|
|
1448
1448
|
if (process.env.NODE_ENV === "production") {
|
|
1449
1449
|
module.exports = require_react_production();
|
|
@@ -2718,6 +2718,9 @@ function injectCodeMeta(node, metaString) {
|
|
|
2718
2718
|
if ((attributes2 == null ? void 0 : attributes2.title) === "false") {
|
|
2719
2719
|
props.title = "";
|
|
2720
2720
|
}
|
|
2721
|
+
if (attributes2) {
|
|
2722
|
+
props.attributes = JSON.stringify(attributes2);
|
|
2723
|
+
}
|
|
2721
2724
|
node.data.hProperties = {
|
|
2722
2725
|
...node.data.hProperties || {},
|
|
2723
2726
|
...props
|
|
@@ -10740,11 +10743,12 @@ import fs3, { writeFile } from "fs/promises";
|
|
|
10740
10743
|
import { VFile as VFile2 } from "vfile";
|
|
10741
10744
|
import { compile as mdxCompile } from "@mdx-js/mdx";
|
|
10742
10745
|
var ContentFS = class {
|
|
10743
|
-
constructor(settings, remarkPlugins2, rehypePlugins, recmaPlugins) {
|
|
10746
|
+
constructor(settings, remarkPlugins2, rehypePlugins, recmaPlugins, remarkRehypeHandlers) {
|
|
10744
10747
|
this.settings = settings;
|
|
10745
10748
|
this.remarkPlugins = remarkPlugins2;
|
|
10746
10749
|
this.rehypePlugins = rehypePlugins;
|
|
10747
10750
|
this.recmaPlugins = recmaPlugins;
|
|
10751
|
+
this.remarkRehypeHandlers = remarkRehypeHandlers;
|
|
10748
10752
|
}
|
|
10749
10753
|
async compile(filePath) {
|
|
10750
10754
|
await fs3.access(filePath);
|
|
@@ -10763,7 +10767,12 @@ var ContentFS = class {
|
|
|
10763
10767
|
recmaPlugins: this.recmaPlugins || [],
|
|
10764
10768
|
development: false,
|
|
10765
10769
|
outputFormat: "function-body",
|
|
10766
|
-
jsx: false
|
|
10770
|
+
jsx: false,
|
|
10771
|
+
remarkRehypeOptions: {
|
|
10772
|
+
handlers: {
|
|
10773
|
+
...this.remarkRehypeHandlers || {}
|
|
10774
|
+
}
|
|
10775
|
+
}
|
|
10767
10776
|
// jsx: false,
|
|
10768
10777
|
// outputFormat: "program", // needed for import/export
|
|
10769
10778
|
});
|
|
@@ -10781,8 +10790,13 @@ var ContentFS = class {
|
|
|
10781
10790
|
recmaPlugins: [],
|
|
10782
10791
|
development: false,
|
|
10783
10792
|
jsx: true,
|
|
10784
|
-
outputFormat: "program"
|
|
10793
|
+
outputFormat: "program",
|
|
10785
10794
|
// needed for import/export
|
|
10795
|
+
remarkRehypeOptions: {
|
|
10796
|
+
handlers: {
|
|
10797
|
+
...this.remarkRehypeHandlers || {}
|
|
10798
|
+
}
|
|
10799
|
+
}
|
|
10786
10800
|
});
|
|
10787
10801
|
const tempPath = join3(tmpdir(), `mdx-${Date.now()}.mjs`);
|
|
10788
10802
|
await writeFile(tempPath, String(compiled), "utf8");
|
|
@@ -10815,7 +10829,7 @@ function mdCodeRehype(settings) {
|
|
|
10815
10829
|
console.time("plugin:mdServerHighlight");
|
|
10816
10830
|
const promises = [];
|
|
10817
10831
|
visit11(tree, "element", (node) => {
|
|
10818
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
|
|
10832
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I;
|
|
10819
10833
|
if (node.tagName === "pre") {
|
|
10820
10834
|
const code2 = node.children[0].children[0].value;
|
|
10821
10835
|
const lang = (_e = (_d = (_c = (_b2 = (_a2 = node.children) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.properties) == null ? void 0 : _c.className) == null ? void 0 : _d[0]) == null ? void 0 : _e.replace("language-", "");
|
|
@@ -10825,8 +10839,9 @@ function mdCodeRehype(settings) {
|
|
|
10825
10839
|
const descriptionHead = (_t = (_s = (_r = node.children) == null ? void 0 : _r[0]) == null ? void 0 : _s.properties) == null ? void 0 : _t.descriptionHead;
|
|
10826
10840
|
const descriptionContent = (_w = (_v = (_u = node.children) == null ? void 0 : _u[0]) == null ? void 0 : _v.properties) == null ? void 0 : _w.descriptionContent;
|
|
10827
10841
|
const descriptionIcon = (_z = (_y = (_x = node.children) == null ? void 0 : _x[0]) == null ? void 0 : _y.properties) == null ? void 0 : _z.descriptionIcon;
|
|
10828
|
-
|
|
10829
|
-
const
|
|
10842
|
+
let attributes2 = (_C = (_B = (_A = node.children) == null ? void 0 : _A[0]) == null ? void 0 : _B.properties) == null ? void 0 : _C.attributes;
|
|
10843
|
+
const meta = (_F = (_E = (_D = node.children) == null ? void 0 : _D[0]) == null ? void 0 : _E.properties) == null ? void 0 : _F.meta;
|
|
10844
|
+
const title = (_I = (_H = (_G = node.children) == null ? void 0 : _G[0]) == null ? void 0 : _H.properties) == null ? void 0 : _I.title;
|
|
10830
10845
|
const promise = (async () => {
|
|
10831
10846
|
var _a3, _b3;
|
|
10832
10847
|
let descriptionContentCode = "";
|
|
@@ -10854,7 +10869,8 @@ function mdCodeRehype(settings) {
|
|
|
10854
10869
|
size,
|
|
10855
10870
|
descriptionHead,
|
|
10856
10871
|
descriptionContent: descriptionContentCode,
|
|
10857
|
-
descriptionIcon
|
|
10872
|
+
descriptionIcon,
|
|
10873
|
+
attributes: attributes2
|
|
10858
10874
|
};
|
|
10859
10875
|
})();
|
|
10860
10876
|
promises.push(promise);
|
|
@@ -10886,9 +10902,9 @@ function color(d) {
|
|
|
10886
10902
|
|
|
10887
10903
|
// ../../node_modules/.pnpm/estree-util-visit@2.0.0/node_modules/estree-util-visit/lib/index.js
|
|
10888
10904
|
var own3 = {}.hasOwnProperty;
|
|
10889
|
-
var CONTINUE = Symbol("continue");
|
|
10890
|
-
var EXIT = Symbol("exit");
|
|
10891
|
-
var SKIP = Symbol("skip");
|
|
10905
|
+
var CONTINUE = /* @__PURE__ */ Symbol("continue");
|
|
10906
|
+
var EXIT = /* @__PURE__ */ Symbol("exit");
|
|
10907
|
+
var SKIP = /* @__PURE__ */ Symbol("skip");
|
|
10892
10908
|
function visit12(tree, visitor) {
|
|
10893
10909
|
let enter2;
|
|
10894
10910
|
let leave;
|