UNPKG

@wordpress/widget-dashboard

Version:

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

91 lines (89 loc) • 3.87 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/widget-dashboard/src/widget-dashboard.tsx var widget_dashboard_exports = {}; __export(widget_dashboard_exports, { WidgetDashboard: () => WidgetDashboard }); module.exports = __toCommonJS(widget_dashboard_exports); var import_dashboard_context = require("./context/dashboard-context.cjs"); var import_ui_context = require("./context/ui-context.cjs"); var import_actions = require("./components/actions/index.cjs"); var import_commands = require("./components/commands/index.cjs"); var import_no_widgets_state = require("./components/no-widgets-state/index.cjs"); var import_reset_confirmation = require("./components/reset-confirmation/index.cjs"); var import_widget_chrome = require("./components/widget-chrome/index.cjs"); var import_widget_inserter = require("./components/widget-inserter/index.cjs"); var import_dashboard_policy = require("./components/dashboard-policy/index.cjs"); var import_widget_settings = require("./components/widget-settings/index.cjs"); var import_widgets = require("./components/widgets/index.cjs"); var import_jsx_runtime = require("react/jsx-runtime"); var WidgetDashboard = Object.assign( function WidgetDashboard2({ layout, onLayoutChange, onLayoutReset, widgetTypes, isResolvingWidgetTypes, editMode, onEditChange, resolveWidgetModule, gridSettings, children }) { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_dashboard_context.WidgetDashboardProvider, { layout, onLayoutChange, onLayoutReset, widgetTypes, isResolvingWidgetTypes, editMode, onEditChange, resolveWidgetModule, gridSettings, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui_context.WidgetDashboardUIProvider, { children: [ children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_no_widgets_state.NoWidgetsState, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_actions.Actions, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_widgets.Widgets, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_commands.Commands, {}) ] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_widget_inserter.WidgetInserter, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_widget_settings.WidgetSettings, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reset_confirmation.ResetConfirmation, {}) ] }) } ); }, { Actions: import_actions.Actions, Widgets: import_widgets.Widgets, WidgetChrome: import_widget_chrome.WidgetChrome, NoWidgetsState: import_no_widgets_state.NoWidgetsState, Commands: import_commands.Commands, Policy: import_dashboard_policy.WidgetDashboardPolicy } ); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { WidgetDashboard }); //# sourceMappingURL=widget-dashboard.cjs.map