@viswa-test/test-citation 0.0.80 → 0.0.81
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/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),r=require("@mui/material"),i=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),r=require("@mui/material"),i=require("react"),t=require("../CognitiveCompareConstants.js"),o=require("lucide-react"),a=require("react-markdown"),s=require("../CognitiveComparehelpers.js"),l=require("rehype-raw");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(i),p=c(a),u=c(l),g=d.default.memo(function(a){var l=a.content,c=a.sxStyles,d=a.deviationBadges,g=void 0===d?[]:d,f=a.highlights,h=void 0===f?[]:f,_=a.maintainRelativeOrder,x=void 0===_||_,v=a.highlightBg,m=i.useMemo(function(){return g.reduce(function(n,r){var i;return e.__assign(e.__assign({},n),((i={})[r.id]=r,i))},{})},[g]),b=i.useMemo(function(){return{mark:function(r){var i=r.children;return n.jsx("span",e.__assign({style:{backgroundColor:v,borderRadius:"2px"}},{children:i}))},span:function(i){var a,s,l,c,d,p,u=i.children,g=e.__rest(i,["children"]),f=g["data-badge-id"];if(!f)return n.jsx("span",e.__assign({},g,{children:u}));var h=m[f];return h?n.jsxs(r.Box,e.__assign({component:"span",sx:{position:"static",display:"inline"}},{children:[n.jsxs(r.Box,e.__assign({ref:h.badgeRef,sx:e.__assign(e.__assign({fontStyle:"normal",position:"absolute",zIndex:30,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=h.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(s=h.style)||void 0===s?void 0:s.badgeText)||t.DEFAULT_DEVIAION_COLOR,border:"1px solid ".concat((null===(l=h.style)||void 0===l?void 0:l.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden"},"left"===h.side?{right:"-16px",transform:"translateY(-20%) translateX(calc(100% + 8px))"}:{left:"-16px",transform:"translateY(-20%) translateX(calc(-100% - 8px))"}),h.isConnected&&h.style&&{outline:"2px solid ".concat(h.style.badgeBorder),outlineOffset:"1px"})},{children:[n.jsxs(r.Box,e.__assign({onClick:function(e){e.stopPropagation(),h.onSummaryClick&&h.onSummaryClick(e)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[n.jsx(r.Box,e.__assign({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:h.label})),("left"===h.side||h.isOrphan)&&n.jsx(r.Box,e.__assign({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(c=h.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE")}},{children:null!=h.score&&"N/A"!==h.score&&"NA"!==h.score&&0!==h.score?"".concat(h.score):"N/A"===h.score||"NA"===h.score?"N/A":"Same"}))]})),("left"===h.side||h.isOrphan)&&n.jsx(r.Box,e.__assign({onClick:function(e){e.stopPropagation(),h.onClick&&h.onClick(e)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(d=h.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:n.jsx(o.EllipsisVertical,{size:12,color:(null===(p=h.style)||void 0===p?void 0:p.badgeText)||"#3730A3"})}))]})),u]})):n.jsx("span",e.__assign({},g,{children:u}))}}},[m,x]),y=i.useMemo(function(){var n=function(e){return e?e.replace(/\\([''])/g,"$1").replace(/\\n/g,"\n").replace(/\r\n/g,"\n").split(/(\n{2,})/).map(function(e){return e.startsWith("\n")?e:e.replace(/\n/g," ")}).join(""):""},r=function(e,n,r){void 0===n&&(n=""),void 0===r&&(r="");var i=e.startsWith("\n\n"),t=e.endsWith("\n\n");return n+e.split(/(\n{2,})/).map(function(e,n,r){if(/^\n{2,}$/.test(e))return e;if(!e.trim())return e;var o=0===n||1===n&&/^\n{2,}$/.test(r[0]),a=n===r.length-1||n===r.length-2&&/^\n{2,}$/.test(r[r.length-1]);return i&&o||t&&a?e:"<mark>".concat(e,"</mark>")}).join("").replace(/^\n{2,}/,"").replace(/\n{2,}$/,"")+r},i=n(s.safeStringify(l||"")),t=e.__spreadArray([],g,!0).sort(function(e,n){var r,i;return((null===(r=n.highlight)||void 0===r?void 0:r.length)||0)-((null===(i=e.highlight)||void 0===i?void 0:i.length)||0)}),o={},a=0;t.forEach(function(e){if(e&&e.highlight){var t=n(e.highlight);if(t){var s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l="__DEV_TOKEN_".concat(a++,"__");o[l]=r(t,'<span data-badge-id="'.concat(e.id,'">'),"</span>"),i=i.replace(t,l);var c="__HIGHLIGHT_TOKEN_".concat(a++,"__");o[c]=r(t),i=i.replace(new RegExp(s,"g"),c)}}});var c=new Set(t.map(function(e){return n(e.highlight)}).filter(Boolean));return h.forEach(function(e){if(e){var t=n(e);if(t&&!c.has(t)){var s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l="__PLAIN_TOKEN_".concat(a++,"__");o[l]=r(t),i=i.replace(new RegExp(s,"g"),l)}}}),Object.keys(o).forEach(function(e){i=i.split(e).join(o[e])}),i},[l,g,h]);return n.jsx(r.Typography,e.__assign({component:"div",sx:e.__assign(e.__assign({},c),{position:"relative",overflow:"visible",whiteSpace:"pre-wrap","& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}})},{children:n.jsx(p.default,e.__assign({components:b,rehypePlugins:[u.default]},{children:s.safeStringify(y).replace(/\\n/g,"\n")}))}))},s.areMarkdownPropsEqual);exports.MemoizedMarkdown=g;
|
|
2
2
|
//# sourceMappingURL=memoizedMarkdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__rest as
|
|
1
|
+
import{__assign as e,__rest as n,__spreadArray as r}from"tslib";import{jsx as o,jsxs as t}from"react/jsx-runtime";import{Box as i,Typography as a}from"@mui/material";import l,{useMemo as c}from"react";import{DEFAULT_DEVIAION_COLOR as s}from"../CognitiveCompareConstants.js";import{EllipsisVertical as p}from"lucide-react";import d from"react-markdown";import{safeStringify as h,areMarkdownPropsEqual as f}from"../CognitiveComparehelpers.js";import g from"rehype-raw";var u=l.memo(function(l){var f=l.content,u=l.sxStyles,m=l.deviationBadges,v=void 0===m?[]:m,x=l.highlights,b=void 0===x?[]:x,y=l.maintainRelativeOrder,_=void 0===y||y,C=l.highlightBg,w=c(function(){return v.reduce(function(n,r){var o;return e(e({},n),((o={})[r.id]=r,o))},{})},[v]),E=c(function(){return{mark:function(n){var r=n.children;return o("span",e({style:{backgroundColor:C,borderRadius:"2px"}},{children:r}))},span:function(r){var a,l,c,d,h,f,g=r.children,u=n(r,["children"]),m=u["data-badge-id"];if(!m)return o("span",e({},u,{children:g}));var v=w[m];return v?t(i,e({component:"span",sx:{position:"static",display:"inline"}},{children:[t(i,e({ref:v.badgeRef,sx:e(e({fontStyle:"normal",position:"absolute",zIndex:30,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=v.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(l=v.style)||void 0===l?void 0:l.badgeText)||s,border:"1px solid ".concat((null===(c=v.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden"},"left"===v.side?{right:"-16px",transform:"translateY(-20%) translateX(calc(100% + 8px))"}:{left:"-16px",transform:"translateY(-20%) translateX(calc(-100% - 8px))"}),v.isConnected&&v.style&&{outline:"2px solid ".concat(v.style.badgeBorder),outlineOffset:"1px"})},{children:[t(i,e({onClick:function(e){e.stopPropagation(),v.onSummaryClick&&v.onSummaryClick(e)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[o(i,e({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:v.label})),("left"===v.side||v.isOrphan)&&o(i,e({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(d=v.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE")}},{children:null!=v.score&&"N/A"!==v.score&&"NA"!==v.score&&0!==v.score?"".concat(v.score):"N/A"===v.score||"NA"===v.score?"N/A":"Same"}))]})),("left"===v.side||v.isOrphan)&&o(i,e({onClick:function(e){e.stopPropagation(),v.onClick&&v.onClick(e)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(h=v.style)||void 0===h?void 0:h.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:o(p,{size:12,color:(null===(f=v.style)||void 0===f?void 0:f.badgeText)||"#3730A3"})}))]})),g]})):o("span",e({},u,{children:g}))}}},[w,_]),S=c(function(){var e=function(e){return e?e.replace(/\\([''])/g,"$1").replace(/\\n/g,"\n").replace(/\r\n/g,"\n").split(/(\n{2,})/).map(function(e){return e.startsWith("\n")?e:e.replace(/\n/g," ")}).join(""):""},n=function(e,n,r){void 0===n&&(n=""),void 0===r&&(r="");var o=e.startsWith("\n\n"),t=e.endsWith("\n\n");return n+e.split(/(\n{2,})/).map(function(e,n,r){if(/^\n{2,}$/.test(e))return e;if(!e.trim())return e;var i=0===n||1===n&&/^\n{2,}$/.test(r[0]),a=n===r.length-1||n===r.length-2&&/^\n{2,}$/.test(r[r.length-1]);return o&&i||t&&a?e:"<mark>".concat(e,"</mark>")}).join("").replace(/^\n{2,}/,"").replace(/\n{2,}$/,"")+r},o=e(h(f||"")),t=r([],v,!0).sort(function(e,n){var r,o;return((null===(r=n.highlight)||void 0===r?void 0:r.length)||0)-((null===(o=e.highlight)||void 0===o?void 0:o.length)||0)}),i={},a=0;t.forEach(function(r){if(r&&r.highlight){var t=e(r.highlight);if(t){var l=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c="__DEV_TOKEN_".concat(a++,"__");i[c]=n(t,'<span data-badge-id="'.concat(r.id,'">'),"</span>"),o=o.replace(t,c);var s="__HIGHLIGHT_TOKEN_".concat(a++,"__");i[s]=n(t),o=o.replace(new RegExp(l,"g"),s)}}});var l=new Set(t.map(function(n){return e(n.highlight)}).filter(Boolean));return b.forEach(function(r){if(r){var t=e(r);if(t&&!l.has(t)){var c=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s="__PLAIN_TOKEN_".concat(a++,"__");i[s]=n(t),o=o.replace(new RegExp(c,"g"),s)}}}),Object.keys(i).forEach(function(e){o=o.split(e).join(i[e])}),o},[f,v,b]);return o(a,e({component:"div",sx:e(e({},u),{position:"relative",overflow:"visible",whiteSpace:"pre-wrap","& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}})},{children:o(d,e({components:E,rehypePlugins:[g]},{children:h(S).replace(/\\n/g,"\n")}))}))},f);export{u as MemoizedMarkdown};
|
|
2
2
|
//# sourceMappingURL=memoizedMarkdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonConstants.d.ts","sourceRoot":"","sources":["../../../../src/CommonConstants/CommonConstants.tsx"],"names":[],"mappings":"AACA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAC5C,eAAO,MAAM,OAAO,EAAE,aAAqB,CAAC;AAC5C,eAAO,MAAM,SAAS,EAAE,aAAuB,CAAC;AAChD,eAAO,MAAM,6BAA6B,yCAAyC,CAAA;AAEnF,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"CommonConstants.d.ts","sourceRoot":"","sources":["../../../../src/CommonConstants/CommonConstants.tsx"],"names":[],"mappings":"AACA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAC5C,eAAO,MAAM,OAAO,EAAE,aAAqB,CAAC;AAC5C,eAAO,MAAM,SAAS,EAAE,aAAuB,CAAC;AAChD,eAAO,MAAM,6BAA6B,yCAAyC,CAAA;AAEnF,eAAO,MAAM,iBAAiB,EAAE,GAykV/B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoizedMarkdown.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/hooks/memoizedMarkdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAMvC,eAAO,MAAM,gBAAgB;aAQlB,MAAM;cACL,GAAG;;;;iBAIA,MAAM;
|
|
1
|
+
{"version":3,"file":"memoizedMarkdown.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/hooks/memoizedMarkdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAMvC,eAAO,MAAM,gBAAgB;aAQlB,MAAM;cACL,GAAG;;;;iBAIA,MAAM;8CAkQI,CAAC"}
|