@uipath/apollo-react 3.68.4 → 3.69.0-pr458.25d2dee

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.
@@ -43,6 +43,8 @@ const external_motion_react_namespaceObject = require("motion/react");
43
43
  const external_react_namespaceObject = require("react");
44
44
  const external_react_markdown_namespaceObject = require("react-markdown");
45
45
  var external_react_markdown_default = /*#__PURE__*/ __webpack_require__.n(external_react_markdown_namespaceObject);
46
+ const external_remark_breaks_namespaceObject = require("remark-breaks");
47
+ var external_remark_breaks_default = /*#__PURE__*/ __webpack_require__.n(external_remark_breaks_namespaceObject);
46
48
  const external_remark_gfm_namespaceObject = require("remark-gfm");
47
49
  var external_remark_gfm_default = /*#__PURE__*/ __webpack_require__.n(external_remark_gfm_namespaceObject);
48
50
  const external_constants_cjs_namespaceObject = require("../../constants.cjs");
@@ -53,6 +55,7 @@ const external_StickyNoteNode_styles_cjs_namespaceObject = require("./StickyNote
53
55
  const external_StickyNoteNode_types_cjs_namespaceObject = require("./StickyNoteNode.types.cjs");
54
56
  const external_StickyNoteNode_utils_cjs_namespaceObject = require("./StickyNoteNode.utils.cjs");
55
57
  const external_useMarkdownShortcuts_cjs_namespaceObject = require("./useMarkdownShortcuts.cjs");
58
+ const external_useScrollCapture_cjs_namespaceObject = require("./useScrollCapture.cjs");
56
59
  const minWidth = 8 * external_constants_cjs_namespaceObject.GRID_SPACING;
57
60
  const minHeight = 8 * external_constants_cjs_namespaceObject.GRID_SPACING;
58
61
  const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = 'Add text', renderPlaceholderOnSelect = false })=>{
@@ -62,6 +65,7 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
62
65
  const [isColorPickerOpen, setIsColorPickerOpen] = (0, external_react_namespaceObject.useState)(false);
63
66
  const [localContent, setLocalContent] = (0, external_react_namespaceObject.useState)(data.content || '');
64
67
  const textAreaRef = (0, external_react_namespaceObject.useRef)(null);
68
+ const { ref: markdownRef, scrollCaptureProps } = (0, external_useScrollCapture_cjs_namespaceObject.useScrollCapture)();
65
69
  const colorButtonRef = (0, external_react_namespaceObject.useRef)(null);
66
70
  const [activeFormats, setActiveFormats] = (0, external_react_namespaceObject.useState)({
67
71
  bold: false,
@@ -384,15 +388,19 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
384
388
  })
385
389
  ]
386
390
  }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_styles_cjs_namespaceObject.StickyNoteMarkdown, {
391
+ ref: markdownRef,
392
+ ...scrollCaptureProps,
387
393
  children: localContent ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_markdown_default(), {
388
394
  remarkPlugins: [
389
- external_remark_gfm_default()
395
+ external_remark_gfm_default(),
396
+ external_remark_breaks_default()
390
397
  ],
391
398
  components: markdownComponents,
392
399
  children: (0, external_StickyNoteNode_utils_cjs_namespaceObject.preserveNewlines)(localContent)
393
400
  }) : renderPlaceholderOnSelect && selected && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_markdown_default(), {
394
401
  remarkPlugins: [
395
- external_remark_gfm_default()
402
+ external_remark_gfm_default(),
403
+ external_remark_breaks_default()
396
404
  ],
397
405
  components: markdownComponents,
398
406
  children: placeholder
@@ -1 +1 @@
1
- {"version":3,"file":"StickyNoteNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/StickyNoteNode.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AA6B1E,OAAO,KAAK,EAAmB,cAAc,EAAiB,MAAM,wBAAwB,CAAC;AAK7F,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAsXD,eAAO,MAAM,cAAc,kHA1WxB,mBAAmB,6CA0WqC,CAAC"}
1
+ {"version":3,"file":"StickyNoteNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/StickyNoteNode.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AA8B1E,OAAO,KAAK,EAAmB,cAAc,EAAiB,MAAM,wBAAwB,CAAC;AAM7F,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AA6XD,eAAO,MAAM,cAAc,kHAjXxB,mBAAmB,6CAiXqC,CAAC"}
@@ -5,6 +5,7 @@ import { NodeResizeControl, useReactFlow } from "../../xyflow/react.js";
5
5
  import { AnimatePresence } from "motion/react";
6
6
  import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
7
7
  import react_markdown from "react-markdown";
8
+ import remark_breaks from "remark-breaks";
8
9
  import remark_gfm from "remark-gfm";
9
10
  import { GRID_SPACING } from "../../constants.js";
10
11
  import { NodeToolbar } from "../Toolbar/index.js";
@@ -14,6 +15,7 @@ import { BottomCornerIndicators, ColorOption, ColorPickerPanel, RESIZE_CONTROL_Z
14
15
  import { STICKY_NOTE_COLORS, withAlpha } from "./StickyNoteNode.types.js";
15
16
  import { preserveNewlines } from "./StickyNoteNode.utils.js";
16
17
  import { useMarkdownShortcuts } from "./useMarkdownShortcuts.js";
18
+ import { useScrollCapture } from "./useScrollCapture.js";
17
19
  const minWidth = 8 * GRID_SPACING;
18
20
  const minHeight = 8 * GRID_SPACING;
19
21
  const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = 'Add text', renderPlaceholderOnSelect = false })=>{
@@ -23,6 +25,7 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
23
25
  const [isColorPickerOpen, setIsColorPickerOpen] = useState(false);
24
26
  const [localContent, setLocalContent] = useState(data.content || '');
25
27
  const textAreaRef = useRef(null);
28
+ const { ref: markdownRef, scrollCaptureProps } = useScrollCapture();
26
29
  const colorButtonRef = useRef(null);
27
30
  const [activeFormats, setActiveFormats] = useState({
28
31
  bold: false,
@@ -345,15 +348,19 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
345
348
  })
346
349
  ]
347
350
  }) : /*#__PURE__*/ jsx(StickyNoteMarkdown, {
351
+ ref: markdownRef,
352
+ ...scrollCaptureProps,
348
353
  children: localContent ? /*#__PURE__*/ jsx(react_markdown, {
349
354
  remarkPlugins: [
350
- remark_gfm
355
+ remark_gfm,
356
+ remark_breaks
351
357
  ],
352
358
  components: markdownComponents,
353
359
  children: preserveNewlines(localContent)
354
360
  }) : renderPlaceholderOnSelect && selected && /*#__PURE__*/ jsx(react_markdown, {
355
361
  remarkPlugins: [
356
- remark_gfm
362
+ remark_gfm,
363
+ remark_breaks
357
364
  ],
358
365
  components: markdownComponents,
359
366
  children: placeholder
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ useScrollCapture: ()=>useScrollCapture
28
+ });
29
+ const external_react_namespaceObject = require("react");
30
+ const EVENT_START_POLL_INTERVAL = 150;
31
+ function useScrollCapture() {
32
+ const ref = (0, external_react_namespaceObject.useRef)(null);
33
+ const [captureScroll, setCaptureScroll] = (0, external_react_namespaceObject.useState)(false);
34
+ const wheelActiveRef = (0, external_react_namespaceObject.useRef)(false);
35
+ const wheelTimeoutRef = (0, external_react_namespaceObject.useRef)(null);
36
+ (0, external_react_namespaceObject.useEffect)(()=>{
37
+ const onWheel = ()=>{
38
+ wheelActiveRef.current = true;
39
+ if (wheelTimeoutRef.current) clearTimeout(wheelTimeoutRef.current);
40
+ wheelTimeoutRef.current = setTimeout(()=>{
41
+ wheelActiveRef.current = false;
42
+ }, EVENT_START_POLL_INTERVAL);
43
+ };
44
+ window.addEventListener('wheel', onWheel, {
45
+ passive: true
46
+ });
47
+ return ()=>window.removeEventListener('wheel', onWheel);
48
+ }, []);
49
+ const onMouseEnter = (0, external_react_namespaceObject.useCallback)(()=>{
50
+ if (wheelActiveRef.current) return;
51
+ const el = ref.current;
52
+ if (el && el.scrollHeight > el.clientHeight) setCaptureScroll(true);
53
+ }, []);
54
+ const onMouseLeave = (0, external_react_namespaceObject.useCallback)(()=>{
55
+ setCaptureScroll(false);
56
+ }, []);
57
+ return {
58
+ ref,
59
+ scrollCaptureProps: {
60
+ className: captureScroll ? 'nowheel' : void 0,
61
+ onMouseEnter,
62
+ onMouseLeave
63
+ }
64
+ };
65
+ }
66
+ exports.useScrollCapture = __webpack_exports__.useScrollCapture;
67
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
68
+ "useScrollCapture"
69
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
70
+ Object.defineProperty(exports, '__esModule', {
71
+ value: true
72
+ });
@@ -0,0 +1,9 @@
1
+ export declare function useScrollCapture<T extends HTMLElement = HTMLDivElement>(): {
2
+ ref: import("react").RefObject<T | null>;
3
+ scrollCaptureProps: {
4
+ className: string | undefined;
5
+ onMouseEnter: () => void;
6
+ onMouseLeave: () => void;
7
+ };
8
+ };
9
+ //# sourceMappingURL=useScrollCapture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScrollCapture.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/useScrollCapture.ts"],"names":[],"mappings":"AAYA,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,WAAW,GAAG,cAAc;;;;;;;EAwCtE"}
@@ -0,0 +1,38 @@
1
+ import { useCallback, useEffect, useRef, useState } from "react";
2
+ const EVENT_START_POLL_INTERVAL = 150;
3
+ function useScrollCapture() {
4
+ const ref = useRef(null);
5
+ const [captureScroll, setCaptureScroll] = useState(false);
6
+ const wheelActiveRef = useRef(false);
7
+ const wheelTimeoutRef = useRef(null);
8
+ useEffect(()=>{
9
+ const onWheel = ()=>{
10
+ wheelActiveRef.current = true;
11
+ if (wheelTimeoutRef.current) clearTimeout(wheelTimeoutRef.current);
12
+ wheelTimeoutRef.current = setTimeout(()=>{
13
+ wheelActiveRef.current = false;
14
+ }, EVENT_START_POLL_INTERVAL);
15
+ };
16
+ window.addEventListener('wheel', onWheel, {
17
+ passive: true
18
+ });
19
+ return ()=>window.removeEventListener('wheel', onWheel);
20
+ }, []);
21
+ const onMouseEnter = useCallback(()=>{
22
+ if (wheelActiveRef.current) return;
23
+ const el = ref.current;
24
+ if (el && el.scrollHeight > el.clientHeight) setCaptureScroll(true);
25
+ }, []);
26
+ const onMouseLeave = useCallback(()=>{
27
+ setCaptureScroll(false);
28
+ }, []);
29
+ return {
30
+ ref,
31
+ scrollCaptureProps: {
32
+ className: captureScroll ? 'nowheel' : void 0,
33
+ onMouseEnter,
34
+ onMouseLeave
35
+ }
36
+ };
37
+ }
38
+ export { useScrollCapture };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/apollo-react",
3
- "version": "3.68.4",
3
+ "version": "3.69.0-pr458.25d2dee",
4
4
  "description": "Apollo Design System - React component library with Material UI theming",
5
5
  "repository": {
6
6
  "type": "git",
@@ -181,7 +181,7 @@
181
181
  "debounce": "^3.0.0",
182
182
  "html-to-image": "^1.11.11",
183
183
  "katex": "^0.16.27",
184
- "lodash": "^4.17.23",
184
+ "lodash": "^4.18.1",
185
185
  "lucide-react": "^0.555.0",
186
186
  "luxon": "^3.7.1",
187
187
  "mermaid": "^11.13.0",
@@ -192,6 +192,7 @@
192
192
  "react-syntax-highlighter": "^16.1.0",
193
193
  "react-window": "^2.2.1",
194
194
  "rehype-katex": "^7.0.1",
195
+ "remark-breaks": "^4.0.0",
195
196
  "remark-gfm": "^4.0.1",
196
197
  "remark-math": "^6.0.0",
197
198
  "reselect": "^5.1.1",