@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
142 lines (140 loc) • 4.85 kB
JavaScript
"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/editor/src/components/collaborators-overlay/avatar-iframe-styles.ts
var avatar_iframe_styles_exports = {};
__export(avatar_iframe_styles_exports, {
AVATAR_IFRAME_STYLES: () => AVATAR_IFRAME_STYLES
});
module.exports = __toCommonJS(avatar_iframe_styles_exports);
var import_collaborator_styles = require("./collaborator-styles.cjs");
var AVATAR_IFRAME_STYLES = `
.editor-avatar {
position: relative;
display: inline-flex;
align-items: center;
border-radius: ${import_collaborator_styles.RADIUS_FULL};
flex-shrink: 0;
box-shadow: 0 0 0 var(--wp-admin-border-width-focus, 2px) ${import_collaborator_styles.WHITE}, ${import_collaborator_styles.ELEVATION_X_SMALL};
}
.editor-avatar__image {
box-sizing: border-box;
position: relative;
width: ${import_collaborator_styles.BUTTON_SIZE_COMPACT};
height: ${import_collaborator_styles.BUTTON_SIZE_COMPACT};
border-radius: ${import_collaborator_styles.RADIUS_FULL};
border: 0;
background-color: var(--wp-admin-theme-color, #3858e9);
overflow: hidden;
overflow: clip;
flex-shrink: 0;
font-size: 0;
color: ${import_collaborator_styles.WHITE};
}
.is-small > .editor-avatar__image {
width: ${import_collaborator_styles.BUTTON_SIZE_SMALL};
height: ${import_collaborator_styles.BUTTON_SIZE_SMALL};
}
.has-avatar-border-color > .editor-avatar__image {
border: var(--wp-admin-border-width-focus, 2px) solid var(--editor-avatar-outline-color);
background-clip: padding-box;
}
.has-avatar-border-color > .editor-avatar__image::after {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus, 2px) ${import_collaborator_styles.WHITE};
pointer-events: none;
z-index: 1;
}
.editor-avatar__img {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
border-radius: inherit;
opacity: 0;
}
.has-src > .editor-avatar__image > .editor-avatar__img {
opacity: 1;
}
.editor-avatar:not(.has-src) > .editor-avatar__image {
display: flex;
align-items: center;
justify-content: center;
font-size: ${import_collaborator_styles.FONT_SIZE_X_SMALL};
font-weight: ${import_collaborator_styles.FONT_WEIGHT_MEDIUM};
border: 0;
background-clip: border-box;
}
.editor-avatar:not(.has-src) > .editor-avatar__image::after {
content: none;
}
.editor-avatar:not(.has-src).has-avatar-border-color > .editor-avatar__image {
background-color: var(--editor-avatar-outline-color);
}
.editor-avatar__name {
font-size: ${import_collaborator_styles.FONT_SIZE_MEDIUM};
font-weight: ${import_collaborator_styles.FONT_WEIGHT_MEDIUM};
line-height: ${import_collaborator_styles.FONT_LINE_HEIGHT_SMALL};
color: var(--editor-avatar-name-color, ${import_collaborator_styles.WHITE});
min-width: 0;
padding-bottom: 2px; /* $grid-unit-05 / 2 */
overflow: hidden;
opacity: 0;
white-space: nowrap;
transition: opacity 0.15s cubic-bezier(0.15, 0, 0.15, 1);
}
.editor-avatar.is-badge {
display: inline-grid;
grid-template-columns: min-content 0fr;
column-gap: 0;
padding-inline-end: 0;
background-color: var(--wp-admin-theme-color, #3858e9);
transition:
grid-template-columns 0.3s cubic-bezier(0.15, 0, 0.15, 1),
column-gap 0.3s cubic-bezier(0.15, 0, 0.15, 1),
padding-inline-end 0.3s cubic-bezier(0.15, 0, 0.15, 1);
}
.editor-avatar.is-badge:hover {
grid-template-columns: min-content 1fr;
column-gap: ${import_collaborator_styles.GRID_UNIT_05};
padding-inline-end: ${import_collaborator_styles.GRID_UNIT_10};
transition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);
}
.editor-avatar.is-badge:hover .editor-avatar__name {
opacity: 1;
transition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);
}
.editor-avatar.is-badge.has-avatar-border-color {
background-color: var(--editor-avatar-outline-color);
}
@media (prefers-reduced-motion: reduce) {
.editor-avatar.is-badge,
.editor-avatar__name {
transition: none;
}
}
`;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
AVATAR_IFRAME_STYLES
});
//# sourceMappingURL=avatar-iframe-styles.cjs.map