@mittwald/mstudio-ext-react-components 0.2.0-alpha.175
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 +84 -0
- package/dist/js/components/Actions/Actions.mjs +9 -0
- package/dist/js/components/Actions/Actions.mjs.map +1 -0
- package/dist/js/components/Breadcrumb/Breadcrumb.mjs +9 -0
- package/dist/js/components/Breadcrumb/Breadcrumb.mjs.map +1 -0
- package/dist/js/components/Title/Title.mjs +9 -0
- package/dist/js/components/Title/Title.mjs.map +1 -0
- package/dist/js/index.mjs +4 -0
- package/dist/js/index.mjs.map +1 -0
- package/dist/types/components/Actions/Actions.d.ts +13 -0
- package/dist/types/components/Actions/Actions.d.ts.map +1 -0
- package/dist/types/components/Actions/index.d.ts +3 -0
- package/dist/types/components/Actions/index.d.ts.map +1 -0
- package/dist/types/components/Breadcrumb/Breadcrumb.d.ts +13 -0
- package/dist/types/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/types/components/Breadcrumb/index.d.ts +3 -0
- package/dist/types/components/Breadcrumb/index.d.ts.map +1 -0
- package/dist/types/components/Title/Title.d.ts +10 -0
- package/dist/types/components/Title/Title.d.ts.map +1 -0
- package/dist/types/components/Title/index.d.ts +3 -0
- package/dist/types/components/Title/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# @mittwald/mstudio-ext-react-components
|
|
2
|
+
|
|
3
|
+
React components that can be used by mStudio extension developers
|
|
4
|
+
|
|
5
|
+
This package is part of
|
|
6
|
+
[Flow – mittwald design system](https://mittwald.github.io/flow/). See the
|
|
7
|
+
homepage for more details.
|
|
8
|
+
|
|
9
|
+
## Customize the mStudio page header for your extension
|
|
10
|
+
|
|
11
|
+
This package offers some components, to customize and extend the mStudio page
|
|
12
|
+
header.
|
|
13
|
+
|
|
14
|
+
### `<Title>`
|
|
15
|
+
|
|
16
|
+
With the `<Title>` component you can overwrite the page title of the mStudio
|
|
17
|
+
header. You will usually need this customization if your extension has
|
|
18
|
+
**subpages**.
|
|
19
|
+
|
|
20
|
+
**Note**: Refer to the existing pages in the mStudio for best practices.
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { Title } from "@mittwald/mstudio-ext-react-components";
|
|
24
|
+
|
|
25
|
+
function DetailsPage() {
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
<Title>Details</Title>
|
|
29
|
+
{/* your code */}
|
|
30
|
+
</>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### `<Actions>`
|
|
36
|
+
|
|
37
|
+
With the `<Actions>` component you can extend the mStudio actions menu in the
|
|
38
|
+
page header. Use the regular `<MenuItem>` component from
|
|
39
|
+
`@mittwald/flow-remote-react-components` to define custom menu items.
|
|
40
|
+
|
|
41
|
+
**Note**: Refer to the existing pages in the mStudio for best practices.
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { MenuItem } from "@mittwald/flow-remote-react-components";
|
|
45
|
+
import { Actions } from "@mittwald/mstudio-ext-react-components";
|
|
46
|
+
|
|
47
|
+
function MainPage() {
|
|
48
|
+
return (
|
|
49
|
+
<>
|
|
50
|
+
<Actions>
|
|
51
|
+
<MenuItem onAction={onRename}>Rename</MenuItem>
|
|
52
|
+
<MenuItem onAction={onDelete}>Delete</MenuItem>
|
|
53
|
+
</Actions>
|
|
54
|
+
{/* your code */}
|
|
55
|
+
</>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### `<Breadcrumb>`
|
|
61
|
+
|
|
62
|
+
With the `<Breadcrumb>` component you can extend the mStudio with your own
|
|
63
|
+
items. Use the regular `<Link>` component from
|
|
64
|
+
`@mittwald/flow-remote-react-components` to define custom links. You will
|
|
65
|
+
usually need this customization if your extension has **multiple subpages**.
|
|
66
|
+
|
|
67
|
+
**Note**: Refer to the existing pages in the mStudio for best practices.
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import { Link } from "@mittwald/flow-remote-react-components";
|
|
71
|
+
import { Breadcrumb } from "@mittwald/mstudio-ext-react-components";
|
|
72
|
+
|
|
73
|
+
function ProfilePage() {
|
|
74
|
+
return (
|
|
75
|
+
<>
|
|
76
|
+
<Breadcrumb>
|
|
77
|
+
<Link href="/profiles">Profiles</Link>
|
|
78
|
+
<Link href="/profiles/5">Profile</Link>
|
|
79
|
+
</Breadcrumb>
|
|
80
|
+
{/* your code */}
|
|
81
|
+
</>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { TunnelEntry } from '@mittwald/flow-remote-react-components';
|
|
5
|
+
|
|
6
|
+
const Actions = (props) => /* @__PURE__ */ jsx(TunnelEntry, { id: "@mstudio-ext/actions", children: props.children });
|
|
7
|
+
|
|
8
|
+
export { Actions, Actions as default };
|
|
9
|
+
//# sourceMappingURL=Actions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Actions.mjs","sources":["../../../../src/components/Actions/Actions.tsx"],"sourcesContent":["import { TunnelEntry } from \"@mittwald/flow-remote-react-components\";\nimport type { FC, PropsWithChildren } from \"react\";\n\n/**\n * Use <MenuItem> children to add items to the actions menu.\n *\n * @example\n * <Actions>\n * <MenuItem onAction={onRename}>Rename</MenuItem>\n * <MenuItem onAction={onDelete}>Delete</MenuItem>\n * </Actions>;\n */\nexport const Actions: FC<PropsWithChildren> = (props) => (\n <TunnelEntry id=\"@mstudio-ext/actions\">{props.children}</TunnelEntry>\n);\n\nexport default Actions;\n"],"names":[],"mappings":";;;AAYa,MAAA,OAAA,GAAiC,CAAC,KAC7C,qBAAA,GAAA,CAAC,eAAY,EAAG,EAAA,sBAAA,EAAwB,gBAAM,QAAS,EAAA;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { TunnelEntry } from '@mittwald/flow-remote-react-components';
|
|
5
|
+
|
|
6
|
+
const Breadcrumb = (props) => /* @__PURE__ */ jsx(TunnelEntry, { id: "@mstudio-ext/breadcrumb", children: props.children });
|
|
7
|
+
|
|
8
|
+
export { Breadcrumb, Breadcrumb as default };
|
|
9
|
+
//# sourceMappingURL=Breadcrumb.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.mjs","sources":["../../../../src/components/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import { TunnelEntry } from \"@mittwald/flow-remote-react-components\";\nimport type { FC, PropsWithChildren } from \"react\";\n\n/**\n * Use <Link> children to add items to the breadcrumb.\n *\n * @example\n * <Breadcrumb>\n * <Link href=\"/profiles\">Profiles</Link>\n * <Link href=\"/profiles/5\">Profile</Link>\n * </Breadcrumb>;\n */\nexport const Breadcrumb: FC<PropsWithChildren> = (props) => (\n <TunnelEntry id=\"@mstudio-ext/breadcrumb\">{props.children}</TunnelEntry>\n);\n\nexport default Breadcrumb;\n"],"names":[],"mappings":";;;AAYa,MAAA,UAAA,GAAoC,CAAC,KAChD,qBAAA,GAAA,CAAC,eAAY,EAAG,EAAA,yBAAA,EAA2B,gBAAM,QAAS,EAAA;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { TunnelEntry } from '@mittwald/flow-remote-react-components';
|
|
5
|
+
|
|
6
|
+
const Title = (props) => /* @__PURE__ */ jsx(TunnelEntry, { id: "@mstudio-ext/title", children: props.children });
|
|
7
|
+
|
|
8
|
+
export { Title, Title as default };
|
|
9
|
+
//# sourceMappingURL=Title.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Title.mjs","sources":["../../../../src/components/Title/Title.tsx"],"sourcesContent":["import { TunnelEntry } from \"@mittwald/flow-remote-react-components\";\nimport type { FC, PropsWithChildren } from \"react\";\n\n/**\n * Overwrite the title of the current page.\n *\n * @example\n * <Title>My title</Title>;\n */\nexport const Title: FC<PropsWithChildren> = (props) => (\n <TunnelEntry id=\"@mstudio-ext/title\">{props.children}</TunnelEntry>\n);\n\nexport default Title;\n"],"names":[],"mappings":";;;AASa,MAAA,KAAA,GAA+B,CAAC,KAC3C,qBAAA,GAAA,CAAC,eAAY,EAAG,EAAA,oBAAA,EAAsB,gBAAM,QAAS,EAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Use <MenuItem> children to add items to the actions menu.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* <Actions>
|
|
7
|
+
* <MenuItem onAction={onRename}>Rename</MenuItem>
|
|
8
|
+
* <MenuItem onAction={onDelete}>Delete</MenuItem>
|
|
9
|
+
* </Actions>;
|
|
10
|
+
*/
|
|
11
|
+
export declare const Actions: FC<PropsWithChildren>;
|
|
12
|
+
export default Actions;
|
|
13
|
+
//# sourceMappingURL=Actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../../src/components/Actions/Actions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEnD;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAEzC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Use <Link> children to add items to the breadcrumb.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* <Breadcrumb>
|
|
7
|
+
* <Link href="/profiles">Profiles</Link>
|
|
8
|
+
* <Link href="/profiles/5">Profile</Link>
|
|
9
|
+
* </Breadcrumb>;
|
|
10
|
+
*/
|
|
11
|
+
export declare const Breadcrumb: FC<PropsWithChildren>;
|
|
12
|
+
export default Breadcrumb;
|
|
13
|
+
//# sourceMappingURL=Breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../../../src/components/Breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEnD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAE5C,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Breadcrumb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Overwrite the title of the current page.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* <Title>My title</Title>;
|
|
7
|
+
*/
|
|
8
|
+
export declare const Title: FC<PropsWithChildren>;
|
|
9
|
+
export default Title;
|
|
10
|
+
//# sourceMappingURL=Title.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Title.d.ts","sourceRoot":"","sources":["../../../../src/components/Title/Title.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAEvC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Title/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mittwald/mstudio-ext-react-components",
|
|
3
|
+
"version": "0.2.0-alpha.175",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "React components that can be used by mStudio extension developers",
|
|
6
|
+
"homepage": "https://mittwald.github.io/flow",
|
|
7
|
+
"repository": "https://github.com/mittwald/flow",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/types/index.d.ts",
|
|
11
|
+
"default": "./dist/js/index.mjs"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=20.11"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "vite build --config vite.build.config.ts",
|
|
22
|
+
"clean": "rimraf dist",
|
|
23
|
+
"test": "exit 0",
|
|
24
|
+
"test:compile": "tsc --noEmit"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@mittwald/flow-remote-react-components": "0.2.0-alpha.177",
|
|
28
|
+
"@types/react": "^19"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@mittwald/typescript-config": "0.2.0-alpha.177",
|
|
32
|
+
"@types/node": "^22.13.10",
|
|
33
|
+
"nx": "^20.5.0",
|
|
34
|
+
"prettier": "^3.5.3",
|
|
35
|
+
"react": "^19",
|
|
36
|
+
"rimraf": "^6.0.1",
|
|
37
|
+
"rollup-plugin-auto-named-exports": "1.0.0-beta.3",
|
|
38
|
+
"rollup-preserve-directives": "^1.1.3",
|
|
39
|
+
"typescript": "^5.8.2",
|
|
40
|
+
"vite": "^6.2.1",
|
|
41
|
+
"vite-plugin-banner": "^0.8.0",
|
|
42
|
+
"vite-plugin-checker": "^0.9.0",
|
|
43
|
+
"vite-plugin-dts": "^4.5.3",
|
|
44
|
+
"vite-plugin-externalize-deps": "^0.9.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^19"
|
|
48
|
+
}
|
|
49
|
+
}
|