UNPKG

@wordpress/block-library

Version:
166 lines (165 loc) • 7.23 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); // \0rolldown/runtime.js var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { key = keys[i]; if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: ((k) => from[k]).bind(null, key), enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); let _wordpress_block_editor = require("@wordpress/block-editor"); let _wordpress_i18n = require("@wordpress/i18n"); let _wordpress_data = require("@wordpress/data"); let _wordpress_core_data = require("@wordpress/core-data"); let _wordpress_element = require("@wordpress/element"); let _wordpress_react_inert_value = require("@wordpress/react-inert-value"); let ______post_comments_form_form_jsx = require("../../post-comments-form/form.cjs"); ______post_comments_form_form_jsx = __toESM(______post_comments_form_form_jsx); let react_jsx_runtime = require("react/jsx-runtime"); // packages/block-library/src/comments/edit/placeholder.jsx function PostCommentsPlaceholder({ postType, postId }) { let [postTitle] = (0, _wordpress_core_data.useEntityProp)("postType", postType, "title", postId); postTitle = postTitle || (0, _wordpress_i18n.__)("Post Title"); const avatarURL = (0, _wordpress_data.useSelect)((select) => select(_wordpress_block_editor.store).getSettings().__experimentalDiscussionSettings?.avatarURL, []); return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { className: "wp-block-comments__legacy-placeholder", inert: (0, _wordpress_react_inert_value.inertValue)(true), children: [ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("One response to %s"), postTitle) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { className: "navigation", children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "alignleft", children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", { href: "#top", children: ["« ", (0, _wordpress_i18n.__)("Older Comments")] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "alignright", children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", { href: "#top", children: [(0, _wordpress_i18n.__)("Newer Comments"), " »"] }) })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", { className: "commentlist", children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { className: "comment even thread-even depth-1", children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", { className: "comment-body", children: [ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("footer", { className: "comment-meta", children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { className: "comment-author vcard", children: [ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", { alt: (0, _wordpress_i18n.__)("Commenter Avatar"), src: avatarURL, className: "avatar avatar-32 photo", height: "32", width: "32", loading: "lazy" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { className: "fn", children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", { href: "#top", className: "url", children: (0, _wordpress_i18n.__)("A WordPress Commenter") }) }), " ", /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { className: "says", children: [(0, _wordpress_i18n.__)("says"), ":"] }) ] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { className: "comment-metadata", children: [ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", { href: "#top", children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("time", { dateTime: "2000-01-01T00:00:00+00:00", children: (0, _wordpress_i18n.__)("January 1, 2000 at 00:00 am") }) }), " ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "edit-link", children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", { className: "comment-edit-link", href: "#top", children: (0, _wordpress_i18n.__)("Edit") }) }) ] })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "comment-content", children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [ (0, _wordpress_i18n.__)("Hi, this is a comment."), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("br", {}), (0, _wordpress_i18n.__)("To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard."), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("br", {}), (0, _wordpress_element.createInterpolateElement)((0, _wordpress_i18n.__)("Commenter avatars come from <a>Gravatar</a>."), { a: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", { href: "https://gravatar.com/" }) }) ] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "reply", children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", { className: "comment-reply-link", href: "#top", "aria-label": (0, _wordpress_i18n.__)("Reply to A WordPress Commenter"), children: (0, _wordpress_i18n._x)("Reply", "verb") }) }) ] }) }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { className: "navigation", children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "alignleft", children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", { href: "#top", children: ["« ", (0, _wordpress_i18n.__)("Older Comments")] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "alignright", children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", { href: "#top", children: [(0, _wordpress_i18n.__)("Newer Comments"), " »"] }) })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(______post_comments_form_form_jsx.default, { postId, postType }) ] }); } exports.default = PostCommentsPlaceholder; //# sourceMappingURL=placeholder.cjs.map