@seamly/web-ui 25.4.0 → 25.5.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamly/web-ui",
3
- "version": "25.4.0",
3
+ "version": "25.5.0",
4
4
  "main": "build/dist/lib/index.js",
5
5
  "types": "build/src/javascripts/index.d.ts",
6
6
  "exports": {
@@ -23,8 +23,8 @@
23
23
  "dependencies": {
24
24
  "@reduxjs/toolkit": "^2.11.2",
25
25
  "@ultraq/icu-message-formatter": "^0.15.2",
26
- "core-js": "^3.48.0",
27
- "focus-trap": "^7.6.6",
26
+ "core-js": "^3.49.0",
27
+ "focus-trap": "^7.8.0",
28
28
  "include-media": "^2.0.0",
29
29
  "js-cookie": "^3.0.5",
30
30
  "minivents": "^2.2.1",
@@ -32,11 +32,11 @@
32
32
  "reconnecting-websocket": "^4.4.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@babel/core": "^7.28.5",
36
- "@babel/preset-env": "^7.28.5",
35
+ "@babel/core": "^7.29.0",
36
+ "@babel/preset-env": "^7.29.3",
37
37
  "@babel/preset-react": "^7.28.5",
38
38
  "@babel/preset-typescript": "^7.28.5",
39
- "@playwright/test": "^1.58.2",
39
+ "@playwright/test": "^1.59.1",
40
40
  "@seamly/doc-site": "^4.1.1",
41
41
  "@seamly/eslint-config": "^4.0.0",
42
42
  "@seamly/prettier-config": "^3.2.0",
@@ -45,28 +45,29 @@
45
45
  "@testing-library/preact": "^3.2.4",
46
46
  "@types/core-js": "^2.5.8",
47
47
  "@types/jest": "^30.0.0",
48
- "babel-jest": "^30.2.0",
49
- "babel-loader": "^10.1.0",
48
+ "@types/node": "^25.6.0",
49
+ "babel-jest": "30.3.0",
50
+ "babel-loader": "^10.1.1",
50
51
  "copy-webpack-plugin": "^14.0.0",
51
52
  "eslint": "^9.39.4",
52
53
  "file-loader": "^6.2.0",
53
54
  "fork-ts-checker-webpack-plugin": "^9.1.0",
54
55
  "husky": "^9.1.7",
55
- "jest": "^30.2.0",
56
- "jest-environment-jsdom": "^30.2.0",
56
+ "jest": "^30.3.0",
57
+ "jest-environment-jsdom": "^30.3.0",
57
58
  "jest-watch-typeahead": "^3.0.1",
58
59
  "nyc": "^18.0.0",
59
60
  "openapi-typescript": "6.7.6",
60
61
  "playwright-test-coverage": "^1.2.12",
61
- "postcss": "^8.5.8",
62
- "preact": "^10.28.4",
63
- "prettier": "^3.8.1",
62
+ "postcss": "^8.5.13",
63
+ "preact": "^10.29.1",
64
+ "prettier": "^3.8.3",
64
65
  "rimraf": "^6.1.3",
65
66
  "style-loader": "^4.0.0",
66
- "stylelint": "^17.4.0",
67
- "typescript": "^5.9.3",
68
- "webpack": "^5.105.4",
69
- "webpack-cli": "^6.0.1",
67
+ "stylelint": "^17.10.0",
68
+ "typescript": "^6.0.3",
69
+ "webpack": "^5.106.2",
70
+ "webpack-cli": "^7.0.2",
70
71
  "webpack-dev-server": "^5.2.3",
71
72
  "webpack-merge": "^6.0.1"
72
73
  },
@@ -76,15 +77,15 @@
76
77
  "undici": "^7.22.0"
77
78
  },
78
79
  "peerDependencies": {
79
- "preact": "^10.28.0"
80
+ "preact": "^10.29.1"
80
81
  },
81
82
  "scripts": {
82
83
  "build:clean": "rimraf build; mkdir -p build",
83
- "build:package": "yarn build:clean && webpack --node-env=production --env build=package",
84
- "build:site": "yarn build:clean && webpack --node-env=production --env build=site",
85
- "build": "yarn build:clean && webpack --node-env=production",
86
- "server": "webpack serve --node-env=development",
87
- "server:test": "webpack serve --node-env=development --env build=test",
84
+ "build:package": "yarn build:clean && webpack --config-node-env=production --env build=package",
85
+ "build:site": "yarn build:clean && webpack --config-node-env=production --env build=site",
86
+ "build": "yarn build:clean && webpack --config-node-env=production",
87
+ "server": "webpack serve --config-node-env=development",
88
+ "server:test": "webpack serve --config-node-env=development --env build=test",
88
89
  "lint:scss": "NODE_OPTIONS=--no-deprecation stylelint \"src/stylesheets/**/*.scss\" --formatter=verbose",
89
90
  "lint:js": "yarn run check:eslint && yarn run check:code",
90
91
  "lint": "yarn run lint:js && yarn run lint:scss && yarn check:prettier",
@@ -107,5 +108,5 @@
107
108
  "test:e2e:coverage": "yarn nyc report --reporter cobertura --reporter html",
108
109
  "prepare": "husky"
109
110
  },
110
- "packageManager": "yarn@4.12.0"
111
+ "packageManager": "yarn@4.13.0"
111
112
  }
@@ -55,7 +55,19 @@ export const setVisibility = createAsyncThunk<
55
55
  }
56
56
  }
57
57
 
58
+ const visibility = (api.store.get(StoreKey) || {}) as Record<
59
+ string,
60
+ VisibilityOptions | boolean | null | undefined
61
+ >
62
+
58
63
  if (previousVisibility === calculatedVisibility) {
64
+ api.store.set(StoreKey, {
65
+ ...visibility,
66
+ [layoutMode]: requestedVisibility,
67
+ ...(typeof showPreChat !== 'undefined' ? { showPreChat } : {}),
68
+ ...(typeof showContinueChat !== 'undefined' ? { showContinueChat } : {}),
69
+ })
70
+
59
71
  return {
60
72
  visibility: null,
61
73
  setInputFocus: args.setInputFocus,
@@ -64,12 +76,12 @@ export const setVisibility = createAsyncThunk<
64
76
  }
65
77
  }
66
78
 
67
- const visibility = api.store.get(StoreKey) as object | undefined
68
-
69
79
  // Store the user-requested visibility in order to reinitialize after refresh
70
80
  api.store.set(StoreKey, {
71
- ...(visibility || {}),
81
+ ...visibility,
72
82
  [layoutMode]: requestedVisibility,
83
+ ...(typeof showPreChat !== 'undefined' ? { showPreChat } : {}),
84
+ ...(typeof showContinueChat !== 'undefined' ? { showContinueChat } : {}),
73
85
  })
74
86
  if (requestedVisibility) {
75
87
  eventBus.emit('ui.visible', requestedVisibility, {
@@ -94,10 +106,39 @@ export const initializeVisibility = createAsyncThunk<any, void, ThunkAPI>(
94
106
  // initialize stored visibility
95
107
  const { layoutMode } = ConfigSelectors.selectConfig(getState())
96
108
 
97
- const storedVisibility =
98
- api.store.get(StoreKey)?.[layoutMode] || visibilityStates.initialize
109
+ const storedVisibilitySettings = (api.store.get(StoreKey) || {}) as Record<
110
+ string,
111
+ VisibilityOptions | boolean | null | undefined
112
+ >
113
+ const storedVisibilityValue = storedVisibilitySettings[layoutMode]
99
114
 
100
- dispatch(setVisibility({ visibility: storedVisibility }))
115
+ const storedVisibility = isPersistedVisibilityState(storedVisibilityValue)
116
+ ? storedVisibilityValue
117
+ : visibilityStates.initialize
118
+
119
+ const storedShowPreChat = storedVisibilitySettings.showPreChat
120
+ const storedShowContinueChat = storedVisibilitySettings.showContinueChat
121
+
122
+ dispatch(
123
+ setVisibility({
124
+ visibility: storedVisibility,
125
+ showPreChat:
126
+ typeof storedShowPreChat === 'boolean'
127
+ ? storedShowPreChat
128
+ : undefined,
129
+ showContinueChat:
130
+ typeof storedShowContinueChat === 'boolean'
131
+ ? storedShowContinueChat
132
+ : undefined,
133
+ }),
134
+ )
101
135
  return storedVisibility
102
136
  },
103
137
  )
138
+
139
+ const isPersistedVisibilityState = (
140
+ value: VisibilityOptions | boolean | undefined,
141
+ ): value is (typeof validVisibilityStates)[number] =>
142
+ value === visibilityStates.open ||
143
+ value === visibilityStates.minimized ||
144
+ value === visibilityStates.hidden
@@ -1,5 +1,5 @@
1
1
  if (process.env.NODE_ENV === 'development') {
2
- module.exports = require('preact/debug')
3
- } else {
4
- module.exports = null
2
+ require('preact/debug')
5
3
  }
4
+
5
+ export {}
@@ -86,6 +86,9 @@ const StyleGuideApp = ({
86
86
  ...config,
87
87
  showDisclaimer:
88
88
  bareState.config.showDisclaimer || config.showDisclaimer,
89
+ useMultilineUserInput:
90
+ bareState.config.useMultilineUserInput ??
91
+ config.useMultilineUserInput,
89
92
  context: {
90
93
  ...config.context,
91
94
  ...bareState.config?.context,
@@ -14,6 +14,7 @@ const baseState = {
14
14
  hideOnNoUserResponse: false,
15
15
  showDisclaimer: false,
16
16
  showSuggestions: true,
17
+ useMultilineUserInput: false,
17
18
  preChat: true,
18
19
  },
19
20
  context: {},