691 lines
31 KiB
JavaScript
691 lines
31 KiB
JavaScript
"use strict";
|
|
(self["webpackChunk_woocommerce_storybook"] = self["webpackChunk_woocommerce_storybook"] || []).push([[9286],{
|
|
|
|
/***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ A: () => (/* binding */ _assertThisInitialized)
|
|
/* harmony export */ });
|
|
function _assertThisInitialized(self) {
|
|
if (self === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/classCallCheck.js":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ A: () => (/* binding */ _classCallCheck)
|
|
/* harmony export */ });
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/createClass.js":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ A: () => (/* binding */ _createClass)
|
|
/* harmony export */ });
|
|
/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
|
|
|
|
function _defineProperties(target, props) {
|
|
for (var i = 0; i < props.length; i++) {
|
|
var descriptor = props[i];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor) descriptor.writable = true;
|
|
Object.defineProperty(target, (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(descriptor.key), descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
Object.defineProperty(Constructor, "prototype", {
|
|
writable: false
|
|
});
|
|
return Constructor;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ A: () => (/* binding */ _getPrototypeOf)
|
|
/* harmony export */ });
|
|
function _getPrototypeOf(o) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
};
|
|
return _getPrototypeOf(o);
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/inherits.js":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ A: () => (/* binding */ _inherits)
|
|
/* harmony export */ });
|
|
/* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js");
|
|
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
constructor: {
|
|
value: subClass,
|
|
writable: true,
|
|
configurable: true
|
|
}
|
|
});
|
|
Object.defineProperty(subClass, "prototype", {
|
|
writable: false
|
|
});
|
|
if (superClass) (0,_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(subClass, superClass);
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ A: () => (/* binding */ _possibleConstructorReturn)
|
|
/* harmony export */ });
|
|
/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/typeof.js");
|
|
/* harmony import */ var _assertThisInitialized_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) {
|
|
if (call && ((0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
} else if (call !== void 0) {
|
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
}
|
|
return (0,_assertThisInitialized_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(self);
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ A: () => (/* binding */ _setPrototypeOf)
|
|
/* harmony export */ });
|
|
function _setPrototypeOf(o, p) {
|
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
o.__proto__ = p;
|
|
return o;
|
|
};
|
|
return _setPrototypeOf(o, p);
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
A: () => (/* binding */ _toPropertyKey)
|
|
});
|
|
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
var esm_typeof = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/typeof.js");
|
|
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
|
|
function _toPrimitive(input, hint) {
|
|
if ((0,esm_typeof/* default */.A)(input) !== "object" || input === null) return input;
|
|
var prim = input[Symbol.toPrimitive];
|
|
if (prim !== undefined) {
|
|
var res = prim.call(input, hint || "default");
|
|
if ((0,esm_typeof/* default */.A)(res) !== "object") return res;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return (hint === "string" ? String : Number)(input);
|
|
}
|
|
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
|
|
|
|
function _toPropertyKey(arg) {
|
|
var key = _toPrimitive(arg, "string");
|
|
return (0,esm_typeof/* default */.A)(key) === "symbol" ? key : String(key);
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/typeof.js":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ A: () => (/* binding */ _typeof)
|
|
/* harmony export */ });
|
|
function _typeof(o) {
|
|
"@babel/helpers - typeof";
|
|
|
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
return typeof o;
|
|
} : function (o) {
|
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
}, _typeof(o);
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../packages/js/components/src/empty-content/index.js":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
/* harmony export */ });
|
|
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.object.to-string.js");
|
|
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.reflect.construct.js");
|
|
/* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
|
|
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/createClass.js");
|
|
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/inherits.js");
|
|
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
|
|
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
|
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/button/index.js");
|
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js");
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("../../node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js");
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__);
|
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js");
|
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_11__);
|
|
/* harmony import */ var _section__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("../../packages/js/components/src/section/header.tsx");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = (0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(Derived),
|
|
result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = (0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return (0,_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(this, result);
|
|
};
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
if (Reflect.construct.sham) return false;
|
|
if (typeof Proxy === "function") return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
/**
|
|
* External dependencies
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
|
|
/**
|
|
* A component to be used when there is no data to show.
|
|
* It can be used as an opportunity to provide explanation or guidance to help a user progress.
|
|
*/
|
|
var EmptyContent = /*#__PURE__*/function (_Component) {
|
|
(0,_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(EmptyContent, _Component);
|
|
var _super = _createSuper(EmptyContent);
|
|
function EmptyContent() {
|
|
(0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)(this, EmptyContent);
|
|
return _super.apply(this, arguments);
|
|
}
|
|
(0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)(EmptyContent, [{
|
|
key: "renderIllustration",
|
|
value: function renderIllustration() {
|
|
var _this$props = this.props,
|
|
illustrationWidth = _this$props.illustrationWidth,
|
|
illustrationHeight = _this$props.illustrationHeight,
|
|
illustration = _this$props.illustration;
|
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.createElement)("img", {
|
|
alt: "",
|
|
src: illustration,
|
|
width: illustrationWidth,
|
|
height: illustrationHeight,
|
|
className: "woocommerce-empty-content__illustration"
|
|
});
|
|
}
|
|
}, {
|
|
key: "renderActionButtons",
|
|
value: function renderActionButtons(type) {
|
|
var actionLabel = type === 'secondary' ? this.props.secondaryActionLabel : this.props.actionLabel;
|
|
var actionURL = type === 'secondary' ? this.props.secondaryActionURL : this.props.actionURL;
|
|
var actionCallback = type === 'secondary' ? this.props.secondaryActionCallback : this.props.actionCallback;
|
|
var isPrimary = type === 'secondary' ? false : true;
|
|
var buttonVariant = isPrimary ? 'primary' : 'secondary';
|
|
if (actionURL && actionCallback) {
|
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A, {
|
|
className: "woocommerce-empty-content__action",
|
|
variant: buttonVariant,
|
|
onClick: actionCallback,
|
|
href: actionURL
|
|
}, actionLabel);
|
|
} else if (actionURL) {
|
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A, {
|
|
className: "woocommerce-empty-content__action",
|
|
variant: buttonVariant,
|
|
href: actionURL
|
|
}, actionLabel);
|
|
} else if (actionCallback) {
|
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A, {
|
|
className: "woocommerce-empty-content__action",
|
|
variant: buttonVariant,
|
|
onClick: actionCallback
|
|
}, actionLabel);
|
|
}
|
|
return null;
|
|
}
|
|
}, {
|
|
key: "renderActions",
|
|
value: function renderActions() {
|
|
var _this$props2 = this.props,
|
|
actionLabel = _this$props2.actionLabel,
|
|
secondaryActionLabel = _this$props2.secondaryActionLabel;
|
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.createElement)("div", {
|
|
className: "woocommerce-empty-content__actions"
|
|
}, actionLabel && this.renderActionButtons('primary'), secondaryActionLabel && this.renderActionButtons('secondary'));
|
|
}
|
|
}, {
|
|
key: "render",
|
|
value: function render() {
|
|
var _this$props3 = this.props,
|
|
className = _this$props3.className,
|
|
title = _this$props3.title,
|
|
message = _this$props3.message,
|
|
illustration = _this$props3.illustration;
|
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.createElement)("div", {
|
|
className: classnames__WEBPACK_IMPORTED_MODULE_4___default()('woocommerce-empty-content', className)
|
|
}, illustration && this.renderIllustration(), title ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.createElement)(_section__WEBPACK_IMPORTED_MODULE_10__.H, {
|
|
className: "woocommerce-empty-content__title"
|
|
}, title) : null, message ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.createElement)("p", {
|
|
className: "woocommerce-empty-content__message"
|
|
}, message) : null, this.renderActions());
|
|
}
|
|
}]);
|
|
return EmptyContent;
|
|
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.Component);
|
|
EmptyContent.propTypes = {
|
|
/**
|
|
* The title to be displayed.
|
|
*/
|
|
title: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string).isRequired,
|
|
/**
|
|
* An additional message to be displayed.
|
|
*/
|
|
message: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().node),
|
|
/**
|
|
* The url string of an image path for img src.
|
|
*/
|
|
illustration: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string),
|
|
/**
|
|
* Height to use for the illustration.
|
|
*/
|
|
illustrationHeight: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().number),
|
|
/**
|
|
* Width to use for the illustration.
|
|
*/
|
|
illustrationWidth: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().number),
|
|
/**
|
|
* Label to be used for the primary action button.
|
|
*/
|
|
actionLabel: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string).isRequired,
|
|
/**
|
|
* URL to be used for the primary action button.
|
|
*/
|
|
actionURL: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string),
|
|
/**
|
|
* Callback to be used for the primary action button.
|
|
*/
|
|
actionCallback: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().func),
|
|
/**
|
|
* Label to be used for the secondary action button.
|
|
*/
|
|
secondaryActionLabel: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string),
|
|
/**
|
|
* URL to be used for the secondary action button.
|
|
*/
|
|
secondaryActionURL: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string),
|
|
/**
|
|
* Callback to be used for the secondary action button.
|
|
*/
|
|
secondaryActionCallback: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().func),
|
|
/**
|
|
* Additional CSS classes.
|
|
*/
|
|
className: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string)
|
|
};
|
|
EmptyContent.defaultProps = {
|
|
// eslint-disable-next-line max-len
|
|
illustration: 'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"%3E%3Cpath d="M226.153073,88.3099993 L355.380187,301.446227 C363.970299,315.614028 359.448689,334.062961 345.280888,342.653073 C340.591108,345.496544 335.21158,347 329.727115,347 L71.2728854,347 C54.7043429,347 41.2728854,333.568542 41.2728854,317 C41.2728854,311.515534 42.7763415,306.136007 45.6198127,301.446227 L174.846927,88.3099993 C183.437039,74.1421985 201.885972,69.6205881 216.053773,78.2106999 C220.184157,80.7150022 223.64877,84.1796157 226.153073,88.3099993 Z M184.370159,153 L186.899684,255.024156 L213.459691,255.024156 L215.989216,153 L184.370159,153 Z M200.179688,307.722584 C209.770801,307.722584 217.359375,300.450201 217.359375,291.175278 C217.359375,281.900355 209.770801,274.627972 200.179688,274.627972 C190.588574,274.627972 183,281.900355 183,291.175278 C183,300.450201 190.588574,307.722584 200.179688,307.722584 Z" id="Combined-Shape" stroke="%23c0c0c0" fill="%23c0c0c0"' + ' fill-rule="nonzero"%3E%3C/path%3E%3C/svg%3E',
|
|
illustrationWidth: 100
|
|
};
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EmptyContent);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../packages/js/components/src/section/context.tsx":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ $: () => (/* binding */ Level)
|
|
/* harmony export */ });
|
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js");
|
|
/**
|
|
* External dependencies
|
|
*/
|
|
|
|
|
|
/**
|
|
* Context container for heading level. We start at 2 because the `h1` is defined in <Header />
|
|
*
|
|
* See https://medium.com/@Heydon/managing-heading-levels-in-design-systems-18be9a746fa3
|
|
*/
|
|
var Level = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)(2);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../packages/js/components/src/section/header.tsx":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ H: () => (/* binding */ H)
|
|
/* harmony export */ });
|
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js");
|
|
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../packages/js/components/src/section/context.tsx");
|
|
|
|
/**
|
|
* External dependencies
|
|
*/
|
|
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
|
|
/**
|
|
* These components are used to frame out the page content for accessible heading hierarchy. Instead of defining fixed heading levels
|
|
* (`h2`, `h3`, …) you can use `<H />` to create "section headings", which look to the parent `<Section />`s for the appropriate
|
|
* heading level.
|
|
*
|
|
* @type {HTMLElement}
|
|
*/
|
|
function H(props) {
|
|
var level = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(_context__WEBPACK_IMPORTED_MODULE_1__/* .Level */ .$);
|
|
var Heading = 'h' + Math.min(level, 6);
|
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Heading, props);
|
|
}
|
|
try {
|
|
// @ts-ignore
|
|
H.displayName = "H";
|
|
// @ts-ignore
|
|
H.__docgenInfo = { "description": "These components are used to frame out the page content for accessible heading hierarchy. Instead of defining fixed heading levels\n(`h2`, `h3`, \u2026) you can use `<H />` to create \"section headings\", which look to the parent `<Section />`s for the appropriate\nheading level.", "displayName": "H", "props": {} };
|
|
// @ts-ignore
|
|
if (typeof STORYBOOK_REACT_CLASSES !== "undefined")
|
|
// @ts-ignore
|
|
STORYBOOK_REACT_CLASSES["../../packages/js/components/src/section/header.tsx#H"] = { docgenInfo: H.__docgenInfo, name: "H", path: "../../packages/js/components/src/section/header.tsx#H" };
|
|
}
|
|
catch (__react_docgen_typescript_loader_error) { }
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/function-bind.js":
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
var uncurryThis = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/function-uncurry-this.js");
|
|
var aCallable = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/a-callable.js");
|
|
var isObject = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/is-object.js");
|
|
var hasOwn = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/has-own-property.js");
|
|
var arraySlice = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/array-slice.js");
|
|
var NATIVE_BIND = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/function-bind-native.js");
|
|
|
|
var $Function = Function;
|
|
var concat = uncurryThis([].concat);
|
|
var join = uncurryThis([].join);
|
|
var factories = {};
|
|
|
|
var construct = function (C, argsLength, args) {
|
|
if (!hasOwn(factories, argsLength)) {
|
|
var list = [];
|
|
var i = 0;
|
|
for (; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
|
factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
|
|
} return factories[argsLength](C, args);
|
|
};
|
|
|
|
// `Function.prototype.bind` method implementation
|
|
// https://tc39.es/ecma262/#sec-function.prototype.bind
|
|
// eslint-disable-next-line es/no-function-prototype-bind -- detection
|
|
module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
|
|
var F = aCallable(this);
|
|
var Prototype = F.prototype;
|
|
var partArgs = arraySlice(arguments, 1);
|
|
var boundFunction = function bound(/* args... */) {
|
|
var args = concat(partArgs, arraySlice(arguments));
|
|
return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
|
|
};
|
|
if (isObject(Prototype)) boundFunction.prototype = Prototype;
|
|
return boundFunction;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.function.bind.js":
|
|
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
// TODO: Remove from `core-js@4`
|
|
var $ = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/export.js");
|
|
var bind = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/function-bind.js");
|
|
|
|
// `Function.prototype.bind` method
|
|
// https://tc39.es/ecma262/#sec-function.prototype.bind
|
|
// eslint-disable-next-line es/no-function-prototype-bind -- detection
|
|
$({ target: 'Function', proto: true, forced: Function.bind !== bind }, {
|
|
bind: bind
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.reflect.construct.js":
|
|
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
var $ = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/export.js");
|
|
var getBuiltIn = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/get-built-in.js");
|
|
var apply = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/function-apply.js");
|
|
var bind = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/function-bind.js");
|
|
var aConstructor = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/a-constructor.js");
|
|
var anObject = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/an-object.js");
|
|
var isObject = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/is-object.js");
|
|
var create = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/object-create.js");
|
|
var fails = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/fails.js");
|
|
|
|
var nativeConstruct = getBuiltIn('Reflect', 'construct');
|
|
var ObjectPrototype = Object.prototype;
|
|
var push = [].push;
|
|
|
|
// `Reflect.construct` method
|
|
// https://tc39.es/ecma262/#sec-reflect.construct
|
|
// MS Edge supports only 2 arguments and argumentsList argument is optional
|
|
// FF Nightly sets third argument as `new.target`, but does not create `this` from it
|
|
var NEW_TARGET_BUG = fails(function () {
|
|
function F() { /* empty */ }
|
|
return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);
|
|
});
|
|
|
|
var ARGS_BUG = !fails(function () {
|
|
nativeConstruct(function () { /* empty */ });
|
|
});
|
|
|
|
var FORCED = NEW_TARGET_BUG || ARGS_BUG;
|
|
|
|
$({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
|
|
construct: function construct(Target, args /* , newTarget */) {
|
|
aConstructor(Target);
|
|
anObject(args);
|
|
var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
|
|
if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
|
|
if (Target === newTarget) {
|
|
// w/o altered newTarget, optimization for 0-4 arguments
|
|
switch (args.length) {
|
|
case 0: return new Target();
|
|
case 1: return new Target(args[0]);
|
|
case 2: return new Target(args[0], args[1]);
|
|
case 3: return new Target(args[0], args[1], args[2]);
|
|
case 4: return new Target(args[0], args[1], args[2], args[3]);
|
|
}
|
|
// w/o altered newTarget, lot of arguments case
|
|
var $args = [null];
|
|
apply(push, $args, args);
|
|
return new (apply(bind, Target, $args))();
|
|
}
|
|
// with altered newTarget, not support built-in constructors
|
|
var proto = newTarget.prototype;
|
|
var instance = create(isObject(proto) ? proto : ObjectPrototype);
|
|
var result = apply(Target, instance, args);
|
|
return isObject(result) ? result : instance;
|
|
}
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "../../packages/js/components/src/analytics/error/stories/analytics-error.story.tsx":
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Basic: () => (/* binding */ Basic),
|
|
"default": () => (/* binding */ analytics_error_story)
|
|
});
|
|
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js
|
|
var react = __webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js");
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.function.bind.js
|
|
var es_function_bind = __webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.function.bind.js");
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/@wordpress+i18n@4.6.1/node_modules/@wordpress/i18n/build-module/index.js + 3 modules
|
|
var build_module = __webpack_require__("../../node_modules/.pnpm/@wordpress+i18n@4.6.1/node_modules/@wordpress/i18n/build-module/index.js");
|
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js
|
|
var prop_types = __webpack_require__("../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js");
|
|
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
|
|
// EXTERNAL MODULE: ../../packages/js/components/src/empty-content/index.js
|
|
var empty_content = __webpack_require__("../../packages/js/components/src/empty-content/index.js");
|
|
;// CONCATENATED MODULE: ../../packages/js/components/src/analytics/error/index.js
|
|
/**
|
|
* External dependencies
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
|
|
/**
|
|
* Component to render when there is an error in an analytics component due to data
|
|
* not being loaded or being invalid.
|
|
*
|
|
* @param {Object} props React props.
|
|
* @param {string} [props.className] Additional class name to style the component.
|
|
*/
|
|
function AnalyticsError(_ref) {
|
|
var className = _ref.className;
|
|
var title = (0,build_module.__)('There was an error getting your stats. Please try again.', 'woocommerce');
|
|
var actionLabel = (0,build_module.__)('Reload', 'woocommerce');
|
|
var actionCallback = function actionCallback() {
|
|
// @todo Add tracking for how often an error is displayed, and the reload action is clicked.
|
|
window.location.reload();
|
|
};
|
|
return (0,react.createElement)(empty_content/* default */.A, {
|
|
className: className,
|
|
title: title,
|
|
actionLabel: actionLabel,
|
|
actionCallback: actionCallback
|
|
});
|
|
}
|
|
AnalyticsError.propTypes = {
|
|
/**
|
|
* Additional class name to style the component.
|
|
*/
|
|
className: (prop_types_default()).string
|
|
};
|
|
/* harmony default export */ const error = (AnalyticsError);
|
|
;// CONCATENATED MODULE: ../../packages/js/components/src/analytics/error/stories/analytics-error.story.tsx
|
|
|
|
|
|
/**
|
|
* External dependencies
|
|
*/
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
var Template = function Template(args) {
|
|
return (0,react.createElement)(error, args);
|
|
};
|
|
var Basic = Template.bind({});
|
|
/* harmony default export */ const analytics_error_story = ({
|
|
title: 'WooCommerce Admin/components/analytics/AnalyticsError',
|
|
component: error
|
|
});
|
|
Basic.parameters = {
|
|
...Basic.parameters,
|
|
docs: {
|
|
...Basic.parameters?.docs,
|
|
source: {
|
|
originalSource: "args => <AnalyticsError {...args} />",
|
|
...Basic.parameters?.docs?.source
|
|
}
|
|
}
|
|
};
|
|
|
|
/***/ })
|
|
|
|
}]); |