@deviceinsight/ng-ui-components 7.24.0 → 7.25.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
@@ -95,9 +95,10 @@ npx yalc link "@deviceinsight/ng-ui-components"
95
95
 
96
96
  # CI
97
97
 
98
- `.gitlab-ci.yml` installs the dependencies and then runs `test`, `scan`, `lint` and
99
- `typecheck` on every branch except `main`. On `develop` the `pages` job publishes the
100
- static Storybook to GitLab Pages. The `publish` job runs for `develop` and for tags:
98
+ `.gitlab-ci.yml` installs the dependencies and then runs `test`, `lint` and `typecheck`
99
+ on every branch except `main`. The `audit` job (`npm run scan`) only runs on `develop`,
100
+ `feature/*` and `renovate/*` branches, so hotfixes and tags are not blocked by it. On `develop` the
101
+ `pages` job publishes the static Storybook to GitLab Pages. The `publish` job runs for `develop` and for tags:
101
102
  `-SNAPSHOT` versions are published to the internal Nexus registry under the `next`
102
103
  tag, releases go to the public npm registry. A release older than the currently
103
104
  published `latest` is published under a `hotfix-<major>.<minor>` tag so that `latest`
@@ -118,77 +119,55 @@ After git flow is installed, the repo needs to be initialized. Run `git flow ini
118
119
  question with the default (press Enter/Return). The script verifies that the branches
119
120
  are named `main` and `develop`.
120
121
 
121
- ## Building a release
122
+ ## Releasing the develop branch
122
123
 
123
- To build a release of this library, execute `./release.sh`, which consists of the following steps:
124
+ Run the release script from the repository root:
124
125
 
125
- ### Before the release: Check for vulnerabilities and run the tests
126
-
127
- Vulnerabilities can occur at any time.
128
- To be sure, the pipeline for the branches and the tags created
129
- in the release process will not fail, the script runs the checks locally before building the
130
- release:
131
-
132
- ```
133
- npm install
134
- npm run scan
135
- npm run test
126
+ ```shell
127
+ ./release.sh
136
128
  ```
137
129
 
138
- If `package-lock.json` changed during the install, the script commits it.
139
-
140
- ### Building the release
141
-
142
- 1. Switch to develop branch and make sure both main and develop are current:
143
-
144
- `git checkout develop && git pull && git fetch origin main:main`
145
-
146
- The script also aborts if the workarea is dirty or if `develop` has unpushed commits.
147
-
148
- 2. Get the upcoming release from `package.json` and start the release:
149
-
150
- `git flow release start $RELEASE_VERSION`, e.g. `git flow release start 1.2.0`.
151
-
152
- 3. Edit the version in `package.json`.
153
-
154
- 3.1. Edit the version in `package.json`, remove the `-SNAPSHOT`.
155
-
156
- 3.2. Commit `package.json`. Commit message should be `Release $RELEASE_VERSION`, e.g. `Release 1.2.0`.
157
-
158
- 4. Finish the release:
159
-
160
- `git flow release finish`
161
-
162
- This will merge the release branch into the `main` branch and create a tag.
163
- It will also merge the release branch into the `develop` branch.
164
-
165
- After this you should be on the `develop` branch.
166
-
167
- 4.1 A merge conflict might occur in `package.json` for the `version`, when main is merged into the develop branch:
168
-
169
- Resolve it by taking the version of the `develop` branch. Then run `npm install` to resolve conflicts in `package-lock.version`.
170
-
171
- Run `git status` to see if there are more conflicts. If there are, resolve them and `git add` the fixed files.
172
-
173
- If there are no more conflicts, run `git add package*` and `git commit`.
174
-
175
- 5. Start a new snapshot version:
176
-
177
- 5.1.
178
- Edit the version in `package.json`,
179
- increment the minor version (e.g., from `1.1.0` to `1.2.0`) and add the `-SNAPSHOT` again,
180
- so that the version is e.g. `1.2.0-SNAPSHOT`.
181
-
182
- 5.2. Run `npm install`.
183
-
184
- 5.3. Commit `package.json` and `package-lock.json`. Commit message should be `Starting $NEW_SNAPSHOT_VERSION`, e.g. `Starting 1.2.0`.
185
-
186
- 6. Push the branches and the tag:
187
-
188
- On branch `develop`:
189
-
190
- `git push`
191
- `git checkout main`
192
- `git push`
193
- `git push --tags`
194
- `git checkout develop`
130
+ Before running it, make sure the workarea is clean and all commits on `develop` are pushed; otherwise the script aborts.
131
+ It releases the current version from `package.json` (without `-SNAPSHOT`) and afterwards starts the next minor snapshot version.
132
+
133
+ ## Building a hotfix for a specific version of this library
134
+
135
+ When building a hotfix in `ng-ui-scale`, first check which version of this library is used on the `main` branch of `ng-ui-scale`, e.g. with `git show origin/main:package.json | grep ng-ui-components`.
136
+ Then build the hotfix on top of exactly that version, so that no unrelated changes from newer releases end up in the `ng-ui-scale` hotfix.
137
+ Do not use `release.sh` or `git flow hotfix` for this: `git flow hotfix finish` merges into `main`, which already contains the newer release.
138
+
139
+ Example: `ng-ui-scale` uses 7.22.0 while 7.24.0 is already released (the version on `main` of this library):
140
+
141
+ 1. Create the branch `hotfix/7.22.1` from the tag 7.22.0:
142
+ ```shell
143
+ git fetch --tags
144
+ git checkout -b hotfix/7.22.1 7.22.0
145
+ ```
146
+ 2. Set the version in `package.json` and `package-lock.json` to 7.22.1:
147
+ ```shell
148
+ npm version 7.22.1 --no-git-tag-version
149
+ ```
150
+ If the `audit` job in `.gitlab-ci.yml` still runs on every branch except `main`, copy its `rules` from `develop`, so that the vulnerability audit does not block the hotfix pipeline.
151
+ 3. Implement or cherry-pick the changes needed for the hotfix, either directly on the hotfix branch or in a feature branch that is merged into it.
152
+ 4. Add a `## Version 7.22.1` entry to `CHANGELOG.md` describing the changes in the hotfix.
153
+ 5. Run `npm run build`, `npm test -- --run` and `npm run lint` to verify there are no errors.
154
+ 6. Commit the changes.
155
+ 7. Tag the hotfix commit and push the tag:
156
+ ```shell
157
+ git tag -a 7.22.1 -m "Hotfix 7.22.1"
158
+ git push origin 7.22.1
159
+ ```
160
+ The `publish` CI job builds the tag and publishes it to npm.
161
+ Because 7.22.1 is older than the `latest` version, it is published under the dist-tag `hotfix-7.22` and `latest` stays at 7.24.0.
162
+ 8. Merge the hotfix branch into `develop` and push `develop`:
163
+ ```shell
164
+ git checkout develop
165
+ git pull
166
+ git merge --no-ff hotfix/7.22.1
167
+ git push
168
+ ```
169
+ `package.json` and `package-lock.json` will conflict; keep the `-SNAPSHOT` version of `develop` and run `npm install` before committing the merge.
170
+ In `CHANGELOG.md`, keep the 7.22.1 entry between the entries for 7.23.0 and 7.22.0.
171
+ Do not merge the hotfix branch into `main`.
172
+ 9. Delete the local hotfix branch: `git branch -d hotfix/7.22.1`.
173
+ 10. Update `ng-ui-scale` on its hotfix branch to 7.22.1.
package/dist/index.cjs CHANGED
@@ -6,7 +6,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
9
  var __copyProps = (to, from, except, desc) => {
11
10
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
11
  key = keys[i];
@@ -73,7 +72,6 @@ let _svgdotjs_svg_js = require("@svgdotjs/svg.js");
73
72
  let highcharts = require("highcharts");
74
73
  highcharts = __toESM(highcharts, 1);
75
74
  let highcharts_react_official = require("highcharts-react-official");
76
- highcharts_react_official = __toESM(highcharts_react_official, 1);
77
75
  let _rc_component_slider = require("@rc-component/slider");
78
76
  _rc_component_slider = __toESM(_rc_component_slider, 1);
79
77
  let _rc_component_tooltip = require("@rc-component/tooltip");
@@ -3423,7 +3421,7 @@ var Chart = class extends react.Component {
3423
3421
  render() {
3424
3422
  const built = this.buildOptions();
3425
3423
  const options = this.props.updateOptions ? this.props.updateOptions(built) : built;
3426
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(highcharts_react_official.default, {
3424
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(highcharts_react_official.HighchartsReact, {
3427
3425
  highcharts: highcharts.default,
3428
3426
  options,
3429
3427
  containerProps: { className: this.props.className },
@@ -3433,54 +3431,15 @@ var Chart = class extends react.Component {
3433
3431
  };
3434
3432
  //#endregion
3435
3433
  //#region src/components/slider/RcSliderWithTooltip.tsx
3436
- var import_raf = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports) => {
3437
- Object.defineProperty(exports, "__esModule", { value: true });
3438
- exports.default = void 0;
3439
- var raf = (callback) => +setTimeout(callback, 16);
3440
- var caf = (num) => clearTimeout(num);
3441
- if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
3442
- raf = (callback) => window.requestAnimationFrame(callback);
3443
- caf = (handle) => window.cancelAnimationFrame(handle);
3444
- }
3445
- var rafUUID = 0;
3446
- var rafIds = /* @__PURE__ */ new Map();
3447
- function cleanup(id) {
3448
- rafIds.delete(id);
3449
- }
3450
- var wrapperRaf = (callback, times = 1) => {
3451
- rafUUID += 1;
3452
- const id = rafUUID;
3453
- function callRef(leftTimes) {
3454
- if (leftTimes === 0) {
3455
- cleanup(id);
3456
- callback();
3457
- } else {
3458
- const realId = raf(() => {
3459
- callRef(leftTimes - 1);
3460
- });
3461
- rafIds.set(id, realId);
3462
- }
3463
- }
3464
- callRef(times);
3465
- return id;
3466
- };
3467
- wrapperRaf.cancel = (id) => {
3468
- const realId = rafIds.get(id);
3469
- cleanup(id);
3470
- return caf(realId);
3471
- };
3472
- if (process.env.NODE_ENV !== "production") wrapperRaf.ids = () => rafIds;
3473
- exports.default = wrapperRaf;
3474
- })))(), 1);
3475
3434
  var HandleTooltip = (props) => {
3476
3435
  const { value, children, visible, tipFormatter = (val) => `${val}`, ...restProps } = props;
3477
3436
  const tooltipRef = (0, react.useRef)(null);
3478
3437
  const rafRef = (0, react.useRef)(null);
3479
3438
  function cancelKeepAlign() {
3480
- if (rafRef.current) import_raf.default.cancel(rafRef.current);
3439
+ if (rafRef.current) cancelAnimationFrame(rafRef.current);
3481
3440
  }
3482
3441
  function keepAlign() {
3483
- rafRef.current = (0, import_raf.default)(() => {
3442
+ rafRef.current = requestAnimationFrame(() => {
3484
3443
  tooltipRef.current?.forceAlign();
3485
3444
  });
3486
3445
  }