@stream-mdx/react 0.4.0 → 1.0.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.
- package/CHANGELOG.md +385 -4
- package/README.md +141 -16
- package/dist/blocks-renderer-DAOBFBfi.d.ts +29 -0
- package/dist/blocks-renderer-DQEL1kJW.d.cts +29 -0
- package/dist/components/bottom-stick-scroll-area.cjs +268 -0
- package/dist/components/bottom-stick-scroll-area.d.cts +36 -0
- package/dist/components/bottom-stick-scroll-area.d.ts +36 -0
- package/dist/components/bottom-stick-scroll-area.mjs +249 -0
- package/dist/components/diff-renderer.cjs +86 -0
- package/dist/components/diff-renderer.d.cts +11 -0
- package/dist/components/diff-renderer.d.ts +11 -0
- package/dist/components/diff-renderer.mjs +66 -0
- package/dist/components/index.cjs +2879 -1295
- package/dist/components/index.d.cts +9 -2
- package/dist/components/index.d.ts +9 -2
- package/dist/components/index.mjs +2842 -1277
- package/dist/components/katex-math.cjs +220 -0
- package/dist/components/katex-math.d.cts +10 -0
- package/dist/components/katex-math.d.ts +10 -0
- package/dist/components/katex-math.mjs +188 -0
- package/dist/contexts/math-tracker.cjs +240 -521
- package/dist/contexts/math-tracker.mjs +235 -513
- package/dist/index-Cmne1yUK.d.cts +723 -0
- package/dist/index-D7dyyu3q.d.ts +723 -0
- package/dist/index.cjs +13180 -5640
- package/dist/index.d.cts +72 -40
- package/dist/index.d.ts +72 -40
- package/dist/index.mjs +12587 -5038
- package/dist/math/display-wrapper.cjs +7 -15
- package/dist/math/display-wrapper.d.cts +2 -2
- package/dist/math/display-wrapper.d.ts +2 -2
- package/dist/math/display-wrapper.mjs +2 -6
- package/dist/node-views-Bpc6Gkgl.d.cts +13 -0
- package/dist/node-views-DpnYdaAS.d.ts +13 -0
- package/dist/renderer/hooks.cjs +35 -20
- package/dist/renderer/hooks.d.cts +22 -1
- package/dist/renderer/hooks.d.ts +22 -1
- package/dist/renderer/hooks.mjs +27 -12
- package/dist/renderer/patch-batching.cjs +7 -8
- package/dist/renderer/patch-batching.d.cts +1 -1
- package/dist/renderer/patch-batching.d.ts +1 -1
- package/dist/renderer/patch-batching.mjs +2 -1
- package/dist/renderer/patch-coalescing.cjs +5 -8
- package/dist/renderer/patch-commit-scheduler.cjs +160 -326
- package/dist/renderer/patch-commit-scheduler.d.cts +28 -4
- package/dist/renderer/patch-commit-scheduler.d.ts +28 -4
- package/dist/renderer/patch-commit-scheduler.mjs +157 -318
- package/dist/renderer/store.cjs +3847 -1099
- package/dist/renderer/store.d.cts +111 -3
- package/dist/renderer/store.d.ts +111 -3
- package/dist/renderer/store.mjs +3847 -1085
- package/dist/renderer/virtualized-code.cjs +415 -71
- package/dist/renderer/virtualized-code.d.cts +24 -23
- package/dist/renderer/virtualized-code.d.ts +24 -23
- package/dist/renderer/virtualized-code.mjs +409 -62
- package/dist/renderer.cjs +10939 -3974
- package/dist/renderer.d.cts +100 -29
- package/dist/renderer.d.ts +100 -29
- package/dist/renderer.mjs +10711 -3697
- package/dist/server-regions-CPLHGli0.d.cts +32 -0
- package/dist/server-regions-mUhyoKi7.d.ts +32 -0
- package/dist/server.cjs +10286 -3365
- package/dist/server.d.cts +17 -247
- package/dist/server.d.ts +17 -247
- package/dist/server.mjs +10565 -3619
- package/dist/{streaming-markdown-DOc2uLiP.d.ts → streaming-markdown-yELbJxyH.d.ts} +51 -55
- package/dist/{streaming-markdown-D-JcByd9.d.cts → streaming-markdown-zVwFuaJG.d.cts} +51 -55
- package/dist/streaming-markdown.cjs +11828 -4879
- package/dist/streaming-markdown.d.cts +9 -2
- package/dist/streaming-markdown.d.ts +9 -2
- package/dist/streaming-markdown.mjs +11820 -4821
- package/dist/trusted-mdx/index.cjs +833 -0
- package/dist/trusted-mdx/index.d.cts +11 -0
- package/dist/trusted-mdx/index.d.ts +11 -0
- package/dist/trusted-mdx/index.mjs +807 -0
- package/dist/trusted-mdx/native-children-slot.cjs +45 -0
- package/dist/trusted-mdx/native-children-slot.d.cts +11 -0
- package/dist/trusted-mdx/native-children-slot.d.ts +11 -0
- package/dist/trusted-mdx/native-children-slot.mjs +24 -0
- package/dist/trusted-mdx/server.cjs +752 -0
- package/dist/trusted-mdx/server.d.cts +24 -0
- package/dist/trusted-mdx/server.d.ts +24 -0
- package/dist/trusted-mdx/server.mjs +724 -0
- package/dist/trusted-mdx-contract-ElKpkDI5.d.cts +113 -0
- package/dist/trusted-mdx-contract-ElKpkDI5.d.ts +113 -0
- package/dist/utils/inline-html.cjs +246 -147
- package/dist/utils/inline-html.d.cts +39 -6
- package/dist/utils/inline-html.d.ts +39 -6
- package/dist/utils/inline-html.mjs +237 -134
- package/package.json +52 -18
- package/shadcn/README.md +28 -0
- package/shadcn/bottom-stick-scroll-area.tsx +358 -0
- package/dist/index-D2MYusAM.d.cts +0 -248
- package/dist/index-D2MYusAM.d.ts +0 -248
- package/dist/mdx-client.cjs +0 -408
- package/dist/mdx-client.d.cts +0 -113
- package/dist/mdx-client.d.ts +0 -113
- package/dist/mdx-client.mjs +0 -369
- package/dist/mdx-coordinator.cjs +0 -563
- package/dist/mdx-coordinator.d.cts +0 -21
- package/dist/mdx-coordinator.d.ts +0 -21
- package/dist/mdx-coordinator.mjs +0 -529
- package/dist/renderer/node-views.cjs +0 -1642
- package/dist/renderer/node-views.d.cts +0 -12
- package/dist/renderer/node-views.d.ts +0 -12
- package/dist/renderer/node-views.mjs +0 -1616
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
11
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
18
|
+
|
|
19
|
+
// src/trusted-mdx/native-children-slot.tsx
|
|
20
|
+
var native_children_slot_exports = {};
|
|
21
|
+
__export(native_children_slot_exports, {
|
|
22
|
+
TrustedMdxNativeChildrenContext: () => TrustedMdxNativeChildrenContext,
|
|
23
|
+
TrustedMdxNativeChildrenSlot: () => TrustedMdxNativeChildrenSlot
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(native_children_slot_exports);
|
|
26
|
+
var import_react = require("react"), TrustedMdxNativeChildrenContext = (0, import_react.createContext)(void 0);
|
|
27
|
+
function TrustedMdxNativeChildrenSlot({
|
|
28
|
+
index,
|
|
29
|
+
children
|
|
30
|
+
}) {
|
|
31
|
+
let prepared = (0, import_react.useContext)(TrustedMdxNativeChildrenContext);
|
|
32
|
+
if (prepared === void 0)
|
|
33
|
+
throw new Error("A trusted MDX native-children slot has no prepared native owner.");
|
|
34
|
+
if (index !== void 0) {
|
|
35
|
+
if (!Array.isArray(prepared) || prepared[index] === void 0)
|
|
36
|
+
throw new Error(`A trusted MDX native-child slot has no prepared owner at index ${index}.`);
|
|
37
|
+
return (0, import_react.createElement)(import_react.Fragment, null, prepared[index]);
|
|
38
|
+
}
|
|
39
|
+
return (0, import_react.createElement)(import_react.Fragment, null, children === void 0 ? prepared : children);
|
|
40
|
+
}
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
TrustedMdxNativeChildrenContext,
|
|
44
|
+
TrustedMdxNativeChildrenSlot
|
|
45
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode, ReactElement } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const TrustedMdxNativeChildrenContext: React.Context<ReactNode>;
|
|
5
|
+
/** A compiler-injected flow-root child slot filled by the worker-owned native renderer. */
|
|
6
|
+
declare function TrustedMdxNativeChildrenSlot({ index, children, }: {
|
|
7
|
+
readonly index?: number;
|
|
8
|
+
readonly children?: ReactNode;
|
|
9
|
+
}): ReactElement;
|
|
10
|
+
|
|
11
|
+
export { TrustedMdxNativeChildrenContext, TrustedMdxNativeChildrenSlot };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode, ReactElement } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const TrustedMdxNativeChildrenContext: React.Context<ReactNode>;
|
|
5
|
+
/** A compiler-injected flow-root child slot filled by the worker-owned native renderer. */
|
|
6
|
+
declare function TrustedMdxNativeChildrenSlot({ index, children, }: {
|
|
7
|
+
readonly index?: number;
|
|
8
|
+
readonly children?: ReactNode;
|
|
9
|
+
}): ReactElement;
|
|
10
|
+
|
|
11
|
+
export { TrustedMdxNativeChildrenContext, TrustedMdxNativeChildrenSlot };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
// src/trusted-mdx/native-children-slot.tsx
|
|
5
|
+
import { Fragment, createContext, createElement, useContext } from "react";
|
|
6
|
+
var TrustedMdxNativeChildrenContext = createContext(void 0);
|
|
7
|
+
function TrustedMdxNativeChildrenSlot({
|
|
8
|
+
index,
|
|
9
|
+
children
|
|
10
|
+
}) {
|
|
11
|
+
let prepared = useContext(TrustedMdxNativeChildrenContext);
|
|
12
|
+
if (prepared === void 0)
|
|
13
|
+
throw new Error("A trusted MDX native-children slot has no prepared native owner.");
|
|
14
|
+
if (index !== void 0) {
|
|
15
|
+
if (!Array.isArray(prepared) || prepared[index] === void 0)
|
|
16
|
+
throw new Error(`A trusted MDX native-child slot has no prepared owner at index ${index}.`);
|
|
17
|
+
return createElement(Fragment, null, prepared[index]);
|
|
18
|
+
}
|
|
19
|
+
return createElement(Fragment, null, children === void 0 ? prepared : children);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
TrustedMdxNativeChildrenContext,
|
|
23
|
+
TrustedMdxNativeChildrenSlot
|
|
24
|
+
};
|