@raketa-builder/support 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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @raketa-builder/support@0.8.0 build
2
+ > @raketa-builder/support@0.10.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 20.64 KB
11
- CJS ⚡️ Build success in 69ms
10
+ CJS dist/index.js 20.78 KB
11
+ CJS ⚡️ Build success in 106ms
package/dist/index.js CHANGED
@@ -538,7 +538,8 @@ var AdminPageRender = ({
538
538
  library,
539
539
  adminLibrary,
540
540
  identifier,
541
- detailPath
541
+ detailPath,
542
+ canvasClassName = ""
542
543
  }) => {
543
544
  const [selectedWidgets, setSelectedWidgets] = import_react6.default.useState([]);
544
545
  const areAllSelected = selectedWidgets.length === page.widgets.length;
@@ -576,7 +577,7 @@ var AdminPageRender = ({
576
577
  onCopy: () => handleCopyWidgets(selectedWidgets, "multiple")
577
578
  }
578
579
  ),
579
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
580
+ page.widgets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
580
581
  "button",
581
582
  {
582
583
  className: `r-button-reset r-button-select-all ${areAllSelected ? "r-all-selected" : ""}`,
@@ -586,7 +587,7 @@ var AdminPageRender = ({
586
587
  }
587
588
  ),
588
589
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { href: detailPath, className: "r-reset r-details-link", title: "Details" }),
589
- page.widgets.map(({ widgetId, component, settings }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
590
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: canvasClassName, children: page.widgets.map(({ widgetId, component, settings }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
590
591
  AdminWidgetMinimal_default,
591
592
  {
592
593
  library,
@@ -597,7 +598,7 @@ var AdminPageRender = ({
597
598
  selectedWidgets
598
599
  },
599
600
  widgetId
600
- ))
601
+ )) })
601
602
  ] });
602
603
  };
603
604
  var AdminPageRender_default = AdminPageRender;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/support",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
@@ -14,6 +14,7 @@ const AdminPageRender = ({
14
14
  adminLibrary,
15
15
  identifier,
16
16
  detailPath,
17
+ canvasClassName = "",
17
18
  }) => {
18
19
  const [selectedWidgets, setSelectedWidgets] = React.useState([]);
19
20
  const areAllSelected = selectedWidgets.length === page.widgets.length;
@@ -60,26 +61,30 @@ const AdminPageRender = ({
60
61
  />
61
62
  )}
62
63
 
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
- />
64
+ {page.widgets.length > 0 && (
65
+ <button
66
+ className={`r-button-reset r-button-select-all ${areAllSelected ? "r-all-selected" : ""}`}
67
+ type="button"
68
+ title="Select all (or Deselect all)"
69
+ onClick={() => handleSelectAll()}
70
+ />
71
+ )}
69
72
 
70
73
  <a href={detailPath} className="r-reset r-details-link" title="Details" />
71
74
 
72
- {page.widgets.map(({ widgetId, component, settings }) => (
73
- <AdminWidgetMinimal
74
- key={widgetId}
75
- library={library}
76
- adminLibrary={adminLibrary}
77
- widget={{ widgetId, component, settings }}
78
- onCopy={handleCopyWidgets}
79
- onSelectWidget={handleSelectWidget}
80
- selectedWidgets={selectedWidgets}
81
- />
82
- ))}
75
+ <div className={canvasClassName}>
76
+ {page.widgets.map(({ widgetId, component, settings }) => (
77
+ <AdminWidgetMinimal
78
+ key={widgetId}
79
+ library={library}
80
+ adminLibrary={adminLibrary}
81
+ widget={{ widgetId, component, settings }}
82
+ onCopy={handleCopyWidgets}
83
+ onSelectWidget={handleSelectWidget}
84
+ selectedWidgets={selectedWidgets}
85
+ />
86
+ ))}
87
+ </div>
83
88
  </React.Fragment>
84
89
  );
85
90
  };