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

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
@@ -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({
@@ -2972,7 +3003,7 @@ var TabbedTerminalPanelInner = ({
2972
3003
  closeTab(activeTabId);
2973
3004
  } : undefined,
2974
3005
  onSwitchToTab: (index) => {
2975
- const tabIndex = index === 8 && tabs.length > 9 ? tabs.length - 1 : index;
3006
+ const tabIndex = index === 8 ? tabs.length - 1 : index;
2976
3007
  if (tabIndex >= 0 && tabIndex < tabs.length) {
2977
3008
  switchTab(tabs[tabIndex].id);
2978
3009
  }
@@ -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.4",
4
4
  "description": "Industry-themed xterm.js terminal components with panel framework integration",
5
5
  "type": "module",
6
6
  "sideEffects": [