@coding-script/script-engine 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,6 +41,9 @@ function ensureScrollbarStyle() {
41
41
  .${SCROLL_CLASS}::-webkit-scrollbar-track { background: transparent; }
42
42
  body.se-panel-resizing { cursor: col-resize !important; user-select: none !important; }
43
43
  body.se-panel-resizing * { cursor: col-resize !important; user-select: none !important; }
44
+ .se-desc-tip p { margin: 0 0 4px 0; }
45
+ .se-desc-tip p:last-child { margin-bottom: 0; }
46
+ .se-desc-tip code { font-family: Menlo, Consolas, monospace; font-size: 11px; }
44
47
  `;
45
48
  document.head.appendChild(style);
46
49
  }
@@ -2,7 +2,7 @@ import react, { useCallback, useEffect, useRef, useState } from "react";
2
2
  import { ToolbarButton } from "./toolbar-button.js";
3
3
  import { FormatIcon } from "./format-icon.js";
4
4
  import { MaximizeIcon, MinimizeIcon } from "./fullscreen-icon.js";
5
- import { themes } from "./theme-colors.js";
5
+ import { ensureScrollbarStyle, themes } from "./theme-colors.js";
6
6
  const HammerIcon = ({ color })=>/*#__PURE__*/ react.createElement("svg", {
7
7
  width: "14",
8
8
  height: "14",
@@ -93,6 +93,7 @@ const Toolbar = ({ title, theme, onThemeChange, enableThemeToggle, enableFormat,
93
93
  }, []);
94
94
  useEffect(()=>{
95
95
  if (!showDesc) return;
96
+ ensureScrollbarStyle();
96
97
  updateTipPos();
97
98
  window.addEventListener('scroll', updateTipPos, true);
98
99
  window.addEventListener('resize', updateTipPos);
@@ -207,6 +208,7 @@ const Toolbar = ({ title, theme, onThemeChange, enableThemeToggle, enableFormat,
207
208
  onClick: item.onClick
208
209
  })), toolbarExtra, showDesc && tipPos && descHtml && /*#__PURE__*/ react.createElement("div", {
209
210
  ref: tipRef,
211
+ className: "se-desc-tip",
210
212
  style: {
211
213
  position: 'fixed',
212
214
  top: tipPos.top,
@@ -220,7 +222,7 @@ const Toolbar = ({ title, theme, onThemeChange, enableThemeToggle, enableFormat,
220
222
  borderRadius: 6,
221
223
  color: colors.text,
222
224
  fontSize: 12,
223
- lineHeight: 1.65,
225
+ lineHeight: 1.5,
224
226
  wordBreak: 'break-word',
225
227
  zIndex: 9999,
226
228
  boxShadow: '0 4px 16px rgba(0,0,0,0.3)',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coding-script/script-engine",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "script-engine components",
5
5
  "keywords": [
6
6
  "coding-script",