@homebound/beam 2.169.2 → 2.171.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/README.md CHANGED
@@ -52,3 +52,23 @@ Our proposal for solving this tension is to adopt a radically different model th
52
52
  "Adopters" of Beam should of course contribute back bug fixes and feature improvements; but they should also feel free (and encouraged) to run their own company-specific forks, and "customize by changing the source".
53
53
 
54
54
  In this way, Beam should be seen as a place to "copy & paste" start from, rather than a project that will have 1,000s of npm downloads, and 100s of companies all collaborating on getting this _one_ `TextField` implementation to behave in the 101 different ways that they each want.
55
+
56
+ ## Bundling
57
+
58
+ Beam provides both CommonJS and ESM artifacts.
59
+
60
+ The CommonJS artifacts are the output of the TypeScript compiler, are not bundled, and are intended to be used downstream for unit testing i.e. in Jest.
61
+
62
+ The ESM artifacts are from esbuild, and are bundled, and instead to be used for downstream bundling, i.e. in create-react-app/vitejs.
63
+
64
+ In terms of pros/cons of bundling:
65
+
66
+ - Pro: The biggest pro is the `esbuild` also bundles our CSS into `dist/index.css`, which we can refer to using `style: dist/index.css` in our `package.json`.
67
+
68
+ Without this bundled CSS, vitejs was unable to rewrite the `require(./DateField.css)` line, and we were having to patch around it.
69
+
70
+ Granted, a) we really don't use a lot of external file CSS files anyway, and b) we could bundle _just_ our CSS.
71
+
72
+ - Pro: The bundle is already ESM, which should "make life easier" (admittedly kinda vague) for vitejs downstream.
73
+
74
+ - (Non-con): I'd thought that a single `index.mjs` would not get tree-shaken, but shaking happens at the `export`-d symbol level and not a file level, so we should be fine.
@@ -23,7 +23,7 @@ function Menu(props) {
23
23
  }, [tree]);
24
24
  const state = (0, react_stately_1.useTreeState)({ children: menuChildren, items: tree.items.map((i) => i.value), selectionMode: "none" });
25
25
  const menuRef = (0, react_1.useRef)(null);
26
- const { menuProps } = (0, react_aria_1.useMenu)({ ...ariaMenuProps, children: menuChildren, autoFocus: true }, state, menuRef);
26
+ const { menuProps } = (0, react_aria_1.useMenu)({ ...ariaMenuProps, autoFocus: true }, state, menuRef);
27
27
  const tid = (0, utils_1.useTestIds)(props);
28
28
  // Bulk updates of MenuItems below. If we find this to be of sluggish performance, then we can change to be more surgical in our updating.
29
29
  // If our list of items change, update the "items" menu section. (key is based on label in `getKey` above)
@@ -27,7 +27,13 @@ function MenuItemImpl(props) {
27
27
  if (typeof onClick === "string") {
28
28
  // if it is an absolute URL, then open in new window. Assuming this should leave the App
29
29
  if ((0, utils_1.isAbsoluteUrl)(onClick)) {
30
- window.open(onClick, "_blank", "noopener,noreferrer");
30
+ // We want to do `window.open(url, "_blank", "noopener,noreferrer")` but that Safari treats
31
+ // that as "open in new window", this happens when safari has the "Open pages in tabs instead of windows" set to "Automatically" (which is the default)
32
+ // see https://support.apple.com/guide/safari/tabs-ibrw1045/mac (Open pages in tabs instead of windows) for other behaviors
33
+ //
34
+ // So we do this instead, and at least null out the opener
35
+ // as a way to manually mimic the `"noopener"` flag.
36
+ window.open(onClick, "_blank").opener = null;
31
37
  return;
32
38
  }
33
39
  // Otherwise, it is a relative URL and we'll assume it is still within the App.
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.169.2",
3
+ "version": "2.171.0",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
+ "module": "dist/index.mjs",
8
+ "style": "dist/index.css",
7
9
  "typings": "dist/index.d.ts",
10
+ "sideEffects": false,
8
11
  "repository": {
9
12
  "type": "git",
10
13
  "url": "https://github.com/homebound-team/beam"
@@ -14,9 +17,6 @@
14
17
  "!dist/**/*.{stories,test}.*",
15
18
  "!dist/setupTests.*"
16
19
  ],
17
- "engines": {
18
- "node": ">=16.4.0"
19
- },
20
20
  "scripts": {
21
21
  "start": "yarn storybook",
22
22
  "build": "yarn copy && ttsc",
@@ -32,9 +32,9 @@
32
32
  "format": "prettier --loglevel warn --write \"**/*.{ts,tsx,css,md}\""
33
33
  },
34
34
  "dependencies": {
35
- "@homebound/form-state": "^2.15.2",
35
+ "@homebound/form-state": "^2.15.3",
36
36
  "@internationalized/number": "^3.0.3",
37
- "@react-aria/utils": "^3.11.3",
37
+ "@react-aria/utils": "^3.13.2",
38
38
  "@react-hook/resize-observer": "^1.2.2",
39
39
  "change-case": "^4.1.2",
40
40
  "date-fns": "^2.28.0",
@@ -42,12 +42,12 @@
42
42
  "fast-deep-equal": "^3.1.3",
43
43
  "framer-motion": "^4.1.11",
44
44
  "memoize-one": "^5.2.1",
45
- "react-aria": "^3.14.1",
46
- "react-day-picker": "^8.0.7",
45
+ "react-aria": "^3.18.0",
46
+ "react-day-picker": "8.0.7",
47
47
  "react-popper": "^2.2.5",
48
48
  "react-router": "^5.2.0",
49
49
  "react-router-dom": "^5.2.0",
50
- "react-stately": "^3.12.2",
50
+ "react-stately": "^3.16.0",
51
51
  "react-virtuoso": "2.10.2",
52
52
  "tributejs": "^5.1.3",
53
53
  "trix": "^1.3.1",
@@ -80,14 +80,15 @@
80
80
  "@homebound/rtl-utils": "^2.59.3",
81
81
  "@homebound/truss": "^1.113.0",
82
82
  "@homebound/tsconfig": "^1.0.3",
83
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
83
84
  "@semantic-release/exec": "^6.0.3",
84
85
  "@semantic-release/git": "^9.0.0",
85
- "@storybook/addon-essentials": "^6.4.9",
86
- "@storybook/addon-interactions": "^6.4.9",
87
- "@storybook/addon-links": "^6.4.9",
88
- "@storybook/addons": "^6.4.9",
89
- "@storybook/react": "^6.4.9",
90
- "@storybook/testing-library": "^0.0.7",
86
+ "@storybook/addon-essentials": "^6.5.10",
87
+ "@storybook/addon-interactions": "^6.5.10",
88
+ "@storybook/addon-links": "^6.5.10",
89
+ "@storybook/addons": "^6.5.10",
90
+ "@storybook/react": "^6.5.10",
91
+ "@storybook/testing-library": "^0.0.13",
91
92
  "@testing-library/jest-dom": "^5.11.9",
92
93
  "@testing-library/react-hooks": "^7.0.1",
93
94
  "@tsconfig/recommended": "^1.0.1",
@@ -104,6 +105,7 @@
104
105
  "babel-loader": "^8.2.2",
105
106
  "chromatic": "^5.9.2",
106
107
  "conventional-changelog-conventionalcommits": "^4.5.0",
108
+ "esbuild": "^0.15.5",
107
109
  "eslint": "^7.21.0",
108
110
  "eslint-config-prettier": "^8.1.0",
109
111
  "eslint-config-react-app": "^6.0.0",
@@ -112,6 +114,7 @@
112
114
  "eslint-plugin-jsx-a11y": "^6.4.1",
113
115
  "eslint-plugin-react": "^7.22.0",
114
116
  "eslint-plugin-react-hooks": "^4.2.0",
117
+ "eslint-plugin-storybook": "^0.6.4",
115
118
  "husky": "^5.1.1",
116
119
  "identity-obj-proxy": "^3.0.0",
117
120
  "jest": "^26.6.3",
@@ -132,7 +135,6 @@
132
135
  "ttypescript": "^1.5.12",
133
136
  "typescript": "^4.4.2",
134
137
  "typescript-transform-paths": "^3.2.1",
135
- "watch": "^1.0.2",
136
- "xstate": "^4.23.0"
138
+ "watch": "^1.0.2"
137
139
  }
138
140
  }