@ringcentral/juno 2.11.0 → 2.12.2

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.
@@ -107,7 +107,7 @@ var _RcDialPad = react_1.forwardRef(function (inProps, ref) {
107
107
  var ariaLabelArr = additionLabel
108
108
  ? [key, additionLabel]
109
109
  : [key];
110
- return (react_1.default.createElement(DialPadButton_1.RcDialPadButton, tslib_1.__assign({ classes: classes, symbol: symbol, key: key, value: key, onKeyEffect: handleKeyEffect }, getItemProps(index), { "aria-label": ariaLabelArr.join(','), onKeyDown: onKeyFocusedIndexHandle }, (_b = {}, _b[dialButtonKey] = key, _b), getDialPadButtonProps === null || getDialPadButtonProps === void 0 ? void 0 : getDialPadButtonProps(key), (key === '0'
110
+ return (react_1.default.createElement(DialPadButton_1.RcDialPadButton, tslib_1.__assign({ classes: classes, symbol: symbol, key: key, value: key, onKeyEffect: handleKeyEffect, externalWindow: externalWindow }, getItemProps(index), { "aria-label": ariaLabelArr.join(','), onKeyDown: onKeyFocusedIndexHandle }, (_b = {}, _b[dialButtonKey] = key, _b), getDialPadButtonProps === null || getDialPadButtonProps === void 0 ? void 0 : getDialPadButtonProps(key), (key === '0'
111
111
  ? {
112
112
  longPressValue: utils_3.DIALER_PAD_PLUS,
113
113
  longPressDelay: longPressDelay,
@@ -1,6 +1,8 @@
1
1
  import { RcIconButtonProps } from '../../Buttons';
2
2
  import { RcDialPadOnChangeReason } from '../DialPad';
3
3
  export declare type RcDialPadButtonProps = {
4
+ /** for custom window */
5
+ externalWindow?: Window;
4
6
  /** output value when press */
5
7
  value: string;
6
8
  /** output value when long press */
@@ -10,7 +12,7 @@ export declare type RcDialPadButtonProps = {
10
12
  /** emit effect when trigger number enter */
11
13
  onKeyEffect: (value: string, reason: RcDialPadOnChangeReason) => void;
12
14
  } & Pick<RcIconButtonProps, 'shouldPersistBg' | 'symbol' | 'classes' | 'tabIndex' | 'onKeyDown' | 'onFocus'>;
13
- declare const RcDialPadButton: import("styled-components").StyledComponentClass<RcDialPadButtonProps, import("../../../foundation").RcTheme, Pick<RcDialPadButtonProps, "symbol" | "tabIndex" | "onFocus" | "onKeyDown" | "classes" | "value" | "shouldPersistBg" | "longPressValue" | "longPressDelay" | "onKeyEffect"> & {
15
+ declare const RcDialPadButton: import("styled-components").StyledComponentClass<RcDialPadButtonProps, import("../../../foundation").RcTheme, Pick<RcDialPadButtonProps, "symbol" | "tabIndex" | "onFocus" | "onKeyDown" | "classes" | "value" | "shouldPersistBg" | "externalWindow" | "longPressValue" | "longPressDelay" | "onKeyEffect"> & {
14
16
  theme?: import("../../../foundation").RcTheme | undefined;
15
17
  }>;
16
18
  export { RcDialPadButton };
@@ -6,9 +6,9 @@ var foundation_1 = require("../../../foundation");
6
6
  var Buttons_1 = require("../../Buttons");
7
7
  var styles_1 = require("./styles");
8
8
  var _RcDialPadButton = function (props) {
9
- var value = props.value, longPressValue = props.longPressValue, longPressDelay = props.longPressDelay, onKeyEffect = props.onKeyEffect, rest = tslib_1.__rest(props, ["value", "longPressValue", "longPressDelay", "onKeyEffect"]);
9
+ var value = props.value, longPressValue = props.longPressValue, longPressDelay = props.longPressDelay, onKeyEffect = props.onKeyEffect, _a = props.externalWindow, externalWindow = _a === void 0 ? window : _a, rest = tslib_1.__rest(props, ["value", "longPressValue", "longPressDelay", "onKeyEffect", "externalWindow"]);
10
10
  var isPressEvent = typeof longPressDelay === 'number' && typeof longPressValue === 'string';
11
- var _a = foundation_1.useLongPress({
11
+ var _b = foundation_1.useLongPress({
12
12
  onTap: function (e, reason) {
13
13
  onKeyEffect(value, reason);
14
14
  },
@@ -17,7 +17,7 @@ var _RcDialPadButton = function (props) {
17
17
  onKeyEffect(longPressValue, reason);
18
18
  }
19
19
  : undefined,
20
- }, rest, { delay: longPressDelay }), ref = _a.ref, events = tslib_1.__rest(_a, ["ref"]);
20
+ }, rest, { delay: longPressDelay, externalWindow: externalWindow }), ref = _b.ref, events = tslib_1.__rest(_b, ["ref"]);
21
21
  return (react_1.default.createElement(Buttons_1.RcIconButton, tslib_1.__assign({ ref: ref, variant: "round", stretchIcon: true }, rest, events)));
22
22
  };
23
23
  var RcDialPadButton = foundation_1.styled(_RcDialPadButton)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.buttonWrapperStyle);
@@ -222,6 +222,7 @@ var PortalManager = /** @class */ (function (_super) {
222
222
  },
223
223
  onUnmounted: function () {
224
224
  var feedback = _this._feedbackMap.get(id);
225
+ _this._feedbackMap.delete(id);
225
226
  resolveOnClosed(feedback);
226
227
  },
227
228
  props: props,
@@ -1,2 +1,3 @@
1
+ export * from './HasPortalParentContext';
1
2
  export * from './PortalIDContext';
2
3
  export * from './PortalManagerContext';
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./HasPortalParentContext"), exports);
4
5
  tslib_1.__exportStar(require("./PortalIDContext"), exports);
5
6
  tslib_1.__exportStar(require("./PortalManagerContext"), exports);
@@ -1,4 +1,5 @@
1
1
  export * from './Connectable';
2
+ export { HasPortalParentProvider } from './context';
2
3
  export * from './PortalHost';
3
4
  export * from './PortalManager';
4
5
  export * from './utils';
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./Connectable"), exports);
5
+ var context_1 = require("./context");
6
+ exports.HasPortalParentProvider = context_1.HasPortalParentProvider;
5
7
  tslib_1.__exportStar(require("./PortalHost"), exports);
6
8
  tslib_1.__exportStar(require("./PortalManager"), exports);
7
9
  tslib_1.__exportStar(require("./utils"), exports);
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
+ // TODO: framer still not have flushSync in there framer version, skip that temporarily
3
+ // import { flushSync } from 'react-dom';
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var react_dom_1 = require("react-dom");
4
- function conditionalFlushSync(flag) {
5
- return flag ? react_dom_1.flushSync : function (cb) { return cb(); };
5
+ function conditionalFlushSync(
6
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
+ flag) {
8
+ // return flag ? flushSync : (cb: () => void) => cb();
9
+ return function (cb) { return cb(); };
6
10
  }
7
11
  exports.default = conditionalFlushSync;
@@ -105,7 +105,7 @@ var _RcDialPad = forwardRef(function (inProps, ref) {
105
105
  var ariaLabelArr = additionLabel
106
106
  ? [key, additionLabel]
107
107
  : [key];
108
- return (React.createElement(RcDialPadButton, __assign({ classes: classes, symbol: symbol, key: key, value: key, onKeyEffect: handleKeyEffect }, getItemProps(index), { "aria-label": ariaLabelArr.join(','), onKeyDown: onKeyFocusedIndexHandle }, (_b = {}, _b[dialButtonKey] = key, _b), getDialPadButtonProps === null || getDialPadButtonProps === void 0 ? void 0 : getDialPadButtonProps(key), (key === '0'
108
+ return (React.createElement(RcDialPadButton, __assign({ classes: classes, symbol: symbol, key: key, value: key, onKeyEffect: handleKeyEffect, externalWindow: externalWindow }, getItemProps(index), { "aria-label": ariaLabelArr.join(','), onKeyDown: onKeyFocusedIndexHandle }, (_b = {}, _b[dialButtonKey] = key, _b), getDialPadButtonProps === null || getDialPadButtonProps === void 0 ? void 0 : getDialPadButtonProps(key), (key === '0'
109
109
  ? {
110
110
  longPressValue: DIALER_PAD_PLUS,
111
111
  longPressDelay: longPressDelay,
@@ -4,9 +4,9 @@ import { styled, useLongPress } from '../../../foundation';
4
4
  import { RcIconButton } from '../../Buttons';
5
5
  import { buttonWrapperStyle } from './styles';
6
6
  var _RcDialPadButton = function (props) {
7
- var value = props.value, longPressValue = props.longPressValue, longPressDelay = props.longPressDelay, onKeyEffect = props.onKeyEffect, rest = __rest(props, ["value", "longPressValue", "longPressDelay", "onKeyEffect"]);
7
+ var value = props.value, longPressValue = props.longPressValue, longPressDelay = props.longPressDelay, onKeyEffect = props.onKeyEffect, _a = props.externalWindow, externalWindow = _a === void 0 ? window : _a, rest = __rest(props, ["value", "longPressValue", "longPressDelay", "onKeyEffect", "externalWindow"]);
8
8
  var isPressEvent = typeof longPressDelay === 'number' && typeof longPressValue === 'string';
9
- var _a = useLongPress({
9
+ var _b = useLongPress({
10
10
  onTap: function (e, reason) {
11
11
  onKeyEffect(value, reason);
12
12
  },
@@ -15,7 +15,7 @@ var _RcDialPadButton = function (props) {
15
15
  onKeyEffect(longPressValue, reason);
16
16
  }
17
17
  : undefined,
18
- }, rest, { delay: longPressDelay }), ref = _a.ref, events = __rest(_a, ["ref"]);
18
+ }, rest, { delay: longPressDelay, externalWindow: externalWindow }), ref = _b.ref, events = __rest(_b, ["ref"]);
19
19
  return (React.createElement(RcIconButton, __assign({ ref: ref, variant: "round", stretchIcon: true }, rest, events)));
20
20
  };
21
21
  var RcDialPadButton = styled(_RcDialPadButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), buttonWrapperStyle);
@@ -220,6 +220,7 @@ var PortalManager = /** @class */ (function (_super) {
220
220
  },
221
221
  onUnmounted: function () {
222
222
  var feedback = _this._feedbackMap.get(id);
223
+ _this._feedbackMap.delete(id);
223
224
  resolveOnClosed(feedback);
224
225
  },
225
226
  props: props,
@@ -1,2 +1,3 @@
1
+ export * from './HasPortalParentContext';
1
2
  export * from './PortalIDContext';
2
3
  export * from './PortalManagerContext';
@@ -1,4 +1,5 @@
1
1
  export * from './Connectable';
2
+ export { HasPortalParentProvider } from './context';
2
3
  export * from './PortalHost';
3
4
  export * from './PortalManager';
4
5
  export * from './utils';
@@ -1,4 +1,8 @@
1
- import { flushSync } from 'react-dom';
2
- export default function conditionalFlushSync(flag) {
3
- return flag ? flushSync : function (cb) { return cb(); };
1
+ // TODO: framer still not have flushSync in there framer version, skip that temporarily
2
+ // import { flushSync } from 'react-dom';
3
+ export default function conditionalFlushSync(
4
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
+ flag) {
6
+ // return flag ? flushSync : (cb: () => void) => cb();
7
+ return function (cb) { return cb(); };
4
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ringcentral/juno",
3
- "version": "2.11.0",
3
+ "version": "2.12.2",
4
4
  "author": "RingCentral",
5
5
  "license": "MIT",
6
6
  "main": "./index.js",