@blocklet/labels 1.6.220 → 1.6.221

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/dist/index.es.js CHANGED
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
8
- import { createContext, useRef, useState, useCallback, useEffect, useMemo, useContext, createElement } from "react";
8
+ import { createContext, useRef, useState, useCallback, useEffect, useMemo, useContext, createElement, Fragment as Fragment$1 } from "react";
9
9
  import { ExpandMore, Edit, LabelOutlined } from "@mui/icons-material";
10
10
  import Box from "@mui/material/Box";
11
11
  import { styled } from "@mui/material/styles";
@@ -852,7 +852,8 @@ function GithubLabelPicker({
852
852
  updateImmediately = true,
853
853
  excludes = [],
854
854
  disabled = false,
855
- enableAccessControl = true
855
+ enableAccessControl = true,
856
+ disablePortal
856
857
  }) {
857
858
  const { t, locale } = useLocaleContext();
858
859
  const { isAdmin, hasAnyPassport } = useSessionContext();
@@ -959,7 +960,7 @@ function GithubLabelPicker({
959
960
  open,
960
961
  anchorEl,
961
962
  placement: "bottom-start",
962
- disablePortal: true,
963
+ disablePortal,
963
964
  sx: (theme) => ({
964
965
  border: `1px solid ${theme.palette.mode === "light" ? "#e1e4e8" : "#30363d"}`,
965
966
  boxShadow: `0 8px 24px ${theme.palette.mode === "light" ? "rgba(149, 157, 165, 0.2)" : "rgb(1, 4, 9)"}`,
@@ -1028,7 +1029,7 @@ function GithubLabelPicker({
1028
1029
  },
1029
1030
  groupBy: () => "x",
1030
1031
  renderGroup: (params) => {
1031
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1032
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
1032
1033
  !!(initialRecentLabels == null ? void 0 : initialRecentLabels.length) && /* @__PURE__ */ jsxs("li", { children: [
1033
1034
  /* @__PURE__ */ jsx(Box$1, { sx: { mb: 0.5, fontSize: 12, fontWeight: "medium" }, children: t("label.recently") }),
1034
1035
  /* @__PURE__ */ jsx(Box$1, { sx: { display: "flex", flexWrap: "wrap", gap: 0.5 }, children: initialRecentLabels.map((x) => {
@@ -1041,7 +1042,8 @@ function GithubLabelPicker({
1041
1042
  onClick: () => {
1042
1043
  handleChange(selected ? pendingValue.filter((y) => y !== x) : [...pendingValue, x]);
1043
1044
  }
1044
- }
1045
+ },
1046
+ x
1045
1047
  );
1046
1048
  }) })
1047
1049
  ] }),
@@ -1062,7 +1064,7 @@ function GithubLabelPicker({
1062
1064
  }
1063
1065
  )
1064
1066
  ] })
1065
- ] });
1067
+ ] }, params.key);
1066
1068
  },
1067
1069
  options: filteredLabels,
1068
1070
  getOptionLabel: (option) => option.data.getName(locale),
package/dist/index.umd.js CHANGED
@@ -839,7 +839,8 @@ var __publicField = (obj, key, value) => {
839
839
  updateImmediately = true,
840
840
  excludes = [],
841
841
  disabled = false,
842
- enableAccessControl = true
842
+ enableAccessControl = true,
843
+ disablePortal
843
844
  }) {
844
845
  const { t, locale } = context.useLocaleContext();
845
846
  const { isAdmin, hasAnyPassport } = useSessionContext();
@@ -946,7 +947,7 @@ var __publicField = (obj, key, value) => {
946
947
  open,
947
948
  anchorEl,
948
949
  placement: "bottom-start",
949
- disablePortal: true,
950
+ disablePortal,
950
951
  sx: (theme) => ({
951
952
  border: `1px solid ${theme.palette.mode === "light" ? "#e1e4e8" : "#30363d"}`,
952
953
  boxShadow: `0 8px 24px ${theme.palette.mode === "light" ? "rgba(149, 157, 165, 0.2)" : "rgb(1, 4, 9)"}`,
@@ -1015,7 +1016,7 @@ var __publicField = (obj, key, value) => {
1015
1016
  },
1016
1017
  groupBy: () => "x",
1017
1018
  renderGroup: (params) => {
1018
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1019
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
1019
1020
  !!(initialRecentLabels == null ? void 0 : initialRecentLabels.length) && /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
1020
1021
  /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { mb: 0.5, fontSize: 12, fontWeight: "medium" }, children: t("label.recently") }),
1021
1022
  /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 0.5 }, children: initialRecentLabels.map((x) => {
@@ -1028,7 +1029,8 @@ var __publicField = (obj, key, value) => {
1028
1029
  onClick: () => {
1029
1030
  handleChange(selected ? pendingValue.filter((y) => y !== x) : [...pendingValue, x]);
1030
1031
  }
1031
- }
1032
+ },
1033
+ x
1032
1034
  );
1033
1035
  }) })
1034
1036
  ] }),
@@ -1049,7 +1051,7 @@ var __publicField = (obj, key, value) => {
1049
1051
  }
1050
1052
  )
1051
1053
  ] })
1052
- ] });
1054
+ ] }, params.key);
1053
1055
  },
1054
1056
  options: filteredLabels,
1055
1057
  getOptionLabel: (option) => option.data.getName(locale),
@@ -13,5 +13,6 @@ export interface GithubLabelPickerProps {
13
13
  disabled?: boolean;
14
14
  enableAccessControl?: boolean;
15
15
  title?: string;
16
+ disablePortal?: boolean;
16
17
  }
17
- export declare function GithubLabelPicker({ value, onChange, noLabelsText, buttonSx, actions, trigger, multiple, updateImmediately, excludes, disabled, enableAccessControl, }: GithubLabelPickerProps): import("react/jsx-runtime").JSX.Element | null;
18
+ export declare function GithubLabelPicker({ value, onChange, noLabelsText, buttonSx, actions, trigger, multiple, updateImmediately, excludes, disabled, enableAccessControl, disablePortal, }: GithubLabelPickerProps): import("react/jsx-runtime").JSX.Element | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/labels",
3
- "version": "1.6.220",
3
+ "version": "1.6.221",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -28,7 +28,7 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@blocklet/translation-input": "1.6.220",
31
+ "@blocklet/translation-input": "1.6.221",
32
32
  "@emotion/css": "^11.10.5",
33
33
  "@emotion/react": "^11.10.5",
34
34
  "@emotion/styled": "^11.10.5",
@@ -83,5 +83,5 @@
83
83
  "resolutions": {
84
84
  "react": "^18.2.0"
85
85
  },
86
- "gitHead": "3465af311407e4d977b94b9805d73aa5a3492254"
86
+ "gitHead": "f0112b033a68810a1c41806d7c4587b264021a68"
87
87
  }