@soul-refiner/design-system 2.14.148 → 2.14.149
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-common"),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"),l=require("../../../atoms/typography/heading.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(t);const
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("@udecode/plate-common"),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"),l=require("../../../atoms/typography/heading.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(t);const x=a.default.forwardRef(({children:n,element:o,...c},x)=>{const{questionAnswerId:h}=o,{defaultFilter:p="",commentInputLoader:m,commentLoader:w,filterComponent:j,hideShowAnswersButton:g,showAnswersBelowInput:b}=a.default.useContext(s.EditorContext),[v,q]=a.default.useState(!1),[y,E]=a.default.useState(p),[A,I]=a.default.useState(!1),B=a.default.useRef(null),C=a.default.useRef(null),$=a.default.useRef(!1);a.default.useEffect(()=>{if(!b)return void($.current||(I(!0),$.current=!0));if("undefined"==typeof IntersectionObserver)return void($.current||(I(!0),$.current=!0));if(!B.current||$.current)return;C.current&&C.current.disconnect();const e=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&!$.current&&($.current=!0,I(!0),e.disconnect(),C.current=null)})},{rootMargin:"200px",threshold:.01});return C.current=e,e.observe(B.current),()=>{C.current&&(C.current.disconnect(),C.current=null)}},[b]);const T=a.default.useCallback(e=>{const t=e.currentTarget.getAttribute("data-value");E(e=>e===t?p:t)},[]),F=a.default.useCallback(()=>E(p),[]);return e.jsx(r.PlateElement,{asChild:!0,element:o,ref:x,...c,children:e.jsxs(t.Fragment,{children:[e.jsx(f,{children:e.jsx(l.H,{as:"p",$color:"green-3",$fontSize:18,$lineHeight:26,$mediumBold:!0,children:n})}),e.jsx("div",{ref:B,children:e.jsxs(u.Box,{$dir:"column",sx:"padding: 0 24px 48px; @media (max-width: 500px) { padding: 0; }",contentEditable:!1,children:[(!g||j)&&e.jsxs(u.Box,{sx:"width: 100%",$justify:"space-between",children:[!g&&e.jsx(i.Button,{as:"div",onClick:()=>q(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:v?"Hide answers":"Show answers"}),j&&e.jsx(d.HideButRender,{show:v,children:e.jsx(j,{filter:y,onFilterChange:T,questionAnswerId:h})})]}),e.jsxs(u.Box,{$dir:"column",$gap:24,children:[!b&&A&&e.jsx(d.HideButRender,{show:v,children:e.jsx(w,{questionAnswerId:h,filterType:y,resetFilter:F,waitToLoad:!v})}),A&&e.jsx(m,{questionAnswerId:h,onComment:()=>q(!0)}),b&&A&&e.jsx(w,{questionAnswerId:h,filterType:y,resetFilter:F,waitToLoad:!1},`comments-${h}`)]})]})})]})})}),f=n.styled.div`
|
|
2
2
|
padding: 16px;
|
|
3
3
|
border-left: 8px solid var(--color-hue-blue-1);
|
|
4
4
|
border-radius: 8px;
|
|
5
5
|
background-color: var(--color-hue-blue-3);
|
|
6
6
|
margin: 24px 0;
|
|
7
|
-
`,h=r.createPluginFactory({key:o.ELEMENT_QA,type:o.ELEMENT_QA,isElement:!0,component:
|
|
7
|
+
`,h=r.createPluginFactory({key:o.ELEMENT_QA,type:o.ELEMENT_QA,isElement:!0,component:x});exports.QuestionAnswerElement=x,exports.createQAPlugin=h;
|
|
@@ -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,uBAAuB,CAAC;AAW/B,eAAO,MAAM,qBAAqB,
|
|
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,uBAAuB,CAAC;AAW/B,eAAO,MAAM,qBAAqB,4FA0KhC,CAAC;AAUH,eAAO,MAAM,cAAc,sgBAKzB,CAAC"}
|