@layers-app/editor 0.0.10 → 0.0.12
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.js +2 -2
- package/dist/index.umd.cjs +52 -1926
- package/dist/{DSD.RjfD_Vp_.js → layers.C5bl-M5E.js} +21 -21
- package/dist/{DSD.AwtUbg5v.js → layers.CJQEaaIH.js} +10 -10
- package/dist/layers.D0SxWFme.js +37825 -0
- package/dist/layers.D95tWX8p.js +16605 -0
- package/dist/{DSD.xqZnHMlT.js → layers.DRs0dAJu.js} +76 -76
- package/dist/layers.DeCNzWQA.js +281 -0
- package/dist/{DSD.DDmZJfof.js → layers.DebyS_9E.js} +23 -23
- package/package.json +2 -2
- package/dist/DSD.CEKnmfYP.js +0 -5658
- package/dist/DSD.CLhKx58f.js +0 -103219
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useMemo as I, useState as D, useRef as S, useCallback as $, useEffect as
|
|
3
|
-
import {
|
|
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, x as b, N as R, k as w, K as v, m as y, r as B, B as A, y as T, l as W } from "./layers.D0SxWFme.js";
|
|
4
4
|
function O(...t) {
|
|
5
5
|
return t.filter(Boolean).join(" ");
|
|
6
6
|
}
|
|
@@ -14,19 +14,19 @@ function L({
|
|
|
14
14
|
totalVotes: a,
|
|
15
15
|
withPollNode: p
|
|
16
16
|
}) {
|
|
17
|
-
const { clientID: r } = W(),
|
|
18
|
-
return /* @__PURE__ */
|
|
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
19
|
/* @__PURE__ */ o(
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
22
|
className: O(
|
|
23
23
|
"PollNode__optionCheckboxWrapper",
|
|
24
|
-
|
|
24
|
+
_ && "PollNode__optionCheckboxChecked"
|
|
25
25
|
),
|
|
26
26
|
children: /* @__PURE__ */ o(
|
|
27
27
|
"input",
|
|
28
28
|
{
|
|
29
|
-
ref:
|
|
29
|
+
ref: h,
|
|
30
30
|
className: "PollNode__optionCheckbox",
|
|
31
31
|
type: "checkbox",
|
|
32
32
|
onChange: () => {
|
|
@@ -34,12 +34,12 @@ function L({
|
|
|
34
34
|
d.toggleVote(t, r);
|
|
35
35
|
});
|
|
36
36
|
},
|
|
37
|
-
checked:
|
|
37
|
+
checked: _
|
|
38
38
|
}
|
|
39
39
|
)
|
|
40
40
|
}
|
|
41
41
|
),
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ g("div", { className: "PollNode__optionInputWrapper", children: [
|
|
43
43
|
/* @__PURE__ */ o(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
@@ -53,7 +53,7 @@ function L({
|
|
|
53
53
|
{
|
|
54
54
|
className: "PollNode__optionInput",
|
|
55
55
|
type: "text",
|
|
56
|
-
value:
|
|
56
|
+
value: f,
|
|
57
57
|
onChange: (d) => {
|
|
58
58
|
const u = d.target, N = u.value, e = u.selectionStart, l = u.selectionEnd;
|
|
59
59
|
p(
|
|
@@ -92,7 +92,7 @@ function z({
|
|
|
92
92
|
options: c,
|
|
93
93
|
nodeKey: n
|
|
94
94
|
}) {
|
|
95
|
-
const [a] =
|
|
95
|
+
const [a] = j(), p = I(() => F(c), [c]), [r, h, m] = E(n), [C, _] = D(null), i = S(null), f = $(
|
|
96
96
|
(e) => {
|
|
97
97
|
if (r && P(x())) {
|
|
98
98
|
e.preventDefault();
|
|
@@ -103,29 +103,29 @@ function z({
|
|
|
103
103
|
},
|
|
104
104
|
[r, n]
|
|
105
105
|
);
|
|
106
|
-
|
|
106
|
+
V(() => R(
|
|
107
107
|
a.registerUpdateListener(({ editorState: e }) => {
|
|
108
|
-
|
|
108
|
+
_(e.read(() => x()));
|
|
109
109
|
}),
|
|
110
110
|
a.registerCommand(
|
|
111
|
-
|
|
111
|
+
B,
|
|
112
112
|
(e) => {
|
|
113
113
|
const l = e;
|
|
114
|
-
return l.target === i.current ? (l.shiftKey || m(),
|
|
114
|
+
return l.target === i.current ? (l.shiftKey || m(), h(!r), !0) : !1;
|
|
115
115
|
},
|
|
116
116
|
v
|
|
117
117
|
),
|
|
118
118
|
a.registerCommand(
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
y,
|
|
120
|
+
f,
|
|
121
121
|
v
|
|
122
122
|
),
|
|
123
123
|
a.registerCommand(
|
|
124
124
|
w,
|
|
125
|
-
|
|
125
|
+
f,
|
|
126
126
|
v
|
|
127
127
|
)
|
|
128
|
-
), [m, a, r, n,
|
|
128
|
+
), [m, a, r, n, f, h]);
|
|
129
129
|
const d = (e, l) => {
|
|
130
130
|
a.update(
|
|
131
131
|
() => {
|
|
@@ -138,13 +138,13 @@ function z({
|
|
|
138
138
|
d((e) => {
|
|
139
139
|
e.addOption(T());
|
|
140
140
|
});
|
|
141
|
-
}, N = P(
|
|
141
|
+
}, N = P(C) && r;
|
|
142
142
|
return /* @__PURE__ */ o(
|
|
143
143
|
"div",
|
|
144
144
|
{
|
|
145
145
|
className: `PollNode__container ${N ? "focused" : ""}`,
|
|
146
146
|
ref: i,
|
|
147
|
-
children: /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ g("div", { className: "PollNode__inner", children: [
|
|
148
148
|
/* @__PURE__ */ o("h2", { className: "PollNode__heading", children: t }),
|
|
149
149
|
c.map((e, l) => {
|
|
150
150
|
const s = e.uid;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ae as p, af as k, l as E } from "./layers.D0SxWFme.js";
|
|
2
2
|
import { useRef as O, useContext as P, useMemo as D, useEffect as h } from "react";
|
|
3
3
|
import { jsx as _ } from "react/jsx-runtime";
|
|
4
4
|
function K(e) {
|
|
@@ -19,18 +19,18 @@ function S({ initialEditor: e, children: t, initialNodes: o, initialTheme: g, sk
|
|
|
19
19
|
i == null && C(9);
|
|
20
20
|
const [l, { getTheme: w }] = i, x = D(() => {
|
|
21
21
|
const a = g || w() || void 0, y = k(i, a);
|
|
22
|
-
if (a !== void 0 && (e._config.theme = a), e._parentEditor = l, o) for (let
|
|
23
|
-
let s = null,
|
|
24
|
-
if (typeof
|
|
25
|
-
const d =
|
|
26
|
-
|
|
22
|
+
if (a !== void 0 && (e._config.theme = a), e._parentEditor = l, o) for (let r of o) {
|
|
23
|
+
let s = null, n = null;
|
|
24
|
+
if (typeof r != "function") {
|
|
25
|
+
const d = r;
|
|
26
|
+
r = d.replace, s = d.with, n = d.withKlass || null;
|
|
27
27
|
}
|
|
28
|
-
const u = e._nodes.get(
|
|
29
|
-
e._nodes.set(
|
|
28
|
+
const u = e._nodes.get(r.getType());
|
|
29
|
+
e._nodes.set(r.getType(), { exportDOM: u ? u.exportDOM : void 0, klass: r, replace: s, replaceWithKlass: n, transforms: m(r) });
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
const
|
|
33
|
-
for (const [s,
|
|
32
|
+
const r = e._nodes = new Map(l._nodes);
|
|
33
|
+
for (const [s, n] of r) e._nodes.set(s, { exportDOM: n.exportDOM, klass: n.klass, replace: n.replace, replaceWithKlass: n.replaceWithKlass, transforms: m(n.klass) });
|
|
34
34
|
}
|
|
35
35
|
return e._config.namespace = l._config.namespace, e._editable = l._editable, [e, y];
|
|
36
36
|
}, []), { isCollabActive: M, yjsDocMap: b } = E(), c = v || f.current || b.has(e.getKey());
|