@industry-theme/xterm-terminal-panel 0.8.3 → 0.8.5

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.
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  // package.json
37
37
  var package_default = {
38
38
  name: "@industry-theme/xterm-terminal-panel",
39
- version: "0.8.3",
39
+ version: "0.8.4",
40
40
  description: "Industry-themed xterm.js terminal components with panel framework integration",
41
41
  type: "module",
42
42
  sideEffects: [
@@ -790,7 +790,38 @@ var ThemedTerminal = forwardRef(({
790
790
  fontWeight: "normal",
791
791
  fontWeightBold: "bold"
792
792
  });
793
+ const MIN_FONT_SIZE = 6;
794
+ const MAX_FONT_SIZE = 40;
795
+ const defaultFontSize = config.fontSize;
796
+ const applyFontSize = (next) => {
797
+ const clamped = Math.max(MIN_FONT_SIZE, Math.min(MAX_FONT_SIZE, next));
798
+ if (clamped === term.options.fontSize) {
799
+ return;
800
+ }
801
+ term.options.fontSize = clamped;
802
+ fitAddonRef.current?.fit();
803
+ if (isScrollLockedRef.current) {
804
+ requestAnimationFrame(() => term.scrollToBottom());
805
+ }
806
+ };
793
807
  term.attachCustomKeyEventHandler((event) => {
808
+ if (event.type !== "keydown") {
809
+ return true;
810
+ }
811
+ if (event.metaKey || event.ctrlKey) {
812
+ if (event.key === "=" || event.key === "+") {
813
+ applyFontSize((term.options.fontSize ?? defaultFontSize) + 1);
814
+ return false;
815
+ }
816
+ if (event.key === "-") {
817
+ applyFontSize((term.options.fontSize ?? defaultFontSize) - 1);
818
+ return false;
819
+ }
820
+ if (event.key === "0") {
821
+ applyFontSize(defaultFontSize);
822
+ return false;
823
+ }
824
+ }
794
825
  if (event.metaKey && event.shiftKey && event.key.toLowerCase() === "p") {
795
826
  if (onShortcutRef.current) {
796
827
  onShortcutRef.current({
@@ -2161,7 +2192,9 @@ var TabButton = ({
2161
2192
  justifyContent: "center",
2162
2193
  gap: "6px",
2163
2194
  padding: "6px 8px",
2164
- backgroundColor: isActive ? theme.colors.background : theme.colors.backgroundSecondary,
2195
+ backgroundColor: isActive ? theme.colors.background : theme.colors.backgroundDark ?? theme.colors.backgroundSecondary,
2196
+ borderBottom: isActive ? `1px solid ${theme.colors.background}` : "1px solid transparent",
2197
+ marginBottom: isActive ? "-1px" : 0,
2165
2198
  cursor: draggable ? "grab" : "pointer",
2166
2199
  userSelect: "none",
2167
2200
  WebkitUserSelect: "none",
@@ -2316,7 +2349,7 @@ var TabBar = ({
2316
2349
  alignItems: "center",
2317
2350
  flex: 1,
2318
2351
  overflow: "hidden",
2319
- backgroundColor: theme.colors.backgroundSecondary,
2352
+ backgroundColor: theme.colors.backgroundDark ?? theme.colors.backgroundSecondary,
2320
2353
  borderBottom: `1px solid ${theme.colors.border}`,
2321
2354
  boxSizing: "border-box"
2322
2355
  },
@@ -2972,7 +3005,7 @@ var TabbedTerminalPanelInner = ({
2972
3005
  closeTab(activeTabId);
2973
3006
  } : undefined,
2974
3007
  onSwitchToTab: (index) => {
2975
- const tabIndex = index === 8 && tabs.length > 9 ? tabs.length - 1 : index;
3008
+ const tabIndex = index === 8 ? tabs.length - 1 : index;
2976
3009
  if (tabIndex >= 0 && tabIndex < tabs.length) {
2977
3010
  switchTab(tabs[tabIndex].id);
2978
3011
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TabButton.d.ts","sourceRoot":"","sources":["../../../../src/components/TabBar/TabButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQtD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAoP9C,CAAC"}
1
+ {"version":3,"file":"TabButton.d.ts","sourceRoot":"","sources":["../../../../src/components/TabBar/TabButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQtD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA0P9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemedTerminal.d.ts","sourceRoot":"","sources":["../../../src/components/ThemedTerminal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAkC3D,OAAO,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAGV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,8BAA8B,CAAC;AAEtC,MAAM,WAAW,4BAA6B,SAAQ,mBAAmB;IACvE,KAAK,EAAE,KAAK,CAAC;CACd;AAsBD,eAAO,MAAM,cAAc,4HAsxC1B,CAAC"}
1
+ {"version":3,"file":"ThemedTerminal.d.ts","sourceRoot":"","sources":["../../../src/components/ThemedTerminal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAkC3D,OAAO,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAGV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,8BAA8B,CAAC;AAEtC,MAAM,WAAW,4BAA6B,SAAQ,mBAAmB;IACvE,KAAK,EAAE,KAAK,CAAC;CACd;AAsBD,eAAO,MAAM,cAAc,4HAg0C1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@industry-theme/xterm-terminal-panel",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "Industry-themed xterm.js terminal components with panel framework integration",
5
5
  "type": "module",
6
6
  "sideEffects": [