@wix/entity-advanced-permissions 1.1422.0 → 1.1423.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.
- package/dist/statics/entity-advanced-permissions.umd.js +163 -106
- package/dist/statics/entity-advanced-permissions.umd.js.map +1 -1
- package/dist/statics/entity-advanced-permissions.umd.min.js +2 -2
- package/dist/statics/entity-advanced-permissions.umd.min.js.map +1 -1
- package/dist/statics/manifest.json +2 -2
- package/dist/statics/manifest.min.json +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
|
@@ -34679,7 +34679,7 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
|
|
34679
34679
|
/******/
|
|
34680
34680
|
/******/ /* webpack/runtime/publicPath */
|
|
34681
34681
|
/******/ (() => {
|
|
34682
|
-
/******/ __webpack_require__.p = "https://static.parastorage.com/services/entity-advanced-permissions/
|
|
34682
|
+
/******/ __webpack_require__.p = "https://static.parastorage.com/services/entity-advanced-permissions/35fbe31f90b9e6b03bec0eea24c498f8fb3769eff353f660d067e57a/";
|
|
34683
34683
|
/******/ })();
|
|
34684
34684
|
/******/
|
|
34685
34685
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
@@ -34783,7 +34783,7 @@ var __webpack_exports__ = {};
|
|
|
34783
34783
|
(() => {
|
|
34784
34784
|
"use strict";
|
|
34785
34785
|
/*!********************************!*\
|
|
34786
|
-
!*** ./index.ts +
|
|
34786
|
+
!*** ./index.ts + 566 modules ***!
|
|
34787
34787
|
\********************************/
|
|
34788
34788
|
// ESM COMPAT FLAG
|
|
34789
34789
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -35710,7 +35710,7 @@ if(false /* HMR */) // removed by dead control flow
|
|
|
35710
35710
|
{}
|
|
35711
35711
|
|
|
35712
35712
|
;// ../../../node_modules/@wix/design-system/dist/esm/utils/versionedNamespace.js
|
|
35713
|
-
const placeholder = '
|
|
35713
|
+
const placeholder = 'wds_1_338_0';
|
|
35714
35714
|
const versionedNamespace = placeholder.startsWith('wds_')
|
|
35715
35715
|
? placeholder
|
|
35716
35716
|
: '';
|
|
@@ -40791,15 +40791,7 @@ const useEventCallback = (fn) => {
|
|
|
40791
40791
|
}, []);
|
|
40792
40792
|
};
|
|
40793
40793
|
//# sourceMappingURL=useEventCallback.js.map
|
|
40794
|
-
;// ../../../node_modules/@wix/design-system/dist/esm/
|
|
40795
|
-
|
|
40796
|
-
|
|
40797
|
-
|
|
40798
|
-
|
|
40799
|
-
|
|
40800
|
-
|
|
40801
|
-
|
|
40802
|
-
|
|
40794
|
+
;// ../../../node_modules/@wix/design-system/dist/esm/utils/containsNativelyInteractive.js
|
|
40803
40795
|
const isNativelyInteractive = (element) => {
|
|
40804
40796
|
if (!element.hasAttribute('tabindex')) {
|
|
40805
40797
|
return element.tabIndex >= 0;
|
|
@@ -40808,6 +40800,11 @@ const isNativelyInteractive = (element) => {
|
|
|
40808
40800
|
probe.removeAttribute('tabindex');
|
|
40809
40801
|
return probe.tabIndex >= 0;
|
|
40810
40802
|
};
|
|
40803
|
+
/**
|
|
40804
|
+
* Whether `target`, or an ancestor below `boundary`, is interactive on its own
|
|
40805
|
+
* (a button, a link, a form field). An element that is focusable only through
|
|
40806
|
+
* a `tabindex` attribute does not count.
|
|
40807
|
+
*/
|
|
40811
40808
|
const containsNativelyInteractive = (target, boundary) => {
|
|
40812
40809
|
for (let element = target; element && element !== boundary; element = element.parentElement) {
|
|
40813
40810
|
if (isNativelyInteractive(element)) {
|
|
@@ -40816,6 +40813,17 @@ const containsNativelyInteractive = (target, boundary) => {
|
|
|
40816
40813
|
}
|
|
40817
40814
|
return false;
|
|
40818
40815
|
};
|
|
40816
|
+
//# sourceMappingURL=containsNativelyInteractive.js.map
|
|
40817
|
+
;// ../../../node_modules/@wix/design-system/dist/esm/Tooltip/Tooltip.js
|
|
40818
|
+
|
|
40819
|
+
|
|
40820
|
+
|
|
40821
|
+
|
|
40822
|
+
|
|
40823
|
+
|
|
40824
|
+
|
|
40825
|
+
|
|
40826
|
+
|
|
40819
40827
|
const Tooltip = (0,external_React_.forwardRef)((componentProps, ref) => {
|
|
40820
40828
|
const { onShow = () => ({}), onHide = () => ({}), size = 'medium', className, placement = 'top', exitDelay = FALLBACK_EXIT_DELAY, enterDelay = FALLBACK_ENTER_DELAY, moveArrowTo, appendTo = 'window', flip = true, fixed = false, maxWidth = 204, fluid, moveBy, disabled, children, zIndex = ZIndex.tooltip, textAlign = 'start', content = '', inline, 'aria-describedby': ariaDescribedBy, 'aria-labelledby': ariaLabelledBy, interactive = true, ...rest } = useDefaultProps('Tooltip', componentProps);
|
|
40821
40829
|
const [shown, setShown] = (0,external_React_.useState)(false);
|
|
@@ -45159,15 +45167,22 @@ const Ticker_constants_dataHooks = {
|
|
|
45159
45167
|
|
|
45160
45168
|
|
|
45161
45169
|
|
|
45162
|
-
|
|
45163
|
-
|
|
45164
|
-
const
|
|
45165
|
-
|
|
45166
|
-
|
|
45167
|
-
|
|
45168
|
-
|
|
45169
|
-
|
|
45170
|
-
|
|
45170
|
+
|
|
45171
|
+
const Ticker = ({ onUp, onDown, upDisabled, downDisabled, onMouseDown, dataHook, }) => {
|
|
45172
|
+
const icons = useIcons('InputTicker', {
|
|
45173
|
+
FormFieldSpinnerUp: FormFieldSpinnerUp_default,
|
|
45174
|
+
FormFieldSpinnerDown: FormFieldSpinnerDown_default,
|
|
45175
|
+
});
|
|
45176
|
+
return (external_React_default().createElement(InputConsumer, { consumerCompName: Ticker.displayName }, ({ disabled, readOnly, size }) => {
|
|
45177
|
+
const isUpDisabled = upDisabled || disabled || readOnly;
|
|
45178
|
+
const isDownDisabled = downDisabled || disabled || readOnly;
|
|
45179
|
+
return (external_React_default().createElement("div", { className: Ticker_classes_classes.root({ size }), onMouseDown: onMouseDown, "data-hook": dataHook },
|
|
45180
|
+
external_React_default().createElement("div", { "data-hook": Ticker_constants_dataHooks.tickerUp, "data-disabled": isUpDisabled, className: Ticker_classes_classes.up({ disabled: isUpDisabled }), onClick: isUpDisabled ? undefined : onUp },
|
|
45181
|
+
external_React_default().createElement(icons.FormFieldSpinnerUp, null)),
|
|
45182
|
+
external_React_default().createElement("div", { "data-hook": Ticker_constants_dataHooks.tickerDown, "data-disabled": isDownDisabled, className: Ticker_classes_classes.down({ disabled: isDownDisabled }), onClick: isDownDisabled ? undefined : onDown },
|
|
45183
|
+
external_React_default().createElement(icons.FormFieldSpinnerDown, null))));
|
|
45184
|
+
}));
|
|
45185
|
+
};
|
|
45171
45186
|
Ticker.displayName = 'Input.Ticker';
|
|
45172
45187
|
|
|
45173
45188
|
//# sourceMappingURL=Ticker.js.map
|
|
@@ -45380,12 +45395,7 @@ var FormFieldErrorFilled_default = FormFieldErrorFilled;
|
|
|
45380
45395
|
|
|
45381
45396
|
|
|
45382
45397
|
|
|
45383
|
-
|
|
45384
|
-
success: external_React_default().createElement(FormFieldSuccessFilled_default, null),
|
|
45385
|
-
warning: external_React_default().createElement(FormFieldWarningFilled_default, null),
|
|
45386
|
-
loading: external_React_default().createElement(Loader, { size: "tiny" }),
|
|
45387
|
-
error: external_React_default().createElement(FormFieldErrorFilled_default, null),
|
|
45388
|
-
};
|
|
45398
|
+
|
|
45389
45399
|
const StatusIndicator = (props) => {
|
|
45390
45400
|
const { dataHook, status = STATUS.ERROR, message, tooltipPlacement = TOOLTIP_PLACEMENT.TOP, className, tooltipProps, } = props;
|
|
45391
45401
|
(0,external_React_.useEffect)(() => {
|
|
@@ -45394,6 +45404,17 @@ const StatusIndicator = (props) => {
|
|
|
45394
45404
|
}
|
|
45395
45405
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45396
45406
|
}, []);
|
|
45407
|
+
const icons = useIcons('StatusIndicator', {
|
|
45408
|
+
FormFieldSuccessFilled: FormFieldSuccessFilled_default,
|
|
45409
|
+
FormFieldWarningFilled: FormFieldWarningFilled_default,
|
|
45410
|
+
FormFieldErrorFilled: FormFieldErrorFilled_default,
|
|
45411
|
+
});
|
|
45412
|
+
const statusToIconMap = {
|
|
45413
|
+
success: external_React_default().createElement(icons.FormFieldSuccessFilled, null),
|
|
45414
|
+
warning: external_React_default().createElement(icons.FormFieldWarningFilled, null),
|
|
45415
|
+
loading: external_React_default().createElement(Loader, { size: "tiny" }),
|
|
45416
|
+
error: external_React_default().createElement(icons.FormFieldErrorFilled, null),
|
|
45417
|
+
};
|
|
45397
45418
|
const icon = statusToIconMap[status];
|
|
45398
45419
|
const renderIcon = () => {
|
|
45399
45420
|
if (message) {
|
|
@@ -62857,6 +62878,7 @@ const Drawer = ({ open, backdrop = true, renderBackdrop = true, resizable = true
|
|
|
62857
62878
|
const contentRef = (0,external_React_.useRef)(null);
|
|
62858
62879
|
const handleRef = (0,external_React_.useRef)(null);
|
|
62859
62880
|
const restingY = (0,external_React_.useRef)(0);
|
|
62881
|
+
const outsideReason = (0,external_React_.useRef)('outside-press');
|
|
62860
62882
|
const dragState = (0,external_React_.useRef)({
|
|
62861
62883
|
isDragging: false,
|
|
62862
62884
|
startY: 0,
|
|
@@ -62990,7 +63012,7 @@ const Drawer = ({ open, backdrop = true, renderBackdrop = true, resizable = true
|
|
|
62990
63012
|
const visibleHeight = contentHeight - currentY;
|
|
62991
63013
|
const lowestSnap = resolvedSnaps[0];
|
|
62992
63014
|
if (dismissible && visibleHeight < lowestSnap * 0.5) {
|
|
62993
|
-
animateToY(currentY, contentHeight, () => onClose(false));
|
|
63015
|
+
animateToY(currentY, contentHeight, () => onClose(false, 'drag'));
|
|
62994
63016
|
return;
|
|
62995
63017
|
}
|
|
62996
63018
|
let nearest = resolvedSnaps[0];
|
|
@@ -63083,16 +63105,24 @@ const Drawer = ({ open, backdrop = true, renderBackdrop = true, resizable = true
|
|
|
63083
63105
|
onHandlePointerUp();
|
|
63084
63106
|
}
|
|
63085
63107
|
};
|
|
63086
|
-
const
|
|
63108
|
+
const handleEscapeKeyDown = (e) => {
|
|
63087
63109
|
e.preventDefault();
|
|
63088
63110
|
if (!dismissible)
|
|
63089
63111
|
return;
|
|
63090
63112
|
const el = contentRef.current;
|
|
63091
63113
|
if (!el) {
|
|
63092
|
-
onClose(false);
|
|
63114
|
+
onClose(false, 'escape-key');
|
|
63115
|
+
return;
|
|
63116
|
+
}
|
|
63117
|
+
animateToY(restingY.current, getSize(el), () => onClose(false, 'escape-key'));
|
|
63118
|
+
};
|
|
63119
|
+
const handleInteractOutside = (e) => {
|
|
63120
|
+
if (!dismissible) {
|
|
63121
|
+
e.preventDefault();
|
|
63093
63122
|
return;
|
|
63094
63123
|
}
|
|
63095
|
-
|
|
63124
|
+
outsideReason.current =
|
|
63125
|
+
e.detail.originalEvent.type === 'focusin' ? 'focus-out' : 'outside-press';
|
|
63096
63126
|
};
|
|
63097
63127
|
const lastAnimatedElRef = (0,external_React_.useRef)(null);
|
|
63098
63128
|
const handleContentRef = (0,external_React_.useCallback)((el) => {
|
|
@@ -63116,10 +63146,10 @@ const Drawer = ({ open, backdrop = true, renderBackdrop = true, resizable = true
|
|
|
63116
63146
|
orientation: axis === 'Y' ? 'horizontal' : 'vertical',
|
|
63117
63147
|
}), "data-hook": Drawer_constants_DATA_HOOKS.HANDLE, onPointerDown: onHandlePointerDown, onPointerMove: onHandlePointerMove, onPointerUp: onHandlePointerUp }));
|
|
63118
63148
|
return (external_React_default().createElement("div", { ref: rootRef, "data-hook": dataHook },
|
|
63119
|
-
external_React_default().createElement(react_dialog_dist_Root, { open: open, onOpenChange: onClose, modal: modal },
|
|
63149
|
+
external_React_default().createElement(react_dialog_dist_Root, { open: open, onOpenChange: isOpen => onClose(isOpen, outsideReason.current), modal: modal },
|
|
63120
63150
|
external_React_default().createElement(react_dialog_dist_Portal, null,
|
|
63121
63151
|
renderBackdrop && (external_React_default().createElement(Overlay, { "data-hook": Drawer_constants_DATA_HOOKS.OVERLAY, className: Drawer_classes_classes.overlay({ backdrop }), style: { zIndex } })),
|
|
63122
|
-
external_React_default().createElement(dist_Content, { ref: handleContentRef, "data-hook": Drawer_constants_DATA_HOOKS.CONTENT, "aria-modal": "true", "aria-labelledby": ariaLabelledBy, role: role, className: Drawer_classes_classes.content({ margin, resizable, anchor }), onInteractOutside:
|
|
63152
|
+
external_React_default().createElement(dist_Content, { ref: handleContentRef, "data-hook": Drawer_constants_DATA_HOOKS.CONTENT, "aria-modal": "true", "aria-labelledby": ariaLabelledBy, role: role, className: Drawer_classes_classes.content({ margin, resizable, anchor }), onInteractOutside: handleInteractOutside, onEscapeKeyDown: handleEscapeKeyDown, onPointerDown: resizable ? onContentPointerDown : undefined, onPointerMove: resizable ? onContentPointerMove : undefined, onPointerUp: resizable ? onContentPointerUp : undefined, style: {
|
|
63123
63153
|
zIndex,
|
|
63124
63154
|
} },
|
|
63125
63155
|
external_React_default().createElement(dist_Title, { className: Drawer_classes_classes.title() }),
|
|
@@ -63962,11 +63992,24 @@ class DropdownBase extends external_React_.PureComponent {
|
|
|
63962
63992
|
activeDescendantId: this._dropdownLayoutRef?.getActiveDescendentElementId(),
|
|
63963
63993
|
});
|
|
63964
63994
|
};
|
|
63965
|
-
this.
|
|
63966
|
-
if (reason
|
|
63967
|
-
this._setIsOpen(false, reason);
|
|
63995
|
+
this._handlePopoverOpenChange = (_, reason) => {
|
|
63996
|
+
if (reason !== 'outside-press' && reason !== 'escape-key') {
|
|
63968
63997
|
return;
|
|
63969
63998
|
}
|
|
63999
|
+
if (reason === 'outside-press') {
|
|
64000
|
+
this._close();
|
|
64001
|
+
}
|
|
64002
|
+
this.props.onClose?.(reason);
|
|
64003
|
+
};
|
|
64004
|
+
this._handleDrawerClose = (_, reason) => {
|
|
64005
|
+
this._close();
|
|
64006
|
+
if (reason === 'outside-press') {
|
|
64007
|
+
this._handleClickOutside();
|
|
64008
|
+
}
|
|
64009
|
+
// The drawer is modal, so focus can't leave it.
|
|
64010
|
+
if (reason !== 'focus-out') {
|
|
64011
|
+
this.props.onClose?.(reason);
|
|
64012
|
+
}
|
|
63970
64013
|
};
|
|
63971
64014
|
this._isDialogMode = () => {
|
|
63972
64015
|
/** This component has two modes:
|
|
@@ -64043,8 +64086,8 @@ class DropdownBase extends external_React_.PureComponent {
|
|
|
64043
64086
|
: children;
|
|
64044
64087
|
return (external_React_default().createElement(WixDesignSystemContext.Consumer, null, ({ mobile }) => mobile ? (external_React_default().createElement("div", null,
|
|
64045
64088
|
external_React_default().createElement("div", null, this._renderChildren(renderedTrigger)),
|
|
64046
|
-
external_React_default().createElement(Drawer, { dataHook: dataHook, open: Boolean(open), onClose:
|
|
64047
|
-
external_React_default().createElement("div", { className: DropdownBase_classes_classes.drawerContent() }, this._renderDropdownLayout())))) : (external_React_default().createElement(PopoverNext, { dataListType: listType, onOpenChange: this.
|
|
64089
|
+
external_React_default().createElement(Drawer, { dataHook: dataHook, open: Boolean(open), onClose: this._handleDrawerClose, zIndex: zIndex },
|
|
64090
|
+
external_React_default().createElement("div", { className: DropdownBase_classes_classes.drawerContent() }, this._renderDropdownLayout())))) : (external_React_default().createElement(PopoverNext, { dataListType: listType, onOpenChange: this._handlePopoverOpenChange, animate: animate, dataHook: dataHook, open: open, autoUpdateOptions: { animationFrame: true }, ...popoverProps, placement: placement, dynamicWidth: dynamicWidth, appendTo: appendTo, showArrow: showArrow, zIndex: zIndex, moveBy: moveBy, onKeyDown: this._handleKeyDown, onMouseEnter: onMouseEnter ||
|
|
64048
64091
|
!!(external_React_default().isValidElement(renderedTrigger) &&
|
|
64049
64092
|
renderedTrigger.props.onMouseEnter)
|
|
64050
64093
|
? () => this._handlePopoverMouseEnter(renderedTrigger)
|
|
@@ -64243,12 +64286,16 @@ function withErrorBoundary(component, errorBoundaryProps) {
|
|
|
64243
64286
|
;// ../../../node_modules/@wix/wix-ui-icons-common/dist/esm/core/fetcher.js
|
|
64244
64287
|
const ABORT_SIGNAL_TIMEOUT = 5e3;
|
|
64245
64288
|
let sanitizer;
|
|
64246
|
-
const
|
|
64247
|
-
|
|
64248
|
-
|
|
64249
|
-
|
|
64250
|
-
|
|
64251
|
-
|
|
64289
|
+
const importSanitizer = () => Promise.resolve().then(() => __webpack_require__.e(/*! import() */ 500).then(__webpack_require__.bind(__webpack_require__, /*! ./sanitize.js */ 7500)));
|
|
64290
|
+
const loadSanitizer = () => {
|
|
64291
|
+
if (!sanitizer) {
|
|
64292
|
+
sanitizer = importSanitizer().catch(importSanitizer).catch((error) => {
|
|
64293
|
+
sanitizer = void 0;
|
|
64294
|
+
throw error;
|
|
64295
|
+
});
|
|
64296
|
+
}
|
|
64297
|
+
return sanitizer;
|
|
64298
|
+
};
|
|
64252
64299
|
const isTransientError = (error) => error instanceof Error && (error.name === "TimeoutError" || error.name === "AbortError");
|
|
64253
64300
|
function createTimeoutSignal(timeout) {
|
|
64254
64301
|
if (typeof AbortSignal.timeout === "function") {
|
|
@@ -77419,10 +77466,11 @@ const IconButton = (0,external_React_.forwardRef)((props, ref) => {
|
|
|
77419
77466
|
const { button: buttonPropsDefaults } = defaultOverrides;
|
|
77420
77467
|
const { skin = 'standard', className, priority = 'primary', size = buttonPropsDefaults.size, children, disabled = false, dataHook, ariaLabel, ariaLabelledBy, ...rest } = useDefaultProps('IconButton', props);
|
|
77421
77468
|
const childSize = ICON_CHILD_SIZE[size];
|
|
77422
|
-
return (external_React_default().createElement(WrappedButtonCore, { ...rest, disabled: disabled, ref: buttonRef, className: IconButton_classes_classes.root({ skin, priority, size, disabled }, className, FocusRing_classes_classes.root()), ...generateDataAttr({
|
|
77423
|
-
|
|
77424
|
-
size,
|
|
77425
|
-
|
|
77469
|
+
return (external_React_default().createElement(WrappedButtonCore, { ...rest, disabled: disabled, ref: buttonRef, className: IconButton_classes_classes.root({ skin, priority, size, disabled }, className, FocusRing_classes_classes.root()), ...generateDataAttr({ skin, size, priority }, [
|
|
77470
|
+
'skin',
|
|
77471
|
+
'size',
|
|
77472
|
+
'priority',
|
|
77473
|
+
]), "data-hook": dataHook, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }, children &&
|
|
77426
77474
|
external_React_default().cloneElement(children, {
|
|
77427
77475
|
size: childSize,
|
|
77428
77476
|
width: childSize,
|
|
@@ -77432,13 +77480,21 @@ const IconButton = (0,external_React_.forwardRef)((props, ref) => {
|
|
|
77432
77480
|
});
|
|
77433
77481
|
IconButton.displayName = 'IconButton';
|
|
77434
77482
|
//# sourceMappingURL=IconButton.js.map
|
|
77435
|
-
;// ../../../node_modules/@wix/design-system/dist/esm/Avatar/constants.js
|
|
77436
|
-
const
|
|
77437
|
-
|
|
77483
|
+
;// ../../../node_modules/@wix/design-system/dist/esm/Avatar/Avatar.constants.js
|
|
77484
|
+
const AVATAR_COLORS = [
|
|
77485
|
+
'A1',
|
|
77486
|
+
'A2',
|
|
77487
|
+
'A3',
|
|
77488
|
+
'A4',
|
|
77489
|
+
'A5',
|
|
77490
|
+
'A6',
|
|
77491
|
+
'A7',
|
|
77492
|
+
];
|
|
77493
|
+
const AVATAR_SHAPES = {
|
|
77438
77494
|
circle: 'circle',
|
|
77439
77495
|
square: 'square',
|
|
77440
77496
|
};
|
|
77441
|
-
const
|
|
77497
|
+
const Avatar_constants_DATA_HOOKS = {
|
|
77442
77498
|
indication: 'avatar-indication',
|
|
77443
77499
|
customIndication: 'avatar-customIndication',
|
|
77444
77500
|
avatarCore: 'avatar-core',
|
|
@@ -77446,7 +77502,7 @@ const Avatar_constants_dataHooks = {
|
|
|
77446
77502
|
loader: 'avatar-loader',
|
|
77447
77503
|
textContainer: 'text-container',
|
|
77448
77504
|
};
|
|
77449
|
-
//# sourceMappingURL=constants.js.map
|
|
77505
|
+
//# sourceMappingURL=Avatar.constants.js.map
|
|
77450
77506
|
;// ../../../node_modules/@wix/design-system/dist/esm/Avatar/Avatar.classes.js
|
|
77451
77507
|
|
|
77452
77508
|
const Avatar_classes_classes = defineClassNames('avatar', {
|
|
@@ -77487,32 +77543,32 @@ const Avatar_classes_classes = defineClassNames('avatar', {
|
|
|
77487
77543
|
;// ../../../node_modules/@wix/design-system/dist/esm/Avatar/assets.js
|
|
77488
77544
|
|
|
77489
77545
|
|
|
77490
|
-
const personSvg = (
|
|
77491
|
-
|
|
77492
|
-
|
|
77493
|
-
|
|
77494
|
-
|
|
77495
|
-
|
|
77496
|
-
|
|
77497
|
-
|
|
77498
|
-
|
|
77499
|
-
|
|
77500
|
-
|
|
77501
|
-
|
|
77502
|
-
|
|
77503
|
-
|
|
77504
|
-
|
|
77505
|
-
|
|
77506
|
-
|
|
77507
|
-
|
|
77508
|
-
|
|
77509
|
-
|
|
77510
|
-
|
|
77511
|
-
|
|
77512
|
-
const businessSvg = (
|
|
77513
|
-
|
|
77514
|
-
const smallBusinessSvg = (
|
|
77515
|
-
|
|
77546
|
+
const personSvg = (external_React_.createElement("svg", { className: Avatar_classes_classes.placeholder(), viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
77547
|
+
external_React_.createElement("g", { clipPath: "url(#avatarPersonClip0)" },
|
|
77548
|
+
external_React_.createElement("g", { opacity: "0.5" },
|
|
77549
|
+
external_React_.createElement("g", { clipPath: "url(#avatarPersonClip1)" },
|
|
77550
|
+
external_React_.createElement("rect", { width: "48", height: "48", rx: "23.4032", fill: "var(--wds-illustration-color-6, #002294)" }),
|
|
77551
|
+
external_React_.createElement("g", { filter: "url(#avatarPersonBlur)" },
|
|
77552
|
+
external_React_.createElement("path", { d: "M27.494 -18.5711C25.7001 -18.2145 23.9293 -17.7199 22.2045 -17.0872C15.1213 -14.4645 8.843 -9.4722 4.70346 -2.44384C-4.76 13.6029 0.506418 34.1589 16.4667 43.4649C32.4269 52.7708 53.0326 47.2954 62.4961 31.2486C71.9596 15.1904 66.6931 -5.36561 50.7444 -14.6601C43.4542 -18.9162 35.2096 -20.078 27.494 -18.5711Z", fill: "url(#avatarPersonGradient)" })))),
|
|
77553
|
+
external_React_.createElement("circle", { cx: "23.9999", cy: "19.2", r: "9.6", fill: "var(--wds-illustration-color-6, #002294)" }),
|
|
77554
|
+
external_React_.createElement("circle", { cx: "24", cy: "55.2", r: "24", fill: "var(--wds-illustration-color-6, #002294)" })),
|
|
77555
|
+
external_React_.createElement("defs", null,
|
|
77556
|
+
external_React_.createElement("filter", { id: "avatarPersonBlur", x: "-14.4", y: "-33.6", width: "96", height: "96", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
77557
|
+
external_React_.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
77558
|
+
external_React_.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
77559
|
+
external_React_.createElement("feGaussianBlur", { stdDeviation: "7.2", result: "effect1_foregroundBlur" })),
|
|
77560
|
+
external_React_.createElement("linearGradient", { id: "avatarPersonGradient", x1: "57.6693", y1: "-13.1682", x2: "0.185771", y2: "60.1835", gradientUnits: "userSpaceOnUse" },
|
|
77561
|
+
external_React_.createElement("stop", { offset: "0.176006", stopColor: "var(--wds-illustration-color-5, #EAEFFF)" }),
|
|
77562
|
+
external_React_.createElement("stop", { offset: "0.576923", stopColor: "var(--wds-illustration-color-3, #B8C4FF)" }),
|
|
77563
|
+
external_React_.createElement("stop", { offset: "0.85", stopColor: "var(--wds-illustration-color-6, #002294)" })),
|
|
77564
|
+
external_React_.createElement("clipPath", { id: "avatarPersonClip0" },
|
|
77565
|
+
external_React_.createElement("rect", { width: "48", height: "48", rx: "24", fill: "white" })),
|
|
77566
|
+
external_React_.createElement("clipPath", { id: "avatarPersonClip1" },
|
|
77567
|
+
external_React_.createElement("rect", { width: "48", height: "48", rx: "23.4032", fill: "white" })))));
|
|
77568
|
+
const businessSvg = (external_React_.createElement("svg", { className: Avatar_classes_classes.placeholder(), viewBox: "0 0 48 48" },
|
|
77569
|
+
external_React_.createElement("path", { d: "M21,13.387 C21,12.705 21.669,12.223 22.316,12.438 L22.316,12.438 L34.632,16.544 C35.449,16.816 36,17.581 36,18.441 L36,18.441 L36,34 L38,34 L38,36 L10,36 L10,34 L12,34 L12,21.659 C12,21.259 12.238,20.898 12.606,20.74 L12.606,20.74 L17.606,18.597 C18.266,18.314 19,18.799 19,19.517 L19,19.517 L19,34 L21,34 Z M32,29 L25,29 L25,31 L32,31 L32,29 Z M32,24 L25,24 L25,26 L32,26 L32,24 Z M32,19 L25,19 L25,21 L32,21 L32,19 Z" })));
|
|
77570
|
+
const smallBusinessSvg = (external_React_.createElement("svg", { className: Avatar_classes_classes.placeholder(), viewBox: "0 0 24 24" },
|
|
77571
|
+
external_React_.createElement("path", { d: "M18,17 L18,8.754 C18,8.308 17.704,7.916 17.275,7.793 L11.637,6.182 C11.318,6.091 11,6.331 11,6.663 L11,17 L9,17 L9,8.934 C9,8.535 8.555,8.297 8.223,8.518 L6.223,9.852 C6.083,9.944 6,10.101 6,10.268 L6,17 L5,17 L5,18 L6,18 L9,18 L11,18 L18,18 L19,18 L19,17 L18,17 Z" })));
|
|
77516
77572
|
const placeholderSVGs = {
|
|
77517
77573
|
size90: { circle: personSvg, square: businessSvg },
|
|
77518
77574
|
size72: { circle: personSvg, square: businessSvg },
|
|
@@ -77529,20 +77585,20 @@ const placeholderSVGs = {
|
|
|
77529
77585
|
/* stringToColor returns a different color for each string.
|
|
77530
77586
|
** Each string will ALWAYS receives the same color, so the color will always be consistent per string
|
|
77531
77587
|
**/
|
|
77532
|
-
const stringToColor = name => {
|
|
77588
|
+
const stringToColor = (name) => {
|
|
77533
77589
|
if (!name) {
|
|
77534
77590
|
return;
|
|
77535
77591
|
}
|
|
77536
77592
|
const hash = stringToNumber(name);
|
|
77537
|
-
const index = hash %
|
|
77538
|
-
return
|
|
77593
|
+
const index = hash % AVATAR_COLORS.length; // this sets an index between 0 and array.length.
|
|
77594
|
+
return AVATAR_COLORS[index];
|
|
77539
77595
|
};
|
|
77540
77596
|
/* stringToNumber creates a number for each string.
|
|
77541
77597
|
** for example the string: "Hi" number will be 177.
|
|
77542
77598
|
** charCode of "H" = 72, charCode of "i" = 105. 72 + 105 = 177
|
|
77543
77599
|
** This creates a unique number for each string
|
|
77544
77600
|
**/
|
|
77545
|
-
const stringToNumber = str => str.split('').reduce((acc, char) => acc + char.charCodeAt(), 0);
|
|
77601
|
+
const stringToNumber = (str) => str.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0);
|
|
77546
77602
|
|
|
77547
77603
|
//# sourceMappingURL=string-to-color.js.map
|
|
77548
77604
|
;// ../../../node_modules/@wix/design-system/dist/esm/utils/propsUtils.js
|
|
@@ -77746,13 +77802,18 @@ const WrappedAvatarCore = Focusable_withFocusable(AvatarCore);
|
|
|
77746
77802
|
|
|
77747
77803
|
|
|
77748
77804
|
|
|
77749
|
-
const getSizeNumber = size => Number(size.substring(4));
|
|
77805
|
+
const getSizeNumber = (size) => Number(size.substring(4));
|
|
77750
77806
|
const defaultSize = 48;
|
|
77751
77807
|
const minSmallIconButton = 60;
|
|
77808
|
+
const DEFAULT_PROPS = {
|
|
77809
|
+
size: 'size48',
|
|
77810
|
+
shape: 'circle',
|
|
77811
|
+
showIndicationOnHover: false,
|
|
77812
|
+
};
|
|
77752
77813
|
/**
|
|
77753
77814
|
* Avatar is a type of element that visually represents a user, either as an image, name initials or placeholder icon.
|
|
77754
77815
|
*/
|
|
77755
|
-
class Avatar_Avatar extends
|
|
77816
|
+
class Avatar_Avatar extends external_React_.PureComponent {
|
|
77756
77817
|
constructor(props) {
|
|
77757
77818
|
super(props);
|
|
77758
77819
|
this._onMouseEnter = () => {
|
|
@@ -77772,7 +77833,7 @@ class Avatar_Avatar extends (external_React_default()).PureComponent {
|
|
|
77772
77833
|
};
|
|
77773
77834
|
}
|
|
77774
77835
|
render() {
|
|
77775
|
-
const { size, presence, indication, color, customIndication, onIndicationClick, dataHook, className, shape, text, placeholder, name, onClick, showIndicationOnHover, loading, ...rest } = this.props;
|
|
77836
|
+
const { size = DEFAULT_PROPS.size, presence, indication, color, customIndication, onIndicationClick, dataHook, className, shape = DEFAULT_PROPS.shape, text, placeholder, name, onClick, showIndicationOnHover = DEFAULT_PROPS.showIndicationOnHover, loading, ...rest } = this.props;
|
|
77776
77837
|
const { fadeIndication, showIndication } = this.state;
|
|
77777
77838
|
const calculatedColor = color || stringToColor(text || name); // if color is provided as a prop use it, otherwise, generate a color based on the text
|
|
77778
77839
|
const sizeNumber = getSizeNumber(size);
|
|
@@ -77781,8 +77842,8 @@ class Avatar_Avatar extends (external_React_default()).PureComponent {
|
|
|
77781
77842
|
const renderIndication = indicationConstraints && !customIndication && indication;
|
|
77782
77843
|
const renderCustomIndication = indicationConstraints && customIndication;
|
|
77783
77844
|
const renderLoader = loading && sizeNumber >= defaultSize;
|
|
77784
|
-
return (
|
|
77785
|
-
|
|
77845
|
+
return (external_React_.createElement("div", { "data-hook": dataHook, className: Avatar_classes_classes.root({}, className) },
|
|
77846
|
+
external_React_.createElement("div", { "data-hook": Avatar_constants_DATA_HOOKS.avatarWSR, onMouseEnter: this._onMouseEnter, onMouseLeave: this._onMouseLeave, className: Avatar_classes_classes.avatarContainer({
|
|
77786
77847
|
shape,
|
|
77787
77848
|
size,
|
|
77788
77849
|
indication: Boolean(customIndication || indication),
|
|
@@ -77791,29 +77852,25 @@ class Avatar_Avatar extends (external_React_default()).PureComponent {
|
|
|
77791
77852
|
clickable: !!onClick,
|
|
77792
77853
|
fade: fadeIndication,
|
|
77793
77854
|
}) },
|
|
77794
|
-
|
|
77795
|
-
|
|
77855
|
+
external_React_.createElement("div", { className: Avatar_classes_classes.coreAvatar() },
|
|
77856
|
+
external_React_.createElement(WrappedAvatarCore, { ...rest, placeholder: placeholder ?? (external_React_.createElement(AvatarDefaultPlaceholder, { shape: shape, size: size })), text: text, name: name, onClick: onClick, initialsLimit: sizeNumber < 24 ? 1 : undefined, "data-hook": Avatar_constants_DATA_HOOKS.avatarCore, className: Avatar_classes_classes.avatar({ color: calculatedColor }, FocusRing_classes_classes.root()) })),
|
|
77796
77857
|
renderLoader && [
|
|
77797
|
-
|
|
77798
|
-
|
|
77799
|
-
|
|
77858
|
+
external_React_.createElement("div", { key: "overlay", className: Avatar_classes_classes.loaderContainer({}, Avatar_classes_classes.overlay()) }),
|
|
77859
|
+
external_React_.createElement("div", { key: "loader", className: Avatar_classes_classes.loaderContainer({}, Avatar_classes_classes.loader()) },
|
|
77860
|
+
external_React_.createElement(Loader, { dataHook: Avatar_constants_DATA_HOOKS.loader, size: "tiny" })),
|
|
77800
77861
|
],
|
|
77801
|
-
presence &&
|
|
77802
|
-
renderIndication && (
|
|
77803
|
-
|
|
77804
|
-
renderCustomIndication && (
|
|
77862
|
+
presence && external_React_.createElement("div", { className: Avatar_classes_classes.presence() }),
|
|
77863
|
+
renderIndication && (external_React_.createElement("div", { className: Avatar_classes_classes.indication() },
|
|
77864
|
+
external_React_.createElement(IconButton, { className: Avatar_classes_classes.iconButtonShadow(), dataHook: Avatar_constants_DATA_HOOKS.indication, skin: "light", onClick: onIndicationClick, shape: shape, size: sizeNumber > minSmallIconButton ? 'small' : 'tiny' }, indication))),
|
|
77865
|
+
renderCustomIndication && (external_React_.createElement("div", { className: Avatar_classes_classes.indication(), "data-hook": Avatar_constants_DATA_HOOKS.customIndication, onClick: onIndicationClick }, customIndication)))));
|
|
77805
77866
|
}
|
|
77806
77867
|
}
|
|
77807
|
-
Avatar_Avatar.contextType = WixDesignSystemContext;
|
|
77808
|
-
const AvatarDefaultPlaceholder = ({ shape, size }) => shape !== avatarShapes.square
|
|
77809
|
-
? placeholderSVGs[size][avatarShapes.circle]
|
|
77810
|
-
: placeholderSVGs[size][avatarShapes.square];
|
|
77811
77868
|
Avatar_Avatar.displayName = 'Avatar';
|
|
77812
|
-
Avatar_Avatar.
|
|
77813
|
-
|
|
77814
|
-
|
|
77815
|
-
|
|
77816
|
-
|
|
77869
|
+
Avatar_Avatar.contextType = WixDesignSystemContext;
|
|
77870
|
+
Avatar_Avatar.defaultProps = DEFAULT_PROPS;
|
|
77871
|
+
const AvatarDefaultPlaceholder = ({ shape, size, }) => shape !== AVATAR_SHAPES.square
|
|
77872
|
+
? placeholderSVGs[size][AVATAR_SHAPES.circle]
|
|
77873
|
+
: placeholderSVGs[size][AVATAR_SHAPES.square];
|
|
77817
77874
|
|
|
77818
77875
|
//# sourceMappingURL=Avatar.js.map
|
|
77819
77876
|
;// ./components/PermissionsList/Avatar.tsx
|