@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
149 lines (145 loc) • 4.84 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/overlay-iframe-styles.ts
var overlay_iframe_styles_exports = {};
__export(overlay_iframe_styles_exports, {
OVERLAY_IFRAME_STYLES: () => OVERLAY_IFRAME_STYLES
});
module.exports = __toCommonJS(overlay_iframe_styles_exports);
var import_collaborator_styles = require("./collaborator-styles.cjs");
var OVERLAY_IFRAME_STYLES = `
.block-canvas-cover {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 20000;
}
.block-canvas-cover .collaborators-overlay-full {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.block-canvas-cover .collaborators-overlay-fixed {
position: fixed;
width: 100%;
height: 100%;
}
.collaborators-overlay-user {
position: absolute;
}
/* Cursor lines render below avatar labels across all users. The parent
.collaborators-overlay-user has no z-index so it does not create a
stacking context \u2014 children participate in the shared overlay context. */
.collaborators-overlay-user-cursor {
position: absolute;
z-index: 0;
width: ${import_collaborator_styles.BORDER_WIDTH_FOCUS_FALLBACK};
border-radius: ${import_collaborator_styles.BORDER_WIDTH};
outline: ${import_collaborator_styles.BORDER_WIDTH} solid ${import_collaborator_styles.WHITE};
box-shadow: ${import_collaborator_styles.ELEVATION_X_SMALL};
animation: collaborators-overlay-cursor-blink 1s infinite;
}
.collaborators-overlay-selection-rect {
position: absolute;
opacity: 0.15;
pointer-events: none;
border-radius: 2px;
}
/* Overlay-specific positioning applied to the Avatar cursor label. */
.collaborators-overlay-user-label.editor-avatar {
position: absolute;
z-index: 1;
transform: translate(-11px, -100%);
margin-top: -${import_collaborator_styles.GRID_UNIT_05};
pointer-events: auto;
overflow: visible;
width: max-content;
}
/* Avatar positioned above a highlighted block as a label. */
.collaborators-overlay-block-label.editor-avatar {
position: absolute;
z-index: 1;
transform: translateY(calc(-100% - ${import_collaborator_styles.GRID_UNIT_10}));
pointer-events: auto;
overflow: visible;
width: max-content;
}
@keyframes collaborators-overlay-cursor-blink {
0%, 45% { opacity: 1; }
55%, 95% { opacity: 0; }
100% { opacity: 1; }
}
.collaborators-overlay-cursor-highlighted .collaborators-overlay-user-cursor {
animation: collaborators-overlay-cursor-highlight 0.6s ease-in-out 3;
}
.collaborators-overlay-cursor-highlighted .collaborators-overlay-user-label {
animation: collaborators-overlay-label-highlight 0.6s ease-in-out 3;
}
@keyframes collaborators-overlay-cursor-highlight {
0%, 100% {
transform: scale(1);
filter: drop-shadow(0 0 0 transparent);
}
50% {
transform: scale(1.2);
filter: drop-shadow(0 0 8px currentColor);
}
}
@keyframes collaborators-overlay-label-highlight {
0%, 100% {
transform: translate(-11px, -100%) scale(1);
filter: drop-shadow(0 0 0 transparent);
}
50% {
transform: translate(-11px, -100%) scale(1.1);
filter: drop-shadow(0 0 6px currentColor);
}
}
.block-editor-block-list__block.is-collaborator-selected:not(:focus)::after {
content: "";
position: absolute;
pointer-events: none;
top: 0;
right: 0;
bottom: 0;
left: 0;
outline-color: var(--collaborator-outline-color);
outline-style: solid;
outline-width: calc(var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
outline-offset: calc(-1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
box-shadow: inset 0 0 0 calc((var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1)) + 0.5px) rgba(${import_collaborator_styles.WHITE}, 0.7);
z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
.collaborators-overlay-user-label,
.collaborators-overlay-user-cursor {
animation: none;
}
}
`;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
OVERLAY_IFRAME_STYLES
});
//# sourceMappingURL=overlay-iframe-styles.cjs.map