@blocklet/labels 2.0.172 → 2.0.174

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.
@@ -1,5 +1,5 @@
1
- import { CreateLabel, FetchLabels } from '../../types';
2
1
  import { Label } from './types';
2
+ import { CreateLabel, FetchLabels } from '../../types';
3
3
 
4
4
  interface LabelsProviderProps {
5
5
  fetchLabels: FetchLabels;
@@ -1,5 +1,5 @@
1
- import { Label } from './types';
2
1
  import { GroupBase } from 'react-select';
2
+ import { Label } from './types';
3
3
 
4
4
  interface LabelPickerProps {
5
5
  data: Label[];
@@ -1,5 +1,5 @@
1
- import { Label } from './types';
2
1
  import { SxProps } from '@mui/system';
2
+ import { Label } from './types';
3
3
 
4
4
  interface SharedProps {
5
5
  selectable?: boolean;
@@ -1,5 +1,5 @@
1
- import { Label } from './types';
2
1
  import { SxProps } from '@mui/material';
2
+ import { Label } from './types';
3
3
 
4
4
  interface LabelsProps {
5
5
  labels: string[] | undefined | null;
package/dist/index.es.js CHANGED
@@ -18,8 +18,8 @@ import { arrayToTree } from "performant-array-to-tree";
18
18
  import { SessionContext } from "@arcblock/did-connect/lib/Session";
19
19
  import chroma from "chroma-js";
20
20
  import CloseOutlineIcon from "@mui/icons-material/Close";
21
- const materialSymbolsLabelRounded = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M5 19q-.825 0-1.413-.587Q3 17.825 3 17V7q0-.825.587-1.412Q4.175 5 5 5h10q.5 0 .938.225q.437.225.712.625l3.525 5q.375.525.375 1.15q0 .625-.375 1.15l-3.525 5q-.275.4-.712.625Q15.5 19 15 19Z" }) });
22
- const materialSymbolsCheckSmall = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "m10 16.4l-4-4L7.4 11l2.6 2.6L16.6 7L18 8.4Z" }) });
21
+ const materialSymbolsLabelRounded = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h11q.475 0 .9.213t.7.587l4.5 6q.4.525.4 1.2t-.4 1.2l-4.5 6q-.275.375-.7.588T15 20z" }) });
22
+ const materialSymbolsCheckSmall = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "m10 16.4l-4-4L7.4 11l2.6 2.6L16.6 7L18 8.4z" }) });
23
23
  const LabelTreeContext = createContext({});
24
24
  function LabelTreeProvider({
25
25
  selectable = false,
@@ -755,7 +755,7 @@ function Labels({ labels, editable, onChange, sx, renderLabel }) {
755
755
  editable && isEmpty && /* @__PURE__ */ jsx(Button, { color: "inherit", variant: "outlined", startIcon: /* @__PURE__ */ jsx(LabelOutlined, {}), onClick: () => setEditing(true), children: "Edit labels" })
756
756
  ] });
757
757
  }
758
- const mdiTagPlusOutline = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M6.5 5A1.5 1.5 0 1 0 8 6.5A1.5 1.5 0 0 0 6.5 5m0 0A1.5 1.5 0 1 0 8 6.5A1.5 1.5 0 0 0 6.5 5m14.91 6.58l-9-9A2 2 0 0 0 11 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 .59 1.42l.41.4a5.62 5.62 0 0 1 2.08-.74L4 11V4h7l9 9l-7 7l-1.08-1.08a5.57 5.57 0 0 1-.74 2.08l.41.41A2 2 0 0 0 13 22a2 2 0 0 0 1.41-.59l7-7A2 2 0 0 0 22 13a2 2 0 0 0-.59-1.42M6.5 5A1.5 1.5 0 1 0 8 6.5A1.5 1.5 0 0 0 6.5 5M10 19H7v3H5v-3H2v-2h3v-3h2v3h3Z" }) });
758
+ const mdiTagPlusOutline = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M6.5 5A1.5 1.5 0 1 0 8 6.5A1.5 1.5 0 0 0 6.5 5m0 0A1.5 1.5 0 1 0 8 6.5A1.5 1.5 0 0 0 6.5 5m14.91 6.58l-9-9A2 2 0 0 0 11 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 .59 1.42l.41.4a5.6 5.6 0 0 1 2.08-.74L4 11V4h7l9 9l-7 7l-1.08-1.08a5.6 5.6 0 0 1-.74 2.08l.41.41A2 2 0 0 0 13 22a2 2 0 0 0 1.41-.59l7-7A2 2 0 0 0 22 13a2 2 0 0 0-.59-1.42M6.5 5A1.5 1.5 0 1 0 8 6.5A1.5 1.5 0 0 0 6.5 5M10 19H7v3H5v-3H2v-2h3v-3h2v3h3Z" }) });
759
759
  const useSessionContext = () => {
760
760
  var _a, _b;
761
761
  const ctx = useContext(SessionContext) || {};
package/dist/index.umd.js CHANGED
@@ -5,8 +5,8 @@
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
6
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
7
 
8
- const materialSymbolsLabelRounded = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "currentColor", d: "M5 19q-.825 0-1.413-.587Q3 17.825 3 17V7q0-.825.587-1.412Q4.175 5 5 5h10q.5 0 .938.225q.437.225.712.625l3.525 5q.375.525.375 1.15q0 .625-.375 1.15l-3.525 5q-.275.4-.712.625Q15.5 19 15 19Z" }) });
9
- const materialSymbolsCheckSmall = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "currentColor", d: "m10 16.4l-4-4L7.4 11l2.6 2.6L16.6 7L18 8.4Z" }) });
8
+ const materialSymbolsLabelRounded = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "currentColor", d: "M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h11q.475 0 .9.213t.7.587l4.5 6q.4.525.4 1.2t-.4 1.2l-4.5 6q-.275.375-.7.588T15 20z" }) });
9
+ const materialSymbolsCheckSmall = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "currentColor", d: "m10 16.4l-4-4L7.4 11l2.6 2.6L16.6 7L18 8.4z" }) });
10
10
  const LabelTreeContext = react.createContext({});
11
11
  function LabelTreeProvider({
12
12
  selectable = false,
@@ -742,7 +742,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
742
742
  editable && isEmpty && /* @__PURE__ */ jsxRuntime.jsx(material.Button, { color: "inherit", variant: "outlined", startIcon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.LabelOutlined, {}), onClick: () => setEditing(true), children: "Edit labels" })
743
743
  ] });
744
744
  }
745
- const mdiTagPlusOutline = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "currentColor", d: "M6.5 5A1.5 1.5 0 1 0 8 6.5A1.5 1.5 0 0 0 6.5 5m0 0A1.5 1.5 0 1 0 8 6.5A1.5 1.5 0 0 0 6.5 5m14.91 6.58l-9-9A2 2 0 0 0 11 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 .59 1.42l.41.4a5.62 5.62 0 0 1 2.08-.74L4 11V4h7l9 9l-7 7l-1.08-1.08a5.57 5.57 0 0 1-.74 2.08l.41.41A2 2 0 0 0 13 22a2 2 0 0 0 1.41-.59l7-7A2 2 0 0 0 22 13a2 2 0 0 0-.59-1.42M6.5 5A1.5 1.5 0 1 0 8 6.5A1.5 1.5 0 0 0 6.5 5M10 19H7v3H5v-3H2v-2h3v-3h2v3h3Z" }) });
745
+ const mdiTagPlusOutline = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "currentColor", d: "M6.5 5A1.5 1.5 0 1 0 8 6.5A1.5 1.5 0 0 0 6.5 5m0 0A1.5 1.5 0 1 0 8 6.5A1.5 1.5 0 0 0 6.5 5m14.91 6.58l-9-9A2 2 0 0 0 11 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 .59 1.42l.41.4a5.6 5.6 0 0 1 2.08-.74L4 11V4h7l9 9l-7 7l-1.08-1.08a5.6 5.6 0 0 1-.74 2.08l.41.41A2 2 0 0 0 13 22a2 2 0 0 0 1.41-.59l7-7A2 2 0 0 0 22 13a2 2 0 0 0-.59-1.42M6.5 5A1.5 1.5 0 1 0 8 6.5A1.5 1.5 0 0 0 6.5 5M10 19H7v3H5v-3H2v-2h3v-3h2v3h3Z" }) });
746
746
  const useSessionContext = () => {
747
747
  var _a, _b;
748
748
  const ctx = react.useContext(Session.SessionContext) || {};
@@ -1,5 +1,5 @@
1
- import { CreateLabel, LabelPayload, LabelsResponse } from '../types';
2
1
  import { LabelTreeNode } from './tree';
2
+ import { CreateLabel, LabelPayload, LabelsResponse } from '../types';
3
3
 
4
4
  interface InitialState {
5
5
  loading: boolean;
@@ -13,11 +13,11 @@ export declare const LabelsContainer: import('unstated-next').Container<{
13
13
  getLabelsByIds: (ids: string[]) => LabelTreeNode[];
14
14
  labelExists: (id: string) => true;
15
15
  getLabelName: (id: string) => string;
16
- getRelatedLabels: (id: string) => import("./tree").TreeNode<{
16
+ getRelatedLabels: (id: string) => import('./tree').TreeNode<{
17
17
  id: string;
18
18
  name: string;
19
19
  icon?: string | undefined;
20
- type?: import("../types").LabelType;
20
+ type?: import('../types').LabelType;
21
21
  color: string;
22
22
  passports: string[];
23
23
  translation?: {
@@ -28,11 +28,11 @@ export declare const LabelsContainer: import('unstated-next').Container<{
28
28
  }): any;
29
29
  getName(locale: string): string;
30
30
  }>[];
31
- getRecommended: (id?: string) => import("./tree").TreeNode<{
31
+ getRecommended: (id?: string) => import('./tree').TreeNode<{
32
32
  id: string;
33
33
  name: string;
34
34
  icon?: string | undefined;
35
- type?: import("../types").LabelType;
35
+ type?: import('../types').LabelType;
36
36
  color: string;
37
37
  passports: string[];
38
38
  translation?: {
@@ -47,7 +47,7 @@ export declare const LabelsContainer: import('unstated-next').Container<{
47
47
  id: string;
48
48
  name: string;
49
49
  icon?: string | undefined;
50
- type?: import("../types").LabelType;
50
+ type?: import('../types').LabelType;
51
51
  color: string;
52
52
  passports: string[];
53
53
  translation?: {
@@ -1,5 +1,5 @@
1
- import { GithubLabelPickerProps } from './github-label-picker';
2
1
  import { TextFieldProps } from '@mui/material';
2
+ import { GithubLabelPickerProps } from './github-label-picker';
3
3
 
4
4
  export interface LabelsInputProps {
5
5
  value: string[];
@@ -1,5 +1,5 @@
1
- import { LabelTreeNode } from './tree';
2
1
  import { Theme, SxProps } from '@mui/material';
2
+ import { LabelTreeNode } from './tree';
3
3
 
4
4
  export interface LabelsProps {
5
5
  labels: string[] | undefined | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/labels",
3
- "version": "2.0.172",
3
+ "version": "2.0.174",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -14,32 +14,22 @@
14
14
  },
15
15
  "./src/*": "./src/*"
16
16
  },
17
- "scripts": {
18
- "dev": "npm run storybook",
19
- "build": "tsc && vite build",
20
- "build:watch": "vite build --watch",
21
- "preview": "vite preview",
22
- "storybook": "start-storybook -p 6007",
23
- "build-storybook": "build-storybook",
24
- "lint": "eslint src --ext .mjs,.js,.jsx,.ts,.tsx",
25
- "lint:fix": "eslint src --ext .mjs,.js,.jsx,.ts,.tsx --fix"
26
- },
27
17
  "publishConfig": {
28
18
  "access": "public"
29
19
  },
30
20
  "dependencies": {
31
- "@blocklet/translation-input": "2.0.172",
32
- "@emotion/css": "^11.10.5",
33
- "@emotion/react": "^11.10.5",
34
- "@emotion/styled": "^11.10.5",
35
- "@iconify/react": "^4.0.1",
36
- "ahooks": "^3.7.8",
37
- "chroma-js": "^2.4.2",
21
+ "@emotion/css": "^11.13.0",
22
+ "@emotion/react": "^11.13.3",
23
+ "@emotion/styled": "^11.13.0",
24
+ "@iconify/react": "^4.1.1",
25
+ "ahooks": "^3.8.1",
26
+ "chroma-js": "^2.6.0",
38
27
  "performant-array-to-tree": "^1.11.0",
39
- "react-arborist": "^2.2.0",
28
+ "react-arborist": "^2.3.0",
40
29
  "react-color": "^2.19.3",
41
- "react-select": "^5.6.0",
42
- "unstated-next": "^1.1.0"
30
+ "react-select": "^5.8.0",
31
+ "unstated-next": "^1.1.0",
32
+ "@blocklet/translation-input": "^2.0.174"
43
33
  },
44
34
  "peerDependencies": {
45
35
  "@arcblock/did-connect": "^2.10.5",
@@ -53,35 +43,38 @@
53
43
  },
54
44
  "devDependencies": {
55
45
  "@arcblock/eslint-config-ts": "^0.3.2",
56
- "@babel/core": "^7.20.2",
57
- "@iconify-json/iconoir": "^1.1.14",
58
- "@iconify-json/material-symbols": "^1.1.26",
59
- "@iconify-json/mdi": "^1.1.36",
60
- "@storybook/addon-actions": "^6.5.13",
61
- "@storybook/addon-essentials": "^6.5.13",
62
- "@storybook/addon-interactions": "^6.5.13",
63
- "@storybook/addon-links": "^6.5.13",
64
- "@storybook/builder-vite": "^8.0.6",
65
- "@storybook/react": "^6.5.13",
46
+ "@babel/core": "^7.25.2",
47
+ "@storybook/addon-actions": "^6.5.16",
48
+ "@storybook/addon-essentials": "^6.5.16",
49
+ "@storybook/addon-interactions": "^6.5.16",
50
+ "@storybook/addon-links": "^6.5.16",
51
+ "@storybook/builder-vite": "^8.3.0",
52
+ "@storybook/react": "^6.5.16",
66
53
  "@storybook/testing-library": "^0.0.13",
67
54
  "@svgr/core": "^6.5.1",
68
55
  "@types/chroma-js": "^2.4.4",
69
- "@types/react": "^18.0.24",
70
- "@types/react-color": "^3.0.6",
71
- "@types/react-dom": "^18.0.8",
72
- "@vitejs/plugin-react": "^4.2.1",
56
+ "@types/react": "^18.3.5",
57
+ "@types/react-color": "^3.0.12",
58
+ "@types/react-dom": "^18.3.0",
59
+ "@vitejs/plugin-react": "^4.3.1",
73
60
  "babel-loader": "^8.3.0",
74
- "react": "^18.2.0",
75
- "react-dom": "^18.2.0",
76
- "rollup-plugin-node-externals": "^7.1.2",
77
- "typescript": "^4.6.4",
78
- "unplugin-icons": "^0.14.14",
79
- "vite": "^5.4.0",
80
- "vite-plugin-dts": "^3.8.1",
61
+ "react": "^18.3.1",
62
+ "react-dom": "^18.3.1",
63
+ "rollup-plugin-node-externals": "^7.1.3",
64
+ "typescript": "^4.9.5",
65
+ "unplugin-icons": "^0.14.15",
66
+ "vite": "^5.4.4",
67
+ "vite-plugin-dts": "^3.9.1",
81
68
  "vite-plugin-libcss": "^1.1.1"
82
69
  },
83
- "resolutions": {
84
- "react": "^18.2.0"
85
- },
86
- "gitHead": "749dd785b5ab83dbb7b7575b2e7f20cc21084129"
87
- }
70
+ "scripts": {
71
+ "dev": "npm run storybook",
72
+ "build": "tsc && vite build",
73
+ "build:watch": "vite build --watch",
74
+ "preview": "vite preview",
75
+ "storybook": "start-storybook -p 6007",
76
+ "build-storybook": "build-storybook",
77
+ "lint": "eslint src --ext .mjs,.js,.jsx,.ts,.tsx",
78
+ "lint:fix": "eslint src --ext .mjs,.js,.jsx,.ts,.tsx --fix"
79
+ }
80
+ }