@raketa-builder/builder 0.8.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.
package/dist/index.js
CHANGED
|
@@ -1304,7 +1304,7 @@ var AdminWidget = ({
|
|
|
1304
1304
|
});
|
|
1305
1305
|
window.localStorage.setItem(`clipboard\u2013${identifier}`, storedWidget);
|
|
1306
1306
|
};
|
|
1307
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(AdminWidgetWrapper_default, { children: [
|
|
1307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(AdminWidgetWrapper_default, { "data-widget": widget.component, children: [
|
|
1308
1308
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(AdminWidgetToolbar_default, { "data-toolbar": true, children: [
|
|
1309
1309
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(IconButton_default, { icon: "iconMove", "data-drag": true }),
|
|
1310
1310
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
@@ -3324,12 +3324,7 @@ var import_react31 = __toESM(require("react"));
|
|
|
3324
3324
|
// src/lib/AdminWidgetMinimal.js
|
|
3325
3325
|
var import_react30 = __toESM(require("react"));
|
|
3326
3326
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3327
|
-
var AdminWidgetMinimal = ({
|
|
3328
|
-
library,
|
|
3329
|
-
adminLibrary,
|
|
3330
|
-
identifier,
|
|
3331
|
-
widget
|
|
3332
|
-
}) => {
|
|
3327
|
+
var AdminWidgetMinimal = ({ library, adminLibrary, identifier, widget }) => {
|
|
3333
3328
|
const currentWidget = library[widget.component];
|
|
3334
3329
|
const currentAdminWidget = adminLibrary[widget.component];
|
|
3335
3330
|
if (!currentWidget || !currentAdminWidget) {
|
|
@@ -3343,7 +3338,7 @@ var AdminWidgetMinimal = ({
|
|
|
3343
3338
|
});
|
|
3344
3339
|
window.localStorage.setItem(`clipboard\u2013${identifier}`, storedWidget);
|
|
3345
3340
|
};
|
|
3346
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(AdminWidgetWrapper_default, { children: [
|
|
3341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(AdminWidgetWrapper_default, { "data-widget": widget.component, children: [
|
|
3347
3342
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(AdminWidgetToolbar_default, { "data-toolbar": true, children: !widgetData_default.deprecated(currentAdminWidget) && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3348
3343
|
IconButton_default,
|
|
3349
3344
|
{
|
package/package.json
CHANGED
package/src/lib/AdminWidget.js
CHANGED
|
@@ -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
|
|
|
@@ -38,7 +38,7 @@ const AdminWidget = ({
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
|
-
<AdminWidgetWrapper>
|
|
41
|
+
<AdminWidgetWrapper data-widget={widget.component}>
|
|
42
42
|
<AdminWidgetToolbar data-toolbar>
|
|
43
43
|
<IconButton icon="iconMove" data-drag />
|
|
44
44
|
<IconButton
|
|
@@ -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,15 +2,11 @@
|
|
|
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
|
|
|
8
|
-
const AdminWidgetMinimal = ({
|
|
9
|
-
library,
|
|
10
|
-
adminLibrary,
|
|
11
|
-
identifier,
|
|
12
|
-
widget,
|
|
13
|
-
}) => {
|
|
9
|
+
const AdminWidgetMinimal = ({ library, adminLibrary, identifier, widget }) => {
|
|
14
10
|
const currentWidget = library[widget.component];
|
|
15
11
|
const currentAdminWidget = adminLibrary[widget.component];
|
|
16
12
|
|
|
@@ -29,7 +25,7 @@ const AdminWidgetMinimal = ({
|
|
|
29
25
|
};
|
|
30
26
|
|
|
31
27
|
return (
|
|
32
|
-
<AdminWidgetWrapper>
|
|
28
|
+
<AdminWidgetWrapper data-widget={widget.component}>
|
|
33
29
|
<AdminWidgetToolbar data-toolbar>
|
|
34
30
|
{!widgetData.deprecated(currentAdminWidget) && (
|
|
35
31
|
<IconButton
|
|
@@ -40,6 +36,10 @@ const AdminWidgetMinimal = ({
|
|
|
40
36
|
)}
|
|
41
37
|
</AdminWidgetToolbar>
|
|
42
38
|
|
|
39
|
+
<AdminWidgetLabel data-widget-label>
|
|
40
|
+
{widgetData.title(currentAdminWidget)}
|
|
41
|
+
</AdminWidgetLabel>
|
|
42
|
+
|
|
43
43
|
{React.createElement(currentWidget, widget.settings)}
|
|
44
44
|
</AdminWidgetWrapper>
|
|
45
45
|
);
|
|
@@ -2,11 +2,12 @@ import styled from "styled-components";
|
|
|
2
2
|
|
|
3
3
|
const AdminWidgetWrapper = styled.div`
|
|
4
4
|
${(props) => `
|
|
5
|
-
|
|
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
|
`;
|