@soul-refiner/design-system 2.14.139 → 2.14.140
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.
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
outline: none;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
*:not(a):not(a *):not(button):not(button *) {
|
|
9
|
+
color: var(--color-grey-3);
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
.slate-bold {
|
|
9
13
|
font-weight: 700;
|
|
10
14
|
}
|
|
@@ -71,4 +75,4 @@
|
|
|
71
75
|
max-width: 864px;
|
|
72
76
|
width: 100%;
|
|
73
77
|
margin: 0 auto;
|
|
74
|
-
`;exports.Editor=({audioLoader:o,commentInputLoader:l,commentLoader:a,editable:s,handleAudioClick:d,handleVideoClick:u,imageSrcLoader:m,onChange:
|
|
78
|
+
`;exports.Editor=({audioLoader:o,commentInputLoader:l,commentLoader:a,editable:s,handleAudioClick:d,handleVideoClick:u,imageSrcLoader:m,onChange:g,previousContent:h,defaultFilter:f,videoTitleLoader:x,filterComponent:v,hideShowAnswersButton:y,showAnswersBelowInput:b})=>e.jsx(r.EditorContext.Provider,{value:{audioLoader:o,commentInputLoader:l,commentLoader:a,handleAudioClick:d,handleVideoClick:u,imageSrcLoader:m,videoTitleLoader:x,defaultFilter:f,filterComponent:v,hideShowAnswersButton:y,showAnswersBelowInput:b},children:e.jsx(t.Plate,{id:"main",initialValue:h,onChange:g,plugins:c,children:e.jsxs(p,{children:[s&&e.jsx(n.EditorBar,{}),e.jsx(t.PlateContent,{id:"main",autoFocus:!0,placeholder:i.PLACEHOLDER,readOnly:!s,spellCheck:!0,onContextMenu:e=>e.preventDefault(),onCopy:()=>{if("clipboard"in navigator)return navigator.clipboard.writeText("")}})]})})});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),
|
|
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:p}=o,{defaultFilter:m="",commentInputLoader:h,commentLoader:w,filterComponent:g,hideShowAnswersButton:j,showAnswersBelowInput:b}=a.default.useContext(s.EditorContext),[v,q]=a.default.useState(!1),[y,E]=a.default.useState(m),[A,I]=a.default.useState(!1),C=a.default.useRef(null),B=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(!C.current||$.current)return;B.current&&B.current.disconnect();const e=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&!$.current&&($.current=!0,I(!0),e.disconnect(),B.current=null)})},{rootMargin:"200px",threshold:.01});return B.current=e,e.observe(C.current),()=>{B.current&&(B.current.disconnect(),B.current=null)}},[b]);const T=a.default.useCallback(e=>{const t=e.currentTarget.getAttribute("data-value");E(e=>e===t?m:t)},[]),F=a.default.useCallback(()=>E(m),[]);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:C,children:e.jsxs(u.Box,{$dir:"column",$gap:"small",sx:"padding: 8px 24px; @media (max-width: 500px) { padding: 8px 0; }",contentEditable:!1,children:[(!j||g)&&e.jsxs(u.Box,{sx:"width: 100%",$justify:"space-between",children:[!j&&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"}),g&&e.jsx(d.HideButRender,{show:v,children:e.jsx(g,{filter:y,onFilterChange:T,questionAnswerId:p})})]}),!b&&A&&e.jsx(d.HideButRender,{show:v,children:e.jsx(w,{questionAnswerId:p,filterType:y,resetFilter:F,waitToLoad:!v})}),A&&e.jsx(h,{questionAnswerId:p,onComment:()=>q(!0)}),b&&A&&e.jsx(w,{questionAnswerId:p,filterType:y,resetFilter:F,waitToLoad:!1},`comments-${p}`)]})})]})})}),f=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
|
-
|
|
7
|
+
margin: 80px 0 0px 0 !important;
|
|
8
|
+
`,p=r.createPluginFactory({key:o.ELEMENT_QA,type:o.ELEMENT_QA,isElement:!0,component:x});exports.QuestionAnswerElement=x,exports.createQAPlugin=p;
|
|
@@ -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,4FAyKhC,CAAC;AAWH,eAAO,MAAM,cAAc,sgBAKzB,CAAC"}
|