@raketa-builder/support 0.7.0 → 0.8.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/.turbo/turbo-build.log +3 -3
- package/dist/index.js +23 -1
- package/package.json +1 -1
- package/src/AdminPageRender/index.js +24 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @raketa-builder/support@0.
|
|
2
|
+
> @raketa-builder/support@0.8.0 build
|
|
3
3
|
> tsup src/index.js --format cjs --loader ".js=jsx"
|
|
4
4
|
|
|
5
5
|
CLI Building entry: src/index.js
|
|
@@ -7,5 +7,5 @@ CLI Using tsconfig: tsconfig.json
|
|
|
7
7
|
CLI tsup v6.5.0
|
|
8
8
|
CLI Target: es6
|
|
9
9
|
CJS Build start
|
|
10
|
-
CJS dist/index.js
|
|
11
|
-
CJS ⚡️ Build success in
|
|
10
|
+
CJS dist/index.js 20.64 KB
|
|
11
|
+
CJS ⚡️ Build success in 69ms
|
package/dist/index.js
CHANGED
|
@@ -533,8 +533,15 @@ var saveToLocalStorage = (identifier, widgets) => window.localStorage.setItem(
|
|
|
533
533
|
`clipboard\u2013${identifier}`,
|
|
534
534
|
JSON.stringify(widgets)
|
|
535
535
|
);
|
|
536
|
-
var AdminPageRender = ({
|
|
536
|
+
var AdminPageRender = ({
|
|
537
|
+
page,
|
|
538
|
+
library,
|
|
539
|
+
adminLibrary,
|
|
540
|
+
identifier,
|
|
541
|
+
detailPath
|
|
542
|
+
}) => {
|
|
537
543
|
const [selectedWidgets, setSelectedWidgets] = import_react6.default.useState([]);
|
|
544
|
+
const areAllSelected = selectedWidgets.length === page.widgets.length;
|
|
538
545
|
const handleSelectWidget = (newWidget) => {
|
|
539
546
|
setSelectedWidgets((oldList) => {
|
|
540
547
|
const isUnique = oldList.filter((w) => w === newWidget).length <= 0;
|
|
@@ -556,6 +563,11 @@ var AdminPageRender = ({ page, library, adminLibrary, identifier }) => {
|
|
|
556
563
|
}
|
|
557
564
|
saveToLocalStorage(identifier, widgets);
|
|
558
565
|
};
|
|
566
|
+
const handleSelectAll = () => {
|
|
567
|
+
if (areAllSelected)
|
|
568
|
+
return setSelectedWidgets([]);
|
|
569
|
+
setSelectedWidgets(page.widgets.map((w) => w.widgetId));
|
|
570
|
+
};
|
|
559
571
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react6.default.Fragment, { children: [
|
|
560
572
|
selectedWidgets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
561
573
|
SelectedWidgetsToolbar_default,
|
|
@@ -564,6 +576,16 @@ var AdminPageRender = ({ page, library, adminLibrary, identifier }) => {
|
|
|
564
576
|
onCopy: () => handleCopyWidgets(selectedWidgets, "multiple")
|
|
565
577
|
}
|
|
566
578
|
),
|
|
579
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
580
|
+
"button",
|
|
581
|
+
{
|
|
582
|
+
className: `r-button-reset r-button-select-all ${areAllSelected ? "r-all-selected" : ""}`,
|
|
583
|
+
type: "button",
|
|
584
|
+
title: "Select all (or Deselect all)",
|
|
585
|
+
onClick: () => handleSelectAll()
|
|
586
|
+
}
|
|
587
|
+
),
|
|
588
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { href: detailPath, className: "r-reset r-details-link", title: "Details" }),
|
|
567
589
|
page.widgets.map(({ widgetId, component, settings }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
568
590
|
AdminWidgetMinimal_default,
|
|
569
591
|
{
|
package/package.json
CHANGED
|
@@ -8,8 +8,15 @@ const saveToLocalStorage = (identifier, widgets) =>
|
|
|
8
8
|
JSON.stringify(widgets)
|
|
9
9
|
);
|
|
10
10
|
|
|
11
|
-
const AdminPageRender = ({
|
|
11
|
+
const AdminPageRender = ({
|
|
12
|
+
page,
|
|
13
|
+
library,
|
|
14
|
+
adminLibrary,
|
|
15
|
+
identifier,
|
|
16
|
+
detailPath,
|
|
17
|
+
}) => {
|
|
12
18
|
const [selectedWidgets, setSelectedWidgets] = React.useState([]);
|
|
19
|
+
const areAllSelected = selectedWidgets.length === page.widgets.length;
|
|
13
20
|
|
|
14
21
|
const handleSelectWidget = (newWidget) => {
|
|
15
22
|
setSelectedWidgets((oldList) => {
|
|
@@ -38,6 +45,12 @@ const AdminPageRender = ({ page, library, adminLibrary, identifier }) => {
|
|
|
38
45
|
saveToLocalStorage(identifier, widgets);
|
|
39
46
|
};
|
|
40
47
|
|
|
48
|
+
const handleSelectAll = () => {
|
|
49
|
+
if (areAllSelected) return setSelectedWidgets([]);
|
|
50
|
+
|
|
51
|
+
setSelectedWidgets(page.widgets.map((w) => w.widgetId));
|
|
52
|
+
};
|
|
53
|
+
|
|
41
54
|
return (
|
|
42
55
|
<React.Fragment>
|
|
43
56
|
{selectedWidgets.length > 0 && (
|
|
@@ -46,6 +59,16 @@ const AdminPageRender = ({ page, library, adminLibrary, identifier }) => {
|
|
|
46
59
|
onCopy={() => handleCopyWidgets(selectedWidgets, "multiple")}
|
|
47
60
|
/>
|
|
48
61
|
)}
|
|
62
|
+
|
|
63
|
+
<button
|
|
64
|
+
className={`r-button-reset r-button-select-all ${areAllSelected ? "r-all-selected" : ""}`}
|
|
65
|
+
type="button"
|
|
66
|
+
title="Select all (or Deselect all)"
|
|
67
|
+
onClick={() => handleSelectAll()}
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
<a href={detailPath} className="r-reset r-details-link" title="Details" />
|
|
71
|
+
|
|
49
72
|
{page.widgets.map(({ widgetId, component, settings }) => (
|
|
50
73
|
<AdminWidgetMinimal
|
|
51
74
|
key={widgetId}
|