elseware-ui 2.26.3 → 2.27.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 +109 -109
- package/build/components/markdown/{editor → com/editor}/MarkdownEditor.d.ts +1 -1
- package/build/components/markdown/com/toc/MarkdownTOC.d.ts +5 -0
- package/build/components/markdown/{viewer → com/viewer}/MarkdownViewer.d.ts +2 -2
- package/build/components/markdown/hooks/useMarkdown.d.ts +1 -0
- package/build/components/markdown/index.d.ts +5 -2
- package/build/components/markdown/provider/MarkdownContext.d.ts +9 -0
- package/build/components/markdown/provider/MarkdownProvider.d.ts +7 -0
- package/build/components/markdown/types/markdown.d.ts +5 -0
- package/build/components/markdown/utils/extractHeadings.d.ts +2 -0
- package/build/components/markdown/utils/generateHeadingNumbers.d.ts +5 -0
- package/build/components/markdown/utils/sanitizeHeading.d.ts +1 -0
- package/build/components/markdown/utils/slugify.d.ts +1 -0
- package/build/components/navigation/menu/index.d.ts +2 -1
- package/build/data/test/md/index.d.ts +2 -0
- package/build/data/test/test-data.d.ts +0 -1
- package/build/index.es.js +1710 -1892
- package/build/index.js +1712 -1891
- package/build/layouts/index.d.ts +2 -1
- package/build/layouts/secondary/documentation-layout/DocumentationLayout.d.ts +6 -0
- package/package.json +128 -126
- package/build/components/general/sidebar/Sidebar.d.ts +0 -10
- package/build/components/general/sidebar/index.d.ts +0 -2
- package/build/components/markdown/editor/index.d.ts +0 -2
- package/build/components/markdown/viewer/index.d.ts +0 -2
package/README.md
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
# elseware UI
|
|
2
|
-
|
|
3
|
-
## Component Imports Structure
|
|
4
|
-
|
|
5
|
-
```javascript
|
|
6
|
-
// External
|
|
7
|
-
import { ReactNode } from "react";
|
|
8
|
-
|
|
9
|
-
// Internal
|
|
10
|
-
import { cn } from "@/utils";
|
|
11
|
-
|
|
12
|
-
// Types
|
|
13
|
-
import { BaseComponentProps } from "@/interfaces";
|
|
14
|
-
import { Variant, Shape, Size } from "@/types";
|
|
15
|
-
|
|
16
|
-
// Data
|
|
17
|
-
import {
|
|
18
|
-
shapes,
|
|
19
|
-
variants,
|
|
20
|
-
borderVariants,
|
|
21
|
-
avatarSizes,
|
|
22
|
-
} from "@/data/styles";
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Copy the following and define the component imports accordingly
|
|
26
|
-
|
|
27
|
-
```javascript
|
|
28
|
-
// External
|
|
29
|
-
|
|
30
|
-
// Internal
|
|
31
|
-
|
|
32
|
-
// Types
|
|
33
|
-
|
|
34
|
-
// Data
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## Folder Hierarchy
|
|
39
|
-
- components: Base UI primitives (buttons, inputs, modals, etc.)
|
|
40
|
-
- compositions: Composite reusable structures built from primitives
|
|
41
|
-
- data: Metadata used on the components/compositions
|
|
42
|
-
- layouts: Page layouts that can be used to quickly structure the page formats
|
|
43
|
-
- styles: Tailwind/CSS stylings
|
|
44
|
-
- types: Custom react types
|
|
45
|
-
- utils: Reusable utility functions and hooks
|
|
46
|
-
|
|
47
|
-
## Setup
|
|
48
|
-
|
|
49
|
-
Install the dependendecies via `npm i`.
|
|
50
|
-
|
|
51
|
-
## Run Storybook
|
|
52
|
-
|
|
53
|
-
To test the components and its features start storybook using `npm run dev`.
|
|
54
|
-
|
|
55
|
-
## Build
|
|
56
|
-
|
|
57
|
-
Run `npm run build` to build the UI framework.
|
|
58
|
-
|
|
59
|
-
## Publishing to npm
|
|
60
|
-
|
|
61
|
-
### Publishing a New Version
|
|
62
|
-
|
|
63
|
-
1. **Update the version number**:
|
|
64
|
-
- Before publishing a new version, update the version in `package.json` following [semantic versioning](https://semver.org/).
|
|
65
|
-
- Example:
|
|
66
|
-
```json
|
|
67
|
-
{
|
|
68
|
-
"name": "elseware-ui",
|
|
69
|
-
"version": "1.0.1",
|
|
70
|
-
...
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
2. **Build the UI Framework**:
|
|
75
|
-
- Run the following command to ensure your changes are built and ready to be published:
|
|
76
|
-
```bash
|
|
77
|
-
npm run build
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
3. **Login to npm**:
|
|
81
|
-
- If you're not already logged in to npm, log in using:
|
|
82
|
-
```bash
|
|
83
|
-
npm login
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
4. **Publish the package**:
|
|
87
|
-
- To publish the package, run the following command:
|
|
88
|
-
```bash
|
|
89
|
-
npm publish --access public
|
|
90
|
-
```
|
|
91
|
-
- Make sure the package name in `package.json` is unique and does not conflict with other packages on npm.
|
|
92
|
-
|
|
93
|
-
### Unpublishing an Older Version
|
|
94
|
-
|
|
95
|
-
If you need to unpublish a specific version of the package:
|
|
96
|
-
|
|
97
|
-
1. **Unpublish a specific version**:
|
|
98
|
-
- To unpublish a specific version of your package (e.g., `1.0.0`), run:
|
|
99
|
-
```bash
|
|
100
|
-
npm unpublish elseware-ui@1.0.0
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
2. **Unpublish the entire package**:
|
|
104
|
-
- If you need to unpublish the entire package, you can run the following command (not recommended for public packages):
|
|
105
|
-
```bash
|
|
106
|
-
npm unpublish elseware-ui --force
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
**Note:** Be cautious when using `--force` as npm restricts package unpublishing for packages that are older than 72 hours to avoid breaking dependencies.
|
|
1
|
+
# elseware UI
|
|
2
|
+
|
|
3
|
+
## Component Imports Structure
|
|
4
|
+
|
|
5
|
+
```javascript
|
|
6
|
+
// External
|
|
7
|
+
import { ReactNode } from "react";
|
|
8
|
+
|
|
9
|
+
// Internal
|
|
10
|
+
import { cn } from "@/utils";
|
|
11
|
+
|
|
12
|
+
// Types
|
|
13
|
+
import { BaseComponentProps } from "@/interfaces";
|
|
14
|
+
import { Variant, Shape, Size } from "@/types";
|
|
15
|
+
|
|
16
|
+
// Data
|
|
17
|
+
import {
|
|
18
|
+
shapes,
|
|
19
|
+
variants,
|
|
20
|
+
borderVariants,
|
|
21
|
+
avatarSizes,
|
|
22
|
+
} from "@/data/styles";
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Copy the following and define the component imports accordingly
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
// External
|
|
29
|
+
|
|
30
|
+
// Internal
|
|
31
|
+
|
|
32
|
+
// Types
|
|
33
|
+
|
|
34
|
+
// Data
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Folder Hierarchy
|
|
39
|
+
- components: Base UI primitives (buttons, inputs, modals, etc.)
|
|
40
|
+
- compositions: Composite reusable structures built from primitives
|
|
41
|
+
- data: Metadata used on the components/compositions
|
|
42
|
+
- layouts: Page layouts that can be used to quickly structure the page formats
|
|
43
|
+
- styles: Tailwind/CSS stylings
|
|
44
|
+
- types: Custom react types
|
|
45
|
+
- utils: Reusable utility functions and hooks
|
|
46
|
+
|
|
47
|
+
## Setup
|
|
48
|
+
|
|
49
|
+
Install the dependendecies via `npm i`.
|
|
50
|
+
|
|
51
|
+
## Run Storybook
|
|
52
|
+
|
|
53
|
+
To test the components and its features start storybook using `npm run dev`.
|
|
54
|
+
|
|
55
|
+
## Build
|
|
56
|
+
|
|
57
|
+
Run `npm run build` to build the UI framework.
|
|
58
|
+
|
|
59
|
+
## Publishing to npm
|
|
60
|
+
|
|
61
|
+
### Publishing a New Version
|
|
62
|
+
|
|
63
|
+
1. **Update the version number**:
|
|
64
|
+
- Before publishing a new version, update the version in `package.json` following [semantic versioning](https://semver.org/).
|
|
65
|
+
- Example:
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"name": "elseware-ui",
|
|
69
|
+
"version": "1.0.1",
|
|
70
|
+
...
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
2. **Build the UI Framework**:
|
|
75
|
+
- Run the following command to ensure your changes are built and ready to be published:
|
|
76
|
+
```bash
|
|
77
|
+
npm run build
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
3. **Login to npm**:
|
|
81
|
+
- If you're not already logged in to npm, log in using:
|
|
82
|
+
```bash
|
|
83
|
+
npm login
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
4. **Publish the package**:
|
|
87
|
+
- To publish the package, run the following command:
|
|
88
|
+
```bash
|
|
89
|
+
npm publish --access public
|
|
90
|
+
```
|
|
91
|
+
- Make sure the package name in `package.json` is unique and does not conflict with other packages on npm.
|
|
92
|
+
|
|
93
|
+
### Unpublishing an Older Version
|
|
94
|
+
|
|
95
|
+
If you need to unpublish a specific version of the package:
|
|
96
|
+
|
|
97
|
+
1. **Unpublish a specific version**:
|
|
98
|
+
- To unpublish a specific version of your package (e.g., `1.0.0`), run:
|
|
99
|
+
```bash
|
|
100
|
+
npm unpublish elseware-ui@1.0.0
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
2. **Unpublish the entire package**:
|
|
104
|
+
- If you need to unpublish the entire package, you can run the following command (not recommended for public packages):
|
|
105
|
+
```bash
|
|
106
|
+
npm unpublish elseware-ui --force
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Note:** Be cautious when using `--force` as npm restricts package unpublishing for packages that are older than 72 hours to avoid breaking dependencies.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "../../../styles/components/markdown/index.css";
|
|
2
1
|
import "@mdxeditor/editor/style.css";
|
|
2
|
+
import "../../../../styles/components/markdown/index.css";
|
|
3
3
|
interface MarkdownViewerProps {
|
|
4
|
-
value
|
|
4
|
+
value?: string;
|
|
5
5
|
}
|
|
6
6
|
declare function MarkdownViewer({ value }: MarkdownViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default MarkdownViewer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useMarkdown(): import("../provider/MarkdownContext").MarkdownContextType | null;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import MarkdownEditor from "./com/editor/MarkdownEditor";
|
|
2
|
+
import MarkdownTOC from "./com/toc/MarkdownTOC";
|
|
3
|
+
import MarkdownViewer from "./com/viewer/MarkdownViewer";
|
|
4
|
+
import MarkdownProvider from "./provider/MarkdownProvider";
|
|
5
|
+
export { MarkdownEditor, MarkdownTOC, MarkdownViewer, MarkdownProvider };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MarkdownHeading } from "../types/markdown";
|
|
3
|
+
export interface MarkdownContextType {
|
|
4
|
+
markdown: string;
|
|
5
|
+
headings: MarkdownHeading[];
|
|
6
|
+
activeHeading: string;
|
|
7
|
+
setActiveHeading: (id: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const MarkdownContext: import("react").Context<MarkdownContextType | null>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface MarkdownProviderProps {
|
|
3
|
+
markdown: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare function MarkdownProvider({ markdown, children }: MarkdownProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default MarkdownProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sanitizeHeading(text: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function slugify(text: string): string;
|
|
@@ -2,5 +2,6 @@ import { Menu } from "./Menu";
|
|
|
2
2
|
import { MenuGroup } from "./com/MenuGroup";
|
|
3
3
|
import { MenuItem } from "./com/MenuItem";
|
|
4
4
|
import { MenuItemTitle } from "./com/MenuItemTitle";
|
|
5
|
-
|
|
5
|
+
import { MenuNode } from "./types";
|
|
6
|
+
export { Menu, MenuGroup, MenuItem, MenuItemTitle, MenuNode };
|
|
6
7
|
export * from "./types";
|
|
@@ -18,4 +18,3 @@ export declare const artifactOptions: {
|
|
|
18
18
|
label: string;
|
|
19
19
|
value: string;
|
|
20
20
|
}[];
|
|
21
|
-
export declare const sampleMarkdownContent = "\n# Hello Markdown\n\nWelcome to the **Markdown Editor**! \nThis editor supports *rich formatting*, _underline_, ~~strikethrough~~ and more.\n\n---\n\n## \uD83D\uDD17 Links\nCheck out [Elseware Games](https://elseware.games) \u2014 your source for game tools.\n\n---\n\n## \uD83D\uDCF7 Images\n\n\n---\n\n## \uD83D\uDD22 Lists\n\n### - Unordered List\n- Item one\n- Item two\n - Nested item\n- Item three\n\n### 1. Ordered List\n1. First\n2. Second\n3. Third\n\n### \u2705 Task List\n- [x] Task completed\n- [ ] Task pending\n- [ ] Another task\n\n---\n\n## \uD83D\uDCE6 Blockquote\n> \"Great software is built, not bought.\"\n\n---\n\n## \uD83D\uDCCA Table\n\n| Feature | Supported |\n| ------------- | --------- |\n| Headings | \u2705 |\n| Lists | \u2705 |\n| Links | \u2705 |\n| Tables | \u2705 |\n| Images | \u2705 |\n| Quotes | \u2705 |\n| Thematic Line | \u2705 |\n\n---\n\n## \uD83D\uDC4B Final Words\n\nHappy editing with **Markdown Editor**!\n";
|