@guardian/stand 0.0.3 → 0.0.5

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
@@ -17,3 +17,40 @@ Stand is component library for Guardian editorial tools. It is co-located within
17
17
  ## Contributing
18
18
 
19
19
  See the [Contributing to Stand](./CONTRIBUTING.md) documentation
20
+
21
+ ## Compatibility
22
+
23
+ See the package.json `peerDependencies` section for compatible versions of React and other dependencies that Stand works with.
24
+
25
+ Version sets for matrix testing live in `./scripts/deps-matrix-versions.json`:
26
+
27
+ The test script `./scripts/test-deps-matrix.sh` reads this JSON file first, then applies any environment overrides you supply. Precedence is:
28
+
29
+ 1. Explicit env var (e.g. `REACT_VERSIONS="18.0.0 19.0.0"`)
30
+ 2. Value from `deps-matrix-versions.json`
31
+
32
+ All three variables (`REACT_VERSIONS`, `EMOTION_VERSIONS`, `TS_VERSIONS`) must be defined after loading; otherwise the script exits with an error.
33
+
34
+ Matrix generation in CI uses the same JSON file in the workflow: `../.github/workflows/stand-component-library-deps-matrix.yml` to ensure consistency.
35
+
36
+ ### Updating Supported Versions
37
+
38
+ 1. Edit `./scripts/deps-matrix-versions.json` with new versions
39
+ 2. Run the matrix test locally:
40
+ ```bash
41
+ ./scripts/test-deps-matrix.sh
42
+ ```
43
+ 3. (Optional) Narrow the matrix with overrides:
44
+ ```bash
45
+ REACT_VERSIONS="18.0.0" EMOTION_VERSIONS="11.14.0" TS_VERSIONS="5.1" ./scripts/test-deps-matrix.sh
46
+ ```
47
+ 4. Review results (table output and any failures). Fix issues or adjust code
48
+ 5. Update `peerDependencies` in `package.json` to reflect the new minimum / tested range
49
+ 6. Open a PR, the CI pipeline will comment with the compatibility matrix
50
+
51
+ ### Tips
52
+
53
+ - Keep versions in ascending order for readability
54
+ - Remove deprecated versions only after confirming no downstream tool depends on them
55
+ - Add a new version first, then run the matrix, then adjust `peerDependencies` once green
56
+ - Changes to `peerDependencies` are always a breaking change to the library, as per our [recommendations](https://github.com/guardian/recommendations/blob/main/npm-packages.md#changes-to-peerdependencies-ranges-are-breaking)
@@ -291,7 +291,14 @@ const Byline = ({
291
291
  allowUntaggedContributors
292
292
  ]);
293
293
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { css: styles.bylineContainerStyles, children: [
294
- /* @__PURE__ */ jsxRuntime.jsx("div", { css: styles.bylineEditorStyles(theme?.editor), ref: editorRef, onBlur }),
294
+ /* @__PURE__ */ jsxRuntime.jsx(
295
+ "div",
296
+ {
297
+ css: styles.bylineEditorStyles(theme?.editor),
298
+ ref: editorRef,
299
+ onBlur
300
+ }
301
+ ),
295
302
  /* @__PURE__ */ jsxRuntime.jsx(
296
303
  "div",
297
304
  {
package/package.json CHANGED
@@ -1,61 +1,63 @@
1
1
  {
2
2
  "name": "@guardian/stand",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "exports": {
6
- "types": "./dist/types/src/index.d.ts",
6
+ "types": "./dist/types/index.d.ts",
7
7
  "import": "./dist/index.js",
8
8
  "require": "./dist/index.cjs"
9
9
  },
10
10
  "files": [
11
11
  "dist"
12
12
  ],
13
- "main": "./dist/index.cjs",
14
- "types": "./dist/types/src/index.d.ts",
15
- "dependencies": {
16
- "@emotion/react": "11.11.4",
17
- "@guardian/prosemirror-invisibles": "3.1.1",
18
- "prosemirror-dropcursor": "1.8.2",
19
- "prosemirror-history": "1.4.1",
20
- "prosemirror-keymap": "1.2.2",
21
- "prosemirror-model": "1.25.0",
22
- "prosemirror-state": "1.4.3",
23
- "prosemirror-view": "1.37.2",
24
- "react": "17.0.2",
25
- "react-dom": "17.0.2"
13
+ "repository": {
14
+ "url": "https://github.com/guardian/flexible-content",
15
+ "directory": "stand-component-library"
26
16
  },
17
+ "main": "./dist/index.cjs",
18
+ "types": "./dist/types/index.d.ts",
27
19
  "devDependencies": {
28
20
  "@changesets/cli": "^2.29.7",
21
+ "@emotion/react": "11.11.4",
29
22
  "@guardian/eslint-config": "12.0.0",
30
23
  "@guardian/prettier": "8.0.1",
24
+ "@guardian/prosemirror-invisibles": "3.1.1",
31
25
  "@guardian/tsconfig": "1.0.0",
32
- "@playwright/experimental-ct-react17": "^1.55.1",
33
- "@rollup/plugin-commonjs": "28.0.6",
34
- "@rollup/plugin-node-resolve": "16.0.1",
35
- "@rollup/plugin-typescript": "12.1.4",
36
- "@storybook/addon-docs": "^9.1.7",
37
- "@storybook/addon-themes": "^9.1.7",
38
- "@storybook/react-vite": "^9.1.7",
26
+ "@playwright/experimental-ct-react17": "^1.56.1",
27
+ "@rollup/plugin-commonjs": "28.0.9",
28
+ "@rollup/plugin-node-resolve": "16.0.3",
29
+ "@rollup/plugin-typescript": "12.3.0",
30
+ "@storybook/addon-docs": "^9.1.15",
31
+ "@storybook/addon-themes": "^9.1.15",
32
+ "@storybook/react-vite": "^9.1.15",
39
33
  "@types/jest": "30.0.0",
40
- "@types/node": "^24.5.2",
34
+ "@types/node": "^24.9.1",
41
35
  "@types/react": "17.0.76",
42
36
  "@types/react-dom": "17.0.25",
43
- "eslint": "9.36.0",
44
- "eslint-plugin-storybook": "^9.1.7",
45
- "jest": "30.1.3",
37
+ "eslint": "9.38.0",
38
+ "eslint-plugin-storybook": "^9.1.15",
39
+ "jest": "30.2.0",
46
40
  "jest-environment-jsdom": "^30.1.2",
47
41
  "prettier": "3.6.2",
42
+ "prosemirror-dropcursor": "1.8.2",
43
+ "prosemirror-history": "1.4.1",
44
+ "prosemirror-keymap": "1.2.2",
45
+ "prosemirror-model": "1.25.0",
46
+ "prosemirror-state": "1.4.3",
47
+ "prosemirror-view": "1.37.2",
48
+ "react": "17.0.2",
49
+ "react-dom": "17.0.2",
48
50
  "rimraf": "6.0.1",
49
- "rollup": "4.52.1",
51
+ "rollup": "4.52.5",
50
52
  "rollup-plugin-esbuild": "6.2.1",
51
53
  "rollup-plugin-node-externals": "8.1.1",
52
- "storybook": "^9.1.7",
53
- "ts-jest": "29.4.4",
54
+ "storybook": "^9.1.15",
55
+ "ts-jest": "29.4.5",
54
56
  "tslib": "2.8.1",
55
57
  "typescript": "5.1.3"
56
58
  },
57
59
  "peerDependencies": {
58
- "@emotion/react": "11.11.4",
60
+ "@emotion/react": ">=11.11.4 <=11.14.0",
59
61
  "@guardian/prosemirror-invisibles": "3.1.1",
60
62
  "prosemirror-dropcursor": "1.8.2",
61
63
  "prosemirror-history": "1.4.1",
@@ -63,15 +65,17 @@
63
65
  "prosemirror-model": "1.25.0",
64
66
  "prosemirror-state": "1.4.3",
65
67
  "prosemirror-view": "1.37.2",
66
- "react": "^17.0.2",
67
- "react-dom": "^17.0.2",
68
- "typescript": "5.5.2"
68
+ "react": "^17.0.2 || ^18.0.0 || ^19.0.0",
69
+ "react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0",
70
+ "typescript": ">=5.0.0 <=5.9.3"
69
71
  },
70
72
  "scripts": {
71
73
  "build": "rimraf dist && rollup -c",
72
74
  "storybook": "storybook dev -p 6007",
73
75
  "build-storybook": "storybook build",
76
+ "tsc": "tsc",
74
77
  "test": "jest",
75
- "test-e2e": "playwright test -c playwright-ct.config.ts"
78
+ "test:e2e": "playwright test -c playwright-ct.config.ts",
79
+ "test:react-matrix": "./scripts/test-react-matrix.sh"
76
80
  }
77
81
  }
@@ -1,3 +0,0 @@
1
- import type { StorybookConfig } from '@storybook/react-vite';
2
- declare const config: StorybookConfig;
3
- export default config;
@@ -1,3 +0,0 @@
1
- import type { Preview } from '@storybook/react-vite';
2
- declare const preview: Preview;
3
- export default preview;
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom';
@@ -1,3 +0,0 @@
1
- import type { ComponentProps } from 'react';
2
- import { Byline } from '../src';
3
- export declare const BylineWithMockSearchContributors: (props: Omit<ComponentProps<typeof Byline>, 'searchContributors' | 'handleSave'>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- /**
2
- * See https://playwright.dev/docs/test-configuration.
3
- */
4
- declare const _default: import("@playwright/experimental-ct-react17").PlaywrightTestConfig<{}, {}>;
5
- export default _default;
@@ -1,206 +0,0 @@
1
- /// <reference types="react" />
2
- import type { TaggedContributor } from './lib';
3
- declare const meta: {
4
- title: string;
5
- component: ({ theme, allowUntaggedContributors, contributorLimit, enablePreview, placeholder, initialValue, readOnly, handleSave, searchContributors, onBlur, }: {
6
- theme?: {
7
- editor?: {
8
- invisibles?: {
9
- color?: string | undefined;
10
- } | undefined;
11
- color?: string | undefined;
12
- border?: string | undefined;
13
- background?: string | undefined;
14
- chip?: {
15
- color?: string | undefined;
16
- border?: string | undefined;
17
- padding?: string | undefined;
18
- borderRadius?: string | undefined;
19
- taggedBackground?: string | undefined;
20
- untagged?: {
21
- color?: string | undefined;
22
- } | undefined;
23
- selected?: {
24
- border?: string | undefined;
25
- } | undefined;
26
- } | undefined;
27
- lineHeight?: string | undefined;
28
- placeholder?: {
29
- color?: string | undefined;
30
- } | undefined;
31
- readOnlyBackground?: string | undefined;
32
- } | undefined;
33
- dropdown?: {
34
- background?: string | undefined;
35
- border?: string | undefined;
36
- maxHeight?: string | undefined;
37
- li?: {
38
- color?: string | undefined;
39
- borderBottom?: string | undefined;
40
- selected?: {
41
- background?: string | undefined;
42
- color?: string | undefined;
43
- } | undefined;
44
- } | undefined;
45
- } | undefined;
46
- } | undefined;
47
- allowUntaggedContributors?: boolean | undefined;
48
- contributorLimit?: number | undefined;
49
- enablePreview?: boolean | undefined;
50
- placeholder?: string | undefined;
51
- initialValue?: import("./lib").BylineModel | undefined;
52
- readOnly?: boolean | undefined;
53
- handleSave: (newValue: import("./lib").BylineModel) => void;
54
- searchContributors?: ((selectedText: string) => Promise<TaggedContributor[]>) | undefined;
55
- onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
56
- }) => import("@emotion/react/jsx-runtime").JSX.Element;
57
- parameters: {};
58
- args: {
59
- handleSave: () => void;
60
- initialValue: never[];
61
- searchContributors: (selectedText: string) => Promise<TaggedContributor[]>;
62
- enablePreview: true;
63
- };
64
- };
65
- export declare const Default: {};
66
- export declare const WithTheme: {
67
- args: {
68
- allowUntaggedContributors: true;
69
- searchContributors: (selectedText: string) => Promise<TaggedContributor[]>;
70
- theme: {
71
- editor: {
72
- invisibles: {
73
- color: string;
74
- };
75
- color: string;
76
- background: string;
77
- border: string;
78
- chip: {
79
- color: string;
80
- taggedBackground: string;
81
- border: string;
82
- borderRadius: string;
83
- padding: string;
84
- untagged: {
85
- color: string;
86
- };
87
- };
88
- };
89
- dropdown: {
90
- background: string;
91
- li: {
92
- color: string;
93
- borderBottom: string;
94
- selected: {
95
- color: string;
96
- background: string;
97
- };
98
- };
99
- };
100
- };
101
- };
102
- };
103
- export declare const WithUntaggedContributors: {
104
- parameters: {
105
- chromatic: {
106
- disableSnapshot: boolean;
107
- };
108
- };
109
- args: {
110
- allowUntaggedContributors: true;
111
- };
112
- };
113
- export declare const WithInitialValue: {
114
- args: {
115
- allowUntaggedContributors: true;
116
- initialValue: ({
117
- type: "contributor";
118
- value: string;
119
- tagId: string;
120
- path: string;
121
- } | {
122
- type: "text";
123
- value: string;
124
- tagId?: undefined;
125
- path?: undefined;
126
- } | {
127
- type: "contributor";
128
- value: string;
129
- tagId?: undefined;
130
- path?: undefined;
131
- })[];
132
- };
133
- };
134
- export declare const WithNoSearch: {
135
- parameters: {
136
- chromatic: {
137
- disableSnapshot: boolean;
138
- };
139
- };
140
- args: {
141
- allowUntaggedContributors: true;
142
- searchContributors: undefined;
143
- };
144
- };
145
- export declare const WithNoSearchAndNoUntagged: {
146
- parameters: {
147
- chromatic: {
148
- disableSnapshot: boolean;
149
- };
150
- };
151
- args: {
152
- allowUntaggedContributors: false;
153
- searchContributors: undefined;
154
- };
155
- };
156
- export declare const WithCustomPlaceholder: {
157
- args: {
158
- allowUntaggedContributors: true;
159
- placeholder: string;
160
- };
161
- };
162
- export declare const WithContributorLimit: {
163
- parameters: {
164
- chromatic: {
165
- disableSnapshot: boolean;
166
- };
167
- };
168
- args: {
169
- contributorLimit: number;
170
- };
171
- };
172
- export declare const WithoutPreview: {
173
- parameters: {
174
- chromatic: {
175
- disableSnapshot: boolean;
176
- };
177
- };
178
- args: {
179
- allowUntaggedContributors: true;
180
- enablePreview: false;
181
- };
182
- };
183
- export declare const ReadOnly: {
184
- args: {
185
- readOnly: true;
186
- allowUntaggedContributors: true;
187
- enablePreview: true;
188
- initialValue: ({
189
- type: "contributor";
190
- value: string;
191
- tagId: string;
192
- path: string;
193
- } | {
194
- type: "text";
195
- value: string;
196
- tagId?: undefined;
197
- path?: undefined;
198
- } | {
199
- type: "contributor";
200
- value: string;
201
- tagId?: undefined;
202
- path?: undefined;
203
- })[];
204
- };
205
- };
206
- export default meta;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes