@wordpress/block-library
Version:
Block library for the WordPress editor.
34 lines (33 loc) • 925 B
JavaScript
// packages/block-library/src/gallery/order-options.ts
import { __ } from "@wordpress/i18n";
function toOrderValue(order) {
return `${order.orderby}/${order.order}`;
}
function parseOrderValue(value) {
const [orderby, order] = value.split("/");
return { orderby, order };
}
var ORDER_OPTIONS = [
{ label: __("Newest to oldest"), value: "date/desc" },
{ label: __("Oldest to newest"), value: "date/asc" },
{
/* translators: Label for ordering images by title in ascending order. */
label: __("A → Z"),
value: "title/asc"
},
{
/* translators: Label for ordering images by title in descending order. */
label: __("Z → A"),
value: "title/desc"
}
];
var RANDOM_ORDER = "random";
var RANDOM_OPTION = { label: __("Random"), value: RANDOM_ORDER };
export {
ORDER_OPTIONS,
RANDOM_OPTION,
RANDOM_ORDER,
parseOrderValue,
toOrderValue
};
//# sourceMappingURL=order-options.mjs.map