@soul-refiner/design-system 2.14.104 → 2.14.105

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.
@@ -1,7 +1,7 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("@udecode/plate"),n=require("styled-components"),o=require("../../constants.js"),s=require("../../context.js"),i=require("../../../actions/button/button.js"),d=require("../../../atoms/box/box.js"),a=require("../../../atoms/hide/hide.js"),l=require("../../../atoms/typography/heading.js"),u=require("../../../../icons/arrow/chevron_down.js"),c=require("../../../../icons/arrow/chevron_up.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=x(t);const h=p.default.forwardRef(({children:n,element:o,...x},h)=>{const{questionAnswerId:w}=o,{defaultFilter:j="",commentInputLoader:f,commentLoader:g,filterComponent:b,hideShowAnswersButton:q,showAnswersBelowInput:v}=p.default.useContext(s.EditorContext),[y,A]=p.default.useState(!1),[E,C]=p.default.useState(j),B=p.default.useCallback(e=>{const t=e.currentTarget.getAttribute("data-value");C(e=>e===t?j:t)},[]),I=p.default.useCallback(()=>C(j),[]);return e.jsx(r.PlateElement,{asChild:!0,element:o,ref:h,...x,children:e.jsxs(t.Fragment,{children:[e.jsx(m,{children:e.jsx(l.H,{as:"p",$fontSize:18,$lineHeight:26,$mediumBold:!0,children:n})}),e.jsxs(d.Box,{$dir:"column",$gap:"medium",sx:"padding: 8px 24px; @media (max-width: 500px) { padding: 8px 0; }",contentEditable:!1,children:[(!q||b)&&e.jsxs(d.Box,{sx:"width: 100%",$justify:"space-between",children:[!q&&e.jsx(i.Button,{as:"div",icon:y?e.jsx(c.ChevronUp,{color:"grey-3"}):e.jsx(u.ChevronDown,{color:"grey-3"}),onClick:()=>A(e=>!e),size:"small",sx:"\n width: fit-content;\n flex-direction: row-reverse;\n color: var(--color-grey-5);\n padding 7px 15px;\n &:not(:hover) svg {\n fill: var(--color-grey-3);\n }\n ",type:"text",contentEditable:!1,children:y?"Hide answers":"Show answers"}),b&&e.jsx(a.HideButRender,{show:y,children:e.jsx(b,{filter:E,onFilterChange:B,questionAnswerId:w})})]}),!v&&e.jsx(a.HideButRender,{show:y,children:e.jsx(g,{questionAnswerId:w,filterType:E,resetFilter:I,waitToLoad:!y})}),e.jsx(f,{questionAnswerId:w,onComment:()=>A(!0)}),v&&e.jsx(g,{questionAnswerId:w,filterType:E,resetFilter:I,waitToLoad:!1})]})]})})}),m=n.styled.div`
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("@udecode/plate"),n=require("styled-components"),o=require("../../constants.js"),s=require("../../context.js"),i=require("../../../actions/button/button.js"),u=require("../../../atoms/box/box.js"),d=require("../../../atoms/hide/hide.js"),c=require("../../../atoms/typography/heading.js"),l=require("../../../../icons/arrow/chevron_down.js"),a=require("../../../../icons/arrow/chevron_up.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=x(r);const h=f.default.forwardRef(({children:n,element:o,...x},h)=>{const{questionAnswerId:m}=o,{defaultFilter:w="",commentInputLoader:j,commentLoader:g,filterComponent:v,hideShowAnswersButton:b,showAnswersBelowInput:q}=f.default.useContext(s.EditorContext),[y,E]=f.default.useState(!1),[A,C]=f.default.useState(w),[I,B]=f.default.useState(!1),T=f.default.useRef(null),$=f.default.useRef(null),F=f.default.useRef(!1);f.default.useEffect(()=>{if(!q)return void(F.current||(B(!0),F.current=!0));if("undefined"==typeof IntersectionObserver)return void(F.current||(B(!0),F.current=!0));if(!T.current||F.current)return;$.current&&$.current.disconnect();const e=new IntersectionObserver(r=>{r.forEach(r=>{r.isIntersecting&&!F.current&&(F.current=!0,B(!0),e.disconnect(),$.current=null)})},{rootMargin:"200px",threshold:.01});return $.current=e,e.observe(T.current),()=>{$.current&&($.current.disconnect(),$.current=null)}},[q]);const L=f.default.useCallback(e=>{const r=e.currentTarget.getAttribute("data-value");C(e=>e===r?w:r)},[]),R=f.default.useCallback(()=>C(w),[]);return e.jsx(t.PlateElement,{asChild:!0,element:o,ref:h,...x,children:e.jsxs(r.Fragment,{children:[e.jsx(p,{children:e.jsx(c.H,{as:"p",$fontSize:18,$lineHeight:26,$mediumBold:!0,children:n})}),e.jsx("div",{ref:T,children:e.jsxs(u.Box,{$dir:"column",$gap:"medium",sx:"padding: 8px 24px; @media (max-width: 500px) { padding: 8px 0; }",contentEditable:!1,children:[(!b||v)&&e.jsxs(u.Box,{sx:"width: 100%",$justify:"space-between",children:[!b&&e.jsx(i.Button,{as:"div",icon:y?e.jsx(a.ChevronUp,{color:"grey-3"}):e.jsx(l.ChevronDown,{color:"grey-3"}),onClick:()=>E(e=>!e),size:"small",sx:"\n width: fit-content;\n flex-direction: row-reverse;\n color: var(--color-grey-5);\n padding 7px 15px;\n &:not(:hover) svg {\n fill: var(--color-grey-3);\n }\n ",type:"text",contentEditable:!1,children:y?"Hide answers":"Show answers"}),v&&e.jsx(d.HideButRender,{show:y,children:e.jsx(v,{filter:A,onFilterChange:L,questionAnswerId:m})})]}),!q&&I&&e.jsx(d.HideButRender,{show:y,children:e.jsx(g,{questionAnswerId:m,filterType:A,resetFilter:R,waitToLoad:!y})}),I&&e.jsx(j,{questionAnswerId:m,onComment:()=>E(!0)}),q&&I&&e.jsx(g,{questionAnswerId:m,filterType:A,resetFilter:R,waitToLoad:!1},`comments-${m}`)]})})]})})}),p=n.styled.div`
2
2
  margin-bottom: 8px;
3
3
  padding: 16px;
4
4
  border-left: 8px solid var(--color-hue-blue-1);
5
5
  border-radius: 8px;
6
6
  background-color: var(--color-hue-blue-3);
7
- `,w=r.createPluginFactory({key:o.ELEMENT_QA,type:o.ELEMENT_QA,isElement:!0,component:h});exports.QuestionAnswerElement=h,exports.createQAPlugin=w;
7
+ `,m=t.createPluginFactory({key:o.ELEMENT_QA,type:o.ELEMENT_QA,isElement:!0,component:h});exports.QuestionAnswerElement=h,exports.createQAPlugin=m;
@@ -1 +1 @@
1
- {"version":3,"file":"qa.d.ts","sourceRoot":"","sources":["../../../../../../src/components/editor/plugins/blocks/qa.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAGL,iBAAiB,EAElB,MAAM,gBAAgB,CAAC;AAWxB,eAAO,MAAM,qBAAqB,4FA4GhC,CAAC;AAUH,eAAO,MAAM,cAAc,wfAKzB,CAAC"}
1
+ {"version":3,"file":"qa.d.ts","sourceRoot":"","sources":["../../../../../../src/components/editor/plugins/blocks/qa.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAGL,iBAAiB,EAElB,MAAM,gBAAgB,CAAC;AAWxB,eAAO,MAAM,qBAAqB,4FA0KhC,CAAC;AAUH,eAAO,MAAM,cAAc,wfAKzB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "2.14.104",
3
+ "version": "2.14.105",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "license": "MIT",