playroom 0.34.0 → 0.34.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # playroom
2
2
 
3
+ ## 0.34.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 88bd204: Fix `playroom build` by making favicon path relative to webpack config
8
+
9
+ ## 0.34.1
10
+
11
+ ### Patch Changes
12
+
13
+ - e3b820b: Add favicon to Playroom site.
14
+ - 4fb69cb: Improve affordance of error marker detail
15
+
3
16
  ## 0.34.0
4
17
 
5
18
  ### Minor Changes
Binary file
Binary file
@@ -141,6 +141,10 @@ module.exports = async (playroomConfig, options) => {
141
141
  include: path.dirname(require.resolve('codemirror/package.json')),
142
142
  use: [MiniCssExtractPlugin.loader, require.resolve('css-loader')],
143
143
  },
144
+ {
145
+ test: /\.png$/i,
146
+ type: 'asset/resource',
147
+ },
144
148
  ],
145
149
  },
146
150
  optimization: {
@@ -163,6 +167,7 @@ module.exports = async (playroomConfig, options) => {
163
167
  chunksSortMode: 'none',
164
168
  chunks: ['index'],
165
169
  filename: 'index.html',
170
+ favicon: path.join(__dirname, '../images/favicon.png'),
166
171
  base: playroomConfig.baseUrl,
167
172
  }),
168
173
  new HtmlWebpackPlugin({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playroom",
3
- "version": "0.34.0",
3
+ "version": "0.34.2",
4
4
  "description": "Design with code, powered by your own component library",
5
5
  "main": "utils/index.js",
6
6
  "types": "utils/index.d.ts",
@@ -23,6 +23,9 @@ export const errorMarker = style([
23
23
  opacity: 0,
24
24
  }),
25
25
  {
26
+ ':hover': {
27
+ cursor: 'help',
28
+ },
26
29
  backgroundColor: colorPaletteVars.background.critical,
27
30
  color: colorPaletteVars.foreground.critical,
28
31
  minWidth: minimumLineNumberWidth,
package/src/index.js CHANGED
@@ -2,6 +2,8 @@ import { renderElement } from './render';
2
2
  import Playroom from './Playroom/Playroom';
3
3
  import { StoreProvider } from './StoreContext/StoreContext';
4
4
  import playroomConfig from './config';
5
+ import faviconPath from '../images/favicon.png';
6
+ import faviconInvertedPath from '../images/favicon-inverted.png';
5
7
 
6
8
  const polyfillIntersectionObserver = () =>
7
9
  typeof window.IntersectionObserver !== 'undefined'
@@ -14,6 +16,15 @@ polyfillIntersectionObserver().then(() => {
14
16
  const outlet = document.createElement('div');
15
17
  document.body.appendChild(outlet);
16
18
 
19
+ const selectedElement = document.head.querySelector('link[rel="icon"]');
20
+ const favicon = window.matchMedia('(prefers-color-scheme: dark)').matches
21
+ ? faviconInvertedPath
22
+ : faviconPath;
23
+
24
+ if (selectedElement) {
25
+ selectedElement.setAttribute('href', favicon);
26
+ }
27
+
17
28
  const renderPlayroom = ({
18
29
  themes = require('./themes'),
19
30
  components = require('./components'),