@raketa-builder/builder 0.9.0 → 0.10.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.
@@ -4,5 +4,5 @@ CLI Using tsconfig: tsconfig.json
4
4
  CLI tsup v6.5.0
5
5
  CLI Target: es6
6
6
  CJS Build start
7
- CJS dist/index.js 128.38 KB
8
- CJS ⚡️ Build success in 44ms
7
+ CJS dist/index.js 128.32 KB
8
+ CJS ⚡️ Build success in 223ms
@@ -1,13 +1,13 @@
1
1
  $ TIMING=1 eslint "**/*.js"
2
2
  Rule | Time (ms) | Relative
3
3
  :---------------------------------|----------:|--------:
4
- react/no-direct-mutation-state | 31.205 | 33.8%
5
- react/display-name | 24.748 | 26.8%
6
- react/require-render-return | 10.247 | 11.1%
7
- react/no-deprecated | 6.985 | 7.6%
8
- react-hooks/rules-of-hooks | 3.509 | 3.8%
9
- react/no-string-refs | 3.039 | 3.3%
10
- react-hooks/exhaustive-deps | 1.302 | 1.4%
11
- jsx-a11y/role-supports-aria-props | 1.285 | 1.4%
12
- react/no-unescaped-entities | 1.190 | 1.3%
13
- react/jsx-no-comment-textnodes | 1.077 | 1.2%
4
+ react/display-name | 86.473 | 28.1%
5
+ react/no-direct-mutation-state | 79.777 | 25.9%
6
+ react/require-render-return | 61.222 | 19.9%
7
+ react/no-deprecated | 15.966 | 5.2%
8
+ react/no-string-refs | 9.252 | 3.0%
9
+ react-hooks/rules-of-hooks | 8.985 | 2.9%
10
+ jsx-a11y/role-supports-aria-props | 4.664 | 1.5%
11
+ react/no-unescaped-entities | 4.425 | 1.4%
12
+ react/jsx-no-comment-textnodes | 4.237 | 1.4%
13
+ react-hooks/exhaustive-deps | 4.217 | 1.4%
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/builder",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable no-undef */
2
2
  import React from "react";
3
- import styled from "styled-components";
4
3
  import AdminWidgetWrapper from "./AdminWidgetWrapper";
5
4
  import AdminWidgetToolbar from "./AdminWidgetToolbar";
5
+ import AdminWidgetLabel from "./AdminWidgetLabel";
6
6
  import IconButton from "./IconButton";
7
7
  import widgetData from "../helpers/widgetData";
8
8
 
@@ -62,6 +62,10 @@ const AdminWidget = ({
62
62
  )}
63
63
  </AdminWidgetToolbar>
64
64
 
65
+ <AdminWidgetLabel data-widget-label>
66
+ {widgetData.title(currentAdminWidget)}
67
+ </AdminWidgetLabel>
68
+
65
69
  {React.createElement(currentWidget, widget.settings)}
66
70
  </AdminWidgetWrapper>
67
71
  );
@@ -0,0 +1,19 @@
1
+ import styled from "styled-components";
2
+ import { reset } from "@raketa-builder/ui";
3
+
4
+ const AdminWidgetLabel = styled.div`
5
+ ${reset};
6
+ position: absolute;
7
+ top: ${(props) => props.theme.font.base};
8
+ right: ${(props) => props.theme.font.base};
9
+ z-index: 9;
10
+ display: none;
11
+ padding: 4px 12px;
12
+ border-radius: 16px;
13
+ background-color: rgba(64, 64, 64, 0.8);
14
+ color: ${(props) => props.theme.colors.trueWhite};
15
+ font-size: ${(props) => props.theme.font.small};
16
+ backdrop-filter: blur(4px);
17
+ `;
18
+
19
+ export default AdminWidgetLabel;
@@ -2,6 +2,7 @@
2
2
  import React from "react";
3
3
  import AdminWidgetWrapper from "./AdminWidgetWrapper";
4
4
  import AdminWidgetToolbar from "./AdminWidgetToolbar";
5
+ import AdminWidgetLabel from "./AdminWidgetLabel";
5
6
  import IconButton from "./IconButton";
6
7
  import widgetData from "../helpers/widgetData";
7
8
 
@@ -35,6 +36,10 @@ const AdminWidgetMinimal = ({ library, adminLibrary, identifier, widget }) => {
35
36
  )}
36
37
  </AdminWidgetToolbar>
37
38
 
39
+ <AdminWidgetLabel data-widget-label>
40
+ {widgetData.title(currentAdminWidget)}
41
+ </AdminWidgetLabel>
42
+
38
43
  {React.createElement(currentWidget, widget.settings)}
39
44
  </AdminWidgetWrapper>
40
45
  );
@@ -2,11 +2,12 @@ import styled from "styled-components";
2
2
 
3
3
  const AdminWidgetWrapper = styled.div`
4
4
  ${(props) => `
5
- &:hover {
5
+ &:hover {
6
6
  position: relative;
7
7
  outline: 1px dashed ${props.theme.colors.gray};
8
8
 
9
9
  & > div[data-toolbar] { display: flex; }
10
+ & > div[data-widget-label] { display: block; }
10
11
  }
11
12
  `}
12
13
  `;