@industry-theme/xterm-terminal-panel 0.2.7 → 0.2.8

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
@@ -1698,6 +1698,7 @@ var TabbedTerminalPanelInner = ({
1698
1698
  const customTabsKey = React2.useMemo(() => {
1699
1699
  return initialTabs.filter((tab) => tab.contentType !== "terminal").map((tab) => tab.id).sort().join(",");
1700
1700
  }, [initialTabs]);
1701
+ const tabToActivateRef = useRef3(null);
1701
1702
  useEffect4(() => {
1702
1703
  const customTabsFromProp = initialTabs.filter((tab) => tab.contentType !== "terminal");
1703
1704
  setOwnedTabs((prevTabs) => {
@@ -1718,11 +1719,17 @@ var TabbedTerminalPanelInner = ({
1718
1719
  const newlyAddedTabs = customTabsFromProp.filter((tab) => !prevCustomTabIds.has(tab.id));
1719
1720
  if (newlyAddedTabs.length > 0) {
1720
1721
  const newTabToActivate = newlyAddedTabs[newlyAddedTabs.length - 1];
1721
- setActiveTabId(newTabToActivate.id);
1722
+ tabToActivateRef.current = newTabToActivate.id;
1722
1723
  }
1723
1724
  return mergedTabs;
1724
1725
  });
1725
1726
  }, [customTabsKey]);
1727
+ useEffect4(() => {
1728
+ if (tabToActivateRef.current) {
1729
+ setActiveTabId(tabToActivateRef.current);
1730
+ tabToActivateRef.current = null;
1731
+ }
1732
+ }, [customTabsKey]);
1726
1733
  const getOwnedTabLabel = useCallback2((index, _directory) => {
1727
1734
  if (tabLabelPrefix) {
1728
1735
  return `${tabLabelPrefix} ${index + 1}`;
@@ -1 +1 @@
1
- {"version":3,"file":"TabbedTerminalPanel.d.ts","sourceRoot":"","sources":["../../../src/panels/TabbedTerminalPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,KAKN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EAIZ,MAAM,gBAAgB,CAAC;AAyBxB,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AA8kCD,eAAO,MAAM,mBAAmB,EAAkC,CAAC,IAAI,SAAS,OAAO,cAAc,EAAE,OAAO,GAAG,WAAW,EAC1H,KAAK,EAAE,wBAAwB,CAAC,IAAI,CAAC,KAClC,KAAK,CAAC,YAAY,CAAC"}
1
+ {"version":3,"file":"TabbedTerminalPanel.d.ts","sourceRoot":"","sources":["../../../src/panels/TabbedTerminalPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,KAKN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EAIZ,MAAM,gBAAgB,CAAC;AAyBxB,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAylCD,eAAO,MAAM,mBAAmB,EAAkC,CAAC,IAAI,SAAS,OAAO,cAAc,EAAE,OAAO,GAAG,WAAW,EAC1H,KAAK,EAAE,wBAAwB,CAAC,IAAI,CAAC,KAClC,KAAK,CAAC,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@industry-theme/xterm-terminal-panel",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Industry-themed xterm.js terminal components with panel framework integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",