@redis-ui/components 51.27.0 → 51.29.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.
Files changed (142) hide show
  1. package/dist/CodeBlock/CodeBlock.cjs +32 -15
  2. package/dist/CodeBlock/CodeBlock.js +32 -15
  3. package/dist/CodeBlock/CodeBlock.style.d.ts +4 -3
  4. package/dist/CodeBlock/CodeBlock.types.cjs +7 -0
  5. package/dist/CodeBlock/CodeBlock.types.d.ts +9 -1
  6. package/dist/CodeBlock/CodeBlock.types.js +7 -1
  7. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.cjs +29 -0
  8. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.cjs +34 -0
  9. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.d.ts +25 -0
  10. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.js +32 -0
  11. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.d.ts +6 -0
  12. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.js +29 -0
  13. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.types.d.ts +10 -0
  14. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.types.js +1 -0
  15. package/dist/index.cjs +1 -0
  16. package/dist/index.js +2 -2
  17. package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.cjs +8 -0
  18. package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +8 -0
  19. package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.cjs +7 -0
  20. package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +7 -0
  21. package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.cjs +12 -0
  22. package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.js +12 -0
  23. package/dist/node_modules/@babel/runtime/helpers/esm/extends.cjs +17 -0
  24. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
  25. package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.cjs +6 -0
  26. package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +6 -0
  27. package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.cjs +6 -0
  28. package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +6 -0
  29. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.cjs +13 -0
  30. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +13 -0
  31. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.cjs +12 -0
  32. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
  33. package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.cjs +10 -0
  34. package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +10 -0
  35. package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.cjs +14 -0
  36. package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +14 -0
  37. package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.cjs +9 -0
  38. package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +9 -0
  39. package/dist/node_modules/@babel/runtime/helpers/esm/typeof.cjs +16 -0
  40. package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js +11 -0
  41. package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.cjs +11 -0
  42. package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +11 -0
  43. package/dist/node_modules/character-entities-legacy/index.cjs +116 -0
  44. package/dist/node_modules/character-entities-legacy/index.js +116 -0
  45. package/dist/node_modules/character-reference-invalid/index.cjs +38 -0
  46. package/dist/node_modules/character-reference-invalid/index.js +38 -0
  47. package/dist/node_modules/comma-separated-tokens/index.cjs +43 -0
  48. package/dist/node_modules/comma-separated-tokens/index.js +43 -0
  49. package/dist/node_modules/decode-named-character-reference/index.dom.cjs +15 -0
  50. package/dist/node_modules/decode-named-character-reference/index.dom.js +15 -0
  51. package/dist/node_modules/hast-util-parse-selector/lib/index.cjs +76 -0
  52. package/dist/node_modules/hast-util-parse-selector/lib/index.js +76 -0
  53. package/dist/node_modules/hastscript/lib/create-h.cjs +262 -0
  54. package/dist/node_modules/hastscript/lib/create-h.js +262 -0
  55. package/dist/node_modules/hastscript/lib/index.cjs +21 -0
  56. package/dist/node_modules/hastscript/lib/index.js +21 -0
  57. package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs +49 -0
  58. package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +49 -0
  59. package/dist/node_modules/is-alphabetical/index.cjs +14 -0
  60. package/dist/node_modules/is-alphabetical/index.js +14 -0
  61. package/dist/node_modules/is-alphanumerical/index.cjs +15 -0
  62. package/dist/node_modules/is-alphanumerical/index.js +15 -0
  63. package/dist/node_modules/is-decimal/index.cjs +14 -0
  64. package/dist/node_modules/is-decimal/index.js +14 -0
  65. package/dist/node_modules/is-hexadecimal/index.cjs +14 -0
  66. package/dist/node_modules/is-hexadecimal/index.js +14 -0
  67. package/dist/node_modules/parse-entities/lib/index.cjs +232 -0
  68. package/dist/node_modules/parse-entities/lib/index.js +232 -0
  69. package/dist/node_modules/property-information/index.cjs +27 -0
  70. package/dist/node_modules/property-information/index.js +26 -0
  71. package/dist/node_modules/property-information/lib/aria.cjs +60 -0
  72. package/dist/node_modules/property-information/lib/aria.js +61 -0
  73. package/dist/node_modules/property-information/lib/find.cjs +81 -0
  74. package/dist/node_modules/property-information/lib/find.js +81 -0
  75. package/dist/node_modules/property-information/lib/html.cjs +326 -0
  76. package/dist/node_modules/property-information/lib/html.js +326 -0
  77. package/dist/node_modules/property-information/lib/normalize.cjs +15 -0
  78. package/dist/node_modules/property-information/lib/normalize.js +15 -0
  79. package/dist/node_modules/property-information/lib/svg.cjs +564 -0
  80. package/dist/node_modules/property-information/lib/svg.js +564 -0
  81. package/dist/node_modules/property-information/lib/util/case-insensitive-transform.cjs +15 -0
  82. package/dist/node_modules/property-information/lib/util/case-insensitive-transform.js +15 -0
  83. package/dist/node_modules/property-information/lib/util/case-sensitive-transform.cjs +14 -0
  84. package/dist/node_modules/property-information/lib/util/case-sensitive-transform.js +14 -0
  85. package/dist/node_modules/property-information/lib/util/create.cjs +53 -0
  86. package/dist/node_modules/property-information/lib/util/create.js +53 -0
  87. package/dist/node_modules/property-information/lib/util/defined-info.cjs +49 -0
  88. package/dist/node_modules/property-information/lib/util/defined-info.js +49 -0
  89. package/dist/node_modules/property-information/lib/util/info.cjs +33 -0
  90. package/dist/node_modules/property-information/lib/util/info.js +33 -0
  91. package/dist/node_modules/property-information/lib/util/merge.cjs +26 -0
  92. package/dist/node_modules/property-information/lib/util/merge.js +26 -0
  93. package/dist/node_modules/property-information/lib/util/schema.cjs +27 -0
  94. package/dist/node_modules/property-information/lib/util/schema.js +27 -0
  95. package/dist/node_modules/property-information/lib/util/types.cjs +35 -0
  96. package/dist/node_modules/property-information/lib/util/types.js +24 -0
  97. package/dist/node_modules/property-information/lib/xlink.cjs +18 -0
  98. package/dist/node_modules/property-information/lib/xlink.js +19 -0
  99. package/dist/node_modules/property-information/lib/xml.cjs +14 -0
  100. package/dist/node_modules/property-information/lib/xml.js +15 -0
  101. package/dist/node_modules/property-information/lib/xmlns.cjs +14 -0
  102. package/dist/node_modules/property-information/lib/xmlns.js +14 -0
  103. package/dist/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.cjs +6 -0
  104. package/dist/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.js +6 -0
  105. package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.cjs +183 -0
  106. package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.js +181 -0
  107. package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.cjs +308 -0
  108. package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.js +306 -0
  109. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.cjs +4 -0
  110. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.js +5 -0
  111. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.cjs +4 -0
  112. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.js +5 -0
  113. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/python.cjs +4 -0
  114. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/python.js +5 -0
  115. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.cjs +4 -0
  116. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.js +5 -0
  117. package/dist/node_modules/react-syntax-highlighter/dist/esm/prism-light.cjs +12 -0
  118. package/dist/node_modules/react-syntax-highlighter/dist/esm/prism-light.js +12 -0
  119. package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vs.cjs +121 -0
  120. package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vs.js +121 -0
  121. package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.cjs +147 -0
  122. package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.js +147 -0
  123. package/dist/node_modules/refractor/lang/bash.cjs +190 -0
  124. package/dist/node_modules/refractor/lang/bash.js +190 -0
  125. package/dist/node_modules/refractor/lang/clike.cjs +37 -0
  126. package/dist/node_modules/refractor/lang/clike.js +37 -0
  127. package/dist/node_modules/refractor/lang/javascript.cjs +122 -0
  128. package/dist/node_modules/refractor/lang/javascript.js +122 -0
  129. package/dist/node_modules/refractor/lang/json.cjs +36 -0
  130. package/dist/node_modules/refractor/lang/json.js +36 -0
  131. package/dist/node_modules/refractor/lang/python.cjs +71 -0
  132. package/dist/node_modules/refractor/lang/python.js +71 -0
  133. package/dist/node_modules/refractor/lang/typescript.cjs +55 -0
  134. package/dist/node_modules/refractor/lang/typescript.js +55 -0
  135. package/dist/node_modules/refractor/lib/core.cjs +214 -0
  136. package/dist/node_modules/refractor/lib/core.js +214 -0
  137. package/dist/node_modules/refractor/lib/prism-core.cjs +595 -0
  138. package/dist/node_modules/refractor/lib/prism-core.js +595 -0
  139. package/dist/node_modules/space-separated-tokens/index.cjs +15 -0
  140. package/dist/node_modules/space-separated-tokens/index.js +15 -0
  141. package/package.json +3 -1
  142. package/skills/redis-ui-components/references/CodeBlock.md +27 -6
@@ -1,9 +1,10 @@
1
1
  const require_CopyToClipboardButton = require("../Button/CopyToClipboardButton/CopyToClipboardButton.cjs");
2
2
  const require_CodeBlock_style = require("./CodeBlock.style.cjs");
3
+ const require_HighlightedCode = require("./components/HighlightedCode/HighlightedCode.cjs");
3
4
  let react_jsx_runtime = require("react/jsx-runtime");
4
5
  let react = require("react");
5
6
  //#region src/CodeBlock/CodeBlock.tsx
6
- var useIsScrollable = (code, overflow, maxHeight) => {
7
+ var useIsScrollable = ({ code, overflow, maxHeight, language }) => {
7
8
  const ref = (0, react.useRef)(null);
8
9
  const [isScrollable, setIsScrollable] = (0, react.useState)(false);
9
10
  (0, react.useLayoutEffect)(() => {
@@ -18,32 +19,48 @@ var useIsScrollable = (code, overflow, maxHeight) => {
18
19
  }, [
19
20
  code,
20
21
  overflow,
21
- maxHeight
22
+ maxHeight,
23
+ language
22
24
  ]);
23
25
  return [ref, isScrollable];
24
26
  };
25
- var CodeBlock = (0, react.forwardRef)(({ code, copyLabel, overflow = "scroll", maxHeight, size = "M", "aria-label": ariaLabel = "Code", ...restProps }, ref) => {
26
- const [preRef, isScrollable] = useIsScrollable(code, overflow, maxHeight);
27
+ var CodeBlock = (0, react.forwardRef)(({ code, language, copyLabel, onCopy, onCopyError, overflow = "scroll", maxHeight, size = "M", "aria-label": ariaLabel = "Code", ...restProps }, ref) => {
28
+ const [preRef, isScrollable] = useIsScrollable({
29
+ code,
30
+ overflow,
31
+ maxHeight,
32
+ language
33
+ });
34
+ const preProps = {
35
+ $size: size,
36
+ $overflow: overflow,
37
+ $maxHeight: maxHeight,
38
+ $withCopy: Boolean(copyLabel),
39
+ ...isScrollable && {
40
+ tabIndex: 0,
41
+ role: "region",
42
+ "aria-label": ariaLabel
43
+ }
44
+ };
27
45
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_CodeBlock_style.CodeBlock, {
28
46
  ref,
29
47
  ...restProps,
30
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CodeBlock_style.CodeBlockPre, {
48
+ children: [language ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_HighlightedCode.default, {
31
49
  ref: preRef,
32
- $size: size,
33
- $overflow: overflow,
34
- $maxHeight: maxHeight,
35
- $withCopy: Boolean(copyLabel),
36
- ...isScrollable && {
37
- tabIndex: 0,
38
- role: "region",
39
- "aria-label": ariaLabel
40
- },
50
+ code,
51
+ language,
52
+ ...preProps
53
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CodeBlock_style.CodeBlockPre, {
54
+ ref: preRef,
55
+ ...preProps,
41
56
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CodeBlock_style.CodeBlockCode, { children: code })
42
57
  }), copyLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CodeBlock_style.CodeBlockCopy, {
43
58
  $size: size,
44
59
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CopyToClipboardButton.default, {
45
60
  textToCopy: code,
46
- "aria-label": copyLabel
61
+ "aria-label": copyLabel,
62
+ onCopy,
63
+ onCopyError
47
64
  })
48
65
  })]
49
66
  });
@@ -1,9 +1,10 @@
1
1
  import CopyToClipboardButton from "../Button/CopyToClipboardButton/CopyToClipboardButton.js";
2
2
  import { CodeBlock as CodeBlock$1, CodeBlockCode, CodeBlockCopy, CodeBlockPre } from "./CodeBlock.style.js";
3
+ import HighlightedCode from "./components/HighlightedCode/HighlightedCode.js";
3
4
  import { jsx, jsxs } from "react/jsx-runtime";
4
5
  import { forwardRef, useLayoutEffect, useRef, useState } from "react";
5
6
  //#region src/CodeBlock/CodeBlock.tsx
6
- var useIsScrollable = (code, overflow, maxHeight) => {
7
+ var useIsScrollable = ({ code, overflow, maxHeight, language }) => {
7
8
  const ref = useRef(null);
8
9
  const [isScrollable, setIsScrollable] = useState(false);
9
10
  useLayoutEffect(() => {
@@ -18,32 +19,48 @@ var useIsScrollable = (code, overflow, maxHeight) => {
18
19
  }, [
19
20
  code,
20
21
  overflow,
21
- maxHeight
22
+ maxHeight,
23
+ language
22
24
  ]);
23
25
  return [ref, isScrollable];
24
26
  };
25
- var CodeBlock = forwardRef(({ code, copyLabel, overflow = "scroll", maxHeight, size = "M", "aria-label": ariaLabel = "Code", ...restProps }, ref) => {
26
- const [preRef, isScrollable] = useIsScrollable(code, overflow, maxHeight);
27
+ var CodeBlock = forwardRef(({ code, language, copyLabel, onCopy, onCopyError, overflow = "scroll", maxHeight, size = "M", "aria-label": ariaLabel = "Code", ...restProps }, ref) => {
28
+ const [preRef, isScrollable] = useIsScrollable({
29
+ code,
30
+ overflow,
31
+ maxHeight,
32
+ language
33
+ });
34
+ const preProps = {
35
+ $size: size,
36
+ $overflow: overflow,
37
+ $maxHeight: maxHeight,
38
+ $withCopy: Boolean(copyLabel),
39
+ ...isScrollable && {
40
+ tabIndex: 0,
41
+ role: "region",
42
+ "aria-label": ariaLabel
43
+ }
44
+ };
27
45
  return /* @__PURE__ */ jsxs(CodeBlock$1, {
28
46
  ref,
29
47
  ...restProps,
30
- children: [/* @__PURE__ */ jsx(CodeBlockPre, {
48
+ children: [language ? /* @__PURE__ */ jsx(HighlightedCode, {
31
49
  ref: preRef,
32
- $size: size,
33
- $overflow: overflow,
34
- $maxHeight: maxHeight,
35
- $withCopy: Boolean(copyLabel),
36
- ...isScrollable && {
37
- tabIndex: 0,
38
- role: "region",
39
- "aria-label": ariaLabel
40
- },
50
+ code,
51
+ language,
52
+ ...preProps
53
+ }) : /* @__PURE__ */ jsx(CodeBlockPre, {
54
+ ref: preRef,
55
+ ...preProps,
41
56
  children: /* @__PURE__ */ jsx(CodeBlockCode, { children: code })
42
57
  }), copyLabel && /* @__PURE__ */ jsx(CodeBlockCopy, {
43
58
  $size: size,
44
59
  children: /* @__PURE__ */ jsx(CopyToClipboardButton, {
45
60
  textToCopy: code,
46
- "aria-label": copyLabel
61
+ "aria-label": copyLabel,
62
+ onCopy,
63
+ onCopyError
47
64
  })
48
65
  })]
49
66
  });
@@ -1,11 +1,12 @@
1
1
  import { CodeBlockOverflow, CodeBlockSize } from './CodeBlock.types';
2
- export declare const CodeBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const CodeBlockPre: import("styled-components").StyledComponent<"pre", any, {
2
+ export type CodeBlockPreStyleProps = {
4
3
  $size: CodeBlockSize;
5
4
  $overflow: CodeBlockOverflow;
6
5
  $maxHeight?: string;
7
6
  $withCopy: boolean;
8
- }, never>;
7
+ };
8
+ export declare const CodeBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
9
+ export declare const CodeBlockPre: import("styled-components").StyledComponent<"pre", any, CodeBlockPreStyleProps, never>;
9
10
  export declare const CodeBlockCode: import("styled-components").StyledComponent<"code", any, {}, never>;
10
11
  /** Spans the first code line, so the button centers on it */
11
12
  export declare const CodeBlockCopy: import("styled-components").StyledComponent<"div", any, {
@@ -5,6 +5,13 @@ var codeBlockOverflows = [
5
5
  "wrap",
6
6
  "ellipsis"
7
7
  ];
8
+ var codeBlockLanguages = [
9
+ "bash",
10
+ "json",
11
+ "python",
12
+ "typescript"
13
+ ];
8
14
  //#endregion
15
+ exports.codeBlockLanguages = codeBlockLanguages;
9
16
  exports.codeBlockOverflows = codeBlockOverflows;
10
17
  exports.codeBlockSizes = codeBlockSizes;
@@ -3,15 +3,23 @@ export declare const codeBlockSizes: readonly ["M", "S"];
3
3
  export type CodeBlockSize = (typeof codeBlockSizes)[number];
4
4
  export declare const codeBlockOverflows: readonly ["scroll", "wrap", "ellipsis"];
5
5
  export type CodeBlockOverflow = (typeof codeBlockOverflows)[number];
6
+ export declare const codeBlockLanguages: readonly ["bash", "json", "python", "typescript"];
7
+ export type CodeBlockLanguage = (typeof codeBlockLanguages)[number];
6
8
  export type OwnCodeBlockProps = {
7
9
  code: string;
10
+ /** Highlights the code's syntax */
11
+ language?: CodeBlockLanguage;
8
12
  /** Shows a copy button and is used as its accessible name */
9
13
  copyLabel?: string;
14
+ /** Called with the code after the copy button copies it */
15
+ onCopy?: (text: string) => void;
16
+ /** Called when the copy button fails to copy */
17
+ onCopyError?: (error: unknown) => void;
10
18
  /** How long lines behave: scroll horizontally, wrap, or truncate with an ellipsis */
11
19
  overflow?: CodeBlockOverflow;
12
20
  /** Scrolls vertically past this height */
13
21
  maxHeight?: string;
14
22
  size?: CodeBlockSize;
15
23
  };
16
- export type RestCodeBlockProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
24
+ export type RestCodeBlockProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onCopy'>;
17
25
  export type CodeBlockProps = OwnCodeBlockProps & RestCodeBlockProps;
@@ -5,5 +5,11 @@ var codeBlockOverflows = [
5
5
  "wrap",
6
6
  "ellipsis"
7
7
  ];
8
+ var codeBlockLanguages = [
9
+ "bash",
10
+ "json",
11
+ "python",
12
+ "typescript"
13
+ ];
8
14
  //#endregion
9
- export { codeBlockOverflows, codeBlockSizes };
15
+ export { codeBlockLanguages, codeBlockOverflows, codeBlockSizes };
@@ -0,0 +1,29 @@
1
+ const require_prism_light = require("../../../node_modules/react-syntax-highlighter/dist/esm/prism-light.cjs");
2
+ const require_CodeBlock_style = require("../../CodeBlock.style.cjs");
3
+ const require_HighlightedCode_constants = require("./HighlightedCode.constants.cjs");
4
+ let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ let react = require("react");
7
+ //#region src/CodeBlock/components/HighlightedCode/HighlightedCode.tsx
8
+ Object.entries(require_HighlightedCode_constants.grammars).forEach(([name, grammar]) => require_prism_light.default.registerLanguage(name, grammar));
9
+ require_prism_light.default.registerLanguage(require_HighlightedCode_constants.bashCommands.displayName, require_HighlightedCode_constants.bashCommands);
10
+ var HighlightedPre = ({ preRef, ...restProps }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CodeBlock_style.CodeBlockPre, {
11
+ ref: preRef,
12
+ ...restProps
13
+ });
14
+ var HighlightedCode = (0, react.forwardRef)(({ code, language, ...preProps }, ref) => {
15
+ const { mode } = (0, _redislabsdev_redis_ui_styles.useTheme)();
16
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_prism_light.default, {
17
+ language,
18
+ style: require_HighlightedCode_constants.syntaxStyles[mode],
19
+ wrapLongLines: preProps.$overflow === "wrap",
20
+ PreTag: HighlightedPre,
21
+ CodeTag: require_CodeBlock_style.CodeBlockCode,
22
+ preRef: ref,
23
+ ...preProps,
24
+ children: code
25
+ });
26
+ });
27
+ HighlightedCode.displayName = "HighlightedCode";
28
+ //#endregion
29
+ exports.default = HighlightedCode;
@@ -0,0 +1,34 @@
1
+ const require_bash = require("../../../node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.cjs");
2
+ const require_json = require("../../../node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.cjs");
3
+ const require_python = require("../../../node_modules/react-syntax-highlighter/dist/esm/languages/prism/python.cjs");
4
+ const require_typescript = require("../../../node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.cjs");
5
+ const require_vs = require("../../../node_modules/react-syntax-highlighter/dist/esm/styles/prism/vs.cjs");
6
+ const require_vsc_dark_plus = require("../../../node_modules/react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.cjs");
7
+ //#region src/CodeBlock/components/HighlightedCode/HighlightedCode.constants.ts
8
+ var grammars = {
9
+ bash: require_bash.default,
10
+ json: require_json.default,
11
+ python: require_python.default,
12
+ typescript: require_typescript.default
13
+ };
14
+ /** Colors bash commands, including `npx` and `pip`, as keywords */
15
+ var bashCommands = Object.assign((prism) => {
16
+ prism.languages.insertBefore("bash", "function", { "package-manager": {
17
+ pattern: /(^|[\s;|&]|[<>]\()(?:npx|pip)(?=$|[)\s;|&])/,
18
+ lookbehind: true,
19
+ alias: "keyword"
20
+ } });
21
+ prism.languages.bash.function.alias = "keyword";
22
+ }, { displayName: "bash-commands" });
23
+ var tokenColors = (style) => ({
24
+ ...Object.fromEntries(Object.entries(style).filter(([selector]) => !selector.includes("language-"))),
25
+ "pre[class*=\"language-\"]": {}
26
+ });
27
+ var syntaxStyles = {
28
+ light: tokenColors(require_vs.default),
29
+ dark: tokenColors(require_vsc_dark_plus.default)
30
+ };
31
+ //#endregion
32
+ exports.bashCommands = bashCommands;
33
+ exports.grammars = grammars;
34
+ exports.syntaxStyles = syntaxStyles;
@@ -0,0 +1,25 @@
1
+ import { CSSProperties } from 'react';
2
+ import { ThemeMode } from '@redis-ui/styles';
3
+ type Prism = {
4
+ languages: {
5
+ insertBefore: (inside: string, before: string, insert: Record<string, unknown>) => void;
6
+ bash: {
7
+ function: {
8
+ alias?: string;
9
+ };
10
+ };
11
+ };
12
+ };
13
+ type SyntaxStyle = Record<string, CSSProperties>;
14
+ export declare const grammars: {
15
+ bash: any;
16
+ json: any;
17
+ python: any;
18
+ typescript: any;
19
+ };
20
+ /** Colors bash commands, including `npx` and `pip`, as keywords */
21
+ export declare const bashCommands: ((prism: Prism) => void) & {
22
+ displayName: string;
23
+ };
24
+ export declare const syntaxStyles: Record<ThemeMode, SyntaxStyle>;
25
+ export {};
@@ -0,0 +1,32 @@
1
+ import bash_default from "../../../node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.js";
2
+ import json_default from "../../../node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.js";
3
+ import python_default from "../../../node_modules/react-syntax-highlighter/dist/esm/languages/prism/python.js";
4
+ import typescript_default from "../../../node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.js";
5
+ import vs_default from "../../../node_modules/react-syntax-highlighter/dist/esm/styles/prism/vs.js";
6
+ import vsc_dark_plus_default from "../../../node_modules/react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.js";
7
+ //#region src/CodeBlock/components/HighlightedCode/HighlightedCode.constants.ts
8
+ var grammars = {
9
+ bash: bash_default,
10
+ json: json_default,
11
+ python: python_default,
12
+ typescript: typescript_default
13
+ };
14
+ /** Colors bash commands, including `npx` and `pip`, as keywords */
15
+ var bashCommands = Object.assign((prism) => {
16
+ prism.languages.insertBefore("bash", "function", { "package-manager": {
17
+ pattern: /(^|[\s;|&]|[<>]\()(?:npx|pip)(?=$|[)\s;|&])/,
18
+ lookbehind: true,
19
+ alias: "keyword"
20
+ } });
21
+ prism.languages.bash.function.alias = "keyword";
22
+ }, { displayName: "bash-commands" });
23
+ var tokenColors = (style) => ({
24
+ ...Object.fromEntries(Object.entries(style).filter(([selector]) => !selector.includes("language-"))),
25
+ "pre[class*=\"language-\"]": {}
26
+ });
27
+ var syntaxStyles = {
28
+ light: tokenColors(vs_default),
29
+ dark: tokenColors(vsc_dark_plus_default)
30
+ };
31
+ //#endregion
32
+ export { bashCommands, grammars, syntaxStyles };
@@ -0,0 +1,6 @@
1
+ import * as S from '../../CodeBlock.style';
2
+ declare const HighlightedCode: import("react").ForwardRefExoticComponent<S.CodeBlockPreStyleProps & Omit<import("react").HTMLAttributes<HTMLPreElement>, "style" | "children"> & {
3
+ code: string;
4
+ language: import("../..").CodeBlockLanguage;
5
+ } & import("react").RefAttributes<HTMLPreElement>>;
6
+ export default HighlightedCode;
@@ -0,0 +1,29 @@
1
+ import SyntaxHighlighter from "../../../node_modules/react-syntax-highlighter/dist/esm/prism-light.js";
2
+ import { CodeBlockCode, CodeBlockPre } from "../../CodeBlock.style.js";
3
+ import { bashCommands, grammars, syntaxStyles } from "./HighlightedCode.constants.js";
4
+ import { useTheme } from "@redis-ui/styles";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { forwardRef } from "react";
7
+ //#region src/CodeBlock/components/HighlightedCode/HighlightedCode.tsx
8
+ Object.entries(grammars).forEach(([name, grammar]) => SyntaxHighlighter.registerLanguage(name, grammar));
9
+ SyntaxHighlighter.registerLanguage(bashCommands.displayName, bashCommands);
10
+ var HighlightedPre = ({ preRef, ...restProps }) => /* @__PURE__ */ jsx(CodeBlockPre, {
11
+ ref: preRef,
12
+ ...restProps
13
+ });
14
+ var HighlightedCode = forwardRef(({ code, language, ...preProps }, ref) => {
15
+ const { mode } = useTheme();
16
+ return /* @__PURE__ */ jsx(SyntaxHighlighter, {
17
+ language,
18
+ style: syntaxStyles[mode],
19
+ wrapLongLines: preProps.$overflow === "wrap",
20
+ PreTag: HighlightedPre,
21
+ CodeTag: CodeBlockCode,
22
+ preRef: ref,
23
+ ...preProps,
24
+ children: code
25
+ });
26
+ });
27
+ HighlightedCode.displayName = "HighlightedCode";
28
+ //#endregion
29
+ export { HighlightedCode as default };
@@ -0,0 +1,10 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ import { CodeBlockLanguage } from '../../CodeBlock.types';
3
+ import { CodeBlockPreStyleProps } from '../../CodeBlock.style';
4
+ export type HighlightedPreProps = CodeBlockPreStyleProps & HTMLAttributes<HTMLPreElement> & {
5
+ preRef: Ref<HTMLPreElement>;
6
+ };
7
+ export type HighlightedCodeProps = CodeBlockPreStyleProps & Omit<HTMLAttributes<HTMLPreElement>, 'children' | 'style'> & {
8
+ code: string;
9
+ language: CodeBlockLanguage;
10
+ };
package/dist/index.cjs CHANGED
@@ -288,6 +288,7 @@ Object.defineProperty(exports, "cardVariants", {
288
288
  }
289
289
  });
290
290
  exports.childrenToString = require_react_utils.childrenToString;
291
+ exports.codeBlockLanguages = require_CodeBlock_types.codeBlockLanguages;
291
292
  exports.codeBlockOverflows = require_CodeBlock_types.codeBlockOverflows;
292
293
  exports.codeBlockSizes = require_CodeBlock_types.codeBlockSizes;
293
294
  exports.combineHandlers = require_react_utils.combineHandlers;
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ import Chip from "./Chip/Chip.js";
72
72
  import { Overflow } from "./Overflow/Overflow.js";
73
73
  import ChipList from "./ChipList/ChipList.js";
74
74
  import CodeBlock from "./CodeBlock/CodeBlock.js";
75
- import { codeBlockOverflows, codeBlockSizes } from "./CodeBlock/CodeBlock.types.js";
75
+ import { codeBlockLanguages, codeBlockOverflows, codeBlockSizes } from "./CodeBlock/CodeBlock.types.js";
76
76
  import CountryFlag from "./CountryFlag/CountryFlag.js";
77
77
  import Drawer from "./Drawer/Drawer.js";
78
78
  import TreeView from "./TreeView/TreeView.js";
@@ -119,4 +119,4 @@ import { ProgressBar } from "./ProgressBar/ProgressBar.js";
119
119
  import { ProfileIcon_style_exports } from "./ProfileIcon/ProfileIcon.style.js";
120
120
  import ProfileIcon from "./ProfileIcon/ProfileIcon.js";
121
121
  import Slider from "./Slider/Slider.js";
122
- export { ActionIconButton_style_exports as ActionButtonWithIconStyles, ActionIconButton, AppBar, AppBar_style_exports as AppBarStyles, AppSelectionMenu, AutoCompleteSelect, Badge, Badge_style_exports as BadgeStyles, Banner, BoxSelectionGroup, Breadcrumbs, Button, ButtonGroup, Button_style_exports as ButtonStyles, IconButton_style_exports as ButtonWithIconStyles, Card, CategoryValueList, Checkbox, Chip, ChipContainer, ChipList, CodeBlock, ContextProvider, CopyToClipboardButton, CountryFlag, Drawer, ErrorContentProvider, FieldAdditionTextIdProvider, FieldAdditionTextIdTransProvider, FieldDisabledProvider, FieldDisabledTransProvider, FieldReadonlyProvider, FieldReadonlyTransProvider, FieldRequiredProvider, FieldRequiredTransProvider, FieldStatusProvider, FieldStatusTransProvider, Filters, FlexDivider, FlexGroup, FlexItem, FlexSplit, FormField, Gauge, Grid, Hero, HighlightedIcon, HighlightedIcon_style_exports as HighlightedIconStyles, IconButton, Input, KeyValueList, Label, Link, LinkList, LinkStyler, Loader, Menu, MidBar, Modal, MoreInfoIcon, MultiBoxSelectionGroup, MultiSelect, NumericInput, Overflow, Pagination, PasswordInput, Popover, PopperProvider, ProfileIcon, ProfileIcon_style_exports as ProfileIconStyles, ProgressBar, QuantityCounter, RadioGroup, RestylableElement, ScreenReaderAnnounce, SearchBar, SearchInput, Section, Select, SelfContained, SharedIdProvider, SharedIdTransProvider, SideBar, Skeleton, Slider, Stepper, StepperStepState, Switch, TableHeading, Tabs, TextArea, TextButton, TextButton_style_exports as TextButtonStyles, ThemeModeSwitch, Toast, Toaster, ToggleButton, ToggleButton_style_exports as ToggleButtonStyles, Tooltip, TooltipCard, Provider as TooltipProvider, TreeView, Typography, UseCaseList, actionIconButtonSizes, badgeVariants, bannerVariants, buttonSizes, buttonVariants, buttonWithIconVariants, cardHoverEffects, cardVariants, childrenToString, codeBlockOverflows, codeBlockSizes, combineHandlers, copyToClipboardButtonVariants, createNullableContext, createPrimitiveContextState, debounce, forwardRefWithGenerics, generateId, getClosestDivisibleNumber, handlePreventDefault, handleStopPropagation, iconButtonSizes, isFragmentElement, isTextualNode, memoWithGenerics, textButtonSizes, textButtonVariants, throttle, toast, typographyColors, useEllipsisTooltip, useErrorContent, useFieldAdditionTextId, useFieldDisabled, useFieldReadonly, useFieldRequired, useFieldStatus, useGeneratedId, useInputValueApi, useInputValueProps, useKeyValueList, useMultiSelectContext, usePaginationContext, usePopperContext, useScrollable, useSelectContext, useSharedId, useThemeModeSwitch, useToastParams };
122
+ export { ActionIconButton_style_exports as ActionButtonWithIconStyles, ActionIconButton, AppBar, AppBar_style_exports as AppBarStyles, AppSelectionMenu, AutoCompleteSelect, Badge, Badge_style_exports as BadgeStyles, Banner, BoxSelectionGroup, Breadcrumbs, Button, ButtonGroup, Button_style_exports as ButtonStyles, IconButton_style_exports as ButtonWithIconStyles, Card, CategoryValueList, Checkbox, Chip, ChipContainer, ChipList, CodeBlock, ContextProvider, CopyToClipboardButton, CountryFlag, Drawer, ErrorContentProvider, FieldAdditionTextIdProvider, FieldAdditionTextIdTransProvider, FieldDisabledProvider, FieldDisabledTransProvider, FieldReadonlyProvider, FieldReadonlyTransProvider, FieldRequiredProvider, FieldRequiredTransProvider, FieldStatusProvider, FieldStatusTransProvider, Filters, FlexDivider, FlexGroup, FlexItem, FlexSplit, FormField, Gauge, Grid, Hero, HighlightedIcon, HighlightedIcon_style_exports as HighlightedIconStyles, IconButton, Input, KeyValueList, Label, Link, LinkList, LinkStyler, Loader, Menu, MidBar, Modal, MoreInfoIcon, MultiBoxSelectionGroup, MultiSelect, NumericInput, Overflow, Pagination, PasswordInput, Popover, PopperProvider, ProfileIcon, ProfileIcon_style_exports as ProfileIconStyles, ProgressBar, QuantityCounter, RadioGroup, RestylableElement, ScreenReaderAnnounce, SearchBar, SearchInput, Section, Select, SelfContained, SharedIdProvider, SharedIdTransProvider, SideBar, Skeleton, Slider, Stepper, StepperStepState, Switch, TableHeading, Tabs, TextArea, TextButton, TextButton_style_exports as TextButtonStyles, ThemeModeSwitch, Toast, Toaster, ToggleButton, ToggleButton_style_exports as ToggleButtonStyles, Tooltip, TooltipCard, Provider as TooltipProvider, TreeView, Typography, UseCaseList, actionIconButtonSizes, badgeVariants, bannerVariants, buttonSizes, buttonVariants, buttonWithIconVariants, cardHoverEffects, cardVariants, childrenToString, codeBlockLanguages, codeBlockOverflows, codeBlockSizes, combineHandlers, copyToClipboardButtonVariants, createNullableContext, createPrimitiveContextState, debounce, forwardRefWithGenerics, generateId, getClosestDivisibleNumber, handlePreventDefault, handleStopPropagation, iconButtonSizes, isFragmentElement, isTextualNode, memoWithGenerics, textButtonSizes, textButtonVariants, throttle, toast, typographyColors, useEllipsisTooltip, useErrorContent, useFieldAdditionTextId, useFieldDisabled, useFieldReadonly, useFieldRequired, useFieldStatus, useGeneratedId, useInputValueApi, useInputValueProps, useKeyValueList, useMultiSelectContext, usePaginationContext, usePopperContext, useScrollable, useSelectContext, useSharedId, useThemeModeSwitch, useToastParams };
@@ -0,0 +1,8 @@
1
+ //#region ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
2
+ function _arrayLikeToArray(r, a) {
3
+ (null == a || a > r.length) && (a = r.length);
4
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
5
+ return n;
6
+ }
7
+ //#endregion
8
+ exports._arrayLikeToArray = _arrayLikeToArray;
@@ -0,0 +1,8 @@
1
+ //#region ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
2
+ function _arrayLikeToArray(r, a) {
3
+ (null == a || a > r.length) && (a = r.length);
4
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
5
+ return n;
6
+ }
7
+ //#endregion
8
+ export { _arrayLikeToArray };
@@ -0,0 +1,7 @@
1
+ const require_arrayLikeToArray = require("./arrayLikeToArray.cjs");
2
+ //#region ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
3
+ function _arrayWithoutHoles(r) {
4
+ if (Array.isArray(r)) return require_arrayLikeToArray._arrayLikeToArray(r);
5
+ }
6
+ //#endregion
7
+ exports._arrayWithoutHoles = _arrayWithoutHoles;
@@ -0,0 +1,7 @@
1
+ import { _arrayLikeToArray } from "./arrayLikeToArray.js";
2
+ //#region ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
3
+ function _arrayWithoutHoles(r) {
4
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
5
+ }
6
+ //#endregion
7
+ export { _arrayWithoutHoles };
@@ -0,0 +1,12 @@
1
+ const require_toPropertyKey = require("./toPropertyKey.cjs");
2
+ //#region ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
3
+ function _defineProperty(e, r, t) {
4
+ return (r = require_toPropertyKey.toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
5
+ value: t,
6
+ enumerable: !0,
7
+ configurable: !0,
8
+ writable: !0
9
+ }) : e[r] = t, e;
10
+ }
11
+ //#endregion
12
+ exports._defineProperty = _defineProperty;
@@ -0,0 +1,12 @@
1
+ import { toPropertyKey } from "./toPropertyKey.js";
2
+ //#region ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
3
+ function _defineProperty(e, r, t) {
4
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
5
+ value: t,
6
+ enumerable: !0,
7
+ configurable: !0,
8
+ writable: !0
9
+ }) : e[r] = t, e;
10
+ }
11
+ //#endregion
12
+ export { _defineProperty };
@@ -0,0 +1,17 @@
1
+ //#region ../../node_modules/@babel/runtime/helpers/esm/extends.js
2
+ function _extends() {
3
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
4
+ for (var e = 1; e < arguments.length; e++) {
5
+ var t = arguments[e];
6
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
7
+ }
8
+ return n;
9
+ }, _extends.apply(null, arguments);
10
+ }
11
+ //#endregion
12
+ Object.defineProperty(exports, "_extends", {
13
+ enumerable: true,
14
+ get: function() {
15
+ return _extends;
16
+ }
17
+ });
@@ -0,0 +1,12 @@
1
+ //#region ../../node_modules/@babel/runtime/helpers/esm/extends.js
2
+ function _extends() {
3
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
4
+ for (var e = 1; e < arguments.length; e++) {
5
+ var t = arguments[e];
6
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
7
+ }
8
+ return n;
9
+ }, _extends.apply(null, arguments);
10
+ }
11
+ //#endregion
12
+ export { _extends };
@@ -0,0 +1,6 @@
1
+ //#region ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
2
+ function _iterableToArray(r) {
3
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
4
+ }
5
+ //#endregion
6
+ exports._iterableToArray = _iterableToArray;
@@ -0,0 +1,6 @@
1
+ //#region ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
2
+ function _iterableToArray(r) {
3
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
4
+ }
5
+ //#endregion
6
+ export { _iterableToArray };
@@ -0,0 +1,6 @@
1
+ //#region ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
2
+ function _nonIterableSpread() {
3
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4
+ }
5
+ //#endregion
6
+ exports._nonIterableSpread = _nonIterableSpread;
@@ -0,0 +1,6 @@
1
+ //#region ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
2
+ function _nonIterableSpread() {
3
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4
+ }
5
+ //#endregion
6
+ export { _nonIterableSpread };
@@ -0,0 +1,13 @@
1
+ const require_objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose.cjs");
2
+ //#region ../../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
3
+ function _objectWithoutProperties(e, t) {
4
+ if (null == e) return {};
5
+ var o, r, i = require_objectWithoutPropertiesLoose._objectWithoutPropertiesLoose(e, t);
6
+ if (Object.getOwnPropertySymbols) {
7
+ var n = Object.getOwnPropertySymbols(e);
8
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
9
+ }
10
+ return i;
11
+ }
12
+ //#endregion
13
+ exports._objectWithoutProperties = _objectWithoutProperties;
@@ -0,0 +1,13 @@
1
+ import { _objectWithoutPropertiesLoose } from "./objectWithoutPropertiesLoose.js";
2
+ //#region ../../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
3
+ function _objectWithoutProperties(e, t) {
4
+ if (null == e) return {};
5
+ var o, r, i = _objectWithoutPropertiesLoose(e, t);
6
+ if (Object.getOwnPropertySymbols) {
7
+ var n = Object.getOwnPropertySymbols(e);
8
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
9
+ }
10
+ return i;
11
+ }
12
+ //#endregion
13
+ export { _objectWithoutProperties };
@@ -0,0 +1,12 @@
1
+ //#region ../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
2
+ function _objectWithoutPropertiesLoose(r, e) {
3
+ if (null == r) return {};
4
+ var t = {};
5
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
6
+ if (-1 !== e.indexOf(n)) continue;
7
+ t[n] = r[n];
8
+ }
9
+ return t;
10
+ }
11
+ //#endregion
12
+ exports._objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
@@ -0,0 +1,12 @@
1
+ //#region ../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
2
+ function _objectWithoutPropertiesLoose(r, e) {
3
+ if (null == r) return {};
4
+ var t = {};
5
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
6
+ if (-1 !== e.indexOf(n)) continue;
7
+ t[n] = r[n];
8
+ }
9
+ return t;
10
+ }
11
+ //#endregion
12
+ export { _objectWithoutPropertiesLoose };
@@ -0,0 +1,10 @@
1
+ const require_arrayWithoutHoles = require("./arrayWithoutHoles.cjs");
2
+ const require_iterableToArray = require("./iterableToArray.cjs");
3
+ const require_unsupportedIterableToArray = require("./unsupportedIterableToArray.cjs");
4
+ const require_nonIterableSpread = require("./nonIterableSpread.cjs");
5
+ //#region ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
6
+ function _toConsumableArray(r) {
7
+ return require_arrayWithoutHoles._arrayWithoutHoles(r) || require_iterableToArray._iterableToArray(r) || require_unsupportedIterableToArray._unsupportedIterableToArray(r) || require_nonIterableSpread._nonIterableSpread();
8
+ }
9
+ //#endregion
10
+ exports._toConsumableArray = _toConsumableArray;