@linzjs/windows 4.1.3 → 5.0.1

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.
Files changed (41) hide show
  1. package/dist/LuiModalAsync/LuiModalAsync.scss +1 -1
  2. package/dist/LuiModalAsync/LuiModalAsync.tsx +17 -13
  3. package/dist/LuiModalAsync/LuiModalAsyncButtonGroup.tsx +12 -12
  4. package/dist/LuiModalAsync/LuiModalAsyncContent.tsx +2 -2
  5. package/dist/LuiModalAsync/LuiModalAsyncContext.tsx +10 -7
  6. package/dist/LuiModalAsync/LuiModalAsyncContextProvider.tsx +25 -16
  7. package/dist/LuiModalAsync/LuiModalAsyncHeader.tsx +18 -18
  8. package/dist/LuiModalAsync/LuiModalAsyncInstanceContext.ts +3 -2
  9. package/dist/LuiModalAsync/LuiModalAsyncMain.tsx +2 -2
  10. package/dist/LuiModalAsync/index.ts +10 -10
  11. package/dist/LuiModalAsync/useLuiModalPrefab.tsx +50 -49
  12. package/dist/LuiModalAsync/useShowAsyncModal.ts +6 -4
  13. package/dist/common/index.ts +1 -1
  14. package/dist/common/useConstFunction.ts +1 -1
  15. package/dist/index.ts +4 -4
  16. package/dist/panel/OpenPanelButton.tsx +4 -3
  17. package/dist/panel/OpenPanelIcon.scss +3 -4
  18. package/dist/panel/OpenPanelIcon.tsx +12 -12
  19. package/dist/panel/Panel.scss +6 -6
  20. package/dist/panel/Panel.tsx +18 -17
  21. package/dist/panel/PanelBlue.scss +3 -3
  22. package/dist/panel/PanelContext.ts +4 -3
  23. package/dist/panel/PanelDock.tsx +6 -5
  24. package/dist/panel/PanelHeader.tsx +25 -25
  25. package/dist/panel/PanelHeaderButton.tsx +8 -8
  26. package/dist/panel/PanelInstanceContext.ts +5 -5
  27. package/dist/panel/PanelInstanceContextProvider.tsx +6 -5
  28. package/dist/panel/PanelsContext.tsx +5 -4
  29. package/dist/panel/PanelsContextProvider.tsx +12 -11
  30. package/dist/panel/PopinWIndow.tsx +23 -22
  31. package/dist/panel/PopoutWindow.tsx +18 -17
  32. package/dist/panel/generateId.ts +12 -12
  33. package/dist/panel/handleStyleSheetsChanges.ts +7 -7
  34. package/dist/panel/index.ts +12 -13
  35. package/dist/panel/types/PanelProps.ts +5 -4
  36. package/dist/panel/types/PanelRestoredState.ts +2 -2
  37. package/dist/panel/types/PanelState.ts +3 -3
  38. package/dist/panel/types/PanelStateOptions.ts +3 -3
  39. package/dist/panel/types/index.ts +6 -6
  40. package/dist/panel/usePanelStateHandler.tsx +12 -11
  41. package/package.json +51 -69
@@ -5,18 +5,18 @@
5
5
  export const makePopoutId = (str: string): string =>
6
6
  str
7
7
  .toLowerCase()
8
- .replaceAll(/[^a-z0-9-]/g, "-")
9
- .replaceAll("0", "-zero-")
10
- .replaceAll("1", "-one-")
11
- .replaceAll("2", "-two-")
12
- .replaceAll("3", "-three-")
13
- .replaceAll("4", "-four-")
14
- .replaceAll("5", "-five-")
15
- .replaceAll("6", "-six-")
16
- .replaceAll("7", "-seven-")
17
- .replaceAll("8", "-eight-")
18
- .replaceAll("9", "-nine-")
19
- .replaceAll(/-+/g, "-")
8
+ .replaceAll(/[^a-z0-9-]/g, '-')
9
+ .replaceAll('0', '-zero-')
10
+ .replaceAll('1', '-one-')
11
+ .replaceAll('2', '-two-')
12
+ .replaceAll('3', '-three-')
13
+ .replaceAll('4', '-four-')
14
+ .replaceAll('5', '-five-')
15
+ .replaceAll('6', '-six-')
16
+ .replaceAll('7', '-seven-')
17
+ .replaceAll('8', '-eight-')
18
+ .replaceAll('9', '-nine-')
19
+ .replaceAll(/-+/g, '-')
20
20
  .toLowerCase();
21
21
 
22
22
  export const popoutWindowDivId = (windowTitle: string): string => `popoutWindow-${makePopoutId(windowTitle)}`;
@@ -1,4 +1,4 @@
1
- import { throttle } from "lodash-es";
1
+ import { throttle } from 'lodash-es';
2
2
 
3
3
  // Copy the app's styles into the new window
4
4
  export const copyStyleSheets = (newHeadMountElement: HTMLDivElement) => {
@@ -6,14 +6,14 @@ export const copyStyleSheets = (newHeadMountElement: HTMLDivElement) => {
6
6
 
7
7
  stylesheets.forEach((stylesheet) => {
8
8
  if (stylesheet.href) {
9
- const newStyleElement = document.createElement("link");
10
- newStyleElement.rel = "stylesheet";
9
+ const newStyleElement = document.createElement('link');
10
+ newStyleElement.rel = 'stylesheet';
11
11
  newStyleElement.href = stylesheet.href;
12
12
  newHeadMountElement.appendChild(newStyleElement);
13
13
  } else {
14
- const css = stylesheet as CSSStyleSheet;
14
+ const css = stylesheet;
15
15
  if (css && css.cssRules && css.cssRules.length > 0) {
16
- const newStyleElement = document.createElement("style");
16
+ const newStyleElement = document.createElement('style');
17
17
  Array.from(css.cssRules).forEach((rule) => {
18
18
  newStyleElement.appendChild(document.createTextNode(rule.cssText));
19
19
  });
@@ -30,7 +30,7 @@ export const copyStyleSheets = (newHeadMountElement: HTMLDivElement) => {
30
30
  * @param newHeadMountElement
31
31
  */
32
32
  export const observeStyleSheetChanges = (newHeadMountElement: HTMLDivElement) => {
33
- const targetNode = document.querySelector("head");
33
+ const targetNode = document.querySelector('head');
34
34
 
35
35
  if (!targetNode) {
36
36
  return null;
@@ -46,7 +46,7 @@ export const observeStyleSheetChanges = (newHeadMountElement: HTMLDivElement) =>
46
46
  // Callback function to execute when mutations are observed
47
47
  const callback: MutationCallback = function (mutationList) {
48
48
  for (const mutation of mutationList) {
49
- if (mutation.type === "childList") {
49
+ if (mutation.type === 'childList') {
50
50
  // console.log("A child node has been added or removed.", mutation);
51
51
  //naive way up updating style sheets
52
52
  //the observer tells us what has been added and removed, but syncing the changes with the
@@ -1,13 +1,12 @@
1
- export * from "./types";
2
-
3
- export * from "./OpenPanelButton";
4
- export * from "./OpenPanelIcon";
5
- export * from "./Panel";
6
- export * from "./PanelContext";
7
- export * from "./PanelDock";
8
- export * from "./PanelHeader";
9
- export * from "./PanelHeaderButton";
10
- export * from "./PanelInstanceContext";
11
- export * from "./PanelInstanceContextProvider";
12
- export * from "./PanelsContext";
13
- export * from "./PanelsContextProvider";
1
+ export * from './OpenPanelButton';
2
+ export * from './OpenPanelIcon';
3
+ export * from './Panel';
4
+ export * from './PanelContext';
5
+ export * from './PanelDock';
6
+ export * from './PanelHeader';
7
+ export * from './PanelHeaderButton';
8
+ export * from './PanelInstanceContext';
9
+ export * from './PanelInstanceContextProvider';
10
+ export * from './PanelsContext';
11
+ export * from './PanelsContextProvider';
12
+ export * from './types';
@@ -1,6 +1,7 @@
1
- import { ReactNode } from "react";
2
- import { PanelPosition } from "./PanelPosition";
3
- import { PanelSize } from "./PanelSize";
1
+ import { ReactNode } from 'react';
2
+
3
+ import { PanelPosition } from './PanelPosition';
4
+ import { PanelSize } from './PanelSize';
4
5
 
5
6
  export interface PanelProps {
6
7
  children: ReactNode;
@@ -11,7 +12,7 @@ export interface PanelProps {
11
12
  minWidth?: number | string;
12
13
  modal?: boolean;
13
14
  onClose?: () => void;
14
- position?: PanelPosition | "tile" | "center";
15
+ position?: PanelPosition | 'tile' | 'center';
15
16
  resizeable?: boolean;
16
17
  size?: PanelSize;
17
18
  title: string;
@@ -1,5 +1,5 @@
1
- import { PanelPosition } from "./PanelPosition";
2
- import { PanelSize } from "./PanelSize";
1
+ import { PanelPosition } from './PanelPosition';
2
+ import { PanelSize } from './PanelSize';
3
3
 
4
4
  export interface PanelRestoredState {
5
5
  panelPoppedOut: boolean;
@@ -1,7 +1,7 @@
1
- import { PanelPosition } from "./PanelPosition";
2
- import { PanelSize } from "./PanelSize";
1
+ import { PanelPosition } from './PanelPosition';
2
+ import { PanelSize } from './PanelSize';
3
3
 
4
- export type PanelMode = "poppedIn" | "poppedOut";
4
+ export type PanelMode = 'poppedIn' | 'poppedOut';
5
5
 
6
6
  export interface PanelLayout {
7
7
  panelPosition?: PanelPosition;
@@ -1,7 +1,7 @@
1
- import { PanelRestoredState } from "./PanelRestoredState";
2
- import { PanelState } from "./PanelState";
1
+ import { PanelRestoredState } from './PanelRestoredState';
2
+ import { PanelState } from './PanelState';
3
3
 
4
- export type SaveStateInOption = "external" | "localStorage";
4
+ export type SaveStateInOption = 'external' | 'localStorage';
5
5
 
6
6
  export type PanelStateOptions = {
7
7
  onRestoreState?: () => PanelRestoredState;
@@ -1,6 +1,6 @@
1
- export * from "./PanelPosition";
2
- export * from "./PanelProps";
3
- export * from "./PanelRestoredState";
4
- export * from "./PanelSize";
5
- export * from "./PanelState";
6
- export * from "./PanelStateOptions";
1
+ export * from './PanelPosition';
2
+ export * from './PanelProps';
3
+ export * from './PanelRestoredState';
4
+ export * from './PanelSize';
5
+ export * from './PanelState';
6
+ export * from './PanelStateOptions';
@@ -1,6 +1,7 @@
1
- import { useContext, useMemo } from "react";
2
- import { PanelsContext } from "./PanelsContext";
3
- import { PanelLayout, PanelMode, PanelRestoredState, PanelState } from "./types";
1
+ import { useContext, useMemo } from 'react';
2
+
3
+ import { PanelsContext } from './PanelsContext';
4
+ import { PanelLayout, PanelMode, PanelRestoredState, PanelState } from './types';
4
5
 
5
6
  type HookArgs = {
6
7
  panelPoppedOut?: boolean;
@@ -15,7 +16,7 @@ export const useRestoreStateFrom = ({ panelPoppedOut, uniqueId }: HookArgs) => {
15
16
  return;
16
17
  }
17
18
 
18
- if (panelStateOptions.saveStateIn === "external") {
19
+ if (panelStateOptions.saveStateIn === 'external') {
19
20
  return panelStateOptions.onRestoreState?.();
20
21
  }
21
22
 
@@ -29,16 +30,16 @@ export const useRestoreStateFrom = ({ panelPoppedOut, uniqueId }: HookArgs) => {
29
30
  if (storedState) {
30
31
  const { mode, ...state } = JSON.parse(storedState) as PanelState;
31
32
 
32
- const currentMode: PanelMode = panelPoppedOut === undefined ? mode : panelPoppedOut ? "poppedOut" : "poppedIn";
33
+ const currentMode: PanelMode = panelPoppedOut === undefined ? mode : panelPoppedOut ? 'poppedOut' : 'poppedIn';
33
34
  const panelLayout = state[currentMode];
34
35
 
35
36
  return {
36
- panelPoppedOut: currentMode === "poppedOut",
37
+ panelPoppedOut: currentMode === 'poppedOut',
37
38
  ...panelLayout,
38
39
  };
39
40
  }
40
41
  } catch (e) {
41
- console.error("Failed to read stored panel state!", e);
42
+ console.error('Failed to read stored panel state!', e);
42
43
  }
43
44
 
44
45
  return null;
@@ -57,9 +58,9 @@ export const useSaveStateIn = ({ panelPoppedOut = false, uniqueId }: HookArgs) =
57
58
  uniqueId,
58
59
  });
59
60
 
60
- const mode: PanelMode = panelPoppedOut ? "poppedOut" : "poppedIn";
61
+ const mode: PanelMode = panelPoppedOut ? 'poppedOut' : 'poppedIn';
61
62
 
62
- if (panelStateOptions.saveStateIn === "external") {
63
+ if (panelStateOptions.saveStateIn === 'external') {
63
64
  panelStateOptions.onSaveState?.({
64
65
  mode,
65
66
  [mode]: panelLayout,
@@ -84,14 +85,14 @@ export const useSaveStateIn = ({ panelPoppedOut = false, uniqueId }: HookArgs) =
84
85
  ...panelLayout,
85
86
  };
86
87
  } catch (e) {
87
- console.error("Failed to read existing panel state!", e);
88
+ console.error('Failed to read existing panel state!', e);
88
89
  }
89
90
  }
90
91
 
91
92
  try {
92
93
  localStorage.setItem(uniqueKey, JSON.stringify(panelState));
93
94
  } catch (e) {
94
- console.error("Failed to save panel state!", e);
95
+ console.error('Failed to save panel state!', e);
95
96
  }
96
97
  };
97
98
  };
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "popout"
14
14
  ],
15
15
  "main": "./dist/index.ts",
16
- "version": "4.1.3",
16
+ "version": "5.0.1",
17
17
  "peerDependencies": {
18
18
  "@linzjs/lui": ">=21",
19
19
  "lodash-es": ">=4",
@@ -32,107 +32,89 @@
32
32
  },
33
33
  "scripts": {
34
34
  "build": "run-s clean stylelint lint lint-circular-deps bundle",
35
- "yalc": "run-s clean bundle && yalc publish",
35
+ "yalc": "run-s clean bundle && yalc push",
36
36
  "clean": "rimraf dist && mkdirp ./dist",
37
37
  "bundle": "tsc --noEmit && rollup -c",
38
- "test": "jest",
38
+ "test": "vitest run",
39
+ "test:watch": "vitest --watch",
39
40
  "stylelint": "stylelint src/**/*.scss src/**/*.css --fix",
40
- "lint": "eslint ./src --ext .js,.ts,.tsx --fix --cache --ignore-path .gitignore",
41
+ "lint": "eslint ./src --ext .js,.ts,.tsx --cache --ignore-path .gitignore",
42
+ "lint:fix": "eslint ./src --ext .js,.ts,.tsx --fix --cache --ignore-path .gitignore",
41
43
  "lint-circular-deps": "npx madge --circular --extensions ts,tsx ./",
42
44
  "storybook": "storybook dev -p 6006",
43
45
  "build-storybook": "storybook build",
44
46
  "deploy-storybook": "npx --yes -p @storybook/storybook-deployer storybook-to-ghpages",
45
47
  "chromatic": "chromatic --exit-zero-on-changes",
46
- "semantic-release": "semantic-release"
48
+ "semantic-release": "semantic-release",
49
+ "upgrade": "npx ncu -i --format group"
47
50
  },
48
51
  "dependencies": {
49
- "@emotion/cache": "^11.13.5",
50
- "@emotion/react": "^11.13.5",
51
- "@emotion/styled": "^11.13.5",
52
+ "@emotion/cache": "^11.14.0",
53
+ "@emotion/react": "^11.14.0",
54
+ "@emotion/styled": "^11.14.0",
52
55
  "@types/uuid": "^10.0.0",
53
56
  "lodash-es": ">=4",
54
- "react-rnd": "^10.4.13",
57
+ "react-rnd": "^10.4.14",
55
58
  "usehooks-ts": "^3.1.0",
56
- "uuid": "^11.0.4"
59
+ "uuid": "^11.0.5"
57
60
  },
58
61
  "devDependencies": {
59
- "@chromatic-com/storybook": "^3.2.2",
60
- "@esbuild-plugins/node-globals-polyfill": "^0.2.3",
61
- "@esbuild-plugins/node-modules-polyfill": "^0.2.2",
62
- "@linzjs/lui": "^22.0.1",
63
- "@linzjs/step-ag-grid": "^22.3.0",
64
- "@rollup/plugin-commonjs": "^28.0.1",
62
+ "@chromatic-com/storybook": "^3.2.4",
63
+ "@linzjs/lui": "^22.4.2",
64
+ "@linzjs/step-ag-grid": "^25.0.1",
65
+ "@linzjs/style": "^5.4.0",
66
+ "@rollup/plugin-commonjs": "^28.0.2",
65
67
  "@rollup/plugin-json": "^6.1.0",
66
- "@rollup/plugin-node-resolve": "^15.3.0",
67
- "@storybook/addon-docs": "^8.4.7",
68
- "@storybook/addon-essentials": "^8.4.7",
69
- "@storybook/addon-interactions": "^8.4.7",
70
- "@storybook/addon-links": "^8.4.7",
71
- "@storybook/addon-mdx-gfm": "^8.4.7",
72
- "@storybook/blocks": "^8.4.7",
73
- "@storybook/react": "^8.4.7",
74
- "@storybook/react-vite": "^8.4.7",
75
- "@storybook/test": "^8.4.7",
76
- "@testing-library/jest-dom": "^6.6.3",
77
- "@testing-library/react": "^16.0.1",
78
- "@testing-library/user-event": "^14.5.2",
79
- "@trivago/prettier-plugin-sort-imports": "^4.3.0",
80
- "@types/jest": "^29.5.14",
68
+ "@rollup/plugin-node-resolve": "^15.3.1",
69
+ "@storybook/addon-docs": "^8.5.3",
70
+ "@storybook/addon-essentials": "^8.5.3",
71
+ "@storybook/addon-interactions": "^8.5.3",
72
+ "@storybook/addon-links": "^8.5.3",
73
+ "@storybook/addon-mdx-gfm": "^8.5.3",
74
+ "@storybook/blocks": "^8.5.3",
75
+ "@storybook/react": "^8.5.3",
76
+ "@storybook/react-vite": "^8.5.3",
77
+ "@storybook/test": "^8.5.3",
78
+ "@testing-library/react": "^16.2.0",
79
+ "@testing-library/user-event": "^14.6.1",
81
80
  "@types/lodash-es": "^4.17.12",
82
- "@types/node": "^22.10.1",
83
- "@types/react": "^18.3.12",
84
- "@types/react-dom": "^18.3.1",
85
- "@typescript-eslint/eslint-plugin": "^7.17.0",
86
- "@typescript-eslint/parser": "^7.17.0",
81
+ "@types/node": "^22.13.0",
82
+ "@types/react": "^18.3.18",
83
+ "@types/react-dom": "^18.3.5",
84
+ "@vitejs/plugin-react-swc": "^3.7.2",
85
+ "@vitest/ui": "^3.0.4",
87
86
  "ag-grid-community": "^32.3.3",
88
87
  "ag-grid-react": "^32.3.3",
89
- "esbuild": "^0.24.0",
90
- "eslint": "^8.57.0",
91
- "eslint-config-prettier": "^9.1.0",
92
- "eslint-config-react-app": "^7.0.1",
93
- "eslint-plugin-deprecation": "^3.0.0",
94
- "eslint-plugin-import": "^2.31.0",
95
- "eslint-plugin-jest": "^28.9.0",
96
- "eslint-plugin-jsx-a11y": "^6.10.2",
97
- "eslint-plugin-prettier": "^5.2.1",
98
- "eslint-plugin-react": "^7.37.2",
99
- "eslint-plugin-react-hooks": "^4.6.2",
100
- "eslint-plugin-storybook": "^0.8.0",
101
- "eslint-plugin-testing-library": "^6.3.0",
102
- "jest": "^29.7.0",
103
- "jest-canvas-mock": "^2.5.2",
104
- "jest-environment-jsdom": "^29.7.0",
105
- "jest-expect-message": "^1.1.3",
88
+ "babel-preset-react-app": "^10.0.1",
89
+ "eslint-plugin-react": "^7.37.4",
90
+ "jsdom": "^26.0.0",
106
91
  "mkdirp": "^3.0.1",
107
92
  "npm-run-all": "^4.1.5",
108
- "prettier": "^3.4.1",
109
93
  "react": "^18.3.1",
110
94
  "react-app-polyfill": "^3.0.0",
111
95
  "react-dom": "^18.3.1",
112
- "rollup": "^4.28.0",
96
+ "rollup": "^4.34.0",
113
97
  "rollup-plugin-copy": "^3.5.0",
114
- "sass": "^1.83.0",
98
+ "sass": "^1.83.4",
115
99
  "sass-loader": "^16.0.4",
116
100
  "semantic-release": "^22.0.12",
117
- "storybook": "^8.4.7",
101
+ "storybook": "^8.5.3",
118
102
  "style-loader": "^4.0.0",
119
- "stylelint": "^16.11.0",
103
+ "stylelint": "^16.14.1",
120
104
  "stylelint-config-recommended": "^14.0.1",
121
105
  "stylelint-config-recommended-scss": "^14.1.0",
122
106
  "stylelint-config-standard": "^36.0.1",
123
- "stylelint-prettier": "5.0.2",
124
- "stylelint-scss": "6.10.0",
125
- "typescript": "^5.7.2",
126
- "vite": "^5.4.11"
107
+ "stylelint-prettier": "5.0.3",
108
+ "stylelint-scss": "6.11.0",
109
+ "typescript": "^5.7.3",
110
+ "vite": "^5.4.14",
111
+ "vite-plugin-html": "^3.2.2",
112
+ "vite-tsconfig-paths": "^5.1.4",
113
+ "vitest": "^3.0.4"
127
114
  },
128
115
  "optionalDependencies": {
129
- "@rollup/rollup-linux-x64-gnu": "^4.28.1"
130
- },
131
- "eslintConfig": {
132
- "extends": [
133
- "react-app",
134
- "react-app/jest"
135
- ]
116
+ "@rollup/rollup-linux-x64-gnu": "^4.34.0",
117
+ "@swc/core-linux-x64-gnu": "^1.10.12"
136
118
  },
137
119
  "browserslist": {
138
120
  "production": [