@richmd/react 1.1.2 → 2.0.0-rc.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/README.md CHANGED
@@ -112,8 +112,40 @@ export default function MarkdownEditor() {
112
112
  }
113
113
  ```
114
114
 
115
+ ### 4. Use the RichmdSlide component (optional)
116
+
117
+ You can use the `RichmdSlide` component to create slide-style Markdown presentations. Here's an example:
118
+
119
+ ```tsx
120
+ "use client";
121
+
122
+ import { RichmdSlide } from "@richmd/react";
123
+
124
+ export default function SlideShow() {
125
+ const markdownSlides = [
126
+ `# Slide 1
127
+ Welcome to **RichmdSlide**!`,
128
+ `# Slide 2
129
+ - Create slides easily
130
+ - Supports Markdown syntax`,
131
+ `# Slide 3
132
+ > "Markdown made interactive!"`,
133
+ ];
134
+
135
+ return (
136
+ <div className="slideshow-container">
137
+ <RichmdSlide text={markdownSlides.join("\n---\n")} isController={true} />
138
+ </div>
139
+ );
140
+ }
141
+ ```
142
+
143
+ In this example, `---` is used to separate slides. Setting the `isController` property to `true` enables the slide controller.
144
+
115
145
  ## Component API
116
146
 
147
+ ### `Richmd`
148
+
117
149
  The `Richmd` component accepts the following props:
118
150
 
119
151
  | Prop | Type | Required | Description |
@@ -122,6 +154,16 @@ The `Richmd` component accepts the following props:
122
154
  | `id` | string | No | HTML id attribute for the container div |
123
155
  | `className` | string | No | CSS class name for the container div |
124
156
 
157
+
158
+ ### `RichmdSlide`
159
+
160
+ The `RichmdSlide` component accepts the following props:
161
+
162
+ | Prop | Type | Required | Description |
163
+ |------|------|----------|-------------|
164
+ | `text` | string | Yes | The markdown text to render |
165
+ | `isController` | boolean | Yes | Toggles the display of the slide controller |
166
+
125
167
  ## Supported Markdown Features
126
168
 
127
169
  Richmd supports a wide range of markdown features:
@@ -141,7 +183,8 @@ Richmd supports a wide range of markdown features:
141
183
  - Video (HTML5 video tag)
142
184
  - Custom HTML tags
143
185
 
144
- For detailed syntax documentation, refer to the [Richmd Markdown Syntax Documentation](https://github.com/richmd/core/blob/main/docs/md-syntax.md).
186
+ For detailed syntax documentation, refer to the [Richmd Markdown Syntax Documentation](./docs/md-syntax.md).
187
+
145
188
 
146
189
  ## License
147
190
 
@@ -1 +1 @@
1
- {"version":3,"file":"Richmd.d.ts","sourceRoot":"","sources":["../src/Richmd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAMxC,CAAC"}
1
+ {"version":3,"file":"Richmd.d.ts","sourceRoot":"","sources":["../src/Richmd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAQxC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ type RichmdProps = {
3
+ text: string;
4
+ isController?: boolean;
5
+ id?: string;
6
+ className?: string;
7
+ };
8
+ export declare const RichmdSlide: React.FC<RichmdProps>;
9
+ export {};
10
+ //# sourceMappingURL=RichmdSlide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RichmdSlide.d.ts","sourceRoot":"","sources":["../src/RichmdSlide.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAK9D,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAqE7C,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import "../styles/richmd.css";
2
2
  import { Richmd } from "./Richmd";
3
- export { Richmd };
3
+ import { RichmdSlide } from "./RichmdSlide";
4
+ export { Richmd, RichmdSlide };
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC"}