@xyo-network/react-address-render 2.47.2 → 2.47.4

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 (45) hide show
  1. package/dist/cjs/components/RenderRowBox.js +3 -2
  2. package/dist/cjs/components/RenderRowBox.js.map +1 -1
  3. package/dist/cjs/components/favorite/FavoriteIconButton.js +20 -12
  4. package/dist/cjs/components/favorite/FavoriteIconButton.js.map +1 -1
  5. package/dist/cjs/components/favorite/Popper.js +21 -0
  6. package/dist/cjs/components/favorite/Popper.js.map +1 -0
  7. package/dist/cjs/components/favorite/PopperButtonGroup.js +20 -0
  8. package/dist/cjs/components/favorite/PopperButtonGroup.js.map +1 -0
  9. package/dist/cjs/components/favorite/lib/PopperId.js +5 -0
  10. package/dist/cjs/components/favorite/lib/PopperId.js.map +1 -0
  11. package/dist/cjs/components/favorite/lib/index.js +5 -0
  12. package/dist/cjs/components/favorite/lib/index.js.map +1 -0
  13. package/dist/docs.json +736 -594
  14. package/dist/esm/components/RenderRowBox.js +2 -2
  15. package/dist/esm/components/RenderRowBox.js.map +1 -1
  16. package/dist/esm/components/favorite/FavoriteIconButton.js +21 -13
  17. package/dist/esm/components/favorite/FavoriteIconButton.js.map +1 -1
  18. package/dist/esm/components/favorite/Popper.js +16 -0
  19. package/dist/esm/components/favorite/Popper.js.map +1 -0
  20. package/dist/esm/components/favorite/PopperButtonGroup.js +14 -0
  21. package/dist/esm/components/favorite/PopperButtonGroup.js.map +1 -0
  22. package/dist/esm/components/favorite/lib/PopperId.js +2 -0
  23. package/dist/esm/components/favorite/lib/PopperId.js.map +1 -0
  24. package/dist/esm/components/favorite/lib/index.js +2 -0
  25. package/dist/esm/components/favorite/lib/index.js.map +1 -0
  26. package/dist/types/components/RenderRowBox.d.ts +2 -0
  27. package/dist/types/components/RenderRowBox.d.ts.map +1 -1
  28. package/dist/types/components/favorite/FavoriteIconButton.d.ts +2 -0
  29. package/dist/types/components/favorite/FavoriteIconButton.d.ts.map +1 -1
  30. package/dist/types/components/favorite/Popper.d.ts +11 -0
  31. package/dist/types/components/favorite/Popper.d.ts.map +1 -0
  32. package/dist/types/components/favorite/PopperButtonGroup.d.ts +9 -0
  33. package/dist/types/components/favorite/PopperButtonGroup.d.ts.map +1 -0
  34. package/dist/types/components/favorite/lib/PopperId.d.ts +2 -0
  35. package/dist/types/components/favorite/lib/PopperId.d.ts.map +1 -0
  36. package/dist/types/components/favorite/lib/index.d.ts +2 -0
  37. package/dist/types/components/favorite/lib/index.d.ts.map +1 -0
  38. package/package.json +3 -3
  39. package/src/components/RenderRowBox.stories.tsx +23 -3
  40. package/src/components/RenderRowBox.tsx +5 -3
  41. package/src/components/favorite/FavoriteIconButton.tsx +35 -12
  42. package/src/components/favorite/Popper.tsx +59 -0
  43. package/src/components/favorite/PopperButtonGroup.tsx +36 -0
  44. package/src/components/favorite/lib/PopperId.ts +1 -0
  45. package/src/components/favorite/lib/index.ts +1 -0
@@ -11,11 +11,12 @@ const react_shared_1 = require("@xyo-network/react-shared");
11
11
  const react_1 = require("react");
12
12
  const favorite_1 = require("./favorite");
13
13
  exports.AddressRenderRowBox = (0, react_1.forwardRef)((_a, ref) => {
14
- var { address, children, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, showFavorite = false } = _a, props = tslib_1.__rest(_a, ["address", "children", "favorite", "iconOnly", "iconSize", "icons", "showFavorite"]);
14
+ var _b;
15
+ var { address, alias, children, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false } = _a, props = tslib_1.__rest(_a, ["address", "alias", "children", "favorite", "iconOnly", "iconSize", "icons", "name", "showFavorite"]);
15
16
  const theme = (0, material_1.useTheme)();
16
17
  const sharedRef = (0, react_shared_1.useShareForwardedRef)(ref);
17
18
  const [elementRef, dispatch] = (0, react_event_1.useXyoEvent)(undefined, sharedRef);
18
- return ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexGrowRow, Object.assign({ gap: 2, justifyContent: "flex-start", ref: elementRef, onClick: () => (address ? dispatch('address', 'click', address) : undefined) }, props, { children: [icons && address ? ((0, jsx_runtime_1.jsx)(material_1.ListItemIcon, Object.assign({ sx: { minWidth: 0 } }, { children: (0, jsx_runtime_1.jsx)(react_identicon_1.Identicon, { size: iconSize, value: address }) }))) : null, iconOnly ? null : ((0, jsx_runtime_1.jsx)(material_1.ListItemText, { children: (0, jsx_runtime_1.jsx)(react_shared_1.EllipsizeBox, Object.assign({ ellipsisPosition: 'end', width: "100%", typographyProps: { fontSize: theme.typography.body1.fontSize } }, { children: address })) })), children, showFavorite && address ? (0, jsx_runtime_1.jsx)(favorite_1.FavoriteIconButton, { size: 'small', address: address, favorite: favoriteProp }) : null] })));
19
+ return ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexGrowRow, Object.assign({ gap: 2, justifyContent: "flex-start", ref: elementRef, onClick: () => (address ? dispatch('address', 'click', address) : undefined) }, props, { children: [icons && address ? ((0, jsx_runtime_1.jsx)(material_1.ListItemIcon, Object.assign({ sx: { minWidth: 0 } }, { children: (0, jsx_runtime_1.jsx)(react_identicon_1.Identicon, { size: iconSize, value: address }) }))) : null, iconOnly ? null : ((0, jsx_runtime_1.jsx)(material_1.ListItemText, { children: (0, jsx_runtime_1.jsx)(react_shared_1.EllipsizeBox, Object.assign({ ellipsisPosition: 'end', width: "100%", typographyProps: { fontSize: theme.typography.body1.fontSize } }, { children: (_b = alias !== null && alias !== void 0 ? alias : name) !== null && _b !== void 0 ? _b : address })) })), children, showFavorite && address ? (0, jsx_runtime_1.jsx)(favorite_1.FavoriteIconButton, { alias: alias, size: 'small', address: address, favorite: favoriteProp }) : null] })));
19
20
  });
20
21
  exports.AddressRenderRowBox.displayName = 'AddressRenderRowBox';
21
22
  //# sourceMappingURL=RenderRowBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RenderRowBox.js","sourceRoot":"","sources":["../../../src/components/RenderRowBox.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAoE;AACpE,yDAA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AAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IACxE,KAAK,eAER,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,CAClB,uBAAC,uBAAY,kBAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,gBAC/B,uBAAC,2BAAS,IAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAI,IAChC,CAChB,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACjB,uBAAC,uBAAY,cACX,uBAAC,2BAAY,kBAAC,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,EAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,EAAE,gBAC/G,MAAA,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,IAAI,mCAAI,OAAO,IACZ,GACF,CAChB,EACA,QAAQ,EACR,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,uBAAC,6BAAkB,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,GAAI,CAAC,CAAC,CAAC,IAAI,KACnH,CACf,CAAA;AACH,CAAC,CACF,CAAA;AAED,2BAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAA"}
@@ -9,28 +9,36 @@ const material_1 = require("@mui/material");
9
9
  const react_event_1 = require("@xyo-network/react-event");
10
10
  const react_shared_1 = require("@xyo-network/react-shared");
11
11
  const react_1 = require("react");
12
+ const lib_1 = require("./lib");
13
+ const Popper_1 = require("./Popper");
12
14
  exports.FavoriteIconButton = (0, react_1.forwardRef)((_a, ref) => {
13
- var { address, children, favorite: favoriteProp } = _a, props = tslib_1.__rest(_a, ["address", "children", "favorite"]);
15
+ var { address, alias, children, favorite: favoriteProp } = _a, props = tslib_1.__rest(_a, ["address", "alias", "children", "favorite"]);
16
+ const [openPopper, setOpenPopper] = (0, react_1.useState)(false);
14
17
  const [favorite, setFavorite] = (0, react_1.useState)(favoriteProp);
15
18
  (0, react_1.useEffect)(() => {
16
19
  setFavorite(favoriteProp);
17
20
  }, [favoriteProp]);
18
21
  const sharedRef = (0, react_shared_1.useShareForwardedRef)(ref);
19
22
  const [buttonRef, dispatch] = (0, react_event_1.useXyoEvent)(undefined, sharedRef);
20
- return ((0, jsx_runtime_1.jsxs)(material_1.IconButton, Object.assign({ ref: buttonRef,
23
+ const onConfirmFavorite = (alias, newFavoriteState) => {
24
+ setFavorite(() => {
25
+ const favoriteEvent = {
26
+ address,
27
+ alias,
28
+ favorite: !!newFavoriteState,
29
+ };
30
+ dispatch('address', 'favorite', JSON.stringify(favoriteEvent));
31
+ return newFavoriteState;
32
+ });
33
+ setOpenPopper(false);
34
+ };
35
+ const starRef = (0, react_1.useRef)(null);
36
+ return ((0, jsx_runtime_1.jsxs)(material_1.IconButton, Object.assign({ ref: buttonRef, "aria-describedby": lib_1.popperId,
21
37
  // used to prevent parent items from rippling when IconButton is clicked
22
38
  onMouseDown: (e) => e.stopPropagation(), onClick: (event) => {
23
39
  event.stopPropagation();
24
- setFavorite((current) => {
25
- const newFavoriteState = !current;
26
- const favoriteEvent = {
27
- address,
28
- favorite: newFavoriteState,
29
- };
30
- dispatch('address', 'favorite', JSON.stringify(favoriteEvent));
31
- return newFavoriteState;
32
- });
33
- } }, props, { children: [favorite ? (0, jsx_runtime_1.jsx)(Star_1.default, { color: "secondary" }) : (0, jsx_runtime_1.jsx)(StarBorder_1.default, {}), children] })));
40
+ setOpenPopper(true);
41
+ } }, props, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ ref: starRef }, { children: favorite ? (0, jsx_runtime_1.jsx)(Star_1.default, { component: 'svg', color: "secondary" }) : (0, jsx_runtime_1.jsx)(StarBorder_1.default, {}) })), (0, jsx_runtime_1.jsx)(Popper_1.FavoritePopper, { alias: alias, favorite: favorite, favoriteRef: starRef, open: openPopper, onConfirmFavorite: onConfirmFavorite, onClickAway: () => setOpenPopper(false) }), children] })));
34
42
  });
35
43
  exports.FavoriteIconButton.displayName = 'FavoriteIconButton';
36
44
  //# sourceMappingURL=FavoriteIconButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FavoriteIconButton.js","sourceRoot":"","sources":["../../../../src/components/favorite/FavoriteIconButton.tsx"],"names":[],"mappings":";;;;;AAAA,4EAA+C;AAC/C,wFAA2D;AAC3D,4CAA2D;AAE3D,0DAAsD;AACtD,4DAAgE;AAChE,iCAAuD;AAY1C,QAAA,kBAAkB,GAAG,IAAA,kBAAU,EAC1C,CAAC,EAAuD,EAAE,GAAG,EAAE,EAAE;QAAhE,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,OAAY,EAAP,KAAK,sBAArD,mCAAuD,CAAF;IACpD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAC,YAAY,CAAC,CAAA;IACtD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,WAAW,CAAC,YAAY,CAAC,CAAA;IAC3B,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAElB,MAAM,SAAS,GAAG,IAAA,mCAAoB,EAAC,GAAG,CAAC,CAAA;IAC3C,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,IAAA,yBAAW,EAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IAE/D,OAAO,CACL,wBAAC,qBAAU,kBACT,GAAG,EAAE,SAAS;QACd,wEAAwE;QACxE,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACvC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,KAAK,CAAC,eAAe,EAAE,CAAA;YACvB,WAAW,CAAC,CAAC,OAAO,EAAE,EAAE;gBACtB,MAAM,gBAAgB,GAAG,CAAC,OAAO,CAAA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,CAAC,GACvC,EACD,QAAQ,KACE,CACd,CAAA;AACH,CAAC,CACF,CAAA;AAED,0BAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAA"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FavoritePopper = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const material_1 = require("@mui/material");
7
+ const react_1 = require("react");
8
+ const lib_1 = require("./lib");
9
+ const PopperButtonGroup_1 = require("./PopperButtonGroup");
10
+ exports.FavoritePopper = (0, react_1.forwardRef)((_a, ref) => {
11
+ var { alias: aliasProp, favorite, favoriteRef, onClickAway = () => {
12
+ return;
13
+ }, onConfirmFavorite } = _a, props = tslib_1.__rest(_a, ["alias", "favorite", "favoriteRef", "onClickAway", "onConfirmFavorite"]);
14
+ const [alias, setAlias] = (0, react_1.useState)();
15
+ (0, react_1.useEffect)(() => {
16
+ setAlias(aliasProp);
17
+ }, [aliasProp]);
18
+ return ((0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, Object.assign({ onClickAway: onClickAway }, { children: (0, jsx_runtime_1.jsx)(material_1.Popper, Object.assign({ id: lib_1.popperId, anchorEl: favoriteRef === null || favoriteRef === void 0 ? void 0 : favoriteRef.current, transition: true, ref: ref }, props, { children: ({ TransitionProps }) => ((0, jsx_runtime_1.jsx)(material_1.Fade, Object.assign({}, TransitionProps, { timeout: 350 }, { children: (0, jsx_runtime_1.jsx)(material_1.Card, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ sx: { display: 'flex', gap: 1 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { autoFocus: true, label: "Favorite Alias", placeholder: "optional", size: "small", value: alias !== null && alias !== void 0 ? alias : '', onChange: (e) => setAlias(e.target.value) }), (0, jsx_runtime_1.jsx)(PopperButtonGroup_1.PopperButtonGroup, { favorite: favorite, onConfirmFavorite: onConfirmFavorite, alias: alias })] })) }) }))) })) })));
19
+ });
20
+ exports.FavoritePopper.displayName = 'FavoritePopper';
21
+ //# sourceMappingURL=Popper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popper.js","sourceRoot":"","sources":["../../../../src/components/favorite/Popper.tsx"],"names":[],"mappings":";;;;;AAAA,4CAA0G;AAC1G,iCAAkE;AAElE,+BAAgC;AAChC,2DAAuD;AAS1C,QAAA,cAAc,GAAG,IAAA,kBAAU,EACtC,CACE,EASC,EACD,GAAG,EACH,EAAE;QAXF,EACE,KAAK,EAAE,SAAS,EAChB,QAAQ,EACR,WAAW,EACX,WAAW,GAAG,GAAG,EAAE;QACjB,OAAM;IACR,CAAC,EACD,iBAAiB,OAElB,EADI,KAAK,sBARV,wEASC,CADS;IAIV,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,GAAU,CAAA;IAC5C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,QAAQ,CAAC,SAAS,CAAC,CAAA;IACrB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IAEf,OAAO,CACL,uBAAC,4BAAiB,kBAAC,WAAW,EAAE,WAAW,gBACzC,uBAAC,iBAAM,kBAAC,EAAE,EAAE,cAAQ,EAAE,QAAQ,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,EAAE,UAAU,QAAC,GAAG,EAAE,GAAG,IAAM,KAAK,cACjF,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,CACxB,uBAAC,eAAI,oBAAK,eAAe,IAAE,OAAO,EAAE,GAAG,gBACrC,uBAAC,eAAI,cACH,wBAAC,sBAAW,kBAAC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,iBAC1C,uBAAC,oBAAS,IACR,SAAS,QACT,KAAK,EAAC,gBAAgB,EACtB,WAAW,EAAC,UAAU,EACtB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,EAClB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GACzC,EACF,uBAAC,qCAAiB,IAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,GAAI,KACjF,GACT,IACF,CACR,IACM,IACS,CACrB,CAAA;AACH,CAAC,CACF,CAAA;AAED,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAA"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PopperButtonGroup = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const Delete_1 = tslib_1.__importDefault(require("@mui/icons-material/Delete"));
7
+ const Star_1 = tslib_1.__importDefault(require("@mui/icons-material/Star"));
8
+ const material_1 = require("@mui/material");
9
+ const PopperButtonGroup = (_a) => {
10
+ var { alias, onConfirmFavorite, favorite } = _a, props = tslib_1.__rest(_a, ["alias", "onConfirmFavorite", "favorite"]);
11
+ return ((0, jsx_runtime_1.jsxs)(material_1.ButtonGroup, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", onClick: (e) => {
12
+ e.stopPropagation();
13
+ onConfirmFavorite === null || onConfirmFavorite === void 0 ? void 0 : onConfirmFavorite(alias, true);
14
+ } }, { children: (0, jsx_runtime_1.jsx)(Star_1.default, {}) })), favorite ? ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", onClick: (e) => {
15
+ e.stopPropagation();
16
+ onConfirmFavorite === null || onConfirmFavorite === void 0 ? void 0 : onConfirmFavorite(alias, false);
17
+ } }, { children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) }))) : null] })));
18
+ };
19
+ exports.PopperButtonGroup = PopperButtonGroup;
20
+ //# sourceMappingURL=PopperButtonGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PopperButtonGroup.js","sourceRoot":"","sources":["../../../../src/components/favorite/PopperButtonGroup.tsx"],"names":[],"mappings":";;;;;AAAA,gFAAmD;AACnD,4EAA+C;AAC/C,4CAAqE;AAQ9D,MAAM,iBAAiB,GAAkC,CAAC,EAAgD,EAAE,EAAE;QAApD,EAAE,KAAK,EAAE,iBAAiB,EAAE,QAAQ,OAAY,EAAP,KAAK,sBAA9C,0CAAgD,CAAF;IAC7G,OAAO,CACL,wBAAC,sBAAW,oBAAK,KAAK,eACpB,uBAAC,iBAAM,kBACL,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oBACb,CAAC,CAAC,eAAe,EAAE,CAAA;oBACnB,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,KAAK,EAAE,IAAI,CAAC,CAAA;gBAClC,CAAC,gBAED,uBAAC,cAAQ,KAAG,IACL,EACR,QAAQ,CAAC,CAAC,CAAC,CACV,uBAAC,iBAAM,kBACL,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oBACb,CAAC,CAAC,eAAe,EAAE,CAAA;oBACnB,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,KAAK,EAAE,KAAK,CAAC,CAAA;gBACnC,CAAC,gBAED,uBAAC,gBAAU,KAAG,IACP,CACV,CAAC,CAAC,CAAC,IAAI,KACI,CACf,CAAA;AACH,CAAC,CAAA;AAzBY,QAAA,iBAAiB,qBAyB7B"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.popperId = void 0;
4
+ exports.popperId = 'favorite-popper';
5
+ //# sourceMappingURL=PopperId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PopperId.js","sourceRoot":"","sources":["../../../../../src/components/favorite/lib/PopperId.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,iBAAiB,CAAA"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./PopperId"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/favorite/lib/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B"}