@tatamicks/core 1.0.3 → 1.0.4
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/PalettePanel-BTB1LkgU.cjs +9 -0
- package/dist/PalettePanel-BTB1LkgU.cjs.map +1 -0
- package/dist/{PalettePanel-N5Y1TJAk.js → PalettePanel-CrA2BGLq.js} +959 -942
- package/dist/PalettePanel-CrA2BGLq.js.map +1 -0
- package/dist/PalettePanel.css +1 -1
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.mjs +4 -4
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.mjs +352 -343
- package/dist/index.mjs.map +1 -1
- package/dist/{paperSettingsWidget-d93s3Gsr.js → paperSettingsWidget-CAIw_Ofm.js} +1582 -1535
- package/dist/paperSettingsWidget-CAIw_Ofm.js.map +1 -0
- package/dist/paperSettingsWidget-CIRKgnz4.cjs +2 -0
- package/dist/paperSettingsWidget-CIRKgnz4.cjs.map +1 -0
- package/dist/shell.cjs +1 -1
- package/dist/shell.mjs +2 -2
- package/dist/{sidebarPortal-B2Mk9Aba.js → sidebarPortal-Bigm11qq.js} +156 -151
- package/dist/sidebarPortal-Bigm11qq.js.map +1 -0
- package/dist/sidebarPortal-Dit8f3sD.cjs +3 -0
- package/dist/sidebarPortal-Dit8f3sD.cjs.map +1 -0
- package/dist/src/canvas.d.ts +4 -0
- package/dist/src/index.d.ts +5 -3
- package/dist/src/shell.d.ts +3 -1
- package/package.json +1 -1
- package/dist/PalettePanel-0cFP3tbA.cjs +0 -9
- package/dist/PalettePanel-0cFP3tbA.cjs.map +0 -1
- package/dist/PalettePanel-N5Y1TJAk.js.map +0 -1
- package/dist/paperSettingsWidget-CJ4QFjYK.cjs +0 -2
- package/dist/paperSettingsWidget-CJ4QFjYK.cjs.map +0 -1
- package/dist/paperSettingsWidget-d93s3Gsr.js.map +0 -1
- package/dist/sidebarPortal-B2Mk9Aba.js.map +0 -1
- package/dist/sidebarPortal-BCIVv4yO.cjs +0 -3
- package/dist/sidebarPortal-BCIVv4yO.cjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { D as
|
|
3
|
-
import { useReducer as
|
|
4
|
-
import { P as
|
|
5
|
-
import {
|
|
6
|
-
import { flushSync as
|
|
7
|
-
import { createRoot as
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { s as
|
|
10
|
-
import './index.css';function
|
|
1
|
+
import { C as te, S as oe, T as F, s as N, c as G, i as ne, r as ae, u as ie, a as se, b as re, B as L, d as le, n as O, e as ce, f as de, g as ue, h as pe, N as me } from "./paperSettingsWidget-CAIw_Ofm.js";
|
|
2
|
+
import { D as Ot, j as Vt, k as Rt, l as Ht, m as $t, V as Wt, o as Ft, p as Ut, q as Gt, t as jt, v as Zt, w as Yt, x as qt } from "./paperSettingsWidget-CAIw_Ofm.js";
|
|
3
|
+
import { useReducer as ge, useRef as z, useCallback as B, useMemo as A, useState as Y, isValidElement as ye, Fragment as he, memo as q, forwardRef as ve, useEffect as be, createElement as ke } from "react";
|
|
4
|
+
import { P as D, u as fe, D as xe, N as X, S as K, a as Pe, Z as j } from "./sidebarPortal-Bigm11qq.js";
|
|
5
|
+
import { b as Kt, c as Jt, d as Qt, e as eo, L as to, f as oo, g as no, h as ao, i as io, j as so, m as ro, k as lo, l as co, n as uo, p as po, s as mo, o as go } from "./sidebarPortal-Bigm11qq.js";
|
|
6
|
+
import { flushSync as we } from "react-dom";
|
|
7
|
+
import { createRoot as Ce } from "react-dom/client";
|
|
8
|
+
import { jsx as l, jsxs as _, Fragment as Se } from "react/jsx-runtime";
|
|
9
|
+
import { s as W, A as Ie, I as V, C as Be, a as Ee, b as Ae, D as De, c as Te, P as ze, G as _e, u as Me, S as Le, d as Ne, g as Oe, e as Ve, f as Re, h as He, O as $e, T as We, i as Fe, j as Ue, k as Ge } from "./PalettePanel-CrA2BGLq.js";
|
|
10
|
+
import './index.css';function je(e) {
|
|
11
11
|
const t = {};
|
|
12
12
|
for (const o of e.properties)
|
|
13
13
|
Object.assign(t, o.defaultProps);
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function Ze(e) {
|
|
17
17
|
const t = /* @__PURE__ */ new Set();
|
|
18
18
|
for (const o of e) {
|
|
19
19
|
if (t.has(o.kind))
|
|
@@ -34,7 +34,7 @@ function je(e) {
|
|
|
34
34
|
kind: o.kind,
|
|
35
35
|
meta: o.meta,
|
|
36
36
|
properties: o.properties,
|
|
37
|
-
defaultProps:
|
|
37
|
+
defaultProps: je(o),
|
|
38
38
|
Renderer: o.Renderer,
|
|
39
39
|
...typeof o.migrateProps == "function" ? {
|
|
40
40
|
migrateProps: o.migrateProps
|
|
@@ -50,8 +50,8 @@ function je(e) {
|
|
|
50
50
|
})
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
54
|
-
function
|
|
53
|
+
const Ct = [te, oe, F];
|
|
54
|
+
function Ye(e, t) {
|
|
55
55
|
switch (t.type) {
|
|
56
56
|
case "setSelectedBlockIds":
|
|
57
57
|
return { ...e, selectedBlockIds: t.ids };
|
|
@@ -66,59 +66,59 @@ const qe = {
|
|
|
66
66
|
pageIdx: 0,
|
|
67
67
|
clipboard: []
|
|
68
68
|
};
|
|
69
|
-
function
|
|
69
|
+
function Xe({
|
|
70
70
|
book: e,
|
|
71
71
|
handleBookChange: t
|
|
72
72
|
}) {
|
|
73
|
-
const [o, n] =
|
|
74
|
-
|
|
73
|
+
const [o, n] = ge(
|
|
74
|
+
Ye,
|
|
75
75
|
qe
|
|
76
|
-
), { selectedBlockIds: a, pageIdx: i } = o, g =
|
|
76
|
+
), { selectedBlockIds: a, pageIdx: i } = o, g = z(e);
|
|
77
77
|
g.current = e;
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
const h =
|
|
78
|
+
const c = z(o);
|
|
79
|
+
c.current = o;
|
|
80
|
+
const h = B(
|
|
81
81
|
(s, r) => {
|
|
82
|
-
const m = g.current, d =
|
|
82
|
+
const m = g.current, d = c.current.pageIdx, y = m.pages[d];
|
|
83
83
|
if (!y) return;
|
|
84
|
-
const k = y.blocks.map((
|
|
85
|
-
const E = s[
|
|
86
|
-
return E ? { ...
|
|
84
|
+
const k = y.blocks.map((I) => {
|
|
85
|
+
const E = s[I.id];
|
|
86
|
+
return E ? { ...I, ...E } : I;
|
|
87
87
|
});
|
|
88
88
|
t(
|
|
89
|
-
|
|
89
|
+
N(m, d, { ...y, blocks: k }),
|
|
90
90
|
r
|
|
91
91
|
);
|
|
92
|
-
const x =
|
|
93
|
-
var
|
|
94
|
-
const E = (
|
|
95
|
-
return typeof E == "string" ? E :
|
|
92
|
+
const x = c.current.selectedBlockIds, C = x.map((I) => {
|
|
93
|
+
var U;
|
|
94
|
+
const E = (U = s[I]) == null ? void 0 : U.id;
|
|
95
|
+
return typeof E == "string" ? E : I;
|
|
96
96
|
});
|
|
97
|
-
C.some((
|
|
97
|
+
C.some((I, E) => I !== x[E]) && n({ type: "setSelectedBlockIds", ids: C });
|
|
98
98
|
},
|
|
99
99
|
[t]
|
|
100
|
-
), u =
|
|
100
|
+
), u = B(
|
|
101
101
|
(s) => {
|
|
102
|
-
const r = g.current, m =
|
|
102
|
+
const r = g.current, m = c.current.pageIdx, d = r.pages[m];
|
|
103
103
|
if (!d) return;
|
|
104
104
|
const y = new Set(s), k = d.blocks.filter(
|
|
105
105
|
(x) => !y.has(x.id)
|
|
106
106
|
);
|
|
107
|
-
t(
|
|
107
|
+
t(N(r, m, { ...d, blocks: k })), n({ type: "setSelectedBlockIds", ids: [] });
|
|
108
108
|
},
|
|
109
109
|
[t]
|
|
110
|
-
), p =
|
|
111
|
-
const r = g.current, m =
|
|
110
|
+
), p = B((s) => {
|
|
111
|
+
const r = g.current, m = c.current.pageIdx, d = r.pages[m];
|
|
112
112
|
if (!d) return;
|
|
113
113
|
const y = d.blocks.filter((k) => s.includes(k.id));
|
|
114
114
|
n({ type: "setClipboard", blocks: y });
|
|
115
|
-
}, []), f =
|
|
115
|
+
}, []), f = B(
|
|
116
116
|
(s) => {
|
|
117
|
-
const r = g.current, m =
|
|
117
|
+
const r = g.current, m = c.current.pageIdx, d = r.pages[m];
|
|
118
118
|
if (!d) return;
|
|
119
119
|
const y = d.blocks.filter((C) => s.includes(C.id)), k = d.grid, x = y.map((C) => ({
|
|
120
120
|
...C,
|
|
121
|
-
id:
|
|
121
|
+
id: G(C.kind),
|
|
122
122
|
layout: {
|
|
123
123
|
...C.layout,
|
|
124
124
|
x: Math.min(C.layout.x + 1, k.colCount - C.layout.w),
|
|
@@ -126,7 +126,7 @@ function Ye({
|
|
|
126
126
|
}
|
|
127
127
|
}));
|
|
128
128
|
t(
|
|
129
|
-
|
|
129
|
+
N(r, m, {
|
|
130
130
|
...d,
|
|
131
131
|
blocks: [...d.blocks, ...x]
|
|
132
132
|
})
|
|
@@ -136,14 +136,14 @@ function Ye({
|
|
|
136
136
|
});
|
|
137
137
|
},
|
|
138
138
|
[t]
|
|
139
|
-
), b =
|
|
140
|
-
const s =
|
|
139
|
+
), b = B(() => {
|
|
140
|
+
const s = c.current.clipboard;
|
|
141
141
|
if (s.length === 0) return;
|
|
142
|
-
const r = g.current, m =
|
|
142
|
+
const r = g.current, m = c.current.pageIdx, d = r.pages[m];
|
|
143
143
|
if (!d) return;
|
|
144
144
|
const y = d.grid, k = s.map((x) => ({
|
|
145
145
|
...x,
|
|
146
|
-
id:
|
|
146
|
+
id: G(x.kind),
|
|
147
147
|
layout: {
|
|
148
148
|
...x.layout,
|
|
149
149
|
x: Math.min(x.layout.x + 1, y.colCount - x.layout.w),
|
|
@@ -151,7 +151,7 @@ function Ye({
|
|
|
151
151
|
}
|
|
152
152
|
}));
|
|
153
153
|
t(
|
|
154
|
-
|
|
154
|
+
N(r, m, {
|
|
155
155
|
...d,
|
|
156
156
|
blocks: [...d.blocks, ...k]
|
|
157
157
|
})
|
|
@@ -159,38 +159,38 @@ function Ye({
|
|
|
159
159
|
type: "setSelectedBlockIds",
|
|
160
160
|
ids: k.map((x) => x.id)
|
|
161
161
|
});
|
|
162
|
-
}, [t]), w =
|
|
162
|
+
}, [t]), w = B(() => {
|
|
163
163
|
var y;
|
|
164
|
-
const s = g.current, r =
|
|
164
|
+
const s = g.current, r = c.current.pageIdx, m = s.pages[r], d = {
|
|
165
165
|
grid: m ? m.grid : ((y = s.pages[0]) == null ? void 0 : y.grid) ?? { colCount: 12, rowCount: 24 },
|
|
166
166
|
blocks: []
|
|
167
167
|
};
|
|
168
|
-
t(
|
|
169
|
-
}, [t]), S =
|
|
170
|
-
const s = g.current, r =
|
|
168
|
+
t(ne(s, r, d)), n({ type: "setPageIdx", idx: r + 1 });
|
|
169
|
+
}, [t]), S = B(() => {
|
|
170
|
+
const s = g.current, r = c.current.pageIdx;
|
|
171
171
|
if (s.pages.length <= 1) return;
|
|
172
|
-
const m =
|
|
172
|
+
const m = ae(s, r);
|
|
173
173
|
t(m), n({
|
|
174
174
|
type: "setPageIdx",
|
|
175
175
|
idx: Math.min(r, m.pages.length - 1)
|
|
176
176
|
});
|
|
177
|
-
}, [t]),
|
|
177
|
+
}, [t]), T = A(
|
|
178
178
|
() => ({
|
|
179
179
|
paste: {
|
|
180
180
|
execute: b,
|
|
181
|
-
isEnabled: () =>
|
|
181
|
+
isEnabled: () => c.current.clipboard.length > 0
|
|
182
182
|
},
|
|
183
183
|
delete: {
|
|
184
|
-
execute: () => u(
|
|
185
|
-
isEnabled: () =>
|
|
184
|
+
execute: () => u(c.current.selectedBlockIds),
|
|
185
|
+
isEnabled: () => c.current.selectedBlockIds.length > 0
|
|
186
186
|
},
|
|
187
187
|
copy: {
|
|
188
|
-
execute: () => p(
|
|
189
|
-
isEnabled: () =>
|
|
188
|
+
execute: () => p(c.current.selectedBlockIds),
|
|
189
|
+
isEnabled: () => c.current.selectedBlockIds.length > 0
|
|
190
190
|
},
|
|
191
191
|
duplicate: {
|
|
192
|
-
execute: () => f(
|
|
193
|
-
isEnabled: () =>
|
|
192
|
+
execute: () => f(c.current.selectedBlockIds),
|
|
193
|
+
isEnabled: () => c.current.selectedBlockIds.length > 0
|
|
194
194
|
},
|
|
195
195
|
addPage: {
|
|
196
196
|
execute: w,
|
|
@@ -230,28 +230,28 @@ function Ye({
|
|
|
230
230
|
]
|
|
231
231
|
);
|
|
232
232
|
return {
|
|
233
|
-
editorState:
|
|
233
|
+
editorState: A(
|
|
234
234
|
() => ({
|
|
235
235
|
selectedBlockIds: a,
|
|
236
236
|
pageIdx: i
|
|
237
237
|
}),
|
|
238
238
|
[a, i]
|
|
239
239
|
),
|
|
240
|
-
actionHandlers:
|
|
240
|
+
actionHandlers: T,
|
|
241
241
|
selectedBlockIds: a
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function St({
|
|
245
245
|
initialBook: e,
|
|
246
246
|
pluginRegistry: t,
|
|
247
247
|
defaultValues: o,
|
|
248
248
|
extra: n
|
|
249
249
|
}) {
|
|
250
|
-
const a =
|
|
250
|
+
const a = z(null), { book: i, handleBookChange: g, historyActionHandlers: c } = ie({
|
|
251
251
|
initialBook: e
|
|
252
|
-
}), [h, u] =
|
|
252
|
+
}), [h, u] = Y(
|
|
253
253
|
o ?? {}
|
|
254
|
-
), p =
|
|
254
|
+
), p = B((s) => {
|
|
255
255
|
s.length !== 0 && u((r) => {
|
|
256
256
|
if (!s.some(
|
|
257
257
|
({ id: y, value: k }) => k === void 0 ? y in r : r[y] !== k
|
|
@@ -261,28 +261,28 @@ function wt({
|
|
|
261
261
|
k === void 0 ? delete d[y] : d[y] = k;
|
|
262
262
|
return d;
|
|
263
263
|
});
|
|
264
|
-
}, []), { editorState: f, actionHandlers: b } =
|
|
264
|
+
}, []), { editorState: f, actionHandlers: b } = Xe({
|
|
265
265
|
book: i,
|
|
266
266
|
handleBookChange: g
|
|
267
267
|
}), w = {
|
|
268
268
|
pageIdx: f.pageIdx,
|
|
269
269
|
...n ? { extra: n } : {}
|
|
270
|
-
}, S =
|
|
270
|
+
}, S = se(
|
|
271
271
|
i,
|
|
272
272
|
g,
|
|
273
273
|
w
|
|
274
|
-
),
|
|
275
|
-
...
|
|
274
|
+
), T = re({
|
|
275
|
+
...c,
|
|
276
276
|
...b
|
|
277
277
|
});
|
|
278
|
-
return { context:
|
|
278
|
+
return { context: A(
|
|
279
279
|
() => ({
|
|
280
280
|
book: i,
|
|
281
281
|
onBookChange: g,
|
|
282
282
|
pluginRegistry: t,
|
|
283
283
|
containerRef: a,
|
|
284
284
|
bindingContext: S,
|
|
285
|
-
actionContext:
|
|
285
|
+
actionContext: T,
|
|
286
286
|
values: h,
|
|
287
287
|
onValuesChange: p,
|
|
288
288
|
editorState: f
|
|
@@ -292,7 +292,7 @@ function wt({
|
|
|
292
292
|
g,
|
|
293
293
|
t,
|
|
294
294
|
S,
|
|
295
|
-
|
|
295
|
+
T,
|
|
296
296
|
h,
|
|
297
297
|
p,
|
|
298
298
|
f
|
|
@@ -337,13 +337,13 @@ function P(e, t, o) {
|
|
|
337
337
|
left: R
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function Ke(e = "canvas-actions") {
|
|
341
341
|
return {
|
|
342
342
|
props: {
|
|
343
343
|
book: {
|
|
344
344
|
paper: {
|
|
345
345
|
size: {
|
|
346
|
-
preset:
|
|
346
|
+
preset: D.CUSTOM,
|
|
347
347
|
width: { value: 160, unit: "mm" },
|
|
348
348
|
height: { value: 20, unit: "mm" }
|
|
349
349
|
},
|
|
@@ -443,17 +443,17 @@ function Ze(e = "canvas-actions") {
|
|
|
443
443
|
]
|
|
444
444
|
}
|
|
445
445
|
},
|
|
446
|
-
plugins: [
|
|
446
|
+
plugins: [L]
|
|
447
447
|
};
|
|
448
448
|
}
|
|
449
|
-
const
|
|
450
|
-
function
|
|
449
|
+
const It = Ke();
|
|
450
|
+
function Je(e = "clipboard") {
|
|
451
451
|
return {
|
|
452
452
|
props: {
|
|
453
453
|
book: {
|
|
454
454
|
paper: {
|
|
455
455
|
size: {
|
|
456
|
-
preset:
|
|
456
|
+
preset: D.CUSTOM,
|
|
457
457
|
width: { value: 60, unit: "mm" },
|
|
458
458
|
height: { value: 20, unit: "mm" }
|
|
459
459
|
},
|
|
@@ -491,17 +491,17 @@ function Xe(e = "clipboard") {
|
|
|
491
491
|
]
|
|
492
492
|
}
|
|
493
493
|
},
|
|
494
|
-
plugins: [
|
|
494
|
+
plugins: [L]
|
|
495
495
|
};
|
|
496
496
|
}
|
|
497
|
-
const
|
|
498
|
-
function
|
|
497
|
+
const Bt = Je();
|
|
498
|
+
function Qe(e = "history") {
|
|
499
499
|
return {
|
|
500
500
|
props: {
|
|
501
501
|
book: {
|
|
502
502
|
paper: {
|
|
503
503
|
size: {
|
|
504
|
-
preset:
|
|
504
|
+
preset: D.CUSTOM,
|
|
505
505
|
width: { value: 40, unit: "mm" },
|
|
506
506
|
height: { value: 20, unit: "mm" }
|
|
507
507
|
},
|
|
@@ -533,12 +533,12 @@ function Ke(e = "history") {
|
|
|
533
533
|
]
|
|
534
534
|
}
|
|
535
535
|
},
|
|
536
|
-
plugins: [
|
|
536
|
+
plugins: [L]
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
|
-
const
|
|
539
|
+
const Et = Qe(), H = {
|
|
540
540
|
size: {
|
|
541
|
-
preset:
|
|
541
|
+
preset: D.CUSTOM
|
|
542
542
|
},
|
|
543
543
|
margin: {
|
|
544
544
|
top: { value: 0, unit: "mm" },
|
|
@@ -548,17 +548,17 @@ const Bt = Ke(), N = {
|
|
|
548
548
|
},
|
|
549
549
|
autoHeight: !0,
|
|
550
550
|
autoWidth: !0
|
|
551
|
-
},
|
|
552
|
-
margin:
|
|
553
|
-
autoHeight:
|
|
554
|
-
autoWidth:
|
|
555
|
-
},
|
|
551
|
+
}, et = {
|
|
552
|
+
margin: H.margin,
|
|
553
|
+
autoHeight: H.autoHeight,
|
|
554
|
+
autoWidth: H.autoWidth
|
|
555
|
+
}, At = {
|
|
556
556
|
props: {
|
|
557
557
|
book: {
|
|
558
558
|
paper: {
|
|
559
|
-
...
|
|
559
|
+
...et,
|
|
560
560
|
size: {
|
|
561
|
-
preset:
|
|
561
|
+
preset: D.CUSTOM,
|
|
562
562
|
width: { value: 160, unit: "mm" },
|
|
563
563
|
height: { value: 8, unit: "mm" }
|
|
564
564
|
}
|
|
@@ -586,7 +586,7 @@ const Bt = Ke(), N = {
|
|
|
586
586
|
props: { horizontal: "center", vertical: "center" }
|
|
587
587
|
},
|
|
588
588
|
{
|
|
589
|
-
...
|
|
589
|
+
...O("layout-x-value", "layout.x"),
|
|
590
590
|
layout: { x: 1, y: 0, w: 1, h: 1 }
|
|
591
591
|
},
|
|
592
592
|
{
|
|
@@ -605,7 +605,7 @@ const Bt = Ke(), N = {
|
|
|
605
605
|
props: { horizontal: "center", vertical: "center" }
|
|
606
606
|
},
|
|
607
607
|
{
|
|
608
|
-
...
|
|
608
|
+
...O("layout-y-value", "layout.y"),
|
|
609
609
|
layout: { x: 4, y: 0, w: 1, h: 1 }
|
|
610
610
|
},
|
|
611
611
|
{
|
|
@@ -624,7 +624,7 @@ const Bt = Ke(), N = {
|
|
|
624
624
|
props: { horizontal: "center", vertical: "center" }
|
|
625
625
|
},
|
|
626
626
|
{
|
|
627
|
-
...
|
|
627
|
+
...O("layout-w-value", "layout.w"),
|
|
628
628
|
layout: { x: 7, y: 0, w: 1, h: 1 }
|
|
629
629
|
},
|
|
630
630
|
{
|
|
@@ -643,7 +643,7 @@ const Bt = Ke(), N = {
|
|
|
643
643
|
props: { horizontal: "center", vertical: "center" }
|
|
644
644
|
},
|
|
645
645
|
{
|
|
646
|
-
...
|
|
646
|
+
...O("layout-h-value", "layout.h"),
|
|
647
647
|
layout: { x: 10, y: 0, w: 1, h: 1 }
|
|
648
648
|
},
|
|
649
649
|
{
|
|
@@ -657,16 +657,16 @@ const Bt = Ke(), N = {
|
|
|
657
657
|
]
|
|
658
658
|
}
|
|
659
659
|
},
|
|
660
|
-
plugins: [
|
|
660
|
+
plugins: [F, le]
|
|
661
661
|
};
|
|
662
|
-
function
|
|
662
|
+
function tt(e) {
|
|
663
663
|
const { pageIdx: t, pageCount: o } = e, n = t !== void 0 ? String(t + 1) : "—", a = o !== void 0 ? String(o) : "—";
|
|
664
664
|
return {
|
|
665
665
|
props: {
|
|
666
666
|
book: {
|
|
667
667
|
paper: {
|
|
668
668
|
size: {
|
|
669
|
-
preset:
|
|
669
|
+
preset: D.CUSTOM,
|
|
670
670
|
width: { value: 130, unit: "mm" },
|
|
671
671
|
height: { value: 20, unit: "mm" }
|
|
672
672
|
},
|
|
@@ -768,17 +768,17 @@ function Qe(e) {
|
|
|
768
768
|
]
|
|
769
769
|
}
|
|
770
770
|
},
|
|
771
|
-
plugins: [
|
|
771
|
+
plugins: [L, F]
|
|
772
772
|
};
|
|
773
773
|
}
|
|
774
|
-
const
|
|
775
|
-
function
|
|
774
|
+
const Dt = tt({});
|
|
775
|
+
function ot(e = "selection") {
|
|
776
776
|
return {
|
|
777
777
|
props: {
|
|
778
778
|
book: {
|
|
779
779
|
paper: {
|
|
780
780
|
size: {
|
|
781
|
-
preset:
|
|
781
|
+
preset: D.CUSTOM,
|
|
782
782
|
width: { value: 60, unit: "mm" },
|
|
783
783
|
height: { value: 20, unit: "mm" }
|
|
784
784
|
},
|
|
@@ -816,43 +816,43 @@ function et(e = "selection") {
|
|
|
816
816
|
]
|
|
817
817
|
}
|
|
818
818
|
},
|
|
819
|
-
plugins: [
|
|
819
|
+
plugins: [L]
|
|
820
820
|
};
|
|
821
821
|
}
|
|
822
|
-
const
|
|
822
|
+
const Tt = ot(), nt = ({
|
|
823
823
|
sections: e = [],
|
|
824
824
|
className: t,
|
|
825
825
|
style: o
|
|
826
|
-
}) => /* @__PURE__ */
|
|
826
|
+
}) => /* @__PURE__ */ l(
|
|
827
827
|
"div",
|
|
828
828
|
{
|
|
829
|
-
className: `${
|
|
829
|
+
className: `${W.container}${t ? ` ${t}` : ""}`,
|
|
830
830
|
style: o,
|
|
831
831
|
"data-testid": "action-bar",
|
|
832
832
|
children: e.map((n, a) => {
|
|
833
|
-
const i =
|
|
834
|
-
return /* @__PURE__ */
|
|
835
|
-
a > 0 && /* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
833
|
+
const i = ye(n) && n.key != null ? n.key : `section-${a}`;
|
|
834
|
+
return /* @__PURE__ */ _(he, { children: [
|
|
835
|
+
a > 0 && /* @__PURE__ */ l(Ie, {}),
|
|
836
|
+
/* @__PURE__ */ l("div", { className: W.section, children: n })
|
|
837
837
|
] }, i);
|
|
838
838
|
})
|
|
839
839
|
}
|
|
840
840
|
);
|
|
841
|
-
|
|
842
|
-
const
|
|
843
|
-
printContainer:
|
|
844
|
-
pageBreak:
|
|
845
|
-
},
|
|
841
|
+
nt.displayName = "ActionBar";
|
|
842
|
+
const at = "_printContainer_e2bnt_1", it = "_pageBreak_e2bnt_6", Z = {
|
|
843
|
+
printContainer: at,
|
|
844
|
+
pageBreak: it
|
|
845
|
+
}, J = q(
|
|
846
846
|
({ page: e, paper: t, values: o, pluginRegistry: n }) => {
|
|
847
|
-
const { paperPx: a, getBlockRectPx: i } =
|
|
847
|
+
const { paperPx: a, getBlockRectPx: i } = fe(
|
|
848
848
|
t,
|
|
849
849
|
e.grid,
|
|
850
|
-
|
|
850
|
+
xe
|
|
851
851
|
), g = o ? { get: (h) => o[h] ?? null, set: () => {
|
|
852
|
-
} } : void 0,
|
|
853
|
-
(h) => !
|
|
852
|
+
} } : void 0, c = e.blocks.filter(
|
|
853
|
+
(h) => !ue(h.hiddenBinding, g)
|
|
854
854
|
);
|
|
855
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ l(
|
|
856
856
|
"div",
|
|
857
857
|
{
|
|
858
858
|
style: {
|
|
@@ -861,12 +861,12 @@ const ot = "_printContainer_e2bnt_1", nt = "_pageBreak_e2bnt_6", G = {
|
|
|
861
861
|
height: `${a.canvas.height}px`,
|
|
862
862
|
backgroundColor: "#fff"
|
|
863
863
|
},
|
|
864
|
-
children: /* @__PURE__ */
|
|
865
|
-
|
|
864
|
+
children: /* @__PURE__ */ l(
|
|
865
|
+
pe,
|
|
866
866
|
{
|
|
867
|
-
blocks:
|
|
867
|
+
blocks: c,
|
|
868
868
|
pluginRegistry: n,
|
|
869
|
-
mode:
|
|
869
|
+
mode: X.VIEW,
|
|
870
870
|
values: o ?? {},
|
|
871
871
|
blockDefaults: e.blockDefaults,
|
|
872
872
|
getBlockRectPx: i,
|
|
@@ -878,14 +878,14 @@ const ot = "_printContainer_e2bnt_1", nt = "_pageBreak_e2bnt_6", G = {
|
|
|
878
878
|
);
|
|
879
879
|
}
|
|
880
880
|
);
|
|
881
|
-
|
|
882
|
-
const
|
|
881
|
+
J.displayName = "PrintPage";
|
|
882
|
+
const Q = ve(
|
|
883
883
|
({ book: e, values: t, pluginRegistry: o, printSettings: n, className: a, style: i }, g) => {
|
|
884
|
-
const
|
|
885
|
-
|
|
884
|
+
const c = ce(e, n), h = de(
|
|
885
|
+
c,
|
|
886
886
|
n == null ? void 0 : n.margin
|
|
887
887
|
);
|
|
888
|
-
return
|
|
888
|
+
return be(() => {
|
|
889
889
|
var f, b;
|
|
890
890
|
(f = document.getElementById("printable-note-page-style")) == null || f.remove(), (b = document.getElementById("tatamicks-book-page-style")) == null || b.remove();
|
|
891
891
|
const u = document.createElement("style");
|
|
@@ -895,23 +895,23 @@ const J = he(
|
|
|
895
895
|
var w, S;
|
|
896
896
|
(w = document.getElementById("printable-note-page-style")) == null || w.remove(), (S = document.getElementById("tatamicks-book-page-style")) == null || S.remove();
|
|
897
897
|
};
|
|
898
|
-
}, [h]), /* @__PURE__ */
|
|
898
|
+
}, [h]), /* @__PURE__ */ l(
|
|
899
899
|
"div",
|
|
900
900
|
{
|
|
901
901
|
ref: g,
|
|
902
|
-
className: [
|
|
902
|
+
className: [Z.printContainer, a].filter(Boolean).join(" "),
|
|
903
903
|
style: i,
|
|
904
904
|
children: e.pages.map((u, p) => {
|
|
905
905
|
const f = u.id ?? (u.blocks.map((b) => b.id).join("_") || `page-${p}`);
|
|
906
|
-
return /* @__PURE__ */
|
|
906
|
+
return /* @__PURE__ */ l(
|
|
907
907
|
"div",
|
|
908
908
|
{
|
|
909
|
-
className: p < e.pages.length - 1 ?
|
|
910
|
-
children: /* @__PURE__ */
|
|
911
|
-
|
|
909
|
+
className: p < e.pages.length - 1 ? Z.pageBreak : void 0,
|
|
910
|
+
children: /* @__PURE__ */ l(
|
|
911
|
+
J,
|
|
912
912
|
{
|
|
913
913
|
page: u,
|
|
914
|
-
paper:
|
|
914
|
+
paper: c,
|
|
915
915
|
values: t,
|
|
916
916
|
pluginRegistry: o
|
|
917
917
|
}
|
|
@@ -924,12 +924,12 @@ const J = he(
|
|
|
924
924
|
);
|
|
925
925
|
}
|
|
926
926
|
);
|
|
927
|
-
|
|
928
|
-
const
|
|
929
|
-
function
|
|
927
|
+
Q.displayName = "NotePrint";
|
|
928
|
+
const st = q(Q);
|
|
929
|
+
function rt(e) {
|
|
930
930
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
931
931
|
}
|
|
932
|
-
function
|
|
932
|
+
function lt(e, t) {
|
|
933
933
|
const o = document.title, n = document.createElement("iframe");
|
|
934
934
|
n.style.cssText = "position:fixed;top:0;left:0;width:100%;height:100%;visibility:hidden;z-index:-9999;border:none;", document.body.appendChild(n);
|
|
935
935
|
const a = n.contentWindow, i = n.contentDocument ?? (a == null ? void 0 : a.document);
|
|
@@ -938,12 +938,12 @@ function st(e, t) {
|
|
|
938
938
|
return;
|
|
939
939
|
}
|
|
940
940
|
const g = Array.from(document.querySelectorAll("style")).map((p) => p.outerHTML).join(`
|
|
941
|
-
`),
|
|
941
|
+
`), c = Array.from(
|
|
942
942
|
document.querySelectorAll('link[rel="stylesheet"]')
|
|
943
943
|
).map((p) => p.outerHTML).join(`
|
|
944
944
|
`), h = e.innerHTML;
|
|
945
945
|
i.open(), i.write(
|
|
946
|
-
`<!DOCTYPE html><html><head><meta charset="utf-8" /><title>${
|
|
946
|
+
`<!DOCTYPE html><html><head><meta charset="utf-8" /><title>${rt(o)}</title>${c}${g}<style>*{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;}</style></head><body>${h}</body></html>`
|
|
947
947
|
), i.close();
|
|
948
948
|
const u = () => {
|
|
949
949
|
document.body.contains(n) && document.body.removeChild(n);
|
|
@@ -954,36 +954,36 @@ function st(e, t) {
|
|
|
954
954
|
a.focus(), a.print();
|
|
955
955
|
}, 0);
|
|
956
956
|
}
|
|
957
|
-
function
|
|
957
|
+
function ct(e, t, o, n) {
|
|
958
958
|
const a = document.createElement("div");
|
|
959
959
|
a.style.cssText = "position:absolute;top:-9999px;left:-9999px;", document.body.appendChild(a);
|
|
960
|
-
const i =
|
|
961
|
-
|
|
960
|
+
const i = Ce(a);
|
|
961
|
+
we(() => {
|
|
962
962
|
i.render(
|
|
963
|
-
|
|
963
|
+
ke(st, { book: e, values: t, pluginRegistry: o, printSettings: n })
|
|
964
964
|
);
|
|
965
|
-
}),
|
|
965
|
+
}), lt(a), i.unmount(), document.body.removeChild(a);
|
|
966
966
|
}
|
|
967
|
-
function
|
|
968
|
-
|
|
967
|
+
function dt(e, t) {
|
|
968
|
+
ct(
|
|
969
969
|
e.book,
|
|
970
970
|
e.values,
|
|
971
971
|
e.pluginRegistry,
|
|
972
972
|
t
|
|
973
973
|
);
|
|
974
974
|
}
|
|
975
|
-
const
|
|
975
|
+
const ee = ({
|
|
976
976
|
pageIdx: e,
|
|
977
977
|
pageCount: t,
|
|
978
978
|
onPageChange: o,
|
|
979
979
|
onAddPage: n,
|
|
980
980
|
onDeletePage: a,
|
|
981
981
|
canDeletePage: i = !0
|
|
982
|
-
}) => /* @__PURE__ */
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
-
|
|
982
|
+
}) => /* @__PURE__ */ _(Se, { children: [
|
|
983
|
+
/* @__PURE__ */ l(
|
|
984
|
+
V,
|
|
985
985
|
{
|
|
986
|
-
icon: /* @__PURE__ */
|
|
986
|
+
icon: /* @__PURE__ */ l(Be, { "aria-hidden": "true" }),
|
|
987
987
|
label: "前のページへ",
|
|
988
988
|
title: "前のページへ",
|
|
989
989
|
onClick: () => o(Math.max(0, e - 1)),
|
|
@@ -991,15 +991,15 @@ const Q = ({
|
|
|
991
991
|
preventFocusOnMouseDown: !0
|
|
992
992
|
}
|
|
993
993
|
),
|
|
994
|
-
/* @__PURE__ */
|
|
994
|
+
/* @__PURE__ */ _("span", { className: W.sectionLabel, children: [
|
|
995
995
|
e + 1,
|
|
996
996
|
" / ",
|
|
997
997
|
t
|
|
998
998
|
] }),
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
|
|
999
|
+
/* @__PURE__ */ l(
|
|
1000
|
+
V,
|
|
1001
1001
|
{
|
|
1002
|
-
icon: /* @__PURE__ */
|
|
1002
|
+
icon: /* @__PURE__ */ l(Ee, { "aria-hidden": "true" }),
|
|
1003
1003
|
label: "次のページへ",
|
|
1004
1004
|
title: "次のページへ",
|
|
1005
1005
|
onClick: () => o(Math.min(t - 1, e + 1)),
|
|
@@ -1007,20 +1007,20 @@ const Q = ({
|
|
|
1007
1007
|
preventFocusOnMouseDown: !0
|
|
1008
1008
|
}
|
|
1009
1009
|
),
|
|
1010
|
-
n !== void 0 && /* @__PURE__ */
|
|
1011
|
-
|
|
1010
|
+
n !== void 0 && /* @__PURE__ */ l(
|
|
1011
|
+
V,
|
|
1012
1012
|
{
|
|
1013
|
-
icon: /* @__PURE__ */
|
|
1013
|
+
icon: /* @__PURE__ */ l(Ae, { "aria-hidden": "true" }),
|
|
1014
1014
|
label: "ページを追加",
|
|
1015
1015
|
title: "ページを追加",
|
|
1016
1016
|
onClick: n,
|
|
1017
1017
|
preventFocusOnMouseDown: !0
|
|
1018
1018
|
}
|
|
1019
1019
|
),
|
|
1020
|
-
a !== void 0 && /* @__PURE__ */
|
|
1021
|
-
|
|
1020
|
+
a !== void 0 && /* @__PURE__ */ l(
|
|
1021
|
+
V,
|
|
1022
1022
|
{
|
|
1023
|
-
icon: /* @__PURE__ */
|
|
1023
|
+
icon: /* @__PURE__ */ l(De, { "aria-hidden": "true" }),
|
|
1024
1024
|
label: "ページを削除",
|
|
1025
1025
|
title: "ページを削除",
|
|
1026
1026
|
onClick: a,
|
|
@@ -1029,37 +1029,37 @@ const Q = ({
|
|
|
1029
1029
|
}
|
|
1030
1030
|
)
|
|
1031
1031
|
] });
|
|
1032
|
-
|
|
1033
|
-
function
|
|
1032
|
+
ee.displayName = "PageNavigationSection";
|
|
1033
|
+
function zt({
|
|
1034
1034
|
context: e,
|
|
1035
1035
|
onActionFeedback: t,
|
|
1036
1036
|
onPrint: o
|
|
1037
1037
|
}) {
|
|
1038
|
-
const { actionContext: n } = e, { book: a, onBookChange: i } = e,
|
|
1039
|
-
/* @__PURE__ */
|
|
1040
|
-
|
|
1038
|
+
const { actionContext: n } = e, { book: a, onBookChange: i } = e, c = e.editorState.pageIdx, h = a.pages[c] ?? a.pages[0], u = [
|
|
1039
|
+
/* @__PURE__ */ l(
|
|
1040
|
+
Te,
|
|
1041
1041
|
{
|
|
1042
1042
|
actionContext: n,
|
|
1043
1043
|
onActionFeedback: t,
|
|
1044
|
-
onPrint: o ?? (() =>
|
|
1044
|
+
onPrint: o ?? (() => dt(e))
|
|
1045
1045
|
},
|
|
1046
1046
|
"canvas"
|
|
1047
1047
|
),
|
|
1048
|
-
/* @__PURE__ */
|
|
1049
|
-
|
|
1048
|
+
/* @__PURE__ */ l(
|
|
1049
|
+
ze,
|
|
1050
1050
|
{
|
|
1051
1051
|
paper: a.paper,
|
|
1052
1052
|
onPaperChange: (p) => i({ ...a, paper: p })
|
|
1053
1053
|
},
|
|
1054
1054
|
"paper"
|
|
1055
1055
|
),
|
|
1056
|
-
/* @__PURE__ */
|
|
1057
|
-
|
|
1056
|
+
/* @__PURE__ */ l(
|
|
1057
|
+
_e,
|
|
1058
1058
|
{
|
|
1059
1059
|
grid: h.grid,
|
|
1060
1060
|
onGridChange: (p) => {
|
|
1061
1061
|
const f = a.pages.map(
|
|
1062
|
-
(b, w) => w ===
|
|
1062
|
+
(b, w) => w === c ? { ...b, grid: p } : b
|
|
1063
1063
|
);
|
|
1064
1064
|
i({ ...a, pages: f });
|
|
1065
1065
|
}
|
|
@@ -1068,10 +1068,10 @@ function At({
|
|
|
1068
1068
|
)
|
|
1069
1069
|
];
|
|
1070
1070
|
return u.push(
|
|
1071
|
-
/* @__PURE__ */
|
|
1072
|
-
|
|
1071
|
+
/* @__PURE__ */ l(
|
|
1072
|
+
ee,
|
|
1073
1073
|
{
|
|
1074
|
-
pageIdx:
|
|
1074
|
+
pageIdx: c,
|
|
1075
1075
|
pageCount: a.pages.length,
|
|
1076
1076
|
onPageChange: (p) => n.execute("goToPage", p),
|
|
1077
1077
|
onAddPage: () => n.execute("addPage"),
|
|
@@ -1082,29 +1082,29 @@ function At({
|
|
|
1082
1082
|
)
|
|
1083
1083
|
), u;
|
|
1084
1084
|
}
|
|
1085
|
-
const
|
|
1085
|
+
const ut = ({
|
|
1086
1086
|
context: e,
|
|
1087
1087
|
gridSize: t,
|
|
1088
1088
|
isDragging: o,
|
|
1089
1089
|
zIndex: n,
|
|
1090
1090
|
onActionFeedback: a
|
|
1091
1091
|
}) => {
|
|
1092
|
-
const { book: i, containerRef: g } = e,
|
|
1092
|
+
const { book: i, containerRef: g } = e, c = e.editorState, h = z(null), u = c.selectedBlockIds ?? [], p = A(() => {
|
|
1093
1093
|
const b = new Set(
|
|
1094
1094
|
i.pages.flatMap((w) => w.blocks.map((S) => S.id))
|
|
1095
1095
|
);
|
|
1096
1096
|
return u.filter((w) => b.has(w));
|
|
1097
|
-
}, [u, i]), f =
|
|
1098
|
-
return /* @__PURE__ */
|
|
1099
|
-
|
|
1097
|
+
}, [u, i]), f = Me(g ?? h, p) ?? null;
|
|
1098
|
+
return /* @__PURE__ */ l(
|
|
1099
|
+
Le,
|
|
1100
1100
|
{
|
|
1101
1101
|
selectionBoundingBox: f,
|
|
1102
1102
|
isDragging: o,
|
|
1103
1103
|
zIndex: n,
|
|
1104
|
-
children: /* @__PURE__ */
|
|
1105
|
-
|
|
1104
|
+
children: /* @__PURE__ */ l(
|
|
1105
|
+
Ne,
|
|
1106
1106
|
{
|
|
1107
|
-
items:
|
|
1107
|
+
items: Oe({
|
|
1108
1108
|
context: e,
|
|
1109
1109
|
gridSize: t,
|
|
1110
1110
|
onActionFeedback: a
|
|
@@ -1115,8 +1115,8 @@ const ct = ({
|
|
|
1115
1115
|
}
|
|
1116
1116
|
);
|
|
1117
1117
|
};
|
|
1118
|
-
|
|
1119
|
-
function
|
|
1118
|
+
ut.displayName = "DefaultSelectionActionBarOverlay";
|
|
1119
|
+
function _t({
|
|
1120
1120
|
context: e,
|
|
1121
1121
|
gridSize: t,
|
|
1122
1122
|
onBlockHover: o,
|
|
@@ -1127,13 +1127,13 @@ function Dt({
|
|
|
1127
1127
|
{
|
|
1128
1128
|
value: "block",
|
|
1129
1129
|
label: "ブロック",
|
|
1130
|
-
content: (e.editorState.selectedBlockIds ?? []).length > 0 ? /* @__PURE__ */
|
|
1130
|
+
content: (e.editorState.selectedBlockIds ?? []).length > 0 ? /* @__PURE__ */ l(Ve, { context: e, gridSize: t }) : /* @__PURE__ */ l(Re, { context: e })
|
|
1131
1131
|
},
|
|
1132
1132
|
{
|
|
1133
1133
|
value: "canvas",
|
|
1134
1134
|
label: "キャンバス",
|
|
1135
|
-
content: /* @__PURE__ */
|
|
1136
|
-
|
|
1135
|
+
content: /* @__PURE__ */ l(
|
|
1136
|
+
He,
|
|
1137
1137
|
{
|
|
1138
1138
|
context: e,
|
|
1139
1139
|
onBlockHover: o,
|
|
@@ -1145,26 +1145,26 @@ function Dt({
|
|
|
1145
1145
|
{
|
|
1146
1146
|
value: "other",
|
|
1147
1147
|
label: "その他",
|
|
1148
|
-
content: /* @__PURE__ */
|
|
1148
|
+
content: /* @__PURE__ */ l($e, { context: e })
|
|
1149
1149
|
}
|
|
1150
1150
|
];
|
|
1151
1151
|
}
|
|
1152
|
-
const
|
|
1153
|
-
container:
|
|
1154
|
-
tabHeader:
|
|
1155
|
-
tabContent:
|
|
1156
|
-
},
|
|
1152
|
+
const pt = "_container_9e3fp_1", mt = "_tabHeader_9e3fp_13", gt = "_tabContent_9e3fp_20", $ = {
|
|
1153
|
+
container: pt,
|
|
1154
|
+
tabHeader: mt,
|
|
1155
|
+
tabContent: gt
|
|
1156
|
+
}, yt = ({ tabs: e, defaultTab: t, className: o }) => {
|
|
1157
1157
|
var a;
|
|
1158
1158
|
const n = t ?? ((a = e[0]) == null ? void 0 : a.value) ?? "";
|
|
1159
|
-
return /* @__PURE__ */
|
|
1159
|
+
return /* @__PURE__ */ l(
|
|
1160
1160
|
"div",
|
|
1161
1161
|
{
|
|
1162
1162
|
className: `${$.container} ${o || ""}`,
|
|
1163
|
-
...
|
|
1164
|
-
children: /* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */
|
|
1166
|
-
e.map((i) => /* @__PURE__ */
|
|
1167
|
-
|
|
1163
|
+
...K,
|
|
1164
|
+
children: /* @__PURE__ */ _(We, { defaultValue: n, variant: "default", children: [
|
|
1165
|
+
/* @__PURE__ */ l(Fe, { className: $.tabHeader, children: e.map((i) => /* @__PURE__ */ l(Ue, { value: i.value, children: i.label }, i.value)) }),
|
|
1166
|
+
e.map((i) => /* @__PURE__ */ l(
|
|
1167
|
+
Ge,
|
|
1168
1168
|
{
|
|
1169
1169
|
value: i.value,
|
|
1170
1170
|
className: $.tabContent,
|
|
@@ -1176,12 +1176,12 @@ const dt = "_container_ymana_1", ut = "_tabHeader_ymana_12", pt = "_tabContent_y
|
|
|
1176
1176
|
}
|
|
1177
1177
|
);
|
|
1178
1178
|
};
|
|
1179
|
-
|
|
1180
|
-
const
|
|
1179
|
+
yt.displayName = "Sidebar";
|
|
1180
|
+
const ht = {
|
|
1181
1181
|
selectedBlockIds: [],
|
|
1182
1182
|
pageIdx: 0
|
|
1183
1183
|
};
|
|
1184
|
-
function
|
|
1184
|
+
function Mt({
|
|
1185
1185
|
label: e,
|
|
1186
1186
|
widget: t,
|
|
1187
1187
|
extraPlugins: o,
|
|
@@ -1189,20 +1189,20 @@ function Tt({
|
|
|
1189
1189
|
isDragging: a,
|
|
1190
1190
|
onTitlePointerDown: i,
|
|
1191
1191
|
onClose: g,
|
|
1192
|
-
onContainerPointerDown:
|
|
1192
|
+
onContainerPointerDown: c,
|
|
1193
1193
|
style: h,
|
|
1194
1194
|
context: u
|
|
1195
1195
|
}) {
|
|
1196
|
-
const p =
|
|
1197
|
-
() =>
|
|
1196
|
+
const p = A(
|
|
1197
|
+
() => Ze([...t.plugins, ...o ?? []]),
|
|
1198
1198
|
[t.plugins, o]
|
|
1199
|
-
), f =
|
|
1199
|
+
), f = z(null), b = A(
|
|
1200
1200
|
() => ({
|
|
1201
1201
|
get: (r) => (u.book, u.bindingContext.get(r)),
|
|
1202
1202
|
set: (r, m) => u.bindingContext.set(r, m)
|
|
1203
1203
|
}),
|
|
1204
1204
|
[u.bindingContext, u.book]
|
|
1205
|
-
), w =
|
|
1205
|
+
), w = A(
|
|
1206
1206
|
() => ({
|
|
1207
1207
|
book: t.props.book,
|
|
1208
1208
|
onBookChange: () => {
|
|
@@ -1211,7 +1211,7 @@ function Tt({
|
|
|
1211
1211
|
containerRef: f,
|
|
1212
1212
|
bindingContext: b,
|
|
1213
1213
|
actionContext: u.actionContext,
|
|
1214
|
-
editorState:
|
|
1214
|
+
editorState: ht,
|
|
1215
1215
|
values: {}
|
|
1216
1216
|
}),
|
|
1217
1217
|
[
|
|
@@ -1220,155 +1220,164 @@ function Tt({
|
|
|
1220
1220
|
b,
|
|
1221
1221
|
u.actionContext
|
|
1222
1222
|
]
|
|
1223
|
-
), [S,
|
|
1224
|
-
r.preventDefault(), r.stopPropagation(),
|
|
1223
|
+
), [S, T] = Y(0.5), M = z({ x: 0, zoom: 0.5 }), s = (r) => {
|
|
1224
|
+
r.preventDefault(), r.stopPropagation(), M.current = { x: r.clientX, zoom: S };
|
|
1225
1225
|
const m = (y) => {
|
|
1226
|
-
const k = y.clientX -
|
|
1227
|
-
|
|
1228
|
-
Math.max(0.25, Math.min(2,
|
|
1226
|
+
const k = y.clientX - M.current.x;
|
|
1227
|
+
T(
|
|
1228
|
+
Math.max(0.25, Math.min(2, M.current.zoom + k / 400))
|
|
1229
1229
|
);
|
|
1230
1230
|
}, d = () => {
|
|
1231
1231
|
window.removeEventListener("pointermove", m), window.removeEventListener("pointerup", d);
|
|
1232
1232
|
};
|
|
1233
1233
|
window.addEventListener("pointermove", m), window.addEventListener("pointerup", d);
|
|
1234
1234
|
};
|
|
1235
|
-
return /* @__PURE__ */
|
|
1235
|
+
return /* @__PURE__ */ l(
|
|
1236
1236
|
"div",
|
|
1237
1237
|
{
|
|
1238
|
-
onPointerDown:
|
|
1239
|
-
...
|
|
1238
|
+
onPointerDown: c,
|
|
1239
|
+
...K,
|
|
1240
1240
|
style: {
|
|
1241
1241
|
position: "fixed",
|
|
1242
1242
|
left: n.x,
|
|
1243
1243
|
top: n.y,
|
|
1244
|
-
|
|
1245
|
-
background: "#fff",
|
|
1246
|
-
border: "1px solid #d1d5db",
|
|
1247
|
-
borderRadius: 6,
|
|
1248
|
-
boxShadow: a ? "0 8px 24px rgba(0,0,0,0.2)" : "0 2px 8px rgba(0,0,0,0.12)",
|
|
1249
|
-
...h
|
|
1244
|
+
...Pe
|
|
1250
1245
|
},
|
|
1251
|
-
children:
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
{
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1246
|
+
children: /* @__PURE__ */ _(
|
|
1247
|
+
"div",
|
|
1248
|
+
{
|
|
1249
|
+
style: {
|
|
1250
|
+
position: "relative",
|
|
1251
|
+
zIndex: a ? j.FLOATING_WIDGET_DRAGGING : j.FLOATING_WIDGET,
|
|
1252
|
+
background: "#fff",
|
|
1253
|
+
border: "1px solid #d1d5db",
|
|
1254
|
+
borderRadius: 6,
|
|
1255
|
+
boxShadow: a ? "0 8px 24px rgba(0,0,0,0.2)" : "0 2px 8px rgba(0,0,0,0.12)",
|
|
1256
|
+
...h
|
|
1257
|
+
},
|
|
1258
|
+
children: [
|
|
1259
|
+
/* @__PURE__ */ _(
|
|
1260
|
+
"div",
|
|
1261
|
+
{
|
|
1262
|
+
style: {
|
|
1263
|
+
display: "flex",
|
|
1264
|
+
alignItems: "center",
|
|
1265
|
+
justifyContent: "space-between",
|
|
1266
|
+
padding: "3px 4px 3px 8px",
|
|
1267
|
+
background: "#f9fafb",
|
|
1268
|
+
borderBottom: "1px solid #e5e7eb",
|
|
1269
|
+
borderRadius: "6px 6px 0 0",
|
|
1270
|
+
cursor: "move",
|
|
1271
|
+
userSelect: "none",
|
|
1272
|
+
gap: 4
|
|
1273
|
+
},
|
|
1274
|
+
onPointerDown: i,
|
|
1275
|
+
children: [
|
|
1276
|
+
/* @__PURE__ */ l("span", { style: { fontSize: 11, color: "#555", whiteSpace: "nowrap" }, children: e }),
|
|
1277
|
+
/* @__PURE__ */ l(
|
|
1278
|
+
"button",
|
|
1279
|
+
{
|
|
1280
|
+
type: "button",
|
|
1281
|
+
onPointerDown: (r) => r.stopPropagation(),
|
|
1282
|
+
onClick: g,
|
|
1283
|
+
style: {
|
|
1284
|
+
background: "none",
|
|
1285
|
+
border: "none",
|
|
1286
|
+
cursor: "pointer",
|
|
1287
|
+
fontSize: 12,
|
|
1288
|
+
color: "#9ca3af",
|
|
1289
|
+
padding: "0 2px",
|
|
1290
|
+
lineHeight: 1
|
|
1291
|
+
},
|
|
1292
|
+
children: "✕"
|
|
1293
|
+
}
|
|
1294
|
+
)
|
|
1295
|
+
]
|
|
1296
|
+
}
|
|
1297
|
+
),
|
|
1298
|
+
/* @__PURE__ */ l("div", { style: { pointerEvents: a ? "none" : "auto", zoom: S }, children: /* @__PURE__ */ l(me, { mode: X.EDIT, context: w }) }),
|
|
1299
|
+
/* @__PURE__ */ l(
|
|
1300
|
+
"div",
|
|
1301
|
+
{
|
|
1302
|
+
onPointerDown: s,
|
|
1303
|
+
style: {
|
|
1304
|
+
position: "absolute",
|
|
1305
|
+
bottom: 0,
|
|
1306
|
+
right: 0,
|
|
1307
|
+
width: 14,
|
|
1308
|
+
height: 14,
|
|
1309
|
+
cursor: "se-resize",
|
|
1310
|
+
background: "linear-gradient(135deg, transparent 50%, #9ca3af 50%)",
|
|
1311
|
+
borderRadius: "0 0 6px 0"
|
|
1286
1312
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
/* @__PURE__ */ c(
|
|
1293
|
-
"div",
|
|
1294
|
-
{
|
|
1295
|
-
onPointerDown: s,
|
|
1296
|
-
style: {
|
|
1297
|
-
position: "absolute",
|
|
1298
|
-
bottom: 0,
|
|
1299
|
-
right: 0,
|
|
1300
|
-
width: 14,
|
|
1301
|
-
height: 14,
|
|
1302
|
-
cursor: "se-resize",
|
|
1303
|
-
background: "linear-gradient(135deg, transparent 50%, #9ca3af 50%)",
|
|
1304
|
-
borderRadius: "0 0 6px 0"
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
)
|
|
1308
|
-
]
|
|
1313
|
+
}
|
|
1314
|
+
)
|
|
1315
|
+
]
|
|
1316
|
+
}
|
|
1317
|
+
)
|
|
1309
1318
|
}
|
|
1310
1319
|
);
|
|
1311
1320
|
}
|
|
1312
1321
|
export {
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1322
|
+
nt as ActionBar,
|
|
1323
|
+
Ct as BASE_PLUGINS,
|
|
1324
|
+
te as CheckboxPlugin,
|
|
1325
|
+
Ot as DEFAULT_BOOK,
|
|
1326
|
+
Kt as DEFAULT_GRID,
|
|
1327
|
+
Vt as DEFAULT_PAGE,
|
|
1328
|
+
Jt as DEFAULT_PAPER,
|
|
1329
|
+
Qt as DEFAULT_PAPER_MARGIN,
|
|
1330
|
+
eo as DEFAULT_PAPER_SIZES,
|
|
1331
|
+
ut as DefaultSelectionActionBarOverlay,
|
|
1332
|
+
Mt as FloatingWidget,
|
|
1333
|
+
to as LineType,
|
|
1334
|
+
me as Note,
|
|
1335
|
+
Rt as NoteEdit,
|
|
1336
|
+
Ht as NoteForm,
|
|
1337
|
+
X as NoteMode,
|
|
1338
|
+
$t as NoteView,
|
|
1339
|
+
D as PaperSizePreset,
|
|
1340
|
+
oe as SelectPlugin,
|
|
1341
|
+
yt as Sidebar,
|
|
1342
|
+
F as TextPlugin,
|
|
1343
|
+
Wt as ValidationSeverity,
|
|
1344
|
+
Ft as addPage,
|
|
1345
|
+
At as blockLayoutWidget,
|
|
1346
|
+
It as canvasActionsWidget,
|
|
1338
1347
|
Ut as cleanValues,
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1348
|
+
Bt as clipboardWidget,
|
|
1349
|
+
G as createBlockId,
|
|
1350
|
+
Ke as createCanvasActionsWidget,
|
|
1351
|
+
Je as createClipboardWidget,
|
|
1352
|
+
Qe as createHistoryWidget,
|
|
1353
|
+
tt as createPageNavigationWidget,
|
|
1354
|
+
Ze as createPluginRegistry,
|
|
1355
|
+
ot as createSelectionDeleteWidget,
|
|
1356
|
+
oo as deserializeBook,
|
|
1357
|
+
no as deserializePage,
|
|
1358
|
+
ao as deserializeValues,
|
|
1359
|
+
Gt as ensurePageIds,
|
|
1360
|
+
zt as getDefaultActionBarSections,
|
|
1361
|
+
_t as getDefaultSidebarTabs,
|
|
1362
|
+
jt as gridSettingsWidget,
|
|
1363
|
+
Et as historyWidget,
|
|
1364
|
+
ne as insertPage,
|
|
1365
|
+
io as isBook,
|
|
1366
|
+
so as isLegacyFormSchema,
|
|
1367
|
+
ro as migrate,
|
|
1368
|
+
lo as migrateBook,
|
|
1369
|
+
co as migrateFormSchemaToBook,
|
|
1370
|
+
uo as migratePage,
|
|
1371
|
+
Zt as movePage,
|
|
1372
|
+
Dt as pageNavigationWidget,
|
|
1373
|
+
Yt as paperSettingsWidget,
|
|
1374
|
+
po as parseBook,
|
|
1375
|
+
dt as printNote,
|
|
1376
|
+
ae as removePage,
|
|
1377
|
+
Tt as selectionDeleteWidget,
|
|
1378
|
+
mo as serializeBook,
|
|
1379
|
+
go as serializePage,
|
|
1380
|
+
N as setPage,
|
|
1381
|
+
St as useNoteContext,
|
|
1373
1382
|
qt as validateBook
|
|
1374
1383
|
};
|