@layers-app/editor 0.0.15-swagger → 0.0.16
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.d.ts +0 -40
- package/dist/index.js +5 -5
- package/dist/layers.BK2HDr2t.js +164 -0
- package/dist/layers.Cj_eKfOr.js +1 -0
- package/dist/layers.D3koK7fX.js +310 -0
- package/dist/{layers.36_3ol3v.js → layers.DKTSDVNR.js} +18910 -19561
- package/dist/layers.Diz9D61w.js +343 -0
- package/dist/layers.kdvITuJm.js +1 -0
- package/dist/{layers.CO00-yDf.js → layers.w2M9V0v2.js} +16 -16
- package/dist/{layers.DuBUvwyq.js → layers.zgx3hOJs.js} +13732 -13606
- package/package.json +13 -12
- package/dist/layers.B073B28e.js +0 -1
- package/dist/layers.BkZOLD-e.js +0 -289
- package/dist/layers.Bt_uh_hb.js +0 -310
- package/dist/layers.CNFYHxt_.js +0 -1
- package/dist/layers.CYqXx2p1.js +0 -1
- package/dist/layers.CypWhmII.js +0 -170
- package/dist/layers.D1A3jNDb.js +0 -164
- package/dist/layers.DZ2FxhQI.js +0 -1
- package/dist/layers.Di1ekcMX.js +0 -52
- package/dist/layers.Q4XQ9POM.js +0 -1
- package/dist/layers.qDjx13HJ.js +0 -288
package/dist/layers.CNFYHxt_.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;
|
package/dist/layers.CYqXx2p1.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;
|
package/dist/layers.CypWhmII.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { jsx as o, jsxs as g } from "react/jsx-runtime";
|
|
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.36_3ol3v.js";
|
|
4
|
-
function O(...t) {
|
|
5
|
-
return t.filter(Boolean).join(" ");
|
|
6
|
-
}
|
|
7
|
-
function F(t) {
|
|
8
|
-
return t.reduce((c, n) => c + n.votes.length, 0);
|
|
9
|
-
}
|
|
10
|
-
function L({
|
|
11
|
-
option: t,
|
|
12
|
-
index: c,
|
|
13
|
-
options: n,
|
|
14
|
-
totalVotes: a,
|
|
15
|
-
withPollNode: p
|
|
16
|
-
}) {
|
|
17
|
-
const { clientID: r } = W(), h = S(null), m = t.votes, _ = m.indexOf(r) !== -1, i = m.length, f = t.text;
|
|
18
|
-
return /* @__PURE__ */ g("div", { className: "PollNode__optionContainer", children: [
|
|
19
|
-
/* @__PURE__ */ o(
|
|
20
|
-
"div",
|
|
21
|
-
{
|
|
22
|
-
className: O(
|
|
23
|
-
"PollNode__optionCheckboxWrapper",
|
|
24
|
-
_ && "PollNode__optionCheckboxChecked"
|
|
25
|
-
),
|
|
26
|
-
children: /* @__PURE__ */ o(
|
|
27
|
-
"input",
|
|
28
|
-
{
|
|
29
|
-
ref: h,
|
|
30
|
-
className: "PollNode__optionCheckbox",
|
|
31
|
-
type: "checkbox",
|
|
32
|
-
onChange: () => {
|
|
33
|
-
p((d) => {
|
|
34
|
-
d.toggleVote(t, r);
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
checked: _
|
|
38
|
-
}
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
),
|
|
42
|
-
/* @__PURE__ */ g("div", { className: "PollNode__optionInputWrapper", children: [
|
|
43
|
-
/* @__PURE__ */ o(
|
|
44
|
-
"div",
|
|
45
|
-
{
|
|
46
|
-
className: "PollNode__optionInputVotes",
|
|
47
|
-
style: { width: `${i === 0 ? 0 : i / a * 100}%` }
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
/* @__PURE__ */ o("span", { className: "PollNode__optionInputVotesCount", children: i > 0 && (i === 1 ? "1 vote" : `${i} votes`) }),
|
|
51
|
-
/* @__PURE__ */ o(
|
|
52
|
-
"input",
|
|
53
|
-
{
|
|
54
|
-
className: "PollNode__optionInput",
|
|
55
|
-
type: "text",
|
|
56
|
-
value: f,
|
|
57
|
-
onChange: (d) => {
|
|
58
|
-
const u = d.target, N = u.value, e = u.selectionStart, l = u.selectionEnd;
|
|
59
|
-
p(
|
|
60
|
-
(s) => {
|
|
61
|
-
s.setOptionText(t, N);
|
|
62
|
-
},
|
|
63
|
-
() => {
|
|
64
|
-
u.selectionStart = e, u.selectionEnd = l;
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
},
|
|
68
|
-
placeholder: `Option ${c + 1}`
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
] }),
|
|
72
|
-
/* @__PURE__ */ o(
|
|
73
|
-
"button",
|
|
74
|
-
{
|
|
75
|
-
disabled: n.length < 3,
|
|
76
|
-
className: O(
|
|
77
|
-
"PollNode__optionDelete",
|
|
78
|
-
n.length < 3 && "PollNode__optionDeleteDisabled"
|
|
79
|
-
),
|
|
80
|
-
"aria-label": "Remove",
|
|
81
|
-
onClick: () => {
|
|
82
|
-
p((d) => {
|
|
83
|
-
d.deleteOption(t);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
] });
|
|
89
|
-
}
|
|
90
|
-
function z({
|
|
91
|
-
question: t,
|
|
92
|
-
options: c,
|
|
93
|
-
nodeKey: n
|
|
94
|
-
}) {
|
|
95
|
-
const [a] = j(), p = I(() => F(c), [c]), [r, h, m] = E(n), [C, _] = D(null), i = S(null), f = $(
|
|
96
|
-
(e) => {
|
|
97
|
-
if (r && P(x())) {
|
|
98
|
-
e.preventDefault();
|
|
99
|
-
const s = k(n);
|
|
100
|
-
b(s) && s.remove();
|
|
101
|
-
}
|
|
102
|
-
return !1;
|
|
103
|
-
},
|
|
104
|
-
[r, n]
|
|
105
|
-
);
|
|
106
|
-
V(() => R(
|
|
107
|
-
a.registerUpdateListener(({ editorState: e }) => {
|
|
108
|
-
_(e.read(() => x()));
|
|
109
|
-
}),
|
|
110
|
-
a.registerCommand(
|
|
111
|
-
y,
|
|
112
|
-
(e) => {
|
|
113
|
-
const l = e;
|
|
114
|
-
return l.target === i.current ? (l.shiftKey || m(), h(!r), !0) : !1;
|
|
115
|
-
},
|
|
116
|
-
v
|
|
117
|
-
),
|
|
118
|
-
a.registerCommand(
|
|
119
|
-
B,
|
|
120
|
-
f,
|
|
121
|
-
v
|
|
122
|
-
),
|
|
123
|
-
a.registerCommand(
|
|
124
|
-
w,
|
|
125
|
-
f,
|
|
126
|
-
v
|
|
127
|
-
)
|
|
128
|
-
), [m, a, r, n, f, h]);
|
|
129
|
-
const d = (e, l) => {
|
|
130
|
-
a.update(
|
|
131
|
-
() => {
|
|
132
|
-
const s = k(n);
|
|
133
|
-
b(s) && e(s);
|
|
134
|
-
},
|
|
135
|
-
{ onUpdate: l }
|
|
136
|
-
);
|
|
137
|
-
}, u = () => {
|
|
138
|
-
d((e) => {
|
|
139
|
-
e.addOption(T());
|
|
140
|
-
});
|
|
141
|
-
}, N = P(C) && r;
|
|
142
|
-
return /* @__PURE__ */ o(
|
|
143
|
-
"div",
|
|
144
|
-
{
|
|
145
|
-
className: `PollNode__container ${N ? "focused" : ""}`,
|
|
146
|
-
ref: i,
|
|
147
|
-
children: /* @__PURE__ */ g("div", { className: "PollNode__inner", children: [
|
|
148
|
-
/* @__PURE__ */ o("h2", { className: "PollNode__heading", children: t }),
|
|
149
|
-
c.map((e, l) => {
|
|
150
|
-
const s = e.uid;
|
|
151
|
-
return /* @__PURE__ */ o(
|
|
152
|
-
L,
|
|
153
|
-
{
|
|
154
|
-
withPollNode: d,
|
|
155
|
-
option: e,
|
|
156
|
-
index: l,
|
|
157
|
-
options: c,
|
|
158
|
-
totalVotes: p
|
|
159
|
-
},
|
|
160
|
-
s
|
|
161
|
-
);
|
|
162
|
-
}),
|
|
163
|
-
/* @__PURE__ */ o("div", { className: "PollNode__footer", children: /* @__PURE__ */ o(A, { onClick: u, small: !0, children: "Add Option" }) })
|
|
164
|
-
] })
|
|
165
|
-
}
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
export {
|
|
169
|
-
z as default
|
|
170
|
-
};
|