ish-ui 1.3.0 → 1.3.1

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.
@@ -16,17 +16,16 @@ var __rest = (this && this.__rest) || function (s, e) {
16
16
  }
17
17
  return t;
18
18
  };
19
- import React, { forwardRef, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
19
+ import { Edit, Tag } from '@mui/icons-material';
20
20
  import { Chip } from '@mui/material';
21
21
  import Autocomplete from '@mui/material/Autocomplete';
22
- import { Edit, Tag } from '@mui/icons-material';
23
- import { useSelectStyles } from '../formFields';
24
- import AddTagMenu from './AddTagMenu';
25
- import EditInPlaceFieldBase from '../formFields/EditInPlaceFieldBase';
26
- import { getAllMenuTags, getHighlightedPartLabel, getMenuTags, stubComponent } from '../utils';
22
+ import React, { forwardRef, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
27
23
  import { makeAppStyles } from '../styles';
24
+ import { EditInPlaceFieldBase, useSelectStyles } from '../formFields';
25
+ import { getAllMenuTags, getHighlightedPartLabel, getMenuTags, stubComponent } from '../utils';
26
+ import { AddTagMenu } from '../tagsInput/index';
28
27
  import { useAppTheme } from '../themes';
29
- const useStyles = makeAppStyles()((theme) => ({
28
+ const useStyles = makeAppStyles()(theme => ({
30
29
  tagColorDotSmall: {
31
30
  width: theme.spacing(2),
32
31
  minWidth: theme.spacing(2),
@@ -202,7 +201,13 @@ function TagInputList({ input, tags, placeholder, labelAdornment, meta, label =
202
201
  noOptions: 'd-none'
203
202
  }, renderValue: (tagValue, getItemProps) => tagValue.map((option, index) => {
204
203
  const tagProps = __rest(getItemProps({ index }), []);
205
- const menuTag = allMenuTags.find(t => t.tagBody.id === option);
204
+ const menuTag = allMenuTags.find(t => t.tagBody.id === option) || {
205
+ tagBody: {
206
+ id: option,
207
+ color: theme.palette.error.main.replace('#', ''),
208
+ name: 'Error: Tag not found!'
209
+ }
210
+ };
206
211
  const tagColors = theme.palette.augmentColor({
207
212
  color: { main: `#${menuTag.tagBody.color}` }
208
213
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ish-ui",
3
3
  "sideEffects": false,
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "description": "UI elements for onCourse and other ish apps",
6
6
  "main": "main.ts",
7
7
  "devDependencies": {
@@ -29,6 +29,7 @@
29
29
  "style-loader": "^4.0.0",
30
30
  "swc-loader": "^0.2.7",
31
31
  "terser-webpack-plugin": "^5.6.1",
32
+ "ts-checker-rspack-plugin": "^1.6.1",
32
33
  "tsc-alias": "^1.9.1",
33
34
  "typescript": "^7.0.2",
34
35
  "webpack": "^5.109.2",
@@ -84,8 +85,9 @@
84
85
  },
85
86
  "scripts": {
86
87
  "test": "exit 0",
87
- "start": "webpack serve --env production --config tools/webpack/webpack.config.dev.js",
88
- "start:prod": "webpack serve --env development --config tools/webpack/webpack.config.prod.js",
88
+ "start": "webpack serve --config-node-env development --config tools/webpack/webpack.config.dev.js",
89
+ "start:prod": "webpack serve --config-node-env production --config tools/webpack/webpack.config.prod.js",
90
+ "analyze": "ANALYZE=1 webpack --config-node-env development --config tools/webpack/webpack.config.dev.js",
89
91
  "build": "tsc -p tsconfig.prod.json && tsc-alias -p tsconfig.prod.json",
90
92
  "lint": "oxlint src/",
91
93
  "typecheck": "tsc --noEmit -p tsconfig.prod.json"
@@ -110,6 +112,7 @@
110
112
  "react-beautiful-dnd-next": {
111
113
  "react": "$react",
112
114
  "react-dom": "$react-dom"
113
- }
115
+ },
116
+ "uuid": "^11.1.1"
114
117
  }
115
- }
118
+ }