diff --git a/src/LiveDevelopment/BrowserScripts/RemoteFunctions.js b/src/LiveDevelopment/BrowserScripts/RemoteFunctions.js index 3272d1f8ad..96c5929bfb 100644 --- a/src/LiveDevelopment/BrowserScripts/RemoteFunctions.js +++ b/src/LiveDevelopment/BrowserScripts/RemoteFunctions.js @@ -258,6 +258,8 @@ function RemoteFunctions(config = {}) { screenOffset: screenOffset, selectElement: selectElement, isSelectedFromEditor: function () { return _selectedFromEditor; }, + isNamedSelection: _isNamedSelection, + toMatchableSelector: toMatchableSelector, sendSelectionToEditor: sendSelectionToEditor, brieflyDisableHoverListeners: brieflyDisableHoverListeners, handleElementClick: handleElementClick, @@ -1126,6 +1128,23 @@ function RemoteFunctions(config = {}) { _clickHighlight.addAll(wanted); } + const RE_STATE_PSEUDO = /::?(?:hover|active|focus-within|focus-visible|focus|visited|target|checked|disabled|enabled|placeholder-shown|before|after|first-line|first-letter|marker|placeholder|selection)\b/gi; + + // A :hover or ::before rule styles the element in a state it is not in right + // now, so it is matched as the plain selector to reach the elements it styles. + function toMatchableSelector(rule) { + const stripped = rule.replace(RE_STATE_PSEUDO, ""); + if (stripped === rule) { + return rule; + } + try { + window.document.querySelector(stripped); + return stripped; + } catch (e) { + return rule; + } + } + /** * Find the best element to select from a list of matched nodes * Prefers: previously selected element > parent of selected > first valid element @@ -1184,7 +1203,7 @@ function RemoteFunctions(config = {}) { // is not useful, similar to how we skip the html tag in isElementInspectable. // The rule can be a comma-separated list of selectors (from multi-cursor), // so we filter out any standalone * segments and keep valid ones. - rule = rule.split(",").map(s => s.trim()).filter(s => s !== "*").join(","); + rule = toMatchableSelector(rule).split(",").map(s => s.trim()).filter(s => s !== "*").join(","); if (!rule) { dismissUIAndCleanupState(); return; diff --git a/src/LiveDevelopment/MultiBrowserImpl/documents/LiveDocument.js b/src/LiveDevelopment/MultiBrowserImpl/documents/LiveDocument.js index 5401a88df9..a61d915bdc 100644 --- a/src/LiveDevelopment/MultiBrowserImpl/documents/LiveDocument.js +++ b/src/LiveDevelopment/MultiBrowserImpl/documents/LiveDocument.js @@ -160,7 +160,9 @@ define(function (require, exports, module) { this.setInstrumentationEnabled(true, true); this.editor.off("cursorActivity", this._onCursorActivity); this.editor.on("cursorActivity", this._onCursorActivity); - this.updateHighlight(); + if (!_isCursorHighlightGated(this)) { + this.updateHighlight(); + } } }; @@ -171,13 +173,29 @@ define(function (require, exports, module) { LiveDocument.prototype._detachFromEditor = function () { if (this.editor) { this._cancelPendingHighlight(); - this.hideHighlight(); + if (!_isCursorHighlightGated(this)) { + this.hideHighlight(); + } this.editor.off("cursorActivity", this._onCursorActivity); } }; let _disableHighlightOnCursor = false; let _cursorHighlightGeneration = 0; + let _cursorHighlightGate = null; + + /** + * Lets something outside the live documents decide whether the caret may move + * the preview highlight, such as a panel holding a selection of its own. + * @param {?function(LiveDocument): boolean} gate Returns false to leave the preview alone; null removes it. + */ + LiveDocument.setCursorHighlightGate = function (gate) { + _cursorHighlightGate = gate || null; + }; + + function _isCursorHighlightGated(liveDoc) { + return !!_cursorHighlightGate && _cursorHighlightGate(liveDoc) === false; + } /** * If tur, it will disable highlights in live preview on cursor movement in editor @@ -210,14 +228,15 @@ define(function (require, exports, module) { */ LiveDocument.prototype._onCursorActivity = function (event, editor) { this._cancelPendingHighlight(); - if (!this.editor || _disableHighlightOnCursor) { + if (!this.editor || _disableHighlightOnCursor || _isCursorHighlightGated(this)) { return; } const self = this; const generation = _cursorHighlightGeneration; this._highlightTimer = window.setTimeout(function () { self._highlightTimer = null; - if (self.editor && !_disableHighlightOnCursor && generation === _cursorHighlightGeneration) { + if (self.editor && !_disableHighlightOnCursor && generation === _cursorHighlightGeneration && + !_isCursorHighlightGated(self)) { self.updateHighlight(); } }, CURSOR_HIGHLIGHT_DEBOUNCE_MS); diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 69f3b3a4d1..83e801f8f0 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -32,7 +32,7 @@ define(function (require, exports, module) { tinycolor = brackets.getModule("thirdparty/tinycolor"); /** Mustache template that forms the bare DOM structure of the UI */ - var ColorEditorTemplate = require("text!ColorEditorTemplate.html"); + var ColorEditorTemplate = require("text!./ColorEditorTemplate.html"); /** * @const @type {number} @@ -131,9 +131,10 @@ define(function (require, exports, module) { this._redoColor = null; this._isUpperCase = PreferencesManager.get("uppercaseColors"); - PreferencesManager.on("change", "uppercaseColors", function () { + this._handleUppercaseColorsChange = function () { this._isUpperCase = PreferencesManager.get("uppercaseColors"); - }.bind(this)); + }.bind(this); + PreferencesManager.on("change", "uppercaseColors", this._handleUppercaseColorsChange); this.$colorValue = this.$element.find(".color-value"); this.$buttonList = this.$element.find("ul.button-bar"); @@ -270,7 +271,7 @@ define(function (require, exports, module) { * Remove any preference listeners before destroying the editor. */ ColorEditor.prototype.destroy = function () { - PreferencesManager.off("change", "uppercaseColors"); + PreferencesManager.off("change", "uppercaseColors", this._handleUppercaseColorsChange); }; /** diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 1e668a23c5..c88cd4cf02 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -828,6 +828,17 @@ define({ "LIVE_PREVIEW_LAYERS_SCRIPT_GENERATED": "Generated by script, not in the source file", "LIVE_PREVIEW_LAYERS_TAG_TOOLTIP": "Show Tag Name Tooltip", "LIVE_PREVIEW_LAYERS_INSERT_ELEMENT": "Insert Element", + "LIVE_PREVIEW_LAYERS_CHANGE_COLOR": "Change color", + "LIVE_PREVIEW_LAYERS_COPY_DECLARATION": "Copy property", + "LIVE_PREVIEW_LAYERS_COPY_RULE": "Copy rule", + "LIVE_PREVIEW_LAYERS_PASTE_PROPERTIES": "Paste properties", + "LIVE_PREVIEW_LAYERS_PASTE": "Paste", + "LIVE_PREVIEW_LAYERS_STYLES_MENU_HINT": "Right-click to copy or paste styles", + "LIVE_PREVIEW_LAYERS_PASTE_INVALID": "Paste CSS properties or one complete selector at a time.", + "LIVE_PREVIEW_LAYERS_PASTE_FAILED": "Couldn’t paste these properties. Try again.", + "LIVE_PREVIEW_LAYERS_PASTED": "Properties pasted into {0}", + "LIVE_PREVIEW_LAYERS_COPY_FAILED": "Couldn’t copy these styles. Try again.", + "LIVE_PREVIEW_LAYERS_INSERT_POSITION": "Placement", "LIVE_PREVIEW_LAYERS_INSERT_INTO_PAGE": "Add to the page", "LIVE_PREVIEW_LAYERS_INSERT_LOADING": "Loading elements…", "LIVE_PREVIEW_LAYERS_INSERT_UNAVAILABLE": "The live preview did not answer. Try again in a moment.", @@ -836,7 +847,7 @@ define({ "LIVE_PREVIEW_LAYERS_EMPTY_PAGE_PROPERTIES": "The page is empty. Add an element to see its properties.", "LIVE_PREVIEW_LAYERS_EMPTY_PAGE_STYLES": "The page is empty. Add an element to see its styles.", "LIVE_PREVIEW_LAYERS_SHOW_SELECTED": "Show the selected element", - "LIVE_PREVIEW_LAYERS_SCRUB_HINT": "Drag to adjust, double-click to edit", + "LIVE_PREVIEW_LAYERS_SCRUB_HINT": "Drag to adjust. Scroll or use arrow keys while editing. Shift: larger steps, Alt: smaller steps", "LIVE_PREVIEW_LAYERS_PROPERTY_PLACEHOLDER": "property", "LIVE_PREVIEW_LAYERS_VALUE_PLACEHOLDER": "value", diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index 0baf7a0d58..473cf2e205 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -27,10 +27,13 @@ @layers-border: rgba(255, 255, 255, 0.09); @layers-input-bg: rgba(255, 255, 255, 0.04); @layers-input-bg-focus: rgba(255, 255, 255, 0.06); -@layers-row-height: 26px; +@layers-font-size: 13px; +@layers-font-xs: 12px; +@layers-font-tree: 14px; +@layers-row-height: 28px; @layers-label-min-width: 72px; @layers-row-intrinsic-width: 115px; -@layers-tools-width: 96px; +@layers-tools-width: 106px; @layers-indent: 14px; @layers-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; @layers-prop-name: #9cdcfe; @@ -44,8 +47,8 @@ display: flex; align-items: center; justify-content: center; - width: 20px; - height: 20px; + width: 22px; + height: 22px; padding: 0; margin: 0; border: none; @@ -57,8 +60,8 @@ flex: none; svg { - width: 13px; - height: 13px; + width: 14px; + height: 14px; display: block; flex: none; } @@ -71,7 +74,7 @@ .layers-field-input() { box-sizing: border-box; - height: 22px; + height: 24px; padding: 0 6px; margin: 0; border: 1px solid transparent; @@ -81,8 +84,8 @@ background: transparent; color: @project-panel-text-1; font-family: @layers-mono; - font-size: @sidebar-xs-font-size; - line-height: 20px; + font-size: @layers-font-xs; + line-height: 22px; transition: none; &::placeholder { @@ -116,7 +119,7 @@ position: relative; background-color: @bc-ai-sidebar-bg; color: @project-panel-text-1; - font-size: @sidebar-small-font-size; + font-size: @layers-font-size; letter-spacing: normal; text-shadow: none; @@ -163,7 +166,7 @@ .layers-message-title { max-width: 100%; margin-bottom: 5px; - font-size: @sidebar-content-font-size; + font-size: @layers-font-tree; font-weight: 600; line-height: 1.35; color: @project-panel-text-1; @@ -185,7 +188,7 @@ background: @layers-accent-soft; color: @project-panel-text-1; font-family: inherit; - font-size: @sidebar-small-font-size; + font-size: @layers-font-size; font-weight: 500; line-height: 1.35; white-space: normal; @@ -239,13 +242,13 @@ display: flex; align-items: center; gap: 2px; - height: 26px; + height: 28px; padding: 0 6px 0 2px; flex-shrink: 0; box-sizing: border-box; cursor: default; user-select: none; - font-size: @sidebar-xs-font-size; + font-size: @layers-font-xs; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; @@ -260,16 +263,16 @@ display: flex; align-items: center; justify-content: center; - width: 18px; - height: 18px; + width: 20px; + height: 20px; flex: none; border-radius: 4px; color: @project-panel-text-2; cursor: pointer; svg { - width: 18px; - height: 18px; + width: 20px; + height: 20px; transition: transform 120ms ease; } @@ -292,7 +295,7 @@ .layers-section-actions { display: flex; align-items: center; - gap: 4px; + gap: 2px; margin-left: auto; flex-shrink: 0; } @@ -324,8 +327,8 @@ opacity: 0; svg { - width: 11px; - height: 11px; + width: 12px; + height: 12px; } } @@ -393,7 +396,7 @@ align-items: center; gap: 6px; width: 100%; - height: 26px; + height: 28px; padding: 0 6px 0 8px; box-sizing: border-box; border: 1px solid @layers-border; @@ -406,8 +409,8 @@ } > svg { - width: 13px; - height: 13px; + width: 14px; + height: 14px; flex: none; color: @project-panel-text-2; } @@ -424,7 +427,7 @@ background: transparent; color: @project-panel-text-1; font-family: inherit; - font-size: @sidebar-small-font-size; + font-size: @layers-font-size; &::placeholder { color: @project-panel-text-2; @@ -437,8 +440,8 @@ display: inline-flex; align-items: center; justify-content: center; - width: 16px; - height: 16px; + width: 18px; + height: 18px; padding: 0; margin: 0; border: none; @@ -450,8 +453,8 @@ flex: none; svg { - width: 11px; - height: 11px; + width: 12px; + height: 12px; display: block; } @@ -469,7 +472,7 @@ padding-bottom: 6px; min-width: min-content; outline: none; - font-size: @sidebar-content-font-size; + font-size: @layers-font-tree; } .layers-sprite { @@ -511,13 +514,16 @@ &.layers-selected { background: @layers-row-select-bg; - box-shadow: inset 2px 0 0 @layers-accent; } &.layers-match { box-shadow: inset 2px 0 0 fade(@layers-accent, 40%); } + &.layers-caret-target { + box-shadow: inset 0 0 0 1px fade(@layers-accent, 55%); + } + &.layers-holds-selected { background: @layers-row-holder-bg; } @@ -561,7 +567,7 @@ border-radius: 6px; background: @layers-input-bg; color: @project-panel-text-1; - font-size: @sidebar-xs-font-size; + font-size: @layers-font-xs; line-height: 1.4; white-space: normal; animation: layers-notice-in 180ms ease-out; @@ -571,15 +577,15 @@ align-items: center; justify-content: center; flex: none; - width: 20px; - height: 20px; + width: 22px; + height: 22px; border-radius: 4px; background: @layers-accent-soft; color: @layers-accent; svg { - width: 12px; - height: 12px; + width: 13px; + height: 13px; display: block; } } @@ -594,15 +600,15 @@ display: flex; align-items: center; justify-content: center; - width: 16px; - height: 16px; + width: 17px; + height: 17px; flex: none; margin-right: 6px; color: @project-panel-text-2; svg { - width: 15px; - height: 15px; + width: 16px; + height: 16px; } } @@ -614,15 +620,15 @@ display: flex; align-items: center; justify-content: center; - width: 15px; - height: 15px; + width: 16px; + height: 16px; flex: none; margin-right: 6px; color: @project-panel-text-2; svg { - width: 15px; - height: 15px; + width: 16px; + height: 16px; display: block; } } @@ -647,8 +653,8 @@ opacity: 0.8; svg { - width: 11px; - height: 11px; + width: 12px; + height: 12px; display: block; } } @@ -670,14 +676,14 @@ margin-top: 1px; svg { - width: 13px; - height: 13px; + width: 14px; + height: 14px; display: block; } } .layers-node.layers-root-node .layers-node-tag { - font-weight: 500; + font-weight: 400; color: @project-panel-text-2; } @@ -700,7 +706,7 @@ .layers-node-tools { display: flex; align-items: center; - gap: 1px; + gap: 2px; position: sticky; right: 0; width: fit-content; @@ -737,7 +743,7 @@ background: @layers-row-select-bg; } - .layers-node.layers-holds-selected:not(:hover) .layers-node-tools { + .layers-node.layers-holds-selected .layers-node-tools { background: @layers-row-holder-bg; } @@ -745,9 +751,9 @@ position: absolute; left: 0; top: 50%; - width: 6px; - height: 18px; - margin-top: -9px; + width: 8px; + height: 24px; + margin-top: -12px; padding: 0; border: none; border-radius: 0 3px 3px 0; @@ -758,7 +764,7 @@ transition: width 100ms ease, background-color 100ms ease; &:hover { - width: 9px; + width: 11px; background: @layers-accent; } } @@ -833,7 +839,7 @@ } } - .layers-decl:not(.layers-editing) .layers-decl-value.layers-decl-numeric { + .layers-decl-value.layers-decl-numeric { cursor: ew-resize; } @@ -846,10 +852,7 @@ } .layers-label { - font-size: 10px; - font-weight: 700; - letter-spacing: 0.04em; - text-transform: uppercase; + font-size: @layers-font-xs; color: @project-panel-text-2; user-select: none; } @@ -858,10 +861,10 @@ display: flex; align-items: center; gap: 6px; - min-height: 24px; + min-height: 26px; .layers-label { - flex: 0 0 44px; + flex: 0 0 48px; } } @@ -887,8 +890,8 @@ padding: 0 5px; color: @project-panel-text-2; font-family: @layers-mono; - font-size: @sidebar-xs-font-size; - line-height: 22px; + font-size: @layers-font-xs; + line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -903,7 +906,7 @@ .layers-attrs-header { display: flex; align-items: center; - min-height: 20px; + min-height: 22px; .layers-label { flex: 1; @@ -929,7 +932,7 @@ display: flex; align-items: center; gap: 4px; - min-height: 24px; + min-height: 26px; .layers-icon-btn { opacity: 0; @@ -943,34 +946,35 @@ .layers-attr-name { flex: 0 1 auto; - min-width: 44px; + min-width: 48px; max-width: 45%; padding-left: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: @layers-mono; - font-size: @sidebar-xs-font-size; + font-size: @layers-font-xs; color: @layers-prop-name; } .layers-attr-row [data-role="name"] { - flex: 0 0 44px; + flex: 0 0 48px; color: @layers-prop-name; } - .layers-decl { + .layers-decl, + .layers-rule-empty { position: relative; display: flex; align-items: center; box-sizing: border-box; min-width: 100%; width: max-content; - min-height: 26px; + min-height: 24px; padding: 0 4px 0 8px; font-family: @layers-mono; - font-size: @sidebar-xs-font-size; - line-height: 22px; + font-size: @layers-font-xs; + line-height: 24px; user-select: none; &:hover { @@ -978,6 +982,21 @@ } } + .layers-rule-empty { + opacity: 0.4; + cursor: text; + + &:hover, + &:focus-visible { + opacity: 0.75; + outline: none; + } + } + + .layers-rule:has(.layers-decl) .layers-rule-empty { + display: none; + } + .layers-decl-name { flex: none; color: @layers-prop-name; @@ -994,8 +1013,45 @@ color: @layers-prop-value; } + .layers-decl-value-wrap { + display: inline-flex; + align-items: center; + flex: none; + gap: 4px; + margin-left: 5px; + + .layers-decl-value { + margin-left: 0; + } + } + + .layers-decl-color { + position: relative; + flex: none; + width: 13px; + height: 13px; + padding: 0; + border: 1px solid rgba(255, 255, 255, 0.25); + border-radius: 2px; + background: repeating-conic-gradient(#999 0% 25%, #fff 0% 50%) 0 0 / 6px 6px; + cursor: pointer; + + &::after { + content: ""; + position: absolute; + inset: 0; + background: var(--layers-color); + } + + &:focus-visible { + outline: 1px solid @layers-accent; + outline-offset: 2px; + } + } + input.layers-decl-input[type="text"] { .layers-field-input(); + user-select: text; flex: none; min-width: 3ch; padding: 0 4px; @@ -1045,10 +1101,56 @@ display: flex; } - .layers-decl.layers-editing .layers-decl-actions { + .layers-decl.layers-editing .layers-decl-actions, + .layers-decl.layers-copied .layers-decl-actions { display: none; } + .layers-decl.layers-menu-target, + .layers-rule-header.layers-menu-target { + background: @layers-hover-bg; + } + + .layers-decl.layers-copied { + animation: layers-flash-row 800ms ease-out; + } + + .layers-rule-header.layers-copied { + border-radius: 3px; + animation: layers-flash-row 800ms ease-out; + } + + .layers-copied-tip { + position: fixed; + z-index: 10; + display: flex; + align-items: center; + gap: 4px; + box-sizing: border-box; + height: 22px; + margin-top: -11px; + padding: 0 8px 0 6px; + border: 1px solid fade(@layers-accent, 55%); + border-radius: 11px; + background: #2a2a2a; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); + color: @project-panel-text-1; + font-size: @layers-font-xs; + white-space: nowrap; + pointer-events: none; + animation: layers-copied-tip 1400ms ease-out forwards; + + .layers-copied-icon { + display: flex; + color: @layers-accent; + + svg { + width: 12px; + height: 12px; + } + } + } + .layers-decl.layers-overridden { .layers-decl-field { text-decoration: line-through; @@ -1085,7 +1187,21 @@ display: flex; align-items: center; gap: 6px; - min-height: 20px; + min-height: 22px; + } + + .layers-rule-header:focus-visible { + outline: 1px solid @layers-accent; + outline-offset: 2px; + } + + .layers-style-notice { + padding: 8px; + margin-bottom: 6px; + border-radius: 4px; + background: @layers-accent-soft; + color: @project-panel-text-1; + font-size: @layers-font-size; } .layers-rule-selector { @@ -1095,7 +1211,8 @@ text-overflow: ellipsis; white-space: nowrap; font-family: @layers-mono; - font-size: @sidebar-xs-font-size; + font-size: @layers-font-xs; + font-weight: 600; color: @project-panel-text-1; } @@ -1105,7 +1222,7 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - font-size: 10px; + font-size: @layers-font-xs; color: @project-panel-text-2; cursor: pointer; @@ -1162,8 +1279,8 @@ background: #2f2f2f; color: @project-panel-text-1; font-family: @layers-mono; - font-size: 11px; - line-height: 15px; + font-size: 12px; + line-height: 16px; white-space: nowrap; pointer-events: none; } @@ -1188,342 +1305,371 @@ body.layers-scrubbing { } .layers-insert-popup { + @layers-insert-accent: @layers-accent; + @layers-insert-scrollbar: #555555; + @layers-insert-scrollbar-hover: #707070; + position: fixed; z-index: 1000; display: flex; flex-direction: column; box-sizing: border-box; - padding: 8px; - border: 1px solid rgba(255, 255, 255, 0.1); - border-radius: 8px; - background: #2a2a2a; - box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.3); + border: 1px solid @layers-border; + border-radius: 3px; + background: @bc-ai-sidebar-bg; + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); color: @project-panel-text-1; - font-size: @sidebar-small-font-size; + color-scheme: dark; + font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; + font-size: 12.5px; + line-height: 1.3; letter-spacing: normal; text-shadow: none; animation: layers-notice-in 90ms ease-out; - .layers-insert-head { - display: flex; - align-items: center; - gap: 8px; - min-height: 24px; - padding: 0 0 8px; - white-space: nowrap; - } + button { + margin: 0; + box-shadow: none; + font: inherit; + text-align: left; - .layers-insert-where { - flex: 1; - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - font-weight: 600; - color: @project-panel-text-1; + &:focus-visible { + outline: 1px solid @layers-insert-accent; + outline-offset: -1px; + } } - .layers-node-icon { + .layers-insert-head { display: flex; align-items: center; - justify-content: center; - width: 15px; - height: 15px; + justify-content: space-between; + gap: 8px; + min-height: 30px; + padding: 0 8px; + background: @layers-input-bg; flex: none; - color: @project-panel-text-2; + } - svg { - width: 15px; - height: 15px; - display: block; - } + .layers-icon-btn { + .layers-icon-button(); + width: 22px; + height: 22px; } .layers-insert-target { display: flex; - flex: 0 1 auto; align-items: center; gap: 4px; - min-width: 40px; - max-width: 38%; - height: 24px; - padding: 0 7px 0 5px; - box-sizing: border-box; - border-radius: 6px; - background: @layers-accent-soft; - color: @project-panel-text-1; - - .layers-node-icon { - width: 14px; - height: 14px; - color: @layers-accent; - - svg { - width: 14px; - height: 14px; - } - } + flex: 0 1 auto; + min-width: 0; } - .layers-insert-target-name { - min-width: 0; + .layers-insert-target-name, + .layers-insert-where { + font-size: 11.5px; + font-weight: 600; overflow: hidden; text-overflow: ellipsis; - font-family: @layers-mono; - font-size: @sidebar-xs-font-size; - font-weight: 500; + white-space: nowrap; } - .layers-insert-positions { - display: flex; - flex: 1 1 auto; - min-width: 0; - gap: 2px; - padding: 2px; - border-radius: 6px; - background: rgba(255, 255, 255, 0.06); + .layers-insert-close { + margin-left: auto; } - .layers-insert-pos { - display: flex; - flex: 1 1 0; - align-items: center; - justify-content: center; - gap: 3px; - min-width: 0; - height: 20px; - padding: 0 4px; + .layers-insert-placement { + position: relative; + flex: none; + max-width: 45%; + } + + .layers-insert-position { + width: auto; + max-width: 100%; + box-sizing: border-box; + height: 24px; margin: 0; - border: none; - border-radius: 4px; - background: transparent; + padding: 2px 24px 2px 7px; + border: 1px solid @layers-border; + border-radius: 3px; + box-shadow: none; + background: @layers-input-bg; color: @project-panel-text-1; - font-family: inherit; - font-size: 10px; - font-weight: 500; - opacity: 0.8; + font: inherit; + font-size: 11.5px; + text-overflow: ellipsis; + appearance: none; cursor: pointer; - outline: none; - - svg { - width: 12px; - height: 12px; - flex: none; - } - span { - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + &:hover { + background: @layers-hover-bg; + border-color: fade(@layers-insert-accent, 40%); } - &:hover { - background: rgba(255, 255, 255, 0.1); - opacity: 1; + &:focus-visible { + outline: 1px solid @layers-insert-accent; + outline-offset: -1px; } - &.layers-active { - background: @layers-accent; - color: #ffffff; - opacity: 1; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); + option { + background: @bc-ai-sidebar-bg; + color: @project-panel-text-1; } + } - &:disabled { - opacity: 0.3; - cursor: default; + .layers-insert-chevron { + position: absolute; + top: 0; + right: 6px; + bottom: 0; + display: flex; + align-items: center; + color: @project-panel-text-2; + pointer-events: none; - &:hover { - background: transparent; - } + svg { + width: 12px; + height: 12px; } } .layers-insert-search { + flex: none; display: flex; align-items: center; - gap: 6px; - height: 26px; - padding: 0 6px 0 8px; - box-sizing: border-box; - border: 1px solid @layers-border; - border-radius: 6px; + position: relative; + margin-bottom: 6px; + } + + .layers-insert-search-icon { + position: absolute; + left: 7px; + display: flex; + align-items: center; + color: @project-panel-text-2; + pointer-events: none; + } + + .layers-insert-search-icon > svg { + width: 13px; + height: 13px; + } + + .layers-insert-search input[type="text"] { + height: auto; + margin: 0; + box-shadow: none; + line-height: 1.3; + width: 100%; background: @layers-input-bg; + border: 1px solid @layers-border; + border-radius: 3px; + color: @project-panel-text-1; + font-size: 12px; + padding: 4px 8px 4px 26px; + outline: none; + font-family: inherit; + box-sizing: border-box; + } - &:focus-within { - border-color: @layers-accent; - background: @layers-input-bg-focus; - } + .layers-insert-search input[type="text"]:focus { + border-color: @layers-insert-accent; + } - > svg { - width: 13px; - height: 13px; - flex: none; - color: @project-panel-text-2; - } + .layers-insert-search.layers-insert-search-connected { + margin-bottom: 0; + } - input[type="text"] { - flex: 1; - min-width: 0; - height: 100%; - padding: 0; - margin: 0; - border: none; - outline: none; - box-shadow: none; - background: transparent; - color: @project-panel-text-1; - font-family: inherit; - font-size: @sidebar-small-font-size; + .layers-insert-search-connected input[type="text"] { + border-radius: 3px 3px 0 0; + } - &::placeholder { - color: @project-panel-text-2; - opacity: 0.75; - } - } + .layers-insert-search input[type="text"]::placeholder { + color: @project-panel-text-2; + } + + .layers-insert-content { + display: flex; + flex-direction: column; + flex: 1; + min-height: 0; + padding: 8px; } .layers-insert-list { - margin: 8px -6px 0 0; - padding: 0; - overflow-y: auto; + flex: 1; + overflow-y: scroll; overflow-x: hidden; + min-height: 0; + scrollbar-width: thin; + scrollbar-color: @layers-insert-scrollbar @bc-ai-sidebar-bg; scrollbar-gutter: stable; + overscroll-behavior: contain; + } - &::-webkit-scrollbar { - width: 6px !important; - background-color: transparent !important; + @supports selector(::-webkit-scrollbar) { + .layers-insert-list { + scrollbar-width: auto; + scrollbar-color: auto; } + } - &::-webkit-scrollbar-thumb { - border-radius: 3px !important; - border: none !important; - background-color: rgba(255, 255, 255, 0.18) !important; - } + .layers-insert-list::-webkit-scrollbar { + width: 6px !important; + height: 6px !important; + background: @bc-ai-sidebar-bg !important; + } + + .layers-insert-list::-webkit-scrollbar-track { + margin: 0 !important; + background: @bc-ai-sidebar-bg !important; + } + + .layers-insert-list::-webkit-scrollbar-thumb { + border: none !important; + border-radius: 3px !important; + background: @layers-insert-scrollbar !important; + background-clip: padding-box !important; + } + + .layers-insert-list::-webkit-scrollbar-thumb:hover { + background: @layers-insert-scrollbar-hover !important; + } + + .layers-insert-list::-webkit-scrollbar-corner { + background: @bc-ai-sidebar-bg !important; } .layers-insert-grid { display: grid; - grid-template-columns: repeat(4, minmax(0, 1fr)); - gap: 4px; + grid-template-columns: 1fr 1fr; + gap: 8px 12px; } - .layers-insert-item { - border-radius: 5px; + .layers-insert-tile { + display: flex; + align-items: center; + gap: 7px; + padding: 6px; + border: 1px solid @layers-border; + border-radius: 3px; cursor: pointer; + min-width: 0; + background: transparent; + transition: + border-color 0.12s, + background 0.12s; + } - &.layers-insert-selected { - background: @layers-accent-strong; - - .layers-node-icon, - .layers-insert-item-tag { - color: @project-panel-text-1; - } - } + .layers-insert-tile:hover { + background: @layers-hover-bg; + border-color: @layers-insert-accent; } - .layers-insert-tile { + .layers-node-icon { display: flex; - flex-direction: column; align-items: center; - justify-content: center; - gap: 3px; + flex-shrink: 0; + color: @project-panel-text-2; + } + + .layers-node-icon > svg { + width: 16px; + height: 16px; + stroke-width: 1.8px; + } + + .layers-insert-item-text { + display: flex; + align-items: baseline; + justify-content: space-between; min-width: 0; - height: 42px; - padding: 0 3px; - box-sizing: border-box; - border: 1px solid @layers-border; - background: rgba(255, 255, 255, 0.03); + overflow: hidden; + flex: 1; + } - .layers-node-icon { - width: 15px; - height: 15px; - color: @project-panel-text-1; + .layers-insert-item-text-inner { + display: inline-flex; + align-items: baseline; + gap: 4px; + white-space: nowrap; + width: 100%; + justify-content: space-between; + } - svg { - width: 15px; - height: 15px; - } - } + .layers-insert-tile:hover .layers-insert-item-text-inner { + animation: layers-insert-text-scroll 2s ease-in-out 0.3s; + } - .layers-insert-item-name { - max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - font-size: 10px; - line-height: 1.2; - } + @keyframes layers-insert-text-scroll { + 0%, 15% { transform: translateX(0); } + 50% { transform: translateX(min(0px, calc(-100% + 140px))); } + 85%, 100% { transform: translateX(0); } + } - &.layers-insert-selected { - border-color: @layers-accent; + .layers-insert-item-name { + font-size: 11.5px; + color: @project-panel-text-1; + white-space: nowrap; + line-height: 1.3; + } - .layers-node-icon { - color: @layers-accent; - } - } + .layers-insert-item-tag { + font-size: 9.5px; + color: @layers-insert-accent; + font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; + line-height: 1.3; } - .layers-insert-more { + .layers-insert-create { display: flex; align-items: center; - justify-content: center; - gap: 4px; - width: 100%; - height: 24px; - margin: 6px 0 0; - padding: 0; - border: none; - border-radius: 4px; - background: transparent; - color: @project-panel-text-2; - font-family: inherit; - font-size: @sidebar-xs-font-size; + gap: 6px; + padding: 5px 8px 5px 26px; cursor: pointer; - outline: none; + border-radius: 0 0 3px 3px; + margin: 0 0 6px; + border: 1px solid @layers-border; + border-top: none; + background: transparent; + flex-shrink: 0; + } - svg { - width: 11px; - height: 11px; - flex: none; - transition: transform 120ms ease; - } + .layers-insert-create:hover { + background: @layers-hover-bg; + } - &.layers-insert-open svg { - transform: rotate(180deg); - } + .layers-insert-empty { + font-size: 11px; + color: @project-panel-text-2; + font-style: italic; + padding: 12px 4px; + text-align: center; + } - &:hover { - background: @layers-hover-bg; - color: @project-panel-text-1; - } + .layers-insert-custom { + flex: none; } .layers-insert-create { - display: flex; - align-items: center; - gap: 7px; - height: 24px; - margin-top: 4px; - padding: 0 6px; - white-space: nowrap; + width: 100%; + box-sizing: border-box; + color: @project-panel-text-2; - .layers-node-icon { - color: @layers-accent; + .layers-node-icon svg { + width: 14px; + height: 14px; } .layers-insert-item-name { - flex: 1; - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - } - } + font-size: 12px; + color: @project-panel-text-2; - .layers-insert-empty { - padding: 8px 6px; - color: @project-panel-text-2; - white-space: normal; + span { + color: @project-panel-text-1; + font-weight: 600; + } + } } } @@ -1540,8 +1686,8 @@ body.layers-scrubbing { background: #2a2a2a; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.3); font-family: @layers-mono; - font-size: @sidebar-xs-font-size; - line-height: 20px; + font-size: @layers-font-xs; + line-height: 22px; animation: layers-notice-in 90ms ease-out; &::-webkit-scrollbar { @@ -1571,7 +1717,7 @@ body.layers-scrubbing { display: flex; align-items: center; gap: 8px; - height: 22px; + height: 24px; padding: 0 8px; border-radius: 4px; color: #d8d8d8; @@ -1655,14 +1801,14 @@ body.layers-dnd-invalid { border-radius: 4px; background: #2f2f2f; color: #e0e0e0; - font-size: 12px; + font-size: 13px; white-space: nowrap; pointer-events: none; opacity: 0.92; svg { - width: 14px; - height: 14px; + width: 15px; + height: 15px; display: block; } @@ -1725,6 +1871,23 @@ body.layers-dnd-invalid { } } +@keyframes layers-copied-tip { + 0% { + opacity: 0; + transform: translateY(4px); + } + + 12%, 80% { + opacity: 1; + transform: none; + } + + 100% { + opacity: 0; + transform: none; + } +} + @keyframes layers-notice-in { 0% { opacity: 0; @@ -1774,3 +1937,101 @@ body.layers-dnd-invalid { animation-duration: 1ms; } } + +.layers-color-popup { + position: fixed; + z-index: 1000; + box-sizing: border-box; + padding: 12px; + overflow: auto; + border: 1px solid @layers-border; + border-radius: 10px; + background: @bc-ai-sidebar-bg; + color: @project-panel-text-1; + box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3); + + .layers-color-head { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 12px; + font-size: @sidebar-small-font-size; + font-weight: 500; + } + + .layers-icon-btn { + .layers-icon-button(); + } + + .color-editor { + min-width: 0; + width: 100%; + height: auto; + padding: 0; + + aside { + display: none; + } + + section { + display: block; + width: 100%; + + .sliders { + display: flex; + align-items: stretch; + } + + .color-selection-field { + flex: 1; + min-width: 0; + width: auto; + margin-right: 12px; + float: none; + } + + .slider { + flex: none; + margin-right: 12px; + float: none; + } + + .opacity-slider { + margin-right: 0; + } + + footer { + display: flex; + align-items: center; + gap: 8px; + padding-top: 12px; + } + + footer input.color-value { + flex: 1; + min-width: 0; + width: 0; + height: 26px; + margin: 0; + padding: 0 6px; + border-color: @layers-border; + background: @layers-input-bg; + color: @project-panel-text-1; + font-family: @layers-mono; + font-size: 11px; + + &:focus { + border-color: @layers-accent; + background: @layers-input-bg-focus; + box-shadow: none; + } + } + } + + ul.button-bar { + flex: none; + margin-left: 0; + white-space: nowrap; + } + } +} diff --git a/tracking-repos.json b/tracking-repos.json index adb9a3a207..8eb59b4fbb 100644 --- a/tracking-repos.json +++ b/tracking-repos.json @@ -1,5 +1,5 @@ { "phoenixPro": { - "commitID": "b73dd3515ed7b32d410ba924d58abfd4a74523ff" + "commitID": "4629664ecb9aadd961c0881fedbeca3eb7669fa3" } }