UNPKG

@wordpress/widget-dashboard

Version:

Stateless rendering engine for widget dashboards: the WidgetDashboard compound component and its grid-settings kit.

66 lines (65 loc) • 2.16 kB
// packages/widget-dashboard/src/widget-dashboard.tsx import { WidgetDashboardProvider } from "./context/dashboard-context.mjs"; import { WidgetDashboardUIProvider } from "./context/ui-context.mjs"; import { Actions } from "./components/actions/index.mjs"; import { Commands } from "./components/commands/index.mjs"; import { NoWidgetsState } from "./components/no-widgets-state/index.mjs"; import { ResetConfirmation } from "./components/reset-confirmation/index.mjs"; import { WidgetChrome } from "./components/widget-chrome/index.mjs"; import { WidgetInserter } from "./components/widget-inserter/index.mjs"; import { WidgetDashboardPolicy } from "./components/dashboard-policy/index.mjs"; import { WidgetSettings } from "./components/widget-settings/index.mjs"; import { Widgets } from "./components/widgets/index.mjs"; import { Fragment, jsx, jsxs } from "react/jsx-runtime"; var WidgetDashboard = Object.assign( function WidgetDashboard2({ layout, onLayoutChange, onLayoutReset, widgetTypes, isResolvingWidgetTypes, editMode, onEditChange, resolveWidgetModule, gridSettings, children }) { return /* @__PURE__ */ jsx( WidgetDashboardProvider, { layout, onLayoutChange, onLayoutReset, widgetTypes, isResolvingWidgetTypes, editMode, onEditChange, resolveWidgetModule, gridSettings, children: /* @__PURE__ */ jsxs(WidgetDashboardUIProvider, { children: [ children ?? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(NoWidgetsState, {}), /* @__PURE__ */ jsx(Actions, {}), /* @__PURE__ */ jsx(Widgets, {}), /* @__PURE__ */ jsx(Commands, {}) ] }), /* @__PURE__ */ jsx(WidgetInserter, {}), /* @__PURE__ */ jsx(WidgetSettings, {}), /* @__PURE__ */ jsx(ResetConfirmation, {}) ] }) } ); }, { Actions, Widgets, WidgetChrome, NoWidgetsState, Commands, Policy: WidgetDashboardPolicy } ); export { WidgetDashboard }; //# sourceMappingURL=widget-dashboard.mjs.map