@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@layers-app/editor",
3
3
  "private": false,
4
- "version": "0.0.15-swagger",
4
+ "version": "0.0.16",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "start": "vite --mode full",
@@ -25,7 +25,7 @@
25
25
  "main": "dist/index.js",
26
26
  "types": "dist/index.d.ts",
27
27
  "dependencies": {
28
- "@layers-app/shared": "^0.0.23",
28
+ "@layers-app/shared": "^0.0.24",
29
29
  "@lexical/headless": "0.21.0",
30
30
  "@lexical/markdown": "0.21.0",
31
31
  "@lexical/react": "0.21.0",
@@ -40,11 +40,11 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@eslint/js": "^9.9.0",
43
- "@mantine/core": "^7.16.2",
44
- "@mantine/dropzone": "^7.16.2",
45
- "@mantine/form": "^7.16.2",
46
- "@mantine/hooks": "^7.16.2",
47
- "@mantine/modals": "^7.16.2",
43
+ "@mantine/core": "^7.17.2",
44
+ "@mantine/dropzone": "^7.17.2",
45
+ "@mantine/form": "^7.17.2",
46
+ "@mantine/hooks": "^7.17.2",
47
+ "@mantine/modals": "^7.17.2",
48
48
  "@rollup/plugin-typescript": "^11.1.6",
49
49
  "@tabler/icons-react": "^3.7.0",
50
50
  "@trivago/prettier-plugin-sort-imports": "^5.2.1",
@@ -84,15 +84,16 @@
84
84
  "vite-plugin-commonjs": "^0.10.1",
85
85
  "vite-plugin-css-injected-by-js": "^3.5.0",
86
86
  "vite-plugin-dts": "^4.0.0-beta.1",
87
+ "vite-plugin-static-copy": "^2.3.0",
87
88
  "vite-plugin-svgr": "^4.2.0",
88
89
  "zustand": "^4.5.4"
89
90
  },
90
91
  "peerDependencies": {
91
- "@mantine/core": ">=7.16.2",
92
- "@mantine/dropzone": ">=7.16.2",
93
- "@mantine/form": ">=7.16.2",
94
- "@mantine/hooks": ">=7.16.2",
95
- "@mantine/modals": ">=7.16.2",
92
+ "@mantine/core": ">=7.17.2",
93
+ "@mantine/dropzone": ">=7.17.2",
94
+ "@mantine/form": ">=7.17.2",
95
+ "@mantine/hooks": ">=7.17.2",
96
+ "@mantine/modals": ">=7.17.2",
96
97
  "@tabler/icons-react": ">=3.7.0",
97
98
  "i18next": "^23.11.5",
98
99
  "lodash-es": ">=4.17.21",
@@ -1 +0,0 @@
1
- "use strict";const c=require("./layers.D1A3jNDb.js"),i=require("react"),_=require("react/jsx-runtime");function E(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k=E(function(e){const t=new URLSearchParams;t.append("code",e);for(let o=1;o<arguments.length;o++)t.append("v",arguments[o]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function m(e){const t=e.transform();return t!==null?new Set([t]):new Set}function O({initialEditor:e,children:t,initialNodes:o,initialTheme:g,skipCollabChecks:x}){const p=i.useRef(!1),u=i.useContext(c.l$2);u==null&&k(9);const[l,{getTheme:v}]=u,w=i.useMemo(()=>{const s=g||v()||void 0,y=c.o$2(u,s);if(s!==void 0&&(e._config.theme=s),e._parentEditor=l,o)for(let n of o){let a=null,r=null;if(typeof n!="function"){const f=n;n=f.replace,a=f.with,r=f.withKlass||null}const h=e._nodes.get(n.getType());e._nodes.set(n.getType(),{exportDOM:h?h.exportDOM:void 0,klass:n,replace:a,replaceWithKlass:r,transforms:m(n)})}else{const n=e._nodes=new Map(l._nodes);for(const[a,r]of n)e._nodes.set(a,{exportDOM:r.exportDOM,klass:r.klass,replace:r.replace,replaceWithKlass:r.replaceWithKlass,transforms:m(r.klass)})}return e._config.namespace=l._config.namespace,e._editable=l._editable,[e,y]},[]),{isCollabActive:M,yjsDocMap:b}=c.l(),d=x||p.current||b.has(e.getKey());return i.useEffect(()=>{d&&(p.current=!0)},[d]),i.useEffect(()=>l.registerEditableListener(s=>{e.setEditable(s)}),[e,l]),_.jsx(c.l$2.Provider,{value:w,children:!M||d?t:null})}function P({children:e,className:t}){return _.jsx("div",{className:t||"Placeholder__root",children:e})}exports.Placeholder=P;exports.d=O;
@@ -1,289 +0,0 @@
1
- import { jsx as g, jsxs as $, Fragment as F } from "react/jsx-runtime";
2
- import { useState as Y, useMemo as V, useLayoutEffect as I, useEffect as b, Suspense as q, useRef as A } from "react";
3
- import { N as T, D as G, g as i, y as c, z as u, A as J, G as Q, H as W, J as Z, M as ee, O as te, P as ne, j as re, Q as z, m as oe, S, k as se, T as ae, U as M, V as O, W as ie, X as ce, Y as le, Z as ue, _ as de, a0 as fe, a1 as me, a2 as ge, u as B, a3 as pe, a4 as Ce, a5 as he, a6 as ye, a7 as ve, a8 as Ee, a9 as we, l as ke, a as De, aa as be, ab as Le, q as Re, s as Se, c as x, ac as P } from "./layers.36_3ol3v.js";
4
- import { d as xe, P as Pe } from "./layers.Di1ekcMX.js";
5
- import { flushSync as $e, createPortal as Ne } from "react-dom";
6
- const E = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Te = E && "documentMode" in document ? document.documentMode : null, Be = !(!E || !("InputEvent" in window) || Te) && "getTargetRanges" in new window.InputEvent("input"), _e = E && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), X = E && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Ae = E && /^(?=.*Chrome).*/i.test(navigator.userAgent), We = E && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Ae;
7
- function K(n, t) {
8
- t.update(() => {
9
- if (n !== null) {
10
- const e = me(n, KeyboardEvent) ? null : n.clipboardData, s = i();
11
- if (s !== null && e != null) {
12
- n.preventDefault();
13
- const a = ge(t);
14
- a !== null && e.setData("text/html", a), e.setData("text/plain", s.getTextContent());
15
- }
16
- }
17
- });
18
- }
19
- function ze(n) {
20
- return T(n.registerCommand(S, (t) => {
21
- const e = i();
22
- return !!c(e) && (e.deleteCharacter(t), !0);
23
- }, u), n.registerCommand(fe, (t) => {
24
- const e = i();
25
- return !!c(e) && (e.deleteWord(t), !0);
26
- }, u), n.registerCommand(de, (t) => {
27
- const e = i();
28
- return !!c(e) && (e.deleteLine(t), !0);
29
- }, u), n.registerCommand(ue, (t) => {
30
- const e = i();
31
- if (!c(e)) return !1;
32
- if (typeof t == "string") e.insertText(t);
33
- else {
34
- const s = t.dataTransfer;
35
- if (s != null) W(s, e);
36
- else {
37
- const a = t.data;
38
- a && e.insertText(a);
39
- }
40
- }
41
- return !0;
42
- }, u), n.registerCommand(le, () => {
43
- const t = i();
44
- return !!c(t) && (t.removeText(), !0);
45
- }, u), n.registerCommand(z, (t) => {
46
- const e = i();
47
- return !!c(e) && (e.insertLineBreak(t), !0);
48
- }, u), n.registerCommand(ce, () => {
49
- const t = i();
50
- return !!c(t) && (t.insertLineBreak(), !0);
51
- }, u), n.registerCommand(ie, (t) => {
52
- const e = i();
53
- if (!c(e)) return !1;
54
- const s = t, a = s.shiftKey;
55
- return !!M(e, !0) && (s.preventDefault(), O(e, a, !0), !0);
56
- }, u), n.registerCommand(ae, (t) => {
57
- const e = i();
58
- if (!c(e)) return !1;
59
- const s = t, a = s.shiftKey;
60
- return !!M(e, !1) && (s.preventDefault(), O(e, a, !1), !0);
61
- }, u), n.registerCommand(se, (t) => {
62
- const e = i();
63
- return !!c(e) && (!X || navigator.language !== "ko-KR") && (t.preventDefault(), n.dispatchCommand(S, !0));
64
- }, u), n.registerCommand(oe, (t) => {
65
- const e = i();
66
- return !!c(e) && (t.preventDefault(), n.dispatchCommand(S, !1));
67
- }, u), n.registerCommand(re, (t) => {
68
- const e = i();
69
- if (!c(e)) return !1;
70
- if (t !== null) {
71
- if ((X || _e || We) && Be) return !1;
72
- t.preventDefault();
73
- }
74
- return n.dispatchCommand(z, !1);
75
- }, u), n.registerCommand(te, () => (ne(), !0), u), n.registerCommand(ee, (t) => {
76
- const e = i();
77
- return !!c(e) && (K(t, n), !0);
78
- }, u), n.registerCommand(Z, (t) => {
79
- const e = i();
80
- return !!c(e) && (function(s, a) {
81
- K(s, a), a.update(() => {
82
- const o = i();
83
- c(o) && o.removeText();
84
- });
85
- }(t, n), !0);
86
- }, u), n.registerCommand(Q, (t) => {
87
- const e = i();
88
- return !!c(e) && (function(s, a) {
89
- s.preventDefault(), a.update(() => {
90
- const o = i(), { clipboardData: d } = s;
91
- d != null && c(o) && W(d, o);
92
- }, { tag: "paste" });
93
- }(t, n), !0);
94
- }, u), n.registerCommand(J, (t) => {
95
- const e = i();
96
- return !!c(e) && (t.preventDefault(), !0);
97
- }, u), n.registerCommand(G, (t) => {
98
- const e = i();
99
- return !!c(e) && (t.preventDefault(), !0);
100
- }, u));
101
- }
102
- const N = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? I : b;
103
- function U(n) {
104
- return n.getEditorState().read(he(n.isComposing()));
105
- }
106
- function Me({ contentEditable: n, placeholder: t = null, ErrorBoundary: e }) {
107
- const [s] = B(), a = function(o, d) {
108
- const [m, v] = Y(() => o.getDecorators());
109
- return N(() => o.registerDecoratorListener((y) => {
110
- $e(() => {
111
- v(y);
112
- });
113
- }), [o]), b(() => {
114
- v(o.getDecorators());
115
- }, [o]), V(() => {
116
- const y = [], w = Object.keys(m);
117
- for (let k = 0; k < w.length; k++) {
118
- const D = w[k], R = g(d, { onError: (l) => o._onError(l), children: g(q, { fallback: null, children: m[D] }) }), r = o.getElementByKey(D);
119
- r !== null && y.push(Ne(R, r, D));
120
- }
121
- return y;
122
- }, [d, m, o]);
123
- }(s, e);
124
- return function(o) {
125
- N(() => T(ze(o), pe(o)), [o]);
126
- }(s), $(F, { children: [n, g(Oe, { content: t }), a] });
127
- }
128
- function Oe({ content: n }) {
129
- const [t] = B(), e = function(a) {
130
- const [o, d] = Y(() => U(a));
131
- return N(() => {
132
- function m() {
133
- const v = U(a);
134
- d(v);
135
- }
136
- return m(), T(a.registerUpdateListener(() => {
137
- m();
138
- }), a.registerEditableListener(() => {
139
- m();
140
- }));
141
- }, [a]), o;
142
- }(t), s = Ce();
143
- return e ? typeof n == "function" ? n(s) : n : null;
144
- }
145
- const Xe = new URL(window.location.href);
146
- new URLSearchParams(Xe.search);
147
- const Ke = "https://wss.dudoc.io";
148
- function Ue(n, t) {
149
- let e = t.get(n);
150
- return e === void 0 ? (e = new ye(), t.set(n, e)) : e.load(), new ve(Ke, "/" + n, e, {
151
- connect: !1
152
- });
153
- }
154
- const Ye = Ee ? I : b, Ie = {
155
- ...we,
156
- paragraph: "StickyEditorTheme__paragraph"
157
- };
158
- function L(n, t) {
159
- const e = n.style, s = t.rootElementRect, a = s !== null ? s.left : 0, o = s !== null ? s.top : 0;
160
- e.top = o + t.y + "px", e.left = a + t.x + "px";
161
- }
162
- function Ge({
163
- x: n,
164
- y: t,
165
- nodeKey: e,
166
- color: s,
167
- caption: a
168
- }) {
169
- const [o] = B(), d = A(null), m = A({
170
- isDragging: !1,
171
- offsetX: 0,
172
- offsetY: 0,
173
- rootElementRect: null,
174
- x: 0,
175
- y: 0
176
- }), { isCollabActive: v } = ke();
177
- b(() => {
178
- const r = m.current;
179
- r.x = n, r.y = t;
180
- const l = d.current;
181
- l !== null && L(l, r);
182
- }, [n, t]), Ye(() => {
183
- const r = m.current, l = new ResizeObserver((h) => {
184
- for (let p = 0; p < h.length; p++) {
185
- const H = h[p], { target: j } = H;
186
- r.rootElementRect = j.getBoundingClientRect();
187
- const _ = d.current;
188
- _ !== null && L(_, r);
189
- }
190
- }), f = o.registerRootListener(
191
- (h, p) => {
192
- p !== null && l.unobserve(p), h !== null && l.observe(h);
193
- }
194
- ), C = () => {
195
- const h = o.getRootElement(), p = d.current;
196
- h !== null && p !== null && (r.rootElementRect = h.getBoundingClientRect(), L(p, r));
197
- };
198
- return window.addEventListener("resize", C), () => {
199
- window.removeEventListener("resize", C), f();
200
- };
201
- }, [o]), b(() => {
202
- const r = d.current;
203
- r !== null && setTimeout(() => {
204
- r.style.setProperty(
205
- "transition",
206
- "top 0.3s ease 0s, left 0.3s ease 0s"
207
- );
208
- }, 500);
209
- }, []);
210
- const y = (r) => {
211
- const l = d.current, f = m.current, C = f.rootElementRect;
212
- l !== null && f.isDragging && C !== null && (f.x = r.pageX - f.offsetX - C.left, f.y = r.pageY - f.offsetY - C.top, L(l, f));
213
- }, w = () => {
214
- const r = d.current, l = m.current;
215
- r !== null && (l.isDragging = !1, r.classList.remove("dragging"), o.update(() => {
216
- const f = x(e);
217
- P(f) && f.setPosition(l.x, l.y);
218
- })), document.removeEventListener("pointermove", y), document.removeEventListener("pointerup", w);
219
- }, k = () => {
220
- o.update(() => {
221
- const r = x(e);
222
- P(r) && r.remove();
223
- });
224
- }, D = () => {
225
- o.update(() => {
226
- const r = x(e);
227
- P(r) && r.toggleColor();
228
- });
229
- }, { historyState: R } = De();
230
- return /* @__PURE__ */ g("div", { ref: d, className: "sticky-note-container", children: /* @__PURE__ */ $(
231
- "div",
232
- {
233
- className: `sticky-note ${s}`,
234
- onPointerDown: (r) => {
235
- const l = d.current;
236
- if (l == null || r.button === 2 || r.target !== l.firstChild)
237
- return;
238
- const f = l, C = m.current;
239
- if (f !== null) {
240
- const { top: h, left: p } = f.getBoundingClientRect();
241
- C.offsetX = r.clientX - p, C.offsetY = r.clientY - h, C.isDragging = !0, f.classList.add("dragging"), document.addEventListener("pointermove", y), document.addEventListener("pointerup", w), r.preventDefault();
242
- }
243
- },
244
- children: [
245
- /* @__PURE__ */ g(
246
- "button",
247
- {
248
- onClick: k,
249
- className: "delete",
250
- "aria-label": "Delete sticky note",
251
- title: "Delete",
252
- children: "X"
253
- }
254
- ),
255
- /* @__PURE__ */ g(
256
- "button",
257
- {
258
- onClick: D,
259
- className: "color",
260
- "aria-label": "Change sticky note color",
261
- title: "Color",
262
- children: /* @__PURE__ */ g("i", { className: "bucket" })
263
- }
264
- ),
265
- /* @__PURE__ */ $(xe, { initialEditor: a, initialTheme: Ie, children: [
266
- v ? /* @__PURE__ */ g(
267
- be,
268
- {
269
- id: a.getKey(),
270
- providerFactory: Ue,
271
- shouldBootstrap: !0
272
- }
273
- ) : /* @__PURE__ */ g(Le, { externalHistoryState: R }),
274
- /* @__PURE__ */ g(
275
- Me,
276
- {
277
- contentEditable: /* @__PURE__ */ g(Se, { className: "StickyNode__contentEditable" }),
278
- placeholder: /* @__PURE__ */ g(Pe, { className: "StickyNode__placeholder", children: "What's up?" }),
279
- ErrorBoundary: Re
280
- }
281
- )
282
- ] })
283
- ]
284
- }
285
- ) });
286
- }
287
- export {
288
- Ge as default
289
- };