@uipath/apollo-react 4.25.1 → 4.26.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.
@@ -26,10 +26,10 @@ __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
27
  useStageNodeLabels: ()=>useStageNodeLabels
28
28
  });
29
- const react_namespaceObject = require("@lingui/react");
30
29
  const external_react_namespaceObject = require("react");
30
+ const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
31
31
  function useStageNodeLabels() {
32
- const { _ } = (0, react_namespaceObject.useLingui)();
32
+ const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
33
33
  return (0, external_react_namespaceObject.useMemo)(()=>({
34
34
  addFirstTask: _({
35
35
  id: 'stage-node.add-first-task',
@@ -1,7 +1,7 @@
1
- import { useLingui } from "@lingui/react";
2
1
  import { useMemo } from "react";
2
+ import { useSafeLingui } from "../../../i18n/index.js";
3
3
  function useStageNodeLabels() {
4
- const { _ } = useLingui();
4
+ const { _ } = useSafeLingui();
5
5
  return useMemo(()=>({
6
6
  addFirstTask: _({
7
7
  id: 'stage-node.add-first-task',
@@ -27,15 +27,15 @@ __webpack_require__.d(__webpack_exports__, {
27
27
  FormattingToolbar: ()=>FormattingToolbar
28
28
  });
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
- const react_namespaceObject = require("@lingui/react");
31
30
  const external_index_cjs_namespaceObject = require("../../index.cjs");
32
31
  const external_react_namespaceObject = require("react");
32
+ const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
33
33
  const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
34
- const index_cjs_namespaceObject = require("./markdown-formatting/index.cjs");
34
+ const external_markdown_formatting_index_cjs_namespaceObject = require("./markdown-formatting/index.cjs");
35
35
  const external_StickyNoteNode_styles_cjs_namespaceObject = require("./StickyNoteNode.styles.cjs");
36
36
  const external_StickyNoteNode_utils_cjs_namespaceObject = require("./StickyNoteNode.utils.cjs");
37
37
  const FormattingToolbarComponent = ({ textAreaRef, borderColor, activeFormats, onFormat })=>{
38
- const { _ } = (0, react_namespaceObject.useLingui)();
38
+ const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
39
39
  const mod = (0, external_StickyNoteNode_utils_cjs_namespaceObject.getModifierKey)();
40
40
  const shift = (0, external_StickyNoteNode_utils_cjs_namespaceObject.isMac)() ? '⇧' : '+Shift+';
41
41
  const applyFormat = (0, external_react_namespaceObject.useCallback)((formatFn)=>{
@@ -52,19 +52,19 @@ const FormattingToolbarComponent = ({ textAreaRef, borderColor, activeFormats, o
52
52
  textAreaRef,
53
53
  onFormat
54
54
  ]);
55
- const handleBold = (0, external_react_namespaceObject.useCallback)(()=>applyFormat(index_cjs_namespaceObject.toggleBold), [
55
+ const handleBold = (0, external_react_namespaceObject.useCallback)(()=>applyFormat(external_markdown_formatting_index_cjs_namespaceObject.toggleBold), [
56
56
  applyFormat
57
57
  ]);
58
- const handleItalic = (0, external_react_namespaceObject.useCallback)(()=>applyFormat(index_cjs_namespaceObject.toggleItalic), [
58
+ const handleItalic = (0, external_react_namespaceObject.useCallback)(()=>applyFormat(external_markdown_formatting_index_cjs_namespaceObject.toggleItalic), [
59
59
  applyFormat
60
60
  ]);
61
- const handleStrikethrough = (0, external_react_namespaceObject.useCallback)(()=>applyFormat(index_cjs_namespaceObject.toggleStrikethrough), [
61
+ const handleStrikethrough = (0, external_react_namespaceObject.useCallback)(()=>applyFormat(external_markdown_formatting_index_cjs_namespaceObject.toggleStrikethrough), [
62
62
  applyFormat
63
63
  ]);
64
- const handleBulletList = (0, external_react_namespaceObject.useCallback)(()=>applyFormat(index_cjs_namespaceObject.toggleBulletList), [
64
+ const handleBulletList = (0, external_react_namespaceObject.useCallback)(()=>applyFormat(external_markdown_formatting_index_cjs_namespaceObject.toggleBulletList), [
65
65
  applyFormat
66
66
  ]);
67
- const handleNumberedList = (0, external_react_namespaceObject.useCallback)(()=>applyFormat(index_cjs_namespaceObject.toggleNumberedList), [
67
+ const handleNumberedList = (0, external_react_namespaceObject.useCallback)(()=>applyFormat(external_markdown_formatting_index_cjs_namespaceObject.toggleNumberedList), [
68
68
  applyFormat
69
69
  ]);
70
70
  const boldLabel = _({
@@ -1 +1 @@
1
- {"version":3,"file":"FormattingToolbar.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/FormattingToolbar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAa3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG5D,UAAU,sBAAsB;IAC9B,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3C;AAwHD,eAAO,MAAM,iBAAiB,+FAjH3B,sBAAsB,6CAiHwC,CAAC"}
1
+ {"version":3,"file":"FormattingToolbar.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/FormattingToolbar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAG1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAa3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG5D,UAAU,sBAAsB;IAC9B,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3C;AAwHD,eAAO,MAAM,iBAAiB,+FAjH3B,sBAAsB,6CAiHwC,CAAC"}
@@ -1,13 +1,13 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useLingui } from "@lingui/react";
3
2
  import { CanvasIcon } from "../../index.js";
4
3
  import { memo, useCallback } from "react";
4
+ import { useSafeLingui } from "../../../i18n/index.js";
5
5
  import { CanvasTooltip } from "../CanvasTooltip.js";
6
6
  import { toggleBold, toggleBulletList, toggleItalic, toggleNumberedList, toggleStrikethrough } from "./markdown-formatting/index.js";
7
7
  import { FormattingButton, FormattingToolbarContainer, ToolbarSeparator } from "./StickyNoteNode.styles.js";
8
8
  import { getModifierKey, isMac } from "./StickyNoteNode.utils.js";
9
9
  const FormattingToolbarComponent = ({ textAreaRef, borderColor, activeFormats, onFormat })=>{
10
- const { _ } = useLingui();
10
+ const { _ } = useSafeLingui();
11
11
  const mod = getModifierKey();
12
12
  const shift = isMac() ? '⇧' : '+Shift+';
13
13
  const applyFormat = useCallback((formatFn)=>{
@@ -27,10 +27,10 @@ __webpack_require__.d(__webpack_exports__, {
27
27
  Toolbox: ()=>Toolbox
28
28
  });
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
- const react_namespaceObject = require("@lingui/react");
31
30
  const index_cjs_namespaceObject = require("../../hooks/index.cjs");
32
31
  const external_layouts_index_cjs_namespaceObject = require("../../layouts/index.cjs");
33
32
  const external_react_namespaceObject = require("react");
33
+ const external_i18n_index_cjs_namespaceObject = require("../../../i18n/index.cjs");
34
34
  const external_react_window_namespaceObject = require("react-window");
35
35
  const external_constants_cjs_namespaceObject = require("../../constants.cjs");
36
36
  const external_Header_cjs_namespaceObject = require("./Header.cjs");
@@ -83,7 +83,7 @@ function searchLeafItems(items, query) {
83
83
  return results;
84
84
  }
85
85
  function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title, initialItems, loading, fullWidth = false, fullHeight = false, quickActions, renderEmptyState }) {
86
- const { _ } = (0, react_namespaceObject.useLingui)();
86
+ const { _ } = (0, external_i18n_index_cjs_namespaceObject.useSafeLingui)();
87
87
  const searchPlaceholder = _({
88
88
  id: 'toolbox.search',
89
89
  message: 'Search'
@@ -1,8 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useLingui } from "@lingui/react";
3
2
  import { useNavigationStack } from "../../hooks/index.js";
4
3
  import { Column } from "../../layouts/index.js";
5
4
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
+ import { useSafeLingui } from "../../../i18n/index.js";
6
6
  import { useListRef } from "react-window";
7
7
  import { TOOLBOX_GAP, TOOLBOX_HEIGHT, TOOLBOX_PADDING_X, TOOLBOX_PADDING_Y, TOOLBOX_WIDTH } from "../../constants.js";
8
8
  import { Header } from "./Header.js";
@@ -55,7 +55,7 @@ function searchLeafItems(items, query) {
55
55
  return results;
56
56
  }
57
57
  function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title, initialItems, loading, fullWidth = false, fullHeight = false, quickActions, renderEmptyState }) {
58
- const { _ } = useLingui();
58
+ const { _ } = useSafeLingui();
59
59
  const searchPlaceholder = _({
60
60
  id: 'toolbox.search',
61
61
  message: 'Search'
@@ -24,18 +24,22 @@ var __webpack_require__ = {};
24
24
  var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
+ useSafeLingui: ()=>external_useSafeLingui_cjs_namespaceObject.useSafeLingui,
27
28
  useApI18n: ()=>external_ApI18nProvider_cjs_namespaceObject.useApI18n,
28
29
  ApI18nProvider: ()=>external_ApI18nProvider_cjs_namespaceObject.ApI18nProvider,
29
30
  SUPPORTED_LOCALES: ()=>external_ApI18nProvider_cjs_namespaceObject.SUPPORTED_LOCALES
30
31
  });
31
32
  const external_ApI18nProvider_cjs_namespaceObject = require("./ApI18nProvider.cjs");
33
+ const external_useSafeLingui_cjs_namespaceObject = require("./useSafeLingui.cjs");
32
34
  exports.ApI18nProvider = __webpack_exports__.ApI18nProvider;
33
35
  exports.SUPPORTED_LOCALES = __webpack_exports__.SUPPORTED_LOCALES;
34
36
  exports.useApI18n = __webpack_exports__.useApI18n;
37
+ exports.useSafeLingui = __webpack_exports__.useSafeLingui;
35
38
  for(var __rspack_i in __webpack_exports__)if (-1 === [
36
39
  "ApI18nProvider",
37
40
  "SUPPORTED_LOCALES",
38
- "useApI18n"
41
+ "useApI18n",
42
+ "useSafeLingui"
39
43
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
40
44
  Object.defineProperty(exports, '__esModule', {
41
45
  value: true
@@ -1,3 +1,4 @@
1
1
  export type { ApI18nProviderProps, SupportedLocale } from './ApI18nProvider';
2
2
  export { ApI18nProvider, SUPPORTED_LOCALES, useApI18n } from './ApI18nProvider';
3
+ export { useSafeLingui } from './useSafeLingui';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  import { ApI18nProvider, SUPPORTED_LOCALES, useApI18n } from "./ApI18nProvider.js";
2
- export { ApI18nProvider, SUPPORTED_LOCALES, useApI18n };
2
+ import { useSafeLingui } from "./useSafeLingui.js";
3
+ export { ApI18nProvider, SUPPORTED_LOCALES, useApI18n, useSafeLingui };
@@ -0,0 +1,46 @@
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
+ useSafeLingui: ()=>useSafeLingui
28
+ });
29
+ const react_namespaceObject = require("@lingui/react");
30
+ const external_react_namespaceObject = require("react");
31
+ const fallbackTranslate = (arg)=>'string' == typeof arg ? arg : arg.message ?? arg.id;
32
+ function useSafeLingui() {
33
+ const ctx = (0, external_react_namespaceObject.useContext)(react_namespaceObject.LinguiContext);
34
+ return (0, external_react_namespaceObject.useMemo)(()=>({
35
+ _: ctx?._ ?? fallbackTranslate
36
+ }), [
37
+ ctx
38
+ ]);
39
+ }
40
+ exports.useSafeLingui = __webpack_exports__.useSafeLingui;
41
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
42
+ "useSafeLingui"
43
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
44
+ Object.defineProperty(exports, '__esModule', {
45
+ value: true
46
+ });
@@ -0,0 +1,14 @@
1
+ type Descriptor = {
2
+ id: string;
3
+ message?: string;
4
+ values?: Record<string, unknown>;
5
+ };
6
+ type Translate = {
7
+ (descriptor: Descriptor): string;
8
+ (id: string): string;
9
+ };
10
+ export declare function useSafeLingui(): {
11
+ _: Translate;
12
+ };
13
+ export {};
14
+ //# sourceMappingURL=useSafeLingui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSafeLingui.d.ts","sourceRoot":"","sources":["../../src/i18n/useSafeLingui.ts"],"names":[],"mappings":"AAGA,KAAK,UAAU,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC;AACrF,KAAK,SAAS,GAAG;IACf,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAAC;IACjC,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB,CAAC;AAcF,wBAAgB,aAAa,IAAI;IAAE,CAAC,EAAE,SAAS,CAAA;CAAE,CAGhD"}
@@ -0,0 +1,12 @@
1
+ import { LinguiContext } from "@lingui/react";
2
+ import { useContext, useMemo } from "react";
3
+ const fallbackTranslate = (arg)=>'string' == typeof arg ? arg : arg.message ?? arg.id;
4
+ function useSafeLingui() {
5
+ const ctx = useContext(LinguiContext);
6
+ return useMemo(()=>({
7
+ _: ctx?._ ?? fallbackTranslate
8
+ }), [
9
+ ctx
10
+ ]);
11
+ }
12
+ export { useSafeLingui };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/apollo-react",
3
- "version": "4.25.1",
3
+ "version": "4.26.1",
4
4
  "description": "Apollo Design System - React component library with Material UI theming",
5
5
  "repository": {
6
6
  "type": "git",