@conloca/mdx 0.1.16 → 0.2.1
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/README.md +50 -16
- package/dist/code-block-frame.js +1 -0
- package/dist/code-block-frame.js.map +1 -0
- package/dist/editor-core.d.ts +0 -2
- package/dist/editor-core.d.ts.map +1 -1
- package/dist/editor-core.js +50 -6
- package/dist/editor-core.js.map +1 -0
- package/dist/esm-passthrough.d.ts +36 -0
- package/dist/esm-passthrough.d.ts.map +1 -0
- package/dist/esm-passthrough.js +237 -0
- package/dist/esm-passthrough.js.map +1 -0
- package/dist/fragments.d.ts +37 -0
- package/dist/fragments.d.ts.map +1 -0
- package/dist/fragments.js +53 -0
- package/dist/fragments.js.map +1 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -0
- package/dist/markdown-options.js +1 -0
- package/dist/markdown-options.js.map +1 -0
- package/dist/mdx/compile-request.d.ts +5 -0
- package/dist/mdx/compile-request.d.ts.map +1 -0
- package/dist/mdx/compile-request.js +40 -0
- package/dist/mdx/compile-request.js.map +1 -0
- package/dist/mdx/compile.d.ts.map +1 -1
- package/dist/mdx/compile.js +30 -1
- package/dist/mdx/compile.js.map +1 -0
- package/dist/mdx/evaluate.d.ts +18 -23
- package/dist/mdx/evaluate.d.ts.map +1 -1
- package/dist/mdx/evaluate.js +123 -29
- package/dist/mdx/evaluate.js.map +1 -0
- package/dist/mdx/heading-outline.d.ts +46 -0
- package/dist/mdx/heading-outline.d.ts.map +1 -0
- package/dist/mdx/heading-outline.js +114 -0
- package/dist/mdx/heading-outline.js.map +1 -0
- package/dist/mdx/literal-attributes.d.ts +26 -0
- package/dist/mdx/literal-attributes.d.ts.map +1 -0
- package/dist/mdx/literal-attributes.js +40 -0
- package/dist/mdx/literal-attributes.js.map +1 -0
- package/dist/mdx/restrict-expressions.d.ts +45 -0
- package/dist/mdx/restrict-expressions.d.ts.map +1 -0
- package/dist/mdx/restrict-expressions.js +171 -0
- package/dist/mdx/restrict-expressions.js.map +1 -0
- package/dist/mdx-editor.js +1 -0
- package/dist/mdx-editor.js.map +1 -0
- package/dist/node.d.ts +3 -2
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +3 -1
- package/dist/node.js.map +1 -0
- package/dist/sandbox-frame.d.ts +114 -0
- package/dist/sandbox-frame.d.ts.map +1 -0
- package/dist/sandbox-frame.js +253 -0
- package/dist/sandbox-frame.js.map +1 -0
- package/dist/types.d.ts +7 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/package.json +58 -41
- package/src/code-block-frame.tsx +262 -0
- package/src/editor-core.tsx +403 -0
- package/src/editor-styles.css +282 -0
- package/src/esm-passthrough.ts +269 -0
- package/src/fragments.ts +91 -0
- package/src/index.ts +5 -0
- package/src/markdown-options.ts +21 -0
- package/src/mdx/compile-request.ts +53 -0
- package/src/mdx/compile.ts +60 -0
- package/src/mdx/evaluate.ts +174 -0
- package/src/mdx/heading-outline.ts +153 -0
- package/src/mdx/literal-attributes.ts +50 -0
- package/src/mdx/restrict-expressions.ts +184 -0
- package/src/mdx-editor.tsx +15 -0
- package/src/node.ts +25 -0
- package/src/sandbox-frame.ts +294 -0
- package/src/types.ts +23 -0
- package/dist/blocks.d.ts +0 -37
- package/dist/blocks.d.ts.map +0 -1
- package/dist/blocks.js +0 -51
- package/dist/hooks/useMDXEvaluation.d.ts +0 -28
- package/dist/hooks/useMDXEvaluation.d.ts.map +0 -1
- package/dist/hooks/useMDXEvaluation.js +0 -117
- package/dist/index.d.mts +0 -127
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -516
- package/dist/index.mjs.map +0 -1
- package/dist/node.d.mts +0 -102
- package/dist/node.d.mts.map +0 -1
- package/dist/node.mjs +0 -140
- package/dist/node.mjs.map +0 -1
- package/dist/style.css +0 -88
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The value a JSON-literal attribute expression (`{3}`, `{true}`, `{"x"}`) has
|
|
3
|
+
* on a published fragment, or undefined when the attribute renders as nothing
|
|
4
|
+
* there: an object (`style={{…}}`), a list, `null`, or anything not JSON.
|
|
5
|
+
*/
|
|
6
|
+
export function literalAttributeValue(expression) {
|
|
7
|
+
let parsed;
|
|
8
|
+
try {
|
|
9
|
+
parsed = JSON.parse(expression.trim());
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
return typeof parsed === 'string' || typeof parsed === 'number' || typeof parsed === 'boolean' ? parsed : undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Remark transform that drops every JSX attribute whose `{…}` value renders as
|
|
18
|
+
* nothing on a published fragment, so a compiled preview shows what will be
|
|
19
|
+
* published. It runs on the markdown tree, before the compiler writes the
|
|
20
|
+
* style objects that align table columns, so those are kept.
|
|
21
|
+
*/
|
|
22
|
+
export function remarkDropUnrenderedAttributes() {
|
|
23
|
+
return (tree) => {
|
|
24
|
+
const walk = (node) => {
|
|
25
|
+
if (Array.isArray(node.attributes)) {
|
|
26
|
+
node.attributes = node.attributes.filter((attr) => {
|
|
27
|
+
const value = attr?.value;
|
|
28
|
+
if (!value || typeof value !== 'object')
|
|
29
|
+
return true;
|
|
30
|
+
const expression = value.value;
|
|
31
|
+
return typeof expression === 'string' && literalAttributeValue(expression) !== undefined;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (Array.isArray(node.children))
|
|
35
|
+
node.children.forEach(walk);
|
|
36
|
+
};
|
|
37
|
+
walk(tree);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=literal-attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal-attributes.js","sourceRoot":"","sources":["../../src/mdx/literal-attributes.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AAC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interface MdastNode {
|
|
2
|
+
type?: string;
|
|
3
|
+
children?: MdastNode[];
|
|
4
|
+
attributes?: MdastAttribute[];
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
interface MdastAttribute {
|
|
8
|
+
type?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
value?: unknown;
|
|
11
|
+
}
|
|
12
|
+
/** Remark transform that neutralizes the author-code AND HTML-injection vectors
|
|
13
|
+
* in authored MDX at every compile/eval entry point.
|
|
14
|
+
*
|
|
15
|
+
* Two layers, because expression-restriction is NOT HTML sanitization:
|
|
16
|
+
* 1. Author code — standalone `{…}` flow/text expressions (`mdxFlowExpression`/
|
|
17
|
+
* `mdxTextExpression`) and top-level ESM `import`/`export` (`mdxjsEsm`) reach
|
|
18
|
+
* `new AsyncFunction`/`evaluate()` as live code, so they fail the compile
|
|
19
|
+
* with a clear error; content fragments never legitimately need either.
|
|
20
|
+
* A comment, `{/* … *\/}`, holds no code and is removed instead, so it
|
|
21
|
+
* renders as nothing, as it does in MDX.
|
|
22
|
+
* 2. HTML injection — `dangerouslySetInnerHTML` (React's raw-HTML escape hatch,
|
|
23
|
+
* which a JSON-literal object slips past the expression exemption), inline
|
|
24
|
+
* `on*` handlers, dangerous URL schemes (`javascript:`/`vbscript:`/
|
|
25
|
+
* `data:text/html`) on URL-bearing attributes and markdown link/image URLs,
|
|
26
|
+
* and script/navigate/embed intrinsic elements (`<script>`, `<iframe>`, …)
|
|
27
|
+
* are dropped or emptied. This layers atop React's own SSR neutralization
|
|
28
|
+
* (it blocks `javascript:` URLs, strips string `on*` handlers, and escapes
|
|
29
|
+
* all text/attribute values). The set above is a renderer-agnostic superset:
|
|
30
|
+
* some of it (`javascript:`, string `on*`) React also covers, but it is
|
|
31
|
+
* re-applied here for the compile and mdast-serializer paths where React is
|
|
32
|
+
* not in the loop, and it adds what React does NOT handle (`data:text/html`,
|
|
33
|
+
* `dangerouslySetInnerHTML`, raw `<script>`/embed elements) — which the
|
|
34
|
+
* published `evaluateMDXToComponent` path would otherwise emit verbatim to
|
|
35
|
+
* every visitor.
|
|
36
|
+
*
|
|
37
|
+
* Non-literal JSX attribute and spread expressions are dropped so a component
|
|
38
|
+
* still renders with its safe props. Shared by `compileMDX` (editor preview) and
|
|
39
|
+
* `evaluateMDXToComponent` (published-site render), so the control is identical
|
|
40
|
+
* on both. In the editor the sandbox is the sufficient boundary; on the published
|
|
41
|
+
* path this transform is the boundary, so it must close the class, not just the
|
|
42
|
+
* eval vector. */
|
|
43
|
+
export declare function remarkRestrictExpressions(): (tree: MdastNode) => void;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=restrict-expressions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restrict-expressions.d.ts","sourceRoot":"","sources":["../../src/mdx/restrict-expressions.ts"],"names":[],"mappings":"AAAA,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAmHD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA8BkB;AAClB,wBAAgB,yBAAyB,WACzB,SAAS,KAAG,IAAI,CAyB/B"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/** A JSON-literal attribute expression (`{3}`, `{true}`, `{"x"}`) is a static
|
|
2
|
+
* value with no executable content — the editor's prop serializers already
|
|
3
|
+
* treat these as data. Anything that doesn't `JSON.parse` is author-controlled
|
|
4
|
+
* code and is dropped. */
|
|
5
|
+
function isLiteralExpression(value) {
|
|
6
|
+
if (!value || typeof value !== 'object')
|
|
7
|
+
return true;
|
|
8
|
+
const raw = value.value;
|
|
9
|
+
if (typeof raw !== 'string')
|
|
10
|
+
return true;
|
|
11
|
+
try {
|
|
12
|
+
JSON.parse(raw.trim());
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** URL-bearing attributes the browser fetches or navigates to. React neutralizes
|
|
20
|
+
* `javascript:` itself but NOT `data:text/html`, so these are scheme-filtered
|
|
21
|
+
* here regardless of who renders the tree. */
|
|
22
|
+
const URL_ATTR = /^(?:href|src|xlink:href|formaction|action|poster|background|cite)$/i;
|
|
23
|
+
/** Script-bearing URL schemes. Mirrors the mdast serializer's list so the
|
|
24
|
+
* compile gate and the raw-HTML serializer neutralize the same schemes. */
|
|
25
|
+
const DANGEROUS_URL_SCHEME = /^(?:javascript|vbscript):|^data:text\/html/i;
|
|
26
|
+
/** Intrinsic HTML elements that execute script, navigate, or embed regardless of
|
|
27
|
+
* their attributes. React renders author-written `<script>` verbatim, so these
|
|
28
|
+
* are never neutralized downstream and must be dropped here. Capitalized JSX
|
|
29
|
+
* (registered components) is never matched — only lowercase raw-HTML tags. */
|
|
30
|
+
const DANGEROUS_ELEMENTS = new Set([
|
|
31
|
+
'script',
|
|
32
|
+
'style',
|
|
33
|
+
'iframe',
|
|
34
|
+
'object',
|
|
35
|
+
'embed',
|
|
36
|
+
'link',
|
|
37
|
+
'meta',
|
|
38
|
+
'base',
|
|
39
|
+
'frame',
|
|
40
|
+
'frameset',
|
|
41
|
+
'applet',
|
|
42
|
+
]);
|
|
43
|
+
function hasDangerousScheme(value) {
|
|
44
|
+
return DANGEROUS_URL_SCHEME.test(value.replace(/[\p{Cc} ]+/gu, ''));
|
|
45
|
+
}
|
|
46
|
+
function isDangerousElement(node) {
|
|
47
|
+
if (node?.type !== 'mdxJsxFlowElement' && node?.type !== 'mdxJsxTextElement')
|
|
48
|
+
return false;
|
|
49
|
+
const name = typeof node.name === 'string' ? node.name : '';
|
|
50
|
+
return /^[a-z]/.test(name) && DANGEROUS_ELEMENTS.has(name.toLowerCase());
|
|
51
|
+
}
|
|
52
|
+
/** `{/* … *\/}`, the way MDX writes a comment: the parsed program has no
|
|
53
|
+
* statements, so nothing in it can run. Without the parsed program it is
|
|
54
|
+
* not trusted to be one. */
|
|
55
|
+
function isComment(node) {
|
|
56
|
+
if (node?.type !== 'mdxFlowExpression' && node?.type !== 'mdxTextExpression')
|
|
57
|
+
return false;
|
|
58
|
+
const program = node.data?.estree;
|
|
59
|
+
return Array.isArray(program?.body) && program.body.length === 0;
|
|
60
|
+
}
|
|
61
|
+
/** A JSON-literal expression whose parsed value is a dangerous-scheme URL string
|
|
62
|
+
* (`href={"data:text/html,…"}` round-trips through `JSON.parse` yet navigates). */
|
|
63
|
+
function isDangerousLiteralUrl(value) {
|
|
64
|
+
const raw = value?.value;
|
|
65
|
+
if (typeof raw !== 'string')
|
|
66
|
+
return false;
|
|
67
|
+
try {
|
|
68
|
+
const parsed = JSON.parse(raw.trim());
|
|
69
|
+
return typeof parsed === 'string' && hasDangerousScheme(parsed);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** Filter/neutralize a JSX element's attributes: drop the `dangerouslySetInnerHTML`
|
|
76
|
+
* raw-HTML sink and inline `on*` handlers, drop non-literal expression props, and
|
|
77
|
+
* empty a URL-bearing attribute carrying a dangerous scheme. */
|
|
78
|
+
function sanitizeAttributes(attributes) {
|
|
79
|
+
const out = [];
|
|
80
|
+
for (const attr of attributes) {
|
|
81
|
+
if (attr?.type === 'mdxJsxExpressionAttribute')
|
|
82
|
+
continue; // `{...spread}` — arbitrary props
|
|
83
|
+
if (attr?.type !== 'mdxJsxAttribute' || typeof attr.name !== 'string') {
|
|
84
|
+
out.push(attr);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const name = attr.name;
|
|
88
|
+
// React's only raw-HTML escape hatch. A JSON-literal object
|
|
89
|
+
// (`{"__html": "<script>…"}`) passes the literal exemption yet injects live
|
|
90
|
+
// HTML on the published path, so drop it regardless of value shape.
|
|
91
|
+
if (name.toLowerCase() === 'dangerouslysetinnerhtml')
|
|
92
|
+
continue;
|
|
93
|
+
// Inline event handlers are never content. React strips string handlers, but
|
|
94
|
+
// dropping them here keeps the gate renderer-agnostic.
|
|
95
|
+
if (/^on/i.test(name))
|
|
96
|
+
continue;
|
|
97
|
+
const value = attr.value;
|
|
98
|
+
if (value && typeof value === 'object') {
|
|
99
|
+
if (!isLiteralExpression(value))
|
|
100
|
+
continue; // non-literal expression prop
|
|
101
|
+
if (URL_ATTR.test(name) && isDangerousLiteralUrl(value)) {
|
|
102
|
+
out.push({ ...attr, value: '' });
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
out.push(attr);
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (typeof value === 'string' && URL_ATTR.test(name) && hasDangerousScheme(value)) {
|
|
109
|
+
out.push({ ...attr, value: '' });
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
out.push(attr);
|
|
113
|
+
}
|
|
114
|
+
return out;
|
|
115
|
+
}
|
|
116
|
+
/** Remark transform that neutralizes the author-code AND HTML-injection vectors
|
|
117
|
+
* in authored MDX at every compile/eval entry point.
|
|
118
|
+
*
|
|
119
|
+
* Two layers, because expression-restriction is NOT HTML sanitization:
|
|
120
|
+
* 1. Author code — standalone `{…}` flow/text expressions (`mdxFlowExpression`/
|
|
121
|
+
* `mdxTextExpression`) and top-level ESM `import`/`export` (`mdxjsEsm`) reach
|
|
122
|
+
* `new AsyncFunction`/`evaluate()` as live code, so they fail the compile
|
|
123
|
+
* with a clear error; content fragments never legitimately need either.
|
|
124
|
+
* A comment, `{/* … *\/}`, holds no code and is removed instead, so it
|
|
125
|
+
* renders as nothing, as it does in MDX.
|
|
126
|
+
* 2. HTML injection — `dangerouslySetInnerHTML` (React's raw-HTML escape hatch,
|
|
127
|
+
* which a JSON-literal object slips past the expression exemption), inline
|
|
128
|
+
* `on*` handlers, dangerous URL schemes (`javascript:`/`vbscript:`/
|
|
129
|
+
* `data:text/html`) on URL-bearing attributes and markdown link/image URLs,
|
|
130
|
+
* and script/navigate/embed intrinsic elements (`<script>`, `<iframe>`, …)
|
|
131
|
+
* are dropped or emptied. This layers atop React's own SSR neutralization
|
|
132
|
+
* (it blocks `javascript:` URLs, strips string `on*` handlers, and escapes
|
|
133
|
+
* all text/attribute values). The set above is a renderer-agnostic superset:
|
|
134
|
+
* some of it (`javascript:`, string `on*`) React also covers, but it is
|
|
135
|
+
* re-applied here for the compile and mdast-serializer paths where React is
|
|
136
|
+
* not in the loop, and it adds what React does NOT handle (`data:text/html`,
|
|
137
|
+
* `dangerouslySetInnerHTML`, raw `<script>`/embed elements) — which the
|
|
138
|
+
* published `evaluateMDXToComponent` path would otherwise emit verbatim to
|
|
139
|
+
* every visitor.
|
|
140
|
+
*
|
|
141
|
+
* Non-literal JSX attribute and spread expressions are dropped so a component
|
|
142
|
+
* still renders with its safe props. Shared by `compileMDX` (editor preview) and
|
|
143
|
+
* `evaluateMDXToComponent` (published-site render), so the control is identical
|
|
144
|
+
* on both. In the editor the sandbox is the sufficient boundary; on the published
|
|
145
|
+
* path this transform is the boundary, so it must close the class, not just the
|
|
146
|
+
* eval vector. */
|
|
147
|
+
export function remarkRestrictExpressions() {
|
|
148
|
+
return (tree) => {
|
|
149
|
+
const walk = (node) => {
|
|
150
|
+
if (node.type === 'mdxFlowExpression' || node.type === 'mdxTextExpression') {
|
|
151
|
+
throw new Error('MDX expressions are not allowed: remove the `{…}` expression from the content.');
|
|
152
|
+
}
|
|
153
|
+
if (node.type === 'mdxjsEsm') {
|
|
154
|
+
throw new Error('MDX import/export statements are not allowed: remove the top-level `import`/`export` from the content.');
|
|
155
|
+
}
|
|
156
|
+
if ((node.type === 'link' || node.type === 'image') &&
|
|
157
|
+
typeof node.url === 'string' &&
|
|
158
|
+
hasDangerousScheme(node.url)) {
|
|
159
|
+
node.url = '';
|
|
160
|
+
}
|
|
161
|
+
if (Array.isArray(node.attributes))
|
|
162
|
+
node.attributes = sanitizeAttributes(node.attributes);
|
|
163
|
+
if (Array.isArray(node.children)) {
|
|
164
|
+
node.children = node.children.filter((child) => !isDangerousElement(child) && !isComment(child));
|
|
165
|
+
node.children.forEach(walk);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
walk(tree);
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=restrict-expressions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restrict-expressions.js","sourceRoot":"","sources":["../../src/mdx/restrict-expressions.ts"],"names":[],"mappings":"AAaA;;;0BAG0B;AAC1B,SAAS,mBAAmB,CAAC,KAAc;IACzC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACrD,MAAM,GAAG,GAAI,KAA6B,CAAC,KAAK,CAAC;IACjD,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACzC,IAAI,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;8CAE8C;AAC9C,MAAM,QAAQ,GAAG,qEAAqE,CAAC;AAEvF;2EAC2E;AAC3E,MAAM,oBAAoB,GAAG,6CAA6C,CAAC;AAE3E;;;8EAG8E;AAC9E,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,UAAU;IACV,QAAQ;CACT,CAAC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E,EAAE,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;gBACjG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/mdx-editor.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx-editor.js","sourceRoot":"","sources":["../src/mdx-editor.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAA2B,MAAM,kBAAkB,CAAC;AAQ1E,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAmC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACzF,OAAO,KAAC,aAAa,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CAAC;AAChD,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
package/dist/node.d.ts
CHANGED
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
* import { evaluateMDXToComponent } from '@conloca/mdx/node';
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
export {
|
|
13
|
+
export { evaluateMDXFragments } from './fragments.js';
|
|
14
14
|
export { compileMDX } from './mdx/compile.js';
|
|
15
|
+
export { handleMDXCompileRequest } from './mdx/compile-request.js';
|
|
15
16
|
export { evaluateMDXToComponent } from './mdx/evaluate.js';
|
|
16
|
-
export type {
|
|
17
|
+
export type { EvaluatedMDXFragment, FailedMDXFragmentEvaluation, MDXCompileResult, MDXFragmentEvaluationResult, } from './types.js';
|
|
17
18
|
//# sourceMappingURL=node.d.ts.map
|
package/dist/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,YAAY,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,YAAY,CAAC"}
|
package/dist/node.js
CHANGED
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* import { evaluateMDXToComponent } from '@conloca/mdx/node';
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
export {
|
|
13
|
+
export { evaluateMDXFragments } from './fragments.js';
|
|
14
14
|
// MDX compilation and evaluation (Node.js only)
|
|
15
15
|
export { compileMDX } from './mdx/compile.js';
|
|
16
|
+
export { handleMDXCompileRequest } from './mdx/compile-request.js';
|
|
16
17
|
export { evaluateMDXToComponent } from './mdx/evaluate.js';
|
|
18
|
+
//# sourceMappingURL=node.js.map
|
package/dist/node.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,gDAAgD;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opaque-origin MDX preview frame document + runtime. Confines the MDX
|
|
3
|
+
* `'unsafe-eval'` to this frame — see `SANDBOX_FRAME_CSP` below.
|
|
4
|
+
* Shared by the cms-spa ContentSandbox and the server route that serves this
|
|
5
|
+
* frame's HTML at `SANDBOX_FRAME_PATH`.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Build a jsx runtime that constructs real DOM nodes instead of React
|
|
9
|
+
* elements. The two isolated MDX preview surfaces render markdown-subset MDX
|
|
10
|
+
* with no component map supplied, so intrinsic elements plus `Fragment` cover
|
|
11
|
+
* everything they emit; this keeps the frame dependency-free (no React bundle
|
|
12
|
+
* to inline). Inline event-handler props are dropped defensively.
|
|
13
|
+
*/
|
|
14
|
+
/** Discriminated messages the frame and its host exchange. */
|
|
15
|
+
export interface SandboxRenderMessage {
|
|
16
|
+
__conlocaSandbox: true;
|
|
17
|
+
kind: 'render';
|
|
18
|
+
mode: 'mdx' | 'html';
|
|
19
|
+
/** Compiled MDX function body (mode `mdx`) or sanitized HTML (mode `html`). */
|
|
20
|
+
payload: string;
|
|
21
|
+
/** Optional stylesheet text injected into the frame for preview fidelity. */
|
|
22
|
+
styles?: string;
|
|
23
|
+
}
|
|
24
|
+
export type SandboxOutboundMessage = {
|
|
25
|
+
__conlocaSandbox: true;
|
|
26
|
+
k: string;
|
|
27
|
+
kind: 'ready';
|
|
28
|
+
} | {
|
|
29
|
+
__conlocaSandbox: true;
|
|
30
|
+
k: string;
|
|
31
|
+
kind: 'height';
|
|
32
|
+
px: number;
|
|
33
|
+
} | {
|
|
34
|
+
__conlocaSandbox: true;
|
|
35
|
+
k: string;
|
|
36
|
+
kind: 'link';
|
|
37
|
+
href: string;
|
|
38
|
+
} | {
|
|
39
|
+
__conlocaSandbox: true;
|
|
40
|
+
k: string;
|
|
41
|
+
kind: 'interact';
|
|
42
|
+
} | {
|
|
43
|
+
__conlocaSandbox: true;
|
|
44
|
+
k: string;
|
|
45
|
+
kind: 'rendered';
|
|
46
|
+
} | {
|
|
47
|
+
__conlocaSandbox: true;
|
|
48
|
+
k: string;
|
|
49
|
+
kind: 'error';
|
|
50
|
+
message: string;
|
|
51
|
+
};
|
|
52
|
+
export declare function createSandboxRuntime(): {
|
|
53
|
+
Fragment: symbol;
|
|
54
|
+
jsx: (type: unknown, props: Record<string, unknown>) => Node;
|
|
55
|
+
jsxs: (type: unknown, props: Record<string, unknown>) => Node;
|
|
56
|
+
jsxDEV: (type: unknown, props: Record<string, unknown>) => Node;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Evaluate a pre-compiled MDX function body. This is the `new AsyncFunction`
|
|
60
|
+
* eval that used to run in the privileged parent (`useMDXEvaluation`) — it now
|
|
61
|
+
* runs only here, inside the sandbox, which is why `'unsafe-eval'` is confined
|
|
62
|
+
* to the frame CSP. Returns the module's default export (the MDX component).
|
|
63
|
+
*/
|
|
64
|
+
export declare function runCompiledMdx(code: string, runtime: Record<string, unknown>): Promise<{
|
|
65
|
+
default?: (props: Record<string, unknown>) => Node;
|
|
66
|
+
}>;
|
|
67
|
+
/**
|
|
68
|
+
* The frame entry point. Wires the message listener, height reporting, and
|
|
69
|
+
* link/interaction interception, then announces readiness. Every dependency
|
|
70
|
+
* arrives as `deps` so the serialized source carries no free identifiers a
|
|
71
|
+
* minifier could rename.
|
|
72
|
+
*/
|
|
73
|
+
export declare function sandboxFrameMain(deps: {
|
|
74
|
+
createSandboxRuntime: typeof createSandboxRuntime;
|
|
75
|
+
runCompiledMdx: typeof runCompiledMdx;
|
|
76
|
+
}): void;
|
|
77
|
+
/**
|
|
78
|
+
* The frame's own Content-Security-Policy. `'unsafe-eval'` is intentional and
|
|
79
|
+
* confined here (the MDX eval lives in the frame). What it does and does NOT
|
|
80
|
+
* close, stated precisely:
|
|
81
|
+
* - The isolation that HOLDS: no `allow-same-origin` gives the frame an opaque
|
|
82
|
+
* origin, so it exposes no cookies, no privileged globals, and no
|
|
83
|
+
* `window.parent` — nothing privileged is reachable to exfiltrate.
|
|
84
|
+
* - Structured-data egress is closed: with no `connect-src`, `fetch`/XHR/
|
|
85
|
+
* WebSocket/`sendBeacon` cannot post data out.
|
|
86
|
+
* - Metadata-only leak channels REMAIN OPEN and are an accepted residual risk.
|
|
87
|
+
* A hostile preview script can still leak the previewing admin's IP/UA/timing
|
|
88
|
+
* (plus author-encoded data) to an external host two ways: (a) passive
|
|
89
|
+
* img/font GETs to `https:` (`img-src`/`font-src`, which `connect-src` does
|
|
90
|
+
* not govern — kept for remote-image/`@font-face` fidelity, CSP-toggleable
|
|
91
|
+
* below); and (b) self-navigation — `location.href`/`location.replace` or a
|
|
92
|
+
* `<meta http-equiv=refresh>` — which is inherent to `allow-scripts` and NOT
|
|
93
|
+
* closeable by CSP (`navigate-to` is unsupported in browsers) or the sandbox
|
|
94
|
+
* flags (same-frame navigation is always allowed), short of dropping
|
|
95
|
+
* `allow-scripts` and the interactive preview with it.
|
|
96
|
+
* Owner toggle: replacing `https:` with just `data: blob:` in `img-src`/`font-src`
|
|
97
|
+
* below closes (a) at a remote-image/-font fidelity cost — but not (b), which has
|
|
98
|
+
* no CSP mitigation. Both leak only request metadata, never privileged content.
|
|
99
|
+
*/
|
|
100
|
+
export declare const SANDBOX_FRAME_CSP = "default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval'; style-src 'unsafe-inline'; img-src data: https: blob:; font-src data: https:";
|
|
101
|
+
/**
|
|
102
|
+
* Assemble the sandbox frame document. The runtime functions are injected as
|
|
103
|
+
* argument expressions to `sandboxFrameMain` so no cross-function identifier
|
|
104
|
+
* has to survive minification by name.
|
|
105
|
+
*
|
|
106
|
+
* The editor loads this from `GET /api/v1/mdx/sandbox-frame` (own response CSP
|
|
107
|
+
* with unsafe-eval). Do NOT use srcdoc/blob from the parent document: those
|
|
108
|
+
* inherit the parent CSP, which forbids unsafe-inline/unsafe-eval and leaves
|
|
109
|
+
* MDX fragment previews as empty white boxes.
|
|
110
|
+
*/
|
|
111
|
+
export declare function buildSandboxSrcdoc(): string;
|
|
112
|
+
/** Well-known path where a host serves {@link buildSandboxSrcdoc}. */
|
|
113
|
+
export declare const SANDBOX_FRAME_PATH = "/api/v1/mdx/sandbox-frame";
|
|
114
|
+
//# sourceMappingURL=sandbox-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-frame.d.ts","sourceRoot":"","sources":["../src/sandbox-frame.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AAEH,8DAA8D;AAC9D,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,IAAI,CAAC;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IACrB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,sBAAsB,GAC9B;IAAE,gBAAgB,EAAE,IAAI,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GACpD;IAAE,gBAAgB,EAAE,IAAI,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACjE;IAAE,gBAAgB,EAAE,IAAI,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjE;IAAE,gBAAgB,EAAE,IAAI,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GACvD;IAAE,gBAAgB,EAAE,IAAI,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAC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