@xplor-education/react-wrappers 3.2.12 → 4.0.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/CHANGELOG.md +26 -0
- package/README.md +21 -89
- package/dist/index.cjs +1541 -367
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6888 -4653
- package/package.json +32 -8
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@xplor-education/react-wrappers` are documented here.
|
|
4
|
+
|
|
5
|
+
## [4.0.0] - 2026-05-29
|
|
6
|
+
|
|
7
|
+
### New Features
|
|
8
|
+
|
|
9
|
+
- **`XplorButton`** now exposes `onXplorClick?: (event: CustomEvent<void>) => void` — click events can be handled via the React wrapper prop directly. Previously the only option was the `clickAction` function prop; both patterns remain valid and `clickAction` is unchanged.
|
|
10
|
+
- **`XplorDropdown`** now exposes `onXplorChange?: (event: CustomEvent<string>) => void` — selection change events are now surfaced.
|
|
11
|
+
- **`XplorCard`** is now exported as a typed React wrapper, including `onXplorCardClick?: (event: CustomEvent<...>) => void`.
|
|
12
|
+
|
|
13
|
+
### Migration Notes
|
|
14
|
+
|
|
15
|
+
- **`@xplor-education/core-stencil-components` is now a declared peer dependency.** Both v3 and v4 require it for TypeScript types to resolve (the `index.d.ts` imports its JSX namespace), but v3 did not declare it explicitly. If you use a strict peer checker (e.g. pnpm with `strict-peer-dependencies=true`), add it to your `dependencies` or `devDependencies`.
|
|
16
|
+
- **Remove any Jest `moduleNameMapper` entry for `@stencil/react-output-target/runtime`.** The runtime is now bundled into the package output. Any existing mapper entry is harmless but dead config.
|
|
17
|
+
|
|
18
|
+
### Internal
|
|
19
|
+
|
|
20
|
+
- Package source moved to `apps/component-library-react`. Stencil's `reactOutputTarget` now writes directly to this package's `src/`, eliminating the separate `react-wrappers` sync step.
|
|
21
|
+
- Build entry changed to `src/index.ts` — a typed wrapper layer that adds `children` and `className` to all component props, generated automatically from the Stencil output on each build.
|
|
22
|
+
- `@stencil/react-output-target/runtime` is now bundled into the output, so consumers no longer need a `moduleNameMapper` entry for it in Jest config.
|
|
23
|
+
|
|
24
|
+
## [3.2.13] and earlier
|
|
25
|
+
|
|
26
|
+
See the [react-wrappers package history](https://www.npmjs.com/package/@xplor-education/react-wrappers?activeTab=versions) for prior release notes.
|
package/README.md
CHANGED
|
@@ -1,98 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```tsx
|
|
14
|
-
import { XpButton, XpDatatable } from '@xplor-education/react-wrappers';
|
|
15
|
-
|
|
16
|
-
function App() {
|
|
17
|
-
return (
|
|
18
|
-
<div>
|
|
19
|
-
<XpButton label="Click me" />
|
|
20
|
-
</div>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Peer Dependencies
|
|
26
|
-
|
|
27
|
-
- `react` ^18.0.0 || ^19.0.0
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
28
9
|
|
|
29
|
-
##
|
|
10
|
+
## Expanding the ESLint configuration
|
|
30
11
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
pnpm run build
|
|
35
|
-
```
|
|
12
|
+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
|
36
13
|
|
|
37
|
-
|
|
14
|
+
- Configure the top-level `parserOptions` property like this:
|
|
38
15
|
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
If using a scoped registry or org, ensure your `.npmrc` is configured.
|
|
52
|
-
|
|
53
|
-
### 2. Bump the version
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
# Choose one:
|
|
57
|
-
npm version patch # e.g. 2.0.2 → 2.0.3
|
|
58
|
-
npm version minor # e.g. 2.0.2 → 2.1.0
|
|
59
|
-
npm version major # e.g. 2.0.2 → 3.0.0
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### 3. Build the project
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
pnpm run build
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
> This runs automatically before publish via the `prepublishOnly` script.
|
|
69
|
-
|
|
70
|
-
### 4. (Optional) Preview what will be published
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
npm pack --dry-run
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
This shows exactly which files will be included. The `files` field limits it to `dist/`.
|
|
77
|
-
|
|
78
|
-
### 5. Publish to NPM
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
npm publish
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Since `publishConfig.access` is set to `"public"` and `private` is `false`, this will publish the scoped package publicly.
|
|
85
|
-
|
|
86
|
-
To do a dry-run first:
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
npm publish --dry-run
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### 6. Push the version tag to git
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
git push && git push --tags
|
|
16
|
+
```js
|
|
17
|
+
export default {
|
|
18
|
+
// other rules...
|
|
19
|
+
parserOptions: {
|
|
20
|
+
ecmaVersion: 'latest',
|
|
21
|
+
sourceType: 'module',
|
|
22
|
+
project: ['./tsconfig.json', './tsconfig.node.json'],
|
|
23
|
+
tsconfigRootDir: __dirname,
|
|
24
|
+
},
|
|
25
|
+
}
|
|
96
26
|
```
|
|
97
27
|
|
|
98
|
-
|
|
28
|
+
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
|
|
29
|
+
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
|
|
30
|
+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
|