@layers-app/editor 0.0.14 → 0.0.15-swagger
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/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/{layers.B3PKFuLO.js → layers.36_3ol3v.js} +3230 -3172
- package/dist/{layers.C0b1Opuc.js → layers.B073B28e.js} +1 -1
- package/dist/{layers.vNINlb5t.js → layers.BkZOLD-e.js} +2 -2
- package/dist/layers.Bt_uh_hb.js +310 -0
- package/dist/{layers.DBwkDa74.js → layers.CNFYHxt_.js} +1 -1
- package/dist/{layers.DETHwCxI.js → layers.CO00-yDf.js} +1 -1
- package/dist/{layers.B9CNbJKD.js → layers.CYqXx2p1.js} +1 -1
- package/dist/{layers.CsuN1Q94.js → layers.CypWhmII.js} +1 -1
- package/dist/{layers.Dyb1dHPy.js → layers.D1A3jNDb.js} +47 -47
- package/dist/{layers.C0ddic19.js → layers.DZ2FxhQI.js} +1 -1
- package/dist/{layers.CovbS90x.js → layers.Di1ekcMX.js} +1 -1
- package/dist/layers.DuBUvwyq.js +50709 -0
- package/dist/{layers.BuTH_4Q9.js → layers.Q4XQ9POM.js} +1 -1
- package/dist/{layers.C5oAiCeN.js → layers.qDjx13HJ.js} +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("react"),e=require("./layers.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("react"),e=require("./layers.D1A3jNDb.js");function C(...n){return n.filter(Boolean).join(" ")}function P(n){return n.reduce((i,s)=>i+s.votes.length,0)}function j({option:n,index:i,options:s,totalVotes:r,withPollNode:h}){const{clientID:a}=e.l(),m=x.useRef(null),N=n.votes,f=N.indexOf(a)!==-1,d=N.length,_=n.text;return o.jsxs("div",{className:"PollNode__optionContainer",children:[o.jsx("div",{className:C("PollNode__optionCheckboxWrapper",f&&"PollNode__optionCheckboxChecked"),children:o.jsx("input",{ref:m,className:"PollNode__optionCheckbox",type:"checkbox",onChange:()=>{h(u=>{u.toggleVote(n,a)})},checked:f})}),o.jsxs("div",{className:"PollNode__optionInputWrapper",children:[o.jsx("div",{className:"PollNode__optionInputVotes",style:{width:`${d===0?0:d/r*100}%`}}),o.jsx("span",{className:"PollNode__optionInputVotesCount",children:d>0&&(d===1?"1 vote":`${d} votes`)}),o.jsx("input",{className:"PollNode__optionInput",type:"text",value:_,onChange:u=>{const p=u.target,v=p.value,t=p.selectionStart,l=p.selectionEnd;h(c=>{c.setOptionText(n,v)},()=>{p.selectionStart=t,p.selectionEnd=l})},placeholder:`Option ${i+1}`})]}),o.jsx("button",{disabled:s.length<3,className:C("PollNode__optionDelete",s.length<3&&"PollNode__optionDeleteDisabled"),"aria-label":"Remove",onClick:()=>{h(u=>{u.deleteOption(n)})}})]})}function k({question:n,options:i,nodeKey:s}){const[r]=e.u(),h=x.useMemo(()=>P(i),[i]),[a,m,N]=e.u$1(s),[g,f]=x.useState(null),d=x.useRef(null),_=x.useCallback(t=>{if(a&&e.wi(e.Ri())){t.preventDefault();const c=e.Ct(s);e.$isPollNode(c)&&c.remove()}return!1},[a,s]);x.useEffect(()=>e.N(r.registerUpdateListener(({editorState:t})=>{f(t.read(()=>e.Ri()))}),r.registerCommand(e.r,t=>{const l=t;return l.target===d.current?(l.shiftKey||N(),m(!a),!0):!1},e.Ks),r.registerCommand(e.w,_,e.Ks),r.registerCommand(e.k,_,e.Ks)),[N,r,a,s,_,m]);const u=(t,l)=>{r.update(()=>{const c=e.Ct(s);e.$isPollNode(c)&&t(c)},{onUpdate:l})},p=()=>{u(t=>{t.addOption(e.createPollOption())})},v=e.wi(g)&&a;return o.jsx("div",{className:`PollNode__container ${v?"focused":""}`,ref:d,children:o.jsxs("div",{className:"PollNode__inner",children:[o.jsx("h2",{className:"PollNode__heading",children:n}),i.map((t,l)=>{const c=t.uid;return o.jsx(j,{withPollNode:u,option:t,index:l,options:i,totalVotes:h},c)}),o.jsx("div",{className:"PollNode__footer",children:o.jsx(e.Button,{onClick:p,small:!0,children:"Add Option"})})]})})}exports.default=k;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o, jsxs as G } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as V, useState as I, useContext as q, useEffect as w } from "react";
|
|
3
3
|
import { useTranslation as J } from "react-i18next";
|
|
4
|
-
import { l as Q, u as X, C as Y, a as Z, b as K, c as C, $ as E, t as ee, I as te, E as ie, d as oe, R as ne, F as ae } from "./layers.
|
|
4
|
+
import { l as Q, u as X, C as Y, a as Z, b as K, c as C, $ as E, t as ee, I as te, E as ie, d as oe, R as ne, F as ae } from "./layers.36_3ol3v.js";
|
|
5
5
|
import { LoadingOverlay as T, Flex as se, Alert as re } from "@mantine/core";
|
|
6
6
|
import { IconInfoCircle as le } from "@tabler/icons-react";
|
|
7
7
|
const j = (t) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),m=require("react"),e=require("./layers.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),m=require("react"),e=require("./layers.D1A3jNDb.js"),b=require("./layers.B073B28e.js"),S=require("react-dom"),h=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,B=h&&"documentMode"in document?document.documentMode:null,_=!(!h||!("InputEvent"in window)||B)&&"getTargetRanges"in new window.InputEvent("input"),W=h&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),N=h&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,A=h&&/^(?=.*Chrome).*/i.test(navigator.userAgent),M=h&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!A;function j(r,n){n.update(()=>{if(r!==null){const t=e.ue(r,KeyboardEvent)?null:r.clipboardData,s=e.Ri();if(s!==null&&t!=null){r.preventDefault();const c=e.v(n);c!==null&&t.setData("text/html",c),t.setData("text/plain",s.getTextContent())}}})}function O(r){return e.N(r.registerCommand(e.i,n=>{const t=e.Ri();return!!e.ki(t)&&(t.deleteCharacter(n),!0)},e.Rs),r.registerCommand(e.u$2,n=>{const t=e.Ri();return!!e.ki(t)&&(t.deleteWord(n),!0)},e.Rs),r.registerCommand(e.f,n=>{const t=e.Ri();return!!e.ki(t)&&(t.deleteLine(n),!0)},e.Rs),r.registerCommand(e.l$1,n=>{const t=e.Ri();if(!e.ki(t))return!1;if(typeof n=="string")t.insertText(n);else{const s=n.dataTransfer;if(s!=null)e.D$1(s,t);else{const c=n.data;c&&t.insertText(c)}}return!0},e.Rs),r.registerCommand(e.a$1,()=>{const n=e.Ri();return!!e.ki(n)&&(n.removeText(),!0)},e.Rs),r.registerCommand(e.s,n=>{const t=e.Ri();return!!e.ki(t)&&(t.insertLineBreak(n),!0)},e.Rs),r.registerCommand(e.o,()=>{const n=e.Ri();return!!e.ki(n)&&(n.insertLineBreak(),!0)},e.Rs),r.registerCommand(e.m,n=>{const t=e.Ri();if(!e.ki(t))return!1;const s=n,c=s.shiftKey;return!!e.L$1(t,!0)&&(s.preventDefault(),e.$(t,c,!0),!0)},e.Rs),r.registerCommand(e.p,n=>{const t=e.Ri();if(!e.ki(t))return!1;const s=n,c=s.shiftKey;return!!e.L$1(t,!1)&&(s.preventDefault(),e.$(t,c,!1),!0)},e.Rs),r.registerCommand(e.k,n=>{const t=e.Ri();return!!e.ki(t)&&(!N||navigator.language!=="ko-KR")&&(n.preventDefault(),r.dispatchCommand(e.i,!0))},e.Rs),r.registerCommand(e.w,n=>{const t=e.Ri();return!!e.ki(t)&&(n.preventDefault(),r.dispatchCommand(e.i,!1))},e.Rs),r.registerCommand(e.C,n=>{const t=e.Ri();if(!e.ki(t))return!1;if(n!==null){if((N||W||M)&&_)return!1;n.preventDefault()}return r.dispatchCommand(e.s,!1)},e.Rs),r.registerCommand(e.z,()=>(e.Ht(),!0),e.Rs),r.registerCommand(e.A,n=>{const t=e.Ri();return!!e.ki(t)&&(j(n,r),!0)},e.Rs),r.registerCommand(e.B,n=>{const t=e.Ri();return!!e.ki(t)&&(function(s,c){j(s,c),c.update(()=>{const i=e.Ri();e.ki(i)&&i.removeText()})}(n,r),!0)},e.Rs),r.registerCommand(e.c,n=>{const t=e.Ri();return!!e.ki(t)&&(function(s,c){s.preventDefault(),c.update(()=>{const i=e.Ri(),{clipboardData:u}=s;u!=null&&e.ki(i)&&e.D$1(u,i)},{tag:"paste"})}(n,r),!0)},e.Rs),r.registerCommand(e.L,n=>{const t=e.Ri();return!!e.ki(t)&&(n.preventDefault(),!0)},e.Rs),r.registerCommand(e.D,n=>{const t=e.Ri();return!!e.ki(t)&&(n.preventDefault(),!0)},e.Rs))}const D=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?m.useLayoutEffect:m.useEffect;function P(r){return r.getEditorState().read(e.g(r.isComposing()))}function z({contentEditable:r,placeholder:n=null,ErrorBoundary:t}){const[s]=e.u(),c=function(i,u){const[f,k]=m.useState(()=>i.getDecorators());return D(()=>i.registerDecoratorListener(C=>{S.flushSync(()=>{k(C)})}),[i]),m.useEffect(()=>{k(i.getDecorators())},[i]),m.useMemo(()=>{const C=[],y=Object.keys(f);for(let E=0;E<y.length;E++){const v=y[E],x=d.jsx(u,{onError:a=>i._onError(a),children:d.jsx(m.Suspense,{fallback:null,children:f[v]})}),o=i.getElementByKey(v);o!==null&&C.push(S.createPortal(x,o,v))}return C},[u,f,i])}(s,t);return function(i){D(()=>e.N(O(i),e.o$1(i)),[i])}(s),d.jsxs(d.Fragment,{children:[r,d.jsx(K,{content:n}),c]})}function K({content:r}){const[n]=e.u(),t=function(c){const[i,u]=m.useState(()=>P(c));return D(()=>{function f(){const k=P(c);u(k)}return f(),e.N(c.registerUpdateListener(()=>{f()}),c.registerEditableListener(()=>{f()}))},[c]),i}(n),s=e.a$2();return t?typeof r=="function"?r(s):r:null}const X=new URL(window.location.href);new URLSearchParams(X.search);const q="https://wss.dudoc.io";function I(r,n){let t=n.get(r);return t===void 0?(t=new e.Doc,n.set(r,t)):t.load(),new e.WebsocketProvider(q,"/"+r,t,{connect:!1})}const U=e.CAN_USE_DOM?m.useLayoutEffect:m.useEffect,Y={...e.theme,paragraph:"StickyEditorTheme__paragraph"};function w(r,n){const t=r.style,s=n.rootElementRect,c=s!==null?s.left:0,i=s!==null?s.top:0;t.top=i+n.y+"px",t.left=c+n.x+"px"}function H({x:r,y:n,nodeKey:t,color:s,caption:c}){const[i]=e.u(),u=m.useRef(null),f=m.useRef({isDragging:!1,offsetX:0,offsetY:0,rootElementRect:null,x:0,y:0}),{isCollabActive:k}=e.l();m.useEffect(()=>{const o=f.current;o.x=r,o.y=n;const a=u.current;a!==null&&w(a,o)},[r,n]),U(()=>{const o=f.current,a=new ResizeObserver(R=>{for(let g=0;g<R.length;g++){const $=R[g],{target:T}=$;o.rootElementRect=T.getBoundingClientRect();const L=u.current;L!==null&&w(L,o)}}),l=i.registerRootListener((R,g)=>{g!==null&&a.unobserve(g),R!==null&&a.observe(R)}),p=()=>{const R=i.getRootElement(),g=u.current;R!==null&&g!==null&&(o.rootElementRect=R.getBoundingClientRect(),w(g,o))};return window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p),l()}},[i]),m.useEffect(()=>{const o=u.current;o!==null&&setTimeout(()=>{o.style.setProperty("transition","top 0.3s ease 0s, left 0.3s ease 0s")},500)},[]);const C=o=>{const a=u.current,l=f.current,p=l.rootElementRect;a!==null&&l.isDragging&&p!==null&&(l.x=o.pageX-l.offsetX-p.left,l.y=o.pageY-l.offsetY-p.top,w(a,l))},y=()=>{const o=u.current,a=f.current;o!==null&&(a.isDragging=!1,o.classList.remove("dragging"),i.update(()=>{const l=e.Ct(t);e.$isStickyNode(l)&&l.setPosition(a.x,a.y)})),document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",y)},E=()=>{i.update(()=>{const o=e.Ct(t);e.$isStickyNode(o)&&o.remove()})},v=()=>{i.update(()=>{const o=e.Ct(t);e.$isStickyNode(o)&&o.toggleColor()})},{historyState:x}=e.useSharedHistoryContext();return d.jsx("div",{ref:u,className:"sticky-note-container",children:d.jsxs("div",{className:`sticky-note ${s}`,onPointerDown:o=>{const a=u.current;if(a==null||o.button===2||o.target!==a.firstChild)return;const l=a,p=f.current;if(l!==null){const{top:R,left:g}=l.getBoundingClientRect();p.offsetX=o.clientX-g,p.offsetY=o.clientY-R,p.isDragging=!0,l.classList.add("dragging"),document.addEventListener("pointermove",C),document.addEventListener("pointerup",y),o.preventDefault()}},children:[d.jsx("button",{onClick:E,className:"delete","aria-label":"Delete sticky note",title:"Delete",children:"X"}),d.jsx("button",{onClick:v,className:"color","aria-label":"Change sticky note color",title:"Color",children:d.jsx("i",{className:"bucket"})}),d.jsxs(b.d,{initialEditor:c,initialTheme:Y,children:[k?d.jsx(e._,{id:c.getKey(),providerFactory:I,shouldBootstrap:!0}):d.jsx(e.a$3,{externalHistoryState:x}),d.jsx(z,{contentEditable:d.jsx(e.LexicalContentEditable,{className:"StickyNode__contentEditable"}),placeholder:d.jsx(b.Placeholder,{className:"StickyNode__placeholder",children:"What's up?"}),ErrorBoundary:e.a})]})]})})}exports.default=H;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o, jsxs as g } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as I, useState as D, useRef as S, useCallback as $, useEffect as V } from "react";
|
|
3
|
-
import { u as j, f as E, w as P, g as x, c as k, v as b, N as R, k as w, K as v, m as B, r as y, B as A, x as T, l as W } from "./layers.
|
|
3
|
+
import { u as j, f as E, w as P, g as x, c as k, v as b, N as R, k as w, K as v, m as B, r as y, B as A, x as T, l as W } from "./layers.36_3ol3v.js";
|
|
4
4
|
function O(...t) {
|
|
5
5
|
return t.filter(Boolean).join(" ");
|
|
6
6
|
}
|