@tatamicks/core 1.0.1 → 1.0.3
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-Dipvtj7D.cjs → PalettePanel-0cFP3tbA.cjs} +2 -2
- package/dist/PalettePanel-0cFP3tbA.cjs.map +1 -0
- package/dist/{PalettePanel-CtXsH6Cb.js → PalettePanel-N5Y1TJAk.js} +232 -242
- package/dist/PalettePanel-N5Y1TJAk.js.map +1 -0
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.mjs +13 -13
- package/dist/index.cjs +3 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +430 -571
- package/dist/index.mjs.map +1 -1
- package/dist/{paperSettingsWidget-sLJsIUxS.cjs → paperSettingsWidget-CJ4QFjYK.cjs} +1 -1
- package/dist/{paperSettingsWidget-sLJsIUxS.cjs.map → paperSettingsWidget-CJ4QFjYK.cjs.map} +1 -1
- package/dist/{paperSettingsWidget-DgDoBA0P.js → paperSettingsWidget-d93s3Gsr.js} +1 -1
- package/dist/{paperSettingsWidget-DgDoBA0P.js.map → paperSettingsWidget-d93s3Gsr.js.map} +1 -1
- package/dist/shell.cjs +1 -1
- package/dist/shell.mjs +2 -2
- package/dist/sidebarPortal-B2Mk9Aba.js +875 -0
- package/dist/sidebarPortal-B2Mk9Aba.js.map +1 -0
- package/dist/sidebarPortal-BCIVv4yO.cjs +3 -0
- package/dist/sidebarPortal-BCIVv4yO.cjs.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/PalettePanel-CtXsH6Cb.js.map +0 -1
- package/dist/PalettePanel-Dipvtj7D.cjs.map +0 -1
- package/dist/sidebarPortal-C06y4JSP.js +0 -723
- package/dist/sidebarPortal-C06y4JSP.js.map +0 -1
- package/dist/sidebarPortal-C3HszQyp.cjs +0 -1
- package/dist/sidebarPortal-C3HszQyp.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 { a as
|
|
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 ee, S as te, T as W, s as L, c as j, i as oe, r as ne, u as ae, a as ie, b as se, B as V, d as re, n as H, e as le, f as ce, g as de, h as ue, N as pe } from "./paperSettingsWidget-d93s3Gsr.js";
|
|
2
|
+
import { D as Vt, j as Lt, k as Ht, l as Ot, m as Rt, V as Nt, o as $t, p as Ut, q as Wt, t as Ft, v as jt, w as Gt, x as qt } from "./paperSettingsWidget-d93s3Gsr.js";
|
|
3
|
+
import { useReducer as me, useRef as T, useCallback as I, useMemo as z, useState as q, isValidElement as ge, Fragment as ye, memo as Y, forwardRef as he, useEffect as ve, createElement as be } from "react";
|
|
4
|
+
import { P as A, u as ke, D as fe, N as Z, S as X } from "./sidebarPortal-B2Mk9Aba.js";
|
|
5
|
+
import { a as Zt, b as Xt, c as Kt, d as Jt, L as Qt, e as eo, f as to, g as oo, i as no, h as ao, m as io, j as so, k as ro, l as lo, p as co, s as uo, n as po } from "./sidebarPortal-B2Mk9Aba.js";
|
|
6
|
+
import { flushSync as xe } from "react-dom";
|
|
7
|
+
import { createRoot as Pe } from "react-dom/client";
|
|
8
|
+
import { jsx as c, jsxs as M, Fragment as we } from "react/jsx-runtime";
|
|
9
|
+
import { s as U, A as Ce, I as O, C as Se, a as Be, b as Ie, D as Ee, c as ze, P as Ae, G as De, u as Te, S as Me, d as _e, g as Ve, e as Le, f as He, h as Oe, O as Re, T as Ne, i as $e, j as Ue, k as We } from "./PalettePanel-N5Y1TJAk.js";
|
|
10
|
+
import './index.css';function Fe(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 je(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 Ye(e) {
|
|
|
34
34
|
kind: o.kind,
|
|
35
35
|
meta: o.meta,
|
|
36
36
|
properties: o.properties,
|
|
37
|
-
defaultProps:
|
|
37
|
+
defaultProps: Fe(o),
|
|
38
38
|
Renderer: o.Renderer,
|
|
39
39
|
...typeof o.migrateProps == "function" ? {
|
|
40
40
|
migrateProps: o.migrateProps
|
|
@@ -50,150 +50,8 @@ function Ye(e) {
|
|
|
50
50
|
})
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
center: "center",
|
|
56
|
-
"flex-end": "right"
|
|
57
|
-
}, Xe = {
|
|
58
|
-
"flex-start": "top",
|
|
59
|
-
center: "center",
|
|
60
|
-
"flex-end": "bottom"
|
|
61
|
-
};
|
|
62
|
-
function Je(e) {
|
|
63
|
-
return typeof e == "object" && e !== null && e.value === 1 && e.unit === "fr";
|
|
64
|
-
}
|
|
65
|
-
function G(e) {
|
|
66
|
-
const t = {};
|
|
67
|
-
for (let o = 0; o < e.length; o++) {
|
|
68
|
-
const n = e[o];
|
|
69
|
-
n !== void 0 && !Je(n) && (t[o] = n);
|
|
70
|
-
}
|
|
71
|
-
return t;
|
|
72
|
-
}
|
|
73
|
-
function K(e) {
|
|
74
|
-
if (typeof e != "object" || e === null)
|
|
75
|
-
throw new Error("grid must be an object");
|
|
76
|
-
const t = e;
|
|
77
|
-
if (Array.isArray(t.cols) && Array.isArray(t.rows)) {
|
|
78
|
-
const o = t.cols, n = t.rows, a = {
|
|
79
|
-
colCount: o.length,
|
|
80
|
-
rowCount: n.length
|
|
81
|
-
}, i = G(o);
|
|
82
|
-
Object.keys(i).length > 0 && (a.cols = i);
|
|
83
|
-
const c = G(n);
|
|
84
|
-
return Object.keys(c).length > 0 && (a.rows = c), a;
|
|
85
|
-
}
|
|
86
|
-
return e;
|
|
87
|
-
}
|
|
88
|
-
function Ke(e) {
|
|
89
|
-
if (!("isIndividual" in e))
|
|
90
|
-
return e;
|
|
91
|
-
const t = { ...e }, o = t.isIndividual ?? !0, n = t.all;
|
|
92
|
-
return delete t.isIndividual, delete t.all, !o && n !== void 0 && ("top" in t || (t.top = n), "right" in t || (t.right = n), "bottom" in t || (t.bottom = n), "left" in t || (t.left = n)), t;
|
|
93
|
-
}
|
|
94
|
-
function Qe(e) {
|
|
95
|
-
const t = { ...e };
|
|
96
|
-
if ("justifyContent" in t) {
|
|
97
|
-
const o = t.justifyContent;
|
|
98
|
-
t.horizontal = Ze[o] ?? o, delete t.justifyContent;
|
|
99
|
-
}
|
|
100
|
-
if ("alignItems" in t) {
|
|
101
|
-
const o = t.alignItems;
|
|
102
|
-
t.vertical = Xe[o] ?? o, delete t.alignItems;
|
|
103
|
-
}
|
|
104
|
-
return t;
|
|
105
|
-
}
|
|
106
|
-
function Q(e) {
|
|
107
|
-
if (typeof e != "object" || e === null)
|
|
108
|
-
return e;
|
|
109
|
-
let t = { ...e };
|
|
110
|
-
return t = Ke(t), t = Qe(t), t;
|
|
111
|
-
}
|
|
112
|
-
function et(e, t) {
|
|
113
|
-
if (typeof e != "object" || e === null)
|
|
114
|
-
throw new Error("page must be an object");
|
|
115
|
-
const o = { ...e };
|
|
116
|
-
return "grid" in o && (o.grid = K(o.grid)), Array.isArray(o.blocks) && (o.blocks = o.blocks.map((n) => {
|
|
117
|
-
if (typeof n == "object" && n !== null) {
|
|
118
|
-
const a = { ...n };
|
|
119
|
-
"props" in a && (a.props = Q(a.props));
|
|
120
|
-
const i = typeof a.kind == "string" ? a.kind : void 0;
|
|
121
|
-
if (i && t) {
|
|
122
|
-
const c = t[i];
|
|
123
|
-
c != null && c.migrateProps && (a.props = c.migrateProps(a.props));
|
|
124
|
-
}
|
|
125
|
-
return a;
|
|
126
|
-
}
|
|
127
|
-
return n;
|
|
128
|
-
})), {
|
|
129
|
-
grid: o.grid,
|
|
130
|
-
blocks: o.blocks,
|
|
131
|
-
...o.blockDefaults !== void 0 ? { blockDefaults: o.blockDefaults } : {},
|
|
132
|
-
...o.metaData !== void 0 ? { metaData: o.metaData } : {}
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
function tt(e) {
|
|
136
|
-
return typeof e == "object" && e !== null && !("pages" in e) && "grid" in e && "blocks" in e;
|
|
137
|
-
}
|
|
138
|
-
function ot(e) {
|
|
139
|
-
return typeof e == "object" && e !== null && "pages" in e;
|
|
140
|
-
}
|
|
141
|
-
function nt(e, t) {
|
|
142
|
-
if (typeof e != "object" || e === null)
|
|
143
|
-
throw new Error("Book must be a JSON object");
|
|
144
|
-
const o = { ...e };
|
|
145
|
-
return Array.isArray(o.pages) && (o.pages = o.pages.map((n) => et(n, t))), {
|
|
146
|
-
paper: o.paper,
|
|
147
|
-
pages: o.pages,
|
|
148
|
-
...o.metaData !== void 0 ? { metaData: o.metaData } : {}
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
function at(e, t) {
|
|
152
|
-
if (typeof e != "object" || e === null)
|
|
153
|
-
throw new Error("Schema must be a JSON object");
|
|
154
|
-
const o = { ...e }, n = {};
|
|
155
|
-
if ("grid" in o && (n.grid = K(o.grid), delete o.grid), "blocks" in o) {
|
|
156
|
-
const c = o.blocks;
|
|
157
|
-
Array.isArray(c) && (n.blocks = c.map((r) => {
|
|
158
|
-
if (typeof r == "object" && r !== null) {
|
|
159
|
-
const m = { ...r };
|
|
160
|
-
"props" in m && (m.props = Q(m.props));
|
|
161
|
-
const p = typeof m.kind == "string" ? m.kind : void 0;
|
|
162
|
-
if (p && t) {
|
|
163
|
-
const u = t[p];
|
|
164
|
-
u != null && u.migrateProps && (m.props = u.migrateProps(m.props));
|
|
165
|
-
}
|
|
166
|
-
return m;
|
|
167
|
-
}
|
|
168
|
-
return r;
|
|
169
|
-
})), delete o.blocks;
|
|
170
|
-
}
|
|
171
|
-
"metaData" in o && (n.metaData = o.metaData, delete o.metaData);
|
|
172
|
-
const a = {};
|
|
173
|
-
"paper" in o && (a.paper = o.paper, delete o.paper);
|
|
174
|
-
const i = {
|
|
175
|
-
grid: n.grid,
|
|
176
|
-
blocks: n.blocks ?? [],
|
|
177
|
-
...n.metaData !== void 0 ? { metaData: n.metaData } : {}
|
|
178
|
-
};
|
|
179
|
-
return {
|
|
180
|
-
paper: a.paper,
|
|
181
|
-
pages: [i]
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
function Vt(e, t) {
|
|
185
|
-
if (tt(e))
|
|
186
|
-
return at(e, t);
|
|
187
|
-
if (ot(e))
|
|
188
|
-
return nt(e, t);
|
|
189
|
-
throw new Error(
|
|
190
|
-
`入力データの形式を判別できません。
|
|
191
|
-
形式 A(旧 FormSchema): トップレベルに 'grid' と 'blocks' が必要
|
|
192
|
-
形式 B(Book): トップレベルに 'pages' が必要`
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
const Ot = [ne, ae, F];
|
|
196
|
-
function it(e, t) {
|
|
53
|
+
const Pt = [ee, te, W];
|
|
54
|
+
function Ge(e, t) {
|
|
197
55
|
switch (t.type) {
|
|
198
56
|
case "setSelectedBlockIds":
|
|
199
57
|
return { ...e, selectedBlockIds: t.ids };
|
|
@@ -203,74 +61,74 @@ function it(e, t) {
|
|
|
203
61
|
return { ...e, clipboard: t.blocks };
|
|
204
62
|
}
|
|
205
63
|
}
|
|
206
|
-
const
|
|
64
|
+
const qe = {
|
|
207
65
|
selectedBlockIds: [],
|
|
208
66
|
pageIdx: 0,
|
|
209
67
|
clipboard: []
|
|
210
68
|
};
|
|
211
|
-
function
|
|
69
|
+
function Ye({
|
|
212
70
|
book: e,
|
|
213
71
|
handleBookChange: t
|
|
214
72
|
}) {
|
|
215
|
-
const [o, n] =
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
), { selectedBlockIds: a, pageIdx: i } = o,
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
const
|
|
223
|
-
(s,
|
|
224
|
-
const
|
|
225
|
-
if (!
|
|
226
|
-
const
|
|
227
|
-
const
|
|
228
|
-
return
|
|
73
|
+
const [o, n] = me(
|
|
74
|
+
Ge,
|
|
75
|
+
qe
|
|
76
|
+
), { selectedBlockIds: a, pageIdx: i } = o, g = T(e);
|
|
77
|
+
g.current = e;
|
|
78
|
+
const l = T(o);
|
|
79
|
+
l.current = o;
|
|
80
|
+
const h = I(
|
|
81
|
+
(s, r) => {
|
|
82
|
+
const m = g.current, d = l.current.pageIdx, y = m.pages[d];
|
|
83
|
+
if (!y) return;
|
|
84
|
+
const k = y.blocks.map((B) => {
|
|
85
|
+
const E = s[B.id];
|
|
86
|
+
return E ? { ...B, ...E } : B;
|
|
229
87
|
});
|
|
230
88
|
t(
|
|
231
|
-
|
|
232
|
-
|
|
89
|
+
L(m, d, { ...y, blocks: k }),
|
|
90
|
+
r
|
|
233
91
|
);
|
|
234
|
-
const x =
|
|
235
|
-
var
|
|
236
|
-
const
|
|
237
|
-
return typeof
|
|
92
|
+
const x = l.current.selectedBlockIds, C = x.map((B) => {
|
|
93
|
+
var F;
|
|
94
|
+
const E = (F = s[B]) == null ? void 0 : F.id;
|
|
95
|
+
return typeof E == "string" ? E : B;
|
|
238
96
|
});
|
|
239
|
-
C.some((B,
|
|
97
|
+
C.some((B, E) => B !== x[E]) && n({ type: "setSelectedBlockIds", ids: C });
|
|
240
98
|
},
|
|
241
99
|
[t]
|
|
242
|
-
),
|
|
100
|
+
), u = I(
|
|
243
101
|
(s) => {
|
|
244
|
-
const
|
|
245
|
-
if (!
|
|
246
|
-
const
|
|
247
|
-
(x) => !
|
|
102
|
+
const r = g.current, m = l.current.pageIdx, d = r.pages[m];
|
|
103
|
+
if (!d) return;
|
|
104
|
+
const y = new Set(s), k = d.blocks.filter(
|
|
105
|
+
(x) => !y.has(x.id)
|
|
248
106
|
);
|
|
249
|
-
t(
|
|
107
|
+
t(L(r, m, { ...d, blocks: k })), n({ type: "setSelectedBlockIds", ids: [] });
|
|
250
108
|
},
|
|
251
109
|
[t]
|
|
252
|
-
),
|
|
253
|
-
const
|
|
254
|
-
if (!
|
|
255
|
-
const
|
|
256
|
-
n({ type: "setClipboard", blocks:
|
|
257
|
-
}, []),
|
|
110
|
+
), p = I((s) => {
|
|
111
|
+
const r = g.current, m = l.current.pageIdx, d = r.pages[m];
|
|
112
|
+
if (!d) return;
|
|
113
|
+
const y = d.blocks.filter((k) => s.includes(k.id));
|
|
114
|
+
n({ type: "setClipboard", blocks: y });
|
|
115
|
+
}, []), f = I(
|
|
258
116
|
(s) => {
|
|
259
|
-
const
|
|
260
|
-
if (!
|
|
261
|
-
const
|
|
117
|
+
const r = g.current, m = l.current.pageIdx, d = r.pages[m];
|
|
118
|
+
if (!d) return;
|
|
119
|
+
const y = d.blocks.filter((C) => s.includes(C.id)), k = d.grid, x = y.map((C) => ({
|
|
262
120
|
...C,
|
|
263
|
-
id:
|
|
121
|
+
id: j(C.kind),
|
|
264
122
|
layout: {
|
|
265
123
|
...C.layout,
|
|
266
|
-
x: Math.min(C.layout.x + 1,
|
|
267
|
-
y: Math.min(C.layout.y + 1,
|
|
124
|
+
x: Math.min(C.layout.x + 1, k.colCount - C.layout.w),
|
|
125
|
+
y: Math.min(C.layout.y + 1, k.rowCount - C.layout.h)
|
|
268
126
|
}
|
|
269
127
|
}));
|
|
270
128
|
t(
|
|
271
|
-
|
|
272
|
-
...
|
|
273
|
-
blocks: [...
|
|
129
|
+
L(r, m, {
|
|
130
|
+
...d,
|
|
131
|
+
blocks: [...d.blocks, ...x]
|
|
274
132
|
})
|
|
275
133
|
), n({
|
|
276
134
|
type: "setSelectedBlockIds",
|
|
@@ -278,74 +136,74 @@ function st({
|
|
|
278
136
|
});
|
|
279
137
|
},
|
|
280
138
|
[t]
|
|
281
|
-
),
|
|
282
|
-
const s =
|
|
139
|
+
), b = I(() => {
|
|
140
|
+
const s = l.current.clipboard;
|
|
283
141
|
if (s.length === 0) return;
|
|
284
|
-
const
|
|
285
|
-
if (!
|
|
286
|
-
const
|
|
142
|
+
const r = g.current, m = l.current.pageIdx, d = r.pages[m];
|
|
143
|
+
if (!d) return;
|
|
144
|
+
const y = d.grid, k = s.map((x) => ({
|
|
287
145
|
...x,
|
|
288
|
-
id:
|
|
146
|
+
id: j(x.kind),
|
|
289
147
|
layout: {
|
|
290
148
|
...x.layout,
|
|
291
|
-
x: Math.min(x.layout.x + 1,
|
|
292
|
-
y: Math.min(x.layout.y + 1,
|
|
149
|
+
x: Math.min(x.layout.x + 1, y.colCount - x.layout.w),
|
|
150
|
+
y: Math.min(x.layout.y + 1, y.rowCount - x.layout.h)
|
|
293
151
|
}
|
|
294
152
|
}));
|
|
295
153
|
t(
|
|
296
|
-
|
|
297
|
-
...
|
|
298
|
-
blocks: [...
|
|
154
|
+
L(r, m, {
|
|
155
|
+
...d,
|
|
156
|
+
blocks: [...d.blocks, ...k]
|
|
299
157
|
})
|
|
300
158
|
), n({
|
|
301
159
|
type: "setSelectedBlockIds",
|
|
302
|
-
ids:
|
|
160
|
+
ids: k.map((x) => x.id)
|
|
303
161
|
});
|
|
304
|
-
}, [t]),
|
|
305
|
-
var
|
|
306
|
-
const s =
|
|
307
|
-
grid:
|
|
162
|
+
}, [t]), w = I(() => {
|
|
163
|
+
var y;
|
|
164
|
+
const s = g.current, r = l.current.pageIdx, m = s.pages[r], d = {
|
|
165
|
+
grid: m ? m.grid : ((y = s.pages[0]) == null ? void 0 : y.grid) ?? { colCount: 12, rowCount: 24 },
|
|
308
166
|
blocks: []
|
|
309
167
|
};
|
|
310
|
-
t(
|
|
168
|
+
t(oe(s, r, d)), n({ type: "setPageIdx", idx: r + 1 });
|
|
311
169
|
}, [t]), S = I(() => {
|
|
312
|
-
const s =
|
|
170
|
+
const s = g.current, r = l.current.pageIdx;
|
|
313
171
|
if (s.pages.length <= 1) return;
|
|
314
|
-
const
|
|
315
|
-
t(
|
|
172
|
+
const m = ne(s, r);
|
|
173
|
+
t(m), n({
|
|
316
174
|
type: "setPageIdx",
|
|
317
|
-
idx: Math.min(
|
|
175
|
+
idx: Math.min(r, m.pages.length - 1)
|
|
318
176
|
});
|
|
319
|
-
}, [t]),
|
|
177
|
+
}, [t]), D = z(
|
|
320
178
|
() => ({
|
|
321
179
|
paste: {
|
|
322
|
-
execute:
|
|
323
|
-
isEnabled: () =>
|
|
180
|
+
execute: b,
|
|
181
|
+
isEnabled: () => l.current.clipboard.length > 0
|
|
324
182
|
},
|
|
325
183
|
delete: {
|
|
326
|
-
execute: () =>
|
|
327
|
-
isEnabled: () =>
|
|
184
|
+
execute: () => u(l.current.selectedBlockIds),
|
|
185
|
+
isEnabled: () => l.current.selectedBlockIds.length > 0
|
|
328
186
|
},
|
|
329
187
|
copy: {
|
|
330
|
-
execute: () =>
|
|
331
|
-
isEnabled: () =>
|
|
188
|
+
execute: () => p(l.current.selectedBlockIds),
|
|
189
|
+
isEnabled: () => l.current.selectedBlockIds.length > 0
|
|
332
190
|
},
|
|
333
191
|
duplicate: {
|
|
334
|
-
execute: () =>
|
|
335
|
-
isEnabled: () =>
|
|
192
|
+
execute: () => f(l.current.selectedBlockIds),
|
|
193
|
+
isEnabled: () => l.current.selectedBlockIds.length > 0
|
|
336
194
|
},
|
|
337
195
|
addPage: {
|
|
338
|
-
execute:
|
|
196
|
+
execute: w,
|
|
339
197
|
isEnabled: () => !0
|
|
340
198
|
},
|
|
341
199
|
deletePage: {
|
|
342
200
|
execute: S,
|
|
343
|
-
isEnabled: () =>
|
|
201
|
+
isEnabled: () => g.current.pages.length > 1
|
|
344
202
|
},
|
|
345
203
|
selectBlocks: {
|
|
346
204
|
execute: (s) => n({ type: "setSelectedBlockIds", ids: s }),
|
|
347
205
|
isEnabled: () => !0,
|
|
348
|
-
validatePayload: (s) => Array.isArray(s) && s.every((
|
|
206
|
+
validatePayload: (s) => Array.isArray(s) && s.every((r) => typeof r == "string")
|
|
349
207
|
},
|
|
350
208
|
goToPage: {
|
|
351
209
|
execute: (s) => n({ type: "setPageIdx", idx: s }),
|
|
@@ -354,94 +212,94 @@ function st({
|
|
|
354
212
|
},
|
|
355
213
|
updateBlocks: {
|
|
356
214
|
execute: (s) => {
|
|
357
|
-
const { updates:
|
|
358
|
-
|
|
215
|
+
const { updates: r, options: m } = s;
|
|
216
|
+
h(r, m);
|
|
359
217
|
},
|
|
360
218
|
isEnabled: () => !0,
|
|
361
219
|
validatePayload: (s) => typeof s == "object" && s !== null && "updates" in s && typeof s.updates == "object"
|
|
362
220
|
}
|
|
363
221
|
}),
|
|
364
222
|
[
|
|
365
|
-
|
|
366
|
-
p,
|
|
223
|
+
b,
|
|
367
224
|
u,
|
|
368
|
-
|
|
369
|
-
|
|
225
|
+
p,
|
|
226
|
+
f,
|
|
227
|
+
w,
|
|
370
228
|
S,
|
|
371
|
-
|
|
229
|
+
h
|
|
372
230
|
]
|
|
373
231
|
);
|
|
374
232
|
return {
|
|
375
|
-
editorState:
|
|
233
|
+
editorState: z(
|
|
376
234
|
() => ({
|
|
377
235
|
selectedBlockIds: a,
|
|
378
236
|
pageIdx: i
|
|
379
237
|
}),
|
|
380
238
|
[a, i]
|
|
381
239
|
),
|
|
382
|
-
actionHandlers:
|
|
240
|
+
actionHandlers: D,
|
|
383
241
|
selectedBlockIds: a
|
|
384
242
|
};
|
|
385
243
|
}
|
|
386
|
-
function
|
|
244
|
+
function wt({
|
|
387
245
|
initialBook: e,
|
|
388
246
|
pluginRegistry: t,
|
|
389
247
|
defaultValues: o,
|
|
390
248
|
extra: n
|
|
391
249
|
}) {
|
|
392
|
-
const a = T(null), { book: i, handleBookChange:
|
|
250
|
+
const a = T(null), { book: i, handleBookChange: g, historyActionHandlers: l } = ae({
|
|
393
251
|
initialBook: e
|
|
394
|
-
}), [
|
|
252
|
+
}), [h, u] = q(
|
|
395
253
|
o ?? {}
|
|
396
|
-
),
|
|
397
|
-
s.length !== 0 &&
|
|
254
|
+
), p = I((s) => {
|
|
255
|
+
s.length !== 0 && u((r) => {
|
|
398
256
|
if (!s.some(
|
|
399
|
-
({ id:
|
|
400
|
-
)) return
|
|
401
|
-
const
|
|
402
|
-
for (const { id:
|
|
403
|
-
|
|
404
|
-
return
|
|
257
|
+
({ id: y, value: k }) => k === void 0 ? y in r : r[y] !== k
|
|
258
|
+
)) return r;
|
|
259
|
+
const d = { ...r };
|
|
260
|
+
for (const { id: y, value: k } of s)
|
|
261
|
+
k === void 0 ? delete d[y] : d[y] = k;
|
|
262
|
+
return d;
|
|
405
263
|
});
|
|
406
|
-
}, []), { editorState:
|
|
264
|
+
}, []), { editorState: f, actionHandlers: b } = Ye({
|
|
407
265
|
book: i,
|
|
408
|
-
handleBookChange:
|
|
409
|
-
}),
|
|
410
|
-
pageIdx:
|
|
266
|
+
handleBookChange: g
|
|
267
|
+
}), w = {
|
|
268
|
+
pageIdx: f.pageIdx,
|
|
411
269
|
...n ? { extra: n } : {}
|
|
412
|
-
}, S =
|
|
270
|
+
}, S = ie(
|
|
413
271
|
i,
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
),
|
|
417
|
-
...
|
|
418
|
-
...
|
|
272
|
+
g,
|
|
273
|
+
w
|
|
274
|
+
), D = se({
|
|
275
|
+
...l,
|
|
276
|
+
...b
|
|
419
277
|
});
|
|
420
|
-
return { context:
|
|
278
|
+
return { context: z(
|
|
421
279
|
() => ({
|
|
422
280
|
book: i,
|
|
423
|
-
onBookChange:
|
|
281
|
+
onBookChange: g,
|
|
424
282
|
pluginRegistry: t,
|
|
425
283
|
containerRef: a,
|
|
426
284
|
bindingContext: S,
|
|
427
|
-
actionContext:
|
|
428
|
-
values:
|
|
429
|
-
onValuesChange:
|
|
430
|
-
editorState:
|
|
285
|
+
actionContext: D,
|
|
286
|
+
values: h,
|
|
287
|
+
onValuesChange: p,
|
|
288
|
+
editorState: f
|
|
431
289
|
}),
|
|
432
290
|
[
|
|
433
291
|
i,
|
|
434
|
-
|
|
292
|
+
g,
|
|
435
293
|
t,
|
|
436
294
|
S,
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
295
|
+
D,
|
|
296
|
+
h,
|
|
297
|
+
p,
|
|
298
|
+
f
|
|
441
299
|
]
|
|
442
300
|
) };
|
|
443
301
|
}
|
|
444
|
-
const
|
|
302
|
+
const v = {
|
|
445
303
|
/** チェック済みチェックボックス (check_box) */
|
|
446
304
|
selectAll: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",
|
|
447
305
|
/** 空チェックボックス (check_box_outline_blank) */
|
|
@@ -466,26 +324,26 @@ const b = {
|
|
|
466
324
|
addPage: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",
|
|
467
325
|
/** マイナス・ページ削除 (remove) */
|
|
468
326
|
deletePage: "M19 13H5v-2h14v2z"
|
|
469
|
-
},
|
|
470
|
-
function
|
|
327
|
+
}, R = { value: 2, unit: "mm" };
|
|
328
|
+
function P(e, t, o) {
|
|
471
329
|
return {
|
|
472
330
|
iconPath: e,
|
|
473
331
|
label: "",
|
|
474
332
|
action: t,
|
|
475
333
|
...o ? { title: o } : {},
|
|
476
|
-
top:
|
|
477
|
-
right:
|
|
478
|
-
bottom:
|
|
479
|
-
left:
|
|
334
|
+
top: R,
|
|
335
|
+
right: R,
|
|
336
|
+
bottom: R,
|
|
337
|
+
left: R
|
|
480
338
|
};
|
|
481
339
|
}
|
|
482
|
-
function
|
|
340
|
+
function Ze(e = "canvas-actions") {
|
|
483
341
|
return {
|
|
484
342
|
props: {
|
|
485
343
|
book: {
|
|
486
344
|
paper: {
|
|
487
345
|
size: {
|
|
488
|
-
preset:
|
|
346
|
+
preset: A.CUSTOM,
|
|
489
347
|
width: { value: 160, unit: "mm" },
|
|
490
348
|
height: { value: 20, unit: "mm" }
|
|
491
349
|
},
|
|
@@ -504,8 +362,8 @@ function lt(e = "canvas-actions") {
|
|
|
504
362
|
id: `${e}-select-all`,
|
|
505
363
|
kind: "button",
|
|
506
364
|
layout: { x: 0, y: 0, w: 1, h: 1 },
|
|
507
|
-
props:
|
|
508
|
-
|
|
365
|
+
props: P(
|
|
366
|
+
v.selectAll,
|
|
509
367
|
"select_all",
|
|
510
368
|
"すべて選択"
|
|
511
369
|
)
|
|
@@ -514,8 +372,8 @@ function lt(e = "canvas-actions") {
|
|
|
514
372
|
id: `${e}-deselect-all`,
|
|
515
373
|
kind: "button",
|
|
516
374
|
layout: { x: 1, y: 0, w: 1, h: 1 },
|
|
517
|
-
props:
|
|
518
|
-
|
|
375
|
+
props: P(
|
|
376
|
+
v.deselectAll,
|
|
519
377
|
"deselect_all",
|
|
520
378
|
"選択を解除"
|
|
521
379
|
)
|
|
@@ -524,8 +382,8 @@ function lt(e = "canvas-actions") {
|
|
|
524
382
|
id: `${e}-delete`,
|
|
525
383
|
kind: "button",
|
|
526
384
|
layout: { x: 2, y: 0, w: 1, h: 1 },
|
|
527
|
-
props:
|
|
528
|
-
|
|
385
|
+
props: P(
|
|
386
|
+
v.delete,
|
|
529
387
|
"delete",
|
|
530
388
|
"削除 (Delete / Backspace)"
|
|
531
389
|
)
|
|
@@ -534,8 +392,8 @@ function lt(e = "canvas-actions") {
|
|
|
534
392
|
id: `${e}-copy`,
|
|
535
393
|
kind: "button",
|
|
536
394
|
layout: { x: 3, y: 0, w: 1, h: 1 },
|
|
537
|
-
props:
|
|
538
|
-
|
|
395
|
+
props: P(
|
|
396
|
+
v.copy,
|
|
539
397
|
"copy",
|
|
540
398
|
"コピー (Ctrl+C / Cmd+C)"
|
|
541
399
|
)
|
|
@@ -544,8 +402,8 @@ function lt(e = "canvas-actions") {
|
|
|
544
402
|
id: `${e}-paste`,
|
|
545
403
|
kind: "button",
|
|
546
404
|
layout: { x: 4, y: 0, w: 1, h: 1 },
|
|
547
|
-
props:
|
|
548
|
-
|
|
405
|
+
props: P(
|
|
406
|
+
v.paste,
|
|
549
407
|
"paste",
|
|
550
408
|
"貼り付け (Ctrl+V / Cmd+V)"
|
|
551
409
|
)
|
|
@@ -554,8 +412,8 @@ function lt(e = "canvas-actions") {
|
|
|
554
412
|
id: `${e}-duplicate`,
|
|
555
413
|
kind: "button",
|
|
556
414
|
layout: { x: 5, y: 0, w: 1, h: 1 },
|
|
557
|
-
props:
|
|
558
|
-
|
|
415
|
+
props: P(
|
|
416
|
+
v.duplicate,
|
|
559
417
|
"duplicate",
|
|
560
418
|
"複製 (Ctrl+D / Cmd+D)"
|
|
561
419
|
)
|
|
@@ -564,8 +422,8 @@ function lt(e = "canvas-actions") {
|
|
|
564
422
|
id: `${e}-undo`,
|
|
565
423
|
kind: "button",
|
|
566
424
|
layout: { x: 6, y: 0, w: 1, h: 1 },
|
|
567
|
-
props:
|
|
568
|
-
|
|
425
|
+
props: P(
|
|
426
|
+
v.undo,
|
|
569
427
|
"undo",
|
|
570
428
|
"元に戻す (Ctrl+Z / Cmd+Z)"
|
|
571
429
|
)
|
|
@@ -574,8 +432,8 @@ function lt(e = "canvas-actions") {
|
|
|
574
432
|
id: `${e}-redo`,
|
|
575
433
|
kind: "button",
|
|
576
434
|
layout: { x: 7, y: 0, w: 1, h: 1 },
|
|
577
|
-
props:
|
|
578
|
-
|
|
435
|
+
props: P(
|
|
436
|
+
v.redo,
|
|
579
437
|
"redo",
|
|
580
438
|
"やり直し (Ctrl+Y / Cmd+Y)"
|
|
581
439
|
)
|
|
@@ -588,14 +446,14 @@ function lt(e = "canvas-actions") {
|
|
|
588
446
|
plugins: [V]
|
|
589
447
|
};
|
|
590
448
|
}
|
|
591
|
-
const
|
|
592
|
-
function
|
|
449
|
+
const Ct = Ze();
|
|
450
|
+
function Xe(e = "clipboard") {
|
|
593
451
|
return {
|
|
594
452
|
props: {
|
|
595
453
|
book: {
|
|
596
454
|
paper: {
|
|
597
455
|
size: {
|
|
598
|
-
preset:
|
|
456
|
+
preset: A.CUSTOM,
|
|
599
457
|
width: { value: 60, unit: "mm" },
|
|
600
458
|
height: { value: 20, unit: "mm" }
|
|
601
459
|
},
|
|
@@ -614,19 +472,19 @@ function ct(e = "clipboard") {
|
|
|
614
472
|
id: `${e}-copy`,
|
|
615
473
|
kind: "button",
|
|
616
474
|
layout: { x: 0, y: 0, w: 1, h: 1 },
|
|
617
|
-
props:
|
|
475
|
+
props: P(v.copy, "copy")
|
|
618
476
|
},
|
|
619
477
|
{
|
|
620
478
|
id: `${e}-paste`,
|
|
621
479
|
kind: "button",
|
|
622
480
|
layout: { x: 1, y: 0, w: 1, h: 1 },
|
|
623
|
-
props:
|
|
481
|
+
props: P(v.paste, "paste")
|
|
624
482
|
},
|
|
625
483
|
{
|
|
626
484
|
id: `${e}-duplicate`,
|
|
627
485
|
kind: "button",
|
|
628
486
|
layout: { x: 2, y: 0, w: 1, h: 1 },
|
|
629
|
-
props:
|
|
487
|
+
props: P(v.duplicate, "duplicate")
|
|
630
488
|
}
|
|
631
489
|
]
|
|
632
490
|
}
|
|
@@ -636,14 +494,14 @@ function ct(e = "clipboard") {
|
|
|
636
494
|
plugins: [V]
|
|
637
495
|
};
|
|
638
496
|
}
|
|
639
|
-
const
|
|
640
|
-
function
|
|
497
|
+
const St = Xe();
|
|
498
|
+
function Ke(e = "history") {
|
|
641
499
|
return {
|
|
642
500
|
props: {
|
|
643
501
|
book: {
|
|
644
502
|
paper: {
|
|
645
503
|
size: {
|
|
646
|
-
preset:
|
|
504
|
+
preset: A.CUSTOM,
|
|
647
505
|
width: { value: 40, unit: "mm" },
|
|
648
506
|
height: { value: 20, unit: "mm" }
|
|
649
507
|
},
|
|
@@ -662,13 +520,13 @@ function dt(e = "history") {
|
|
|
662
520
|
id: `${e}-undo`,
|
|
663
521
|
kind: "button",
|
|
664
522
|
layout: { x: 0, y: 0, w: 1, h: 1 },
|
|
665
|
-
props:
|
|
523
|
+
props: P(v.undo, "undo")
|
|
666
524
|
},
|
|
667
525
|
{
|
|
668
526
|
id: `${e}-redo`,
|
|
669
527
|
kind: "button",
|
|
670
528
|
layout: { x: 1, y: 0, w: 1, h: 1 },
|
|
671
|
-
props:
|
|
529
|
+
props: P(v.redo, "redo")
|
|
672
530
|
}
|
|
673
531
|
]
|
|
674
532
|
}
|
|
@@ -678,9 +536,9 @@ function dt(e = "history") {
|
|
|
678
536
|
plugins: [V]
|
|
679
537
|
};
|
|
680
538
|
}
|
|
681
|
-
const
|
|
539
|
+
const Bt = Ke(), N = {
|
|
682
540
|
size: {
|
|
683
|
-
preset:
|
|
541
|
+
preset: A.CUSTOM
|
|
684
542
|
},
|
|
685
543
|
margin: {
|
|
686
544
|
top: { value: 0, unit: "mm" },
|
|
@@ -690,17 +548,17 @@ const Rt = dt(), R = {
|
|
|
690
548
|
},
|
|
691
549
|
autoHeight: !0,
|
|
692
550
|
autoWidth: !0
|
|
693
|
-
},
|
|
694
|
-
margin:
|
|
695
|
-
autoHeight:
|
|
696
|
-
autoWidth:
|
|
697
|
-
},
|
|
551
|
+
}, Je = {
|
|
552
|
+
margin: N.margin,
|
|
553
|
+
autoHeight: N.autoHeight,
|
|
554
|
+
autoWidth: N.autoWidth
|
|
555
|
+
}, It = {
|
|
698
556
|
props: {
|
|
699
557
|
book: {
|
|
700
558
|
paper: {
|
|
701
|
-
...
|
|
559
|
+
...Je,
|
|
702
560
|
size: {
|
|
703
|
-
preset:
|
|
561
|
+
preset: A.CUSTOM,
|
|
704
562
|
width: { value: 160, unit: "mm" },
|
|
705
563
|
height: { value: 8, unit: "mm" }
|
|
706
564
|
}
|
|
@@ -728,7 +586,7 @@ const Rt = dt(), R = {
|
|
|
728
586
|
props: { horizontal: "center", vertical: "center" }
|
|
729
587
|
},
|
|
730
588
|
{
|
|
731
|
-
...
|
|
589
|
+
...H("layout-x-value", "layout.x"),
|
|
732
590
|
layout: { x: 1, y: 0, w: 1, h: 1 }
|
|
733
591
|
},
|
|
734
592
|
{
|
|
@@ -747,7 +605,7 @@ const Rt = dt(), R = {
|
|
|
747
605
|
props: { horizontal: "center", vertical: "center" }
|
|
748
606
|
},
|
|
749
607
|
{
|
|
750
|
-
...
|
|
608
|
+
...H("layout-y-value", "layout.y"),
|
|
751
609
|
layout: { x: 4, y: 0, w: 1, h: 1 }
|
|
752
610
|
},
|
|
753
611
|
{
|
|
@@ -766,7 +624,7 @@ const Rt = dt(), R = {
|
|
|
766
624
|
props: { horizontal: "center", vertical: "center" }
|
|
767
625
|
},
|
|
768
626
|
{
|
|
769
|
-
...
|
|
627
|
+
...H("layout-w-value", "layout.w"),
|
|
770
628
|
layout: { x: 7, y: 0, w: 1, h: 1 }
|
|
771
629
|
},
|
|
772
630
|
{
|
|
@@ -785,7 +643,7 @@ const Rt = dt(), R = {
|
|
|
785
643
|
props: { horizontal: "center", vertical: "center" }
|
|
786
644
|
},
|
|
787
645
|
{
|
|
788
|
-
...
|
|
646
|
+
...H("layout-h-value", "layout.h"),
|
|
789
647
|
layout: { x: 10, y: 0, w: 1, h: 1 }
|
|
790
648
|
},
|
|
791
649
|
{
|
|
@@ -799,16 +657,16 @@ const Rt = dt(), R = {
|
|
|
799
657
|
]
|
|
800
658
|
}
|
|
801
659
|
},
|
|
802
|
-
plugins: [
|
|
660
|
+
plugins: [W, re]
|
|
803
661
|
};
|
|
804
|
-
function
|
|
662
|
+
function Qe(e) {
|
|
805
663
|
const { pageIdx: t, pageCount: o } = e, n = t !== void 0 ? String(t + 1) : "—", a = o !== void 0 ? String(o) : "—";
|
|
806
664
|
return {
|
|
807
665
|
props: {
|
|
808
666
|
book: {
|
|
809
667
|
paper: {
|
|
810
668
|
size: {
|
|
811
|
-
preset:
|
|
669
|
+
preset: A.CUSTOM,
|
|
812
670
|
width: { value: 130, unit: "mm" },
|
|
813
671
|
height: { value: 20, unit: "mm" }
|
|
814
672
|
},
|
|
@@ -834,7 +692,7 @@ function pt(e) {
|
|
|
834
692
|
kind: "button",
|
|
835
693
|
layout: { x: 0, y: 0, w: 1, h: 1 },
|
|
836
694
|
props: {
|
|
837
|
-
iconPath:
|
|
695
|
+
iconPath: v.prevPage,
|
|
838
696
|
label: "",
|
|
839
697
|
action: "prev_page"
|
|
840
698
|
}
|
|
@@ -880,7 +738,7 @@ function pt(e) {
|
|
|
880
738
|
kind: "button",
|
|
881
739
|
layout: { x: 4, y: 0, w: 1, h: 1 },
|
|
882
740
|
props: {
|
|
883
|
-
iconPath:
|
|
741
|
+
iconPath: v.nextPage,
|
|
884
742
|
label: "",
|
|
885
743
|
action: "next_page"
|
|
886
744
|
}
|
|
@@ -890,7 +748,7 @@ function pt(e) {
|
|
|
890
748
|
kind: "button",
|
|
891
749
|
layout: { x: 5, y: 0, w: 1, h: 1 },
|
|
892
750
|
props: {
|
|
893
|
-
iconPath:
|
|
751
|
+
iconPath: v.addPage,
|
|
894
752
|
label: "",
|
|
895
753
|
action: "add_page"
|
|
896
754
|
}
|
|
@@ -900,7 +758,7 @@ function pt(e) {
|
|
|
900
758
|
kind: "button",
|
|
901
759
|
layout: { x: 6, y: 0, w: 1, h: 1 },
|
|
902
760
|
props: {
|
|
903
|
-
iconPath:
|
|
761
|
+
iconPath: v.deletePage,
|
|
904
762
|
label: "",
|
|
905
763
|
action: "delete_page"
|
|
906
764
|
}
|
|
@@ -910,17 +768,17 @@ function pt(e) {
|
|
|
910
768
|
]
|
|
911
769
|
}
|
|
912
770
|
},
|
|
913
|
-
plugins: [V,
|
|
771
|
+
plugins: [V, W]
|
|
914
772
|
};
|
|
915
773
|
}
|
|
916
|
-
const
|
|
917
|
-
function
|
|
774
|
+
const Et = Qe({});
|
|
775
|
+
function et(e = "selection") {
|
|
918
776
|
return {
|
|
919
777
|
props: {
|
|
920
778
|
book: {
|
|
921
779
|
paper: {
|
|
922
780
|
size: {
|
|
923
|
-
preset:
|
|
781
|
+
preset: A.CUSTOM,
|
|
924
782
|
width: { value: 60, unit: "mm" },
|
|
925
783
|
height: { value: 20, unit: "mm" }
|
|
926
784
|
},
|
|
@@ -939,19 +797,19 @@ function mt(e = "selection") {
|
|
|
939
797
|
id: `${e}-select-all`,
|
|
940
798
|
kind: "button",
|
|
941
799
|
layout: { x: 0, y: 0, w: 1, h: 1 },
|
|
942
|
-
props:
|
|
800
|
+
props: P(v.selectAll, "select_all")
|
|
943
801
|
},
|
|
944
802
|
{
|
|
945
803
|
id: `${e}-deselect-all`,
|
|
946
804
|
kind: "button",
|
|
947
805
|
layout: { x: 1, y: 0, w: 1, h: 1 },
|
|
948
|
-
props:
|
|
806
|
+
props: P(v.deselectAll, "deselect_all")
|
|
949
807
|
},
|
|
950
808
|
{
|
|
951
809
|
id: `${e}-delete`,
|
|
952
810
|
kind: "button",
|
|
953
811
|
layout: { x: 2, y: 0, w: 1, h: 1 },
|
|
954
|
-
props:
|
|
812
|
+
props: P(v.delete, "delete")
|
|
955
813
|
}
|
|
956
814
|
]
|
|
957
815
|
}
|
|
@@ -961,40 +819,40 @@ function mt(e = "selection") {
|
|
|
961
819
|
plugins: [V]
|
|
962
820
|
};
|
|
963
821
|
}
|
|
964
|
-
const
|
|
822
|
+
const zt = et(), tt = ({
|
|
965
823
|
sections: e = [],
|
|
966
824
|
className: t,
|
|
967
825
|
style: o
|
|
968
|
-
}) => /* @__PURE__ */
|
|
826
|
+
}) => /* @__PURE__ */ c(
|
|
969
827
|
"div",
|
|
970
828
|
{
|
|
971
|
-
className: `${
|
|
829
|
+
className: `${U.container}${t ? ` ${t}` : ""}`,
|
|
972
830
|
style: o,
|
|
973
831
|
"data-testid": "action-bar",
|
|
974
832
|
children: e.map((n, a) => {
|
|
975
|
-
const i =
|
|
976
|
-
return /* @__PURE__ */ M(
|
|
977
|
-
a > 0 && /* @__PURE__ */
|
|
978
|
-
/* @__PURE__ */
|
|
833
|
+
const i = ge(n) && n.key != null ? n.key : `section-${a}`;
|
|
834
|
+
return /* @__PURE__ */ M(ye, { children: [
|
|
835
|
+
a > 0 && /* @__PURE__ */ c(Ce, {}),
|
|
836
|
+
/* @__PURE__ */ c("div", { className: U.section, children: n })
|
|
979
837
|
] }, i);
|
|
980
838
|
})
|
|
981
839
|
}
|
|
982
840
|
);
|
|
983
|
-
|
|
984
|
-
const
|
|
985
|
-
printContainer:
|
|
986
|
-
pageBreak:
|
|
987
|
-
},
|
|
841
|
+
tt.displayName = "ActionBar";
|
|
842
|
+
const ot = "_printContainer_e2bnt_1", nt = "_pageBreak_e2bnt_6", G = {
|
|
843
|
+
printContainer: ot,
|
|
844
|
+
pageBreak: nt
|
|
845
|
+
}, K = Y(
|
|
988
846
|
({ page: e, paper: t, values: o, pluginRegistry: n }) => {
|
|
989
|
-
const { paperPx: a, getBlockRectPx: i } =
|
|
847
|
+
const { paperPx: a, getBlockRectPx: i } = ke(
|
|
990
848
|
t,
|
|
991
849
|
e.grid,
|
|
992
|
-
|
|
993
|
-
),
|
|
994
|
-
} } : void 0,
|
|
995
|
-
(
|
|
850
|
+
fe
|
|
851
|
+
), g = o ? { get: (h) => o[h] ?? null, set: () => {
|
|
852
|
+
} } : void 0, l = e.blocks.filter(
|
|
853
|
+
(h) => !de(h.hiddenBinding, g)
|
|
996
854
|
);
|
|
997
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ c(
|
|
998
856
|
"div",
|
|
999
857
|
{
|
|
1000
858
|
style: {
|
|
@@ -1003,12 +861,12 @@ const yt = "_printContainer_e2bnt_1", ht = "_pageBreak_e2bnt_6", q = {
|
|
|
1003
861
|
height: `${a.canvas.height}px`,
|
|
1004
862
|
backgroundColor: "#fff"
|
|
1005
863
|
},
|
|
1006
|
-
children: /* @__PURE__ */
|
|
1007
|
-
|
|
864
|
+
children: /* @__PURE__ */ c(
|
|
865
|
+
ue,
|
|
1008
866
|
{
|
|
1009
|
-
blocks:
|
|
867
|
+
blocks: l,
|
|
1010
868
|
pluginRegistry: n,
|
|
1011
|
-
mode:
|
|
869
|
+
mode: Z.VIEW,
|
|
1012
870
|
values: o ?? {},
|
|
1013
871
|
blockDefaults: e.blockDefaults,
|
|
1014
872
|
getBlockRectPx: i,
|
|
@@ -1020,58 +878,58 @@ const yt = "_printContainer_e2bnt_1", ht = "_pageBreak_e2bnt_6", q = {
|
|
|
1020
878
|
);
|
|
1021
879
|
}
|
|
1022
880
|
);
|
|
1023
|
-
|
|
1024
|
-
const
|
|
1025
|
-
({ book: e, values: t, pluginRegistry: o, printSettings: n, className: a, style: i },
|
|
1026
|
-
const
|
|
1027
|
-
|
|
881
|
+
K.displayName = "PrintPage";
|
|
882
|
+
const J = he(
|
|
883
|
+
({ book: e, values: t, pluginRegistry: o, printSettings: n, className: a, style: i }, g) => {
|
|
884
|
+
const l = le(e, n), h = ce(
|
|
885
|
+
l,
|
|
1028
886
|
n == null ? void 0 : n.margin
|
|
1029
887
|
);
|
|
1030
|
-
return
|
|
1031
|
-
var
|
|
1032
|
-
(
|
|
1033
|
-
const p = document.createElement("style");
|
|
1034
|
-
p.id = "printable-note-page-style", p.textContent = m, document.head.appendChild(p);
|
|
888
|
+
return ve(() => {
|
|
889
|
+
var f, b;
|
|
890
|
+
(f = document.getElementById("printable-note-page-style")) == null || f.remove(), (b = document.getElementById("tatamicks-book-page-style")) == null || b.remove();
|
|
1035
891
|
const u = document.createElement("style");
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
892
|
+
u.id = "printable-note-page-style", u.textContent = h, document.head.appendChild(u);
|
|
893
|
+
const p = document.createElement("style");
|
|
894
|
+
return p.id = "tatamicks-book-page-style", p.textContent = h, document.head.appendChild(p), () => {
|
|
895
|
+
var w, S;
|
|
896
|
+
(w = document.getElementById("printable-note-page-style")) == null || w.remove(), (S = document.getElementById("tatamicks-book-page-style")) == null || S.remove();
|
|
1039
897
|
};
|
|
1040
|
-
}, [
|
|
898
|
+
}, [h]), /* @__PURE__ */ c(
|
|
1041
899
|
"div",
|
|
1042
900
|
{
|
|
1043
|
-
ref:
|
|
1044
|
-
className: [
|
|
901
|
+
ref: g,
|
|
902
|
+
className: [G.printContainer, a].filter(Boolean).join(" "),
|
|
1045
903
|
style: i,
|
|
1046
|
-
children: e.pages.map((
|
|
1047
|
-
const
|
|
1048
|
-
return /* @__PURE__ */
|
|
904
|
+
children: e.pages.map((u, p) => {
|
|
905
|
+
const f = u.id ?? (u.blocks.map((b) => b.id).join("_") || `page-${p}`);
|
|
906
|
+
return /* @__PURE__ */ c(
|
|
1049
907
|
"div",
|
|
1050
908
|
{
|
|
1051
|
-
className:
|
|
1052
|
-
children: /* @__PURE__ */
|
|
1053
|
-
|
|
909
|
+
className: p < e.pages.length - 1 ? G.pageBreak : void 0,
|
|
910
|
+
children: /* @__PURE__ */ c(
|
|
911
|
+
K,
|
|
1054
912
|
{
|
|
1055
|
-
page:
|
|
1056
|
-
paper:
|
|
913
|
+
page: u,
|
|
914
|
+
paper: l,
|
|
1057
915
|
values: t,
|
|
1058
916
|
pluginRegistry: o
|
|
1059
917
|
}
|
|
1060
918
|
)
|
|
1061
919
|
},
|
|
1062
|
-
|
|
920
|
+
f
|
|
1063
921
|
);
|
|
1064
922
|
})
|
|
1065
923
|
}
|
|
1066
924
|
);
|
|
1067
925
|
}
|
|
1068
926
|
);
|
|
1069
|
-
|
|
1070
|
-
const
|
|
1071
|
-
function
|
|
927
|
+
J.displayName = "NotePrint";
|
|
928
|
+
const at = Y(J);
|
|
929
|
+
function it(e) {
|
|
1072
930
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1073
931
|
}
|
|
1074
|
-
function
|
|
932
|
+
function st(e, t) {
|
|
1075
933
|
const o = document.title, n = document.createElement("iframe");
|
|
1076
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);
|
|
1077
935
|
const a = n.contentWindow, i = n.contentDocument ?? (a == null ? void 0 : a.document);
|
|
@@ -1079,53 +937,53 @@ function vt(e, t) {
|
|
|
1079
937
|
document.body.removeChild(n);
|
|
1080
938
|
return;
|
|
1081
939
|
}
|
|
1082
|
-
const
|
|
1083
|
-
`),
|
|
940
|
+
const g = Array.from(document.querySelectorAll("style")).map((p) => p.outerHTML).join(`
|
|
941
|
+
`), l = Array.from(
|
|
1084
942
|
document.querySelectorAll('link[rel="stylesheet"]')
|
|
1085
|
-
).map((
|
|
1086
|
-
`),
|
|
943
|
+
).map((p) => p.outerHTML).join(`
|
|
944
|
+
`), h = e.innerHTML;
|
|
1087
945
|
i.open(), i.write(
|
|
1088
|
-
`<!DOCTYPE html><html><head><meta charset="utf-8" /><title>${
|
|
946
|
+
`<!DOCTYPE html><html><head><meta charset="utf-8" /><title>${it(o)}</title>${l}${g}<style>*{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;}</style></head><body>${h}</body></html>`
|
|
1089
947
|
), i.close();
|
|
1090
|
-
const
|
|
948
|
+
const u = () => {
|
|
1091
949
|
document.body.contains(n) && document.body.removeChild(n);
|
|
1092
950
|
};
|
|
1093
951
|
a.addEventListener("afterprint", () => {
|
|
1094
|
-
|
|
952
|
+
u();
|
|
1095
953
|
}), setTimeout(() => {
|
|
1096
954
|
a.focus(), a.print();
|
|
1097
955
|
}, 0);
|
|
1098
956
|
}
|
|
1099
|
-
function
|
|
957
|
+
function rt(e, t, o, n) {
|
|
1100
958
|
const a = document.createElement("div");
|
|
1101
959
|
a.style.cssText = "position:absolute;top:-9999px;left:-9999px;", document.body.appendChild(a);
|
|
1102
|
-
const i =
|
|
1103
|
-
|
|
960
|
+
const i = Pe(a);
|
|
961
|
+
xe(() => {
|
|
1104
962
|
i.render(
|
|
1105
|
-
|
|
963
|
+
be(at, { book: e, values: t, pluginRegistry: o, printSettings: n })
|
|
1106
964
|
);
|
|
1107
|
-
}),
|
|
965
|
+
}), st(a), i.unmount(), document.body.removeChild(a);
|
|
1108
966
|
}
|
|
1109
|
-
function
|
|
1110
|
-
|
|
967
|
+
function lt(e, t) {
|
|
968
|
+
rt(
|
|
1111
969
|
e.book,
|
|
1112
970
|
e.values,
|
|
1113
971
|
e.pluginRegistry,
|
|
1114
972
|
t
|
|
1115
973
|
);
|
|
1116
974
|
}
|
|
1117
|
-
const
|
|
975
|
+
const Q = ({
|
|
1118
976
|
pageIdx: e,
|
|
1119
977
|
pageCount: t,
|
|
1120
978
|
onPageChange: o,
|
|
1121
979
|
onAddPage: n,
|
|
1122
980
|
onDeletePage: a,
|
|
1123
981
|
canDeletePage: i = !0
|
|
1124
|
-
}) => /* @__PURE__ */ M(
|
|
1125
|
-
/* @__PURE__ */
|
|
1126
|
-
|
|
982
|
+
}) => /* @__PURE__ */ M(we, { children: [
|
|
983
|
+
/* @__PURE__ */ c(
|
|
984
|
+
O,
|
|
1127
985
|
{
|
|
1128
|
-
icon: /* @__PURE__ */
|
|
986
|
+
icon: /* @__PURE__ */ c(Se, { "aria-hidden": "true" }),
|
|
1129
987
|
label: "前のページへ",
|
|
1130
988
|
title: "前のページへ",
|
|
1131
989
|
onClick: () => o(Math.max(0, e - 1)),
|
|
@@ -1133,15 +991,15 @@ const oe = ({
|
|
|
1133
991
|
preventFocusOnMouseDown: !0
|
|
1134
992
|
}
|
|
1135
993
|
),
|
|
1136
|
-
/* @__PURE__ */ M("span", { className:
|
|
994
|
+
/* @__PURE__ */ M("span", { className: U.sectionLabel, children: [
|
|
1137
995
|
e + 1,
|
|
1138
996
|
" / ",
|
|
1139
997
|
t
|
|
1140
998
|
] }),
|
|
1141
|
-
/* @__PURE__ */
|
|
1142
|
-
|
|
999
|
+
/* @__PURE__ */ c(
|
|
1000
|
+
O,
|
|
1143
1001
|
{
|
|
1144
|
-
icon: /* @__PURE__ */
|
|
1002
|
+
icon: /* @__PURE__ */ c(Be, { "aria-hidden": "true" }),
|
|
1145
1003
|
label: "次のページへ",
|
|
1146
1004
|
title: "次のページへ",
|
|
1147
1005
|
onClick: () => o(Math.min(t - 1, e + 1)),
|
|
@@ -1149,20 +1007,20 @@ const oe = ({
|
|
|
1149
1007
|
preventFocusOnMouseDown: !0
|
|
1150
1008
|
}
|
|
1151
1009
|
),
|
|
1152
|
-
n !== void 0 && /* @__PURE__ */
|
|
1153
|
-
|
|
1010
|
+
n !== void 0 && /* @__PURE__ */ c(
|
|
1011
|
+
O,
|
|
1154
1012
|
{
|
|
1155
|
-
icon: /* @__PURE__ */
|
|
1013
|
+
icon: /* @__PURE__ */ c(Ie, { "aria-hidden": "true" }),
|
|
1156
1014
|
label: "ページを追加",
|
|
1157
1015
|
title: "ページを追加",
|
|
1158
1016
|
onClick: n,
|
|
1159
1017
|
preventFocusOnMouseDown: !0
|
|
1160
1018
|
}
|
|
1161
1019
|
),
|
|
1162
|
-
a !== void 0 && /* @__PURE__ */
|
|
1163
|
-
|
|
1020
|
+
a !== void 0 && /* @__PURE__ */ c(
|
|
1021
|
+
O,
|
|
1164
1022
|
{
|
|
1165
|
-
icon: /* @__PURE__ */
|
|
1023
|
+
icon: /* @__PURE__ */ c(Ee, { "aria-hidden": "true" }),
|
|
1166
1024
|
label: "ページを削除",
|
|
1167
1025
|
title: "ページを削除",
|
|
1168
1026
|
onClick: a,
|
|
@@ -1171,94 +1029,94 @@ const oe = ({
|
|
|
1171
1029
|
}
|
|
1172
1030
|
)
|
|
1173
1031
|
] });
|
|
1174
|
-
|
|
1175
|
-
function
|
|
1032
|
+
Q.displayName = "PageNavigationSection";
|
|
1033
|
+
function At({
|
|
1176
1034
|
context: e,
|
|
1177
1035
|
onActionFeedback: t,
|
|
1178
1036
|
onPrint: o
|
|
1179
1037
|
}) {
|
|
1180
|
-
const { actionContext: n } = e, { book: a, onBookChange: i } = e,
|
|
1181
|
-
/* @__PURE__ */
|
|
1182
|
-
|
|
1038
|
+
const { actionContext: n } = e, { book: a, onBookChange: i } = e, l = e.editorState.pageIdx, h = a.pages[l] ?? a.pages[0], u = [
|
|
1039
|
+
/* @__PURE__ */ c(
|
|
1040
|
+
ze,
|
|
1183
1041
|
{
|
|
1184
1042
|
actionContext: n,
|
|
1185
1043
|
onActionFeedback: t,
|
|
1186
|
-
onPrint: o ?? (() =>
|
|
1044
|
+
onPrint: o ?? (() => lt(e))
|
|
1187
1045
|
},
|
|
1188
1046
|
"canvas"
|
|
1189
1047
|
),
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
|
|
1048
|
+
/* @__PURE__ */ c(
|
|
1049
|
+
Ae,
|
|
1192
1050
|
{
|
|
1193
1051
|
paper: a.paper,
|
|
1194
|
-
onPaperChange: (
|
|
1052
|
+
onPaperChange: (p) => i({ ...a, paper: p })
|
|
1195
1053
|
},
|
|
1196
1054
|
"paper"
|
|
1197
1055
|
),
|
|
1198
|
-
/* @__PURE__ */
|
|
1199
|
-
|
|
1056
|
+
/* @__PURE__ */ c(
|
|
1057
|
+
De,
|
|
1200
1058
|
{
|
|
1201
|
-
grid:
|
|
1202
|
-
onGridChange: (
|
|
1203
|
-
const
|
|
1204
|
-
(
|
|
1059
|
+
grid: h.grid,
|
|
1060
|
+
onGridChange: (p) => {
|
|
1061
|
+
const f = a.pages.map(
|
|
1062
|
+
(b, w) => w === l ? { ...b, grid: p } : b
|
|
1205
1063
|
);
|
|
1206
|
-
i({ ...a, pages:
|
|
1064
|
+
i({ ...a, pages: f });
|
|
1207
1065
|
}
|
|
1208
1066
|
},
|
|
1209
1067
|
"grid"
|
|
1210
1068
|
)
|
|
1211
1069
|
];
|
|
1212
|
-
return
|
|
1213
|
-
/* @__PURE__ */
|
|
1214
|
-
|
|
1070
|
+
return u.push(
|
|
1071
|
+
/* @__PURE__ */ c(
|
|
1072
|
+
Q,
|
|
1215
1073
|
{
|
|
1216
|
-
pageIdx:
|
|
1074
|
+
pageIdx: l,
|
|
1217
1075
|
pageCount: a.pages.length,
|
|
1218
|
-
onPageChange: (
|
|
1076
|
+
onPageChange: (p) => n.execute("goToPage", p),
|
|
1219
1077
|
onAddPage: () => n.execute("addPage"),
|
|
1220
1078
|
onDeletePage: () => n.execute("deletePage"),
|
|
1221
1079
|
canDeletePage: a.pages.length > 1
|
|
1222
1080
|
},
|
|
1223
1081
|
"page-nav"
|
|
1224
1082
|
)
|
|
1225
|
-
),
|
|
1083
|
+
), u;
|
|
1226
1084
|
}
|
|
1227
|
-
const
|
|
1085
|
+
const ct = ({
|
|
1228
1086
|
context: e,
|
|
1229
1087
|
gridSize: t,
|
|
1230
1088
|
isDragging: o,
|
|
1231
1089
|
zIndex: n,
|
|
1232
1090
|
onActionFeedback: a
|
|
1233
1091
|
}) => {
|
|
1234
|
-
const { book: i, containerRef:
|
|
1235
|
-
const
|
|
1236
|
-
i.pages.flatMap((
|
|
1092
|
+
const { book: i, containerRef: g } = e, l = e.editorState, h = T(null), u = l.selectedBlockIds ?? [], p = z(() => {
|
|
1093
|
+
const b = new Set(
|
|
1094
|
+
i.pages.flatMap((w) => w.blocks.map((S) => S.id))
|
|
1237
1095
|
);
|
|
1238
|
-
return
|
|
1239
|
-
}, [
|
|
1240
|
-
return /* @__PURE__ */
|
|
1241
|
-
|
|
1096
|
+
return u.filter((w) => b.has(w));
|
|
1097
|
+
}, [u, i]), f = Te(g ?? h, p) ?? null;
|
|
1098
|
+
return /* @__PURE__ */ c(
|
|
1099
|
+
Me,
|
|
1242
1100
|
{
|
|
1243
|
-
selectionBoundingBox:
|
|
1101
|
+
selectionBoundingBox: f,
|
|
1244
1102
|
isDragging: o,
|
|
1245
1103
|
zIndex: n,
|
|
1246
|
-
children: /* @__PURE__ */
|
|
1247
|
-
|
|
1104
|
+
children: /* @__PURE__ */ c(
|
|
1105
|
+
_e,
|
|
1248
1106
|
{
|
|
1249
|
-
items:
|
|
1107
|
+
items: Ve({
|
|
1250
1108
|
context: e,
|
|
1251
1109
|
gridSize: t,
|
|
1252
1110
|
onActionFeedback: a
|
|
1253
1111
|
}),
|
|
1254
|
-
onPointerDown: (
|
|
1112
|
+
onPointerDown: (b) => b.stopPropagation()
|
|
1255
1113
|
}
|
|
1256
1114
|
)
|
|
1257
1115
|
}
|
|
1258
1116
|
);
|
|
1259
1117
|
};
|
|
1260
|
-
|
|
1261
|
-
function
|
|
1118
|
+
ct.displayName = "DefaultSelectionActionBarOverlay";
|
|
1119
|
+
function Dt({
|
|
1262
1120
|
context: e,
|
|
1263
1121
|
gridSize: t,
|
|
1264
1122
|
onBlockHover: o,
|
|
@@ -1269,13 +1127,13 @@ function Wt({
|
|
|
1269
1127
|
{
|
|
1270
1128
|
value: "block",
|
|
1271
1129
|
label: "ブロック",
|
|
1272
|
-
content: (e.editorState.selectedBlockIds ?? []).length > 0 ? /* @__PURE__ */
|
|
1130
|
+
content: (e.editorState.selectedBlockIds ?? []).length > 0 ? /* @__PURE__ */ c(Le, { context: e, gridSize: t }) : /* @__PURE__ */ c(He, { context: e })
|
|
1273
1131
|
},
|
|
1274
1132
|
{
|
|
1275
1133
|
value: "canvas",
|
|
1276
1134
|
label: "キャンバス",
|
|
1277
|
-
content: /* @__PURE__ */
|
|
1278
|
-
|
|
1135
|
+
content: /* @__PURE__ */ c(
|
|
1136
|
+
Oe,
|
|
1279
1137
|
{
|
|
1280
1138
|
context: e,
|
|
1281
1139
|
onBlockHover: o,
|
|
@@ -1287,29 +1145,29 @@ function Wt({
|
|
|
1287
1145
|
{
|
|
1288
1146
|
value: "other",
|
|
1289
1147
|
label: "その他",
|
|
1290
|
-
content: /* @__PURE__ */
|
|
1148
|
+
content: /* @__PURE__ */ c(Re, { context: e })
|
|
1291
1149
|
}
|
|
1292
1150
|
];
|
|
1293
1151
|
}
|
|
1294
|
-
const
|
|
1295
|
-
container:
|
|
1296
|
-
tabHeader:
|
|
1297
|
-
tabContent:
|
|
1298
|
-
},
|
|
1152
|
+
const dt = "_container_ymana_1", ut = "_tabHeader_ymana_12", pt = "_tabContent_ymana_19", $ = {
|
|
1153
|
+
container: dt,
|
|
1154
|
+
tabHeader: ut,
|
|
1155
|
+
tabContent: pt
|
|
1156
|
+
}, mt = ({ tabs: e, defaultTab: t, className: o }) => {
|
|
1299
1157
|
var a;
|
|
1300
1158
|
const n = t ?? ((a = e[0]) == null ? void 0 : a.value) ?? "";
|
|
1301
|
-
return /* @__PURE__ */
|
|
1159
|
+
return /* @__PURE__ */ c(
|
|
1302
1160
|
"div",
|
|
1303
1161
|
{
|
|
1304
|
-
className: `${
|
|
1305
|
-
...
|
|
1306
|
-
children: /* @__PURE__ */ M(
|
|
1307
|
-
/* @__PURE__ */
|
|
1308
|
-
e.map((i) => /* @__PURE__ */
|
|
1309
|
-
|
|
1162
|
+
className: `${$.container} ${o || ""}`,
|
|
1163
|
+
...X,
|
|
1164
|
+
children: /* @__PURE__ */ M(Ne, { defaultValue: n, variant: "default", children: [
|
|
1165
|
+
/* @__PURE__ */ c($e, { className: $.tabHeader, children: e.map((i) => /* @__PURE__ */ c(Ue, { value: i.value, children: i.label }, i.value)) }),
|
|
1166
|
+
e.map((i) => /* @__PURE__ */ c(
|
|
1167
|
+
We,
|
|
1310
1168
|
{
|
|
1311
1169
|
value: i.value,
|
|
1312
|
-
className:
|
|
1170
|
+
className: $.tabContent,
|
|
1313
1171
|
children: i.content
|
|
1314
1172
|
},
|
|
1315
1173
|
i.value
|
|
@@ -1318,67 +1176,67 @@ const Pt = "_container_ymana_1", Ct = "_tabHeader_ymana_12", St = "_tabContent_y
|
|
|
1318
1176
|
}
|
|
1319
1177
|
);
|
|
1320
1178
|
};
|
|
1321
|
-
|
|
1322
|
-
const
|
|
1179
|
+
mt.displayName = "Sidebar";
|
|
1180
|
+
const gt = {
|
|
1323
1181
|
selectedBlockIds: [],
|
|
1324
1182
|
pageIdx: 0
|
|
1325
1183
|
};
|
|
1326
|
-
function
|
|
1184
|
+
function Tt({
|
|
1327
1185
|
label: e,
|
|
1328
1186
|
widget: t,
|
|
1329
1187
|
extraPlugins: o,
|
|
1330
1188
|
position: n,
|
|
1331
1189
|
isDragging: a,
|
|
1332
1190
|
onTitlePointerDown: i,
|
|
1333
|
-
onClose:
|
|
1334
|
-
onContainerPointerDown:
|
|
1335
|
-
style:
|
|
1336
|
-
context:
|
|
1191
|
+
onClose: g,
|
|
1192
|
+
onContainerPointerDown: l,
|
|
1193
|
+
style: h,
|
|
1194
|
+
context: u
|
|
1337
1195
|
}) {
|
|
1338
|
-
const
|
|
1339
|
-
() =>
|
|
1196
|
+
const p = z(
|
|
1197
|
+
() => je([...t.plugins, ...o ?? []]),
|
|
1340
1198
|
[t.plugins, o]
|
|
1341
|
-
),
|
|
1199
|
+
), f = T(null), b = z(
|
|
1342
1200
|
() => ({
|
|
1343
|
-
get: (
|
|
1344
|
-
set: (
|
|
1201
|
+
get: (r) => (u.book, u.bindingContext.get(r)),
|
|
1202
|
+
set: (r, m) => u.bindingContext.set(r, m)
|
|
1345
1203
|
}),
|
|
1346
|
-
[
|
|
1347
|
-
),
|
|
1204
|
+
[u.bindingContext, u.book]
|
|
1205
|
+
), w = z(
|
|
1348
1206
|
() => ({
|
|
1349
1207
|
book: t.props.book,
|
|
1350
1208
|
onBookChange: () => {
|
|
1351
1209
|
},
|
|
1352
|
-
pluginRegistry:
|
|
1353
|
-
containerRef:
|
|
1354
|
-
bindingContext:
|
|
1355
|
-
actionContext:
|
|
1356
|
-
editorState:
|
|
1210
|
+
pluginRegistry: p,
|
|
1211
|
+
containerRef: f,
|
|
1212
|
+
bindingContext: b,
|
|
1213
|
+
actionContext: u.actionContext,
|
|
1214
|
+
editorState: gt,
|
|
1357
1215
|
values: {}
|
|
1358
1216
|
}),
|
|
1359
1217
|
[
|
|
1360
1218
|
t.props.book,
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1219
|
+
p,
|
|
1220
|
+
b,
|
|
1221
|
+
u.actionContext
|
|
1364
1222
|
]
|
|
1365
|
-
), [S,
|
|
1366
|
-
|
|
1367
|
-
const
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1370
|
-
Math.max(0.25, Math.min(2, _.current.zoom +
|
|
1223
|
+
), [S, D] = q(0.5), _ = T({ x: 0, zoom: 0.5 }), s = (r) => {
|
|
1224
|
+
r.preventDefault(), r.stopPropagation(), _.current = { x: r.clientX, zoom: S };
|
|
1225
|
+
const m = (y) => {
|
|
1226
|
+
const k = y.clientX - _.current.x;
|
|
1227
|
+
D(
|
|
1228
|
+
Math.max(0.25, Math.min(2, _.current.zoom + k / 400))
|
|
1371
1229
|
);
|
|
1372
|
-
},
|
|
1373
|
-
window.removeEventListener("pointermove",
|
|
1230
|
+
}, d = () => {
|
|
1231
|
+
window.removeEventListener("pointermove", m), window.removeEventListener("pointerup", d);
|
|
1374
1232
|
};
|
|
1375
|
-
window.addEventListener("pointermove",
|
|
1233
|
+
window.addEventListener("pointermove", m), window.addEventListener("pointerup", d);
|
|
1376
1234
|
};
|
|
1377
1235
|
return /* @__PURE__ */ M(
|
|
1378
1236
|
"div",
|
|
1379
1237
|
{
|
|
1380
|
-
onPointerDown:
|
|
1381
|
-
...
|
|
1238
|
+
onPointerDown: l,
|
|
1239
|
+
...X,
|
|
1382
1240
|
style: {
|
|
1383
1241
|
position: "fixed",
|
|
1384
1242
|
left: n.x,
|
|
@@ -1388,7 +1246,7 @@ function Gt({
|
|
|
1388
1246
|
border: "1px solid #d1d5db",
|
|
1389
1247
|
borderRadius: 6,
|
|
1390
1248
|
boxShadow: a ? "0 8px 24px rgba(0,0,0,0.2)" : "0 2px 8px rgba(0,0,0,0.12)",
|
|
1391
|
-
...
|
|
1249
|
+
...h
|
|
1392
1250
|
},
|
|
1393
1251
|
children: [
|
|
1394
1252
|
/* @__PURE__ */ M(
|
|
@@ -1408,13 +1266,13 @@ function Gt({
|
|
|
1408
1266
|
},
|
|
1409
1267
|
onPointerDown: i,
|
|
1410
1268
|
children: [
|
|
1411
|
-
/* @__PURE__ */
|
|
1412
|
-
/* @__PURE__ */
|
|
1269
|
+
/* @__PURE__ */ c("span", { style: { fontSize: 11, color: "#555", whiteSpace: "nowrap" }, children: e }),
|
|
1270
|
+
/* @__PURE__ */ c(
|
|
1413
1271
|
"button",
|
|
1414
1272
|
{
|
|
1415
1273
|
type: "button",
|
|
1416
|
-
onPointerDown: (
|
|
1417
|
-
onClick:
|
|
1274
|
+
onPointerDown: (r) => r.stopPropagation(),
|
|
1275
|
+
onClick: g,
|
|
1418
1276
|
style: {
|
|
1419
1277
|
background: "none",
|
|
1420
1278
|
border: "none",
|
|
@@ -1430,8 +1288,8 @@ function Gt({
|
|
|
1430
1288
|
]
|
|
1431
1289
|
}
|
|
1432
1290
|
),
|
|
1433
|
-
/* @__PURE__ */
|
|
1434
|
-
/* @__PURE__ */
|
|
1291
|
+
/* @__PURE__ */ c("div", { style: { pointerEvents: a ? "none" : "auto", zoom: S }, children: /* @__PURE__ */ c(pe, { mode: Z.EDIT, context: w }) }),
|
|
1292
|
+
/* @__PURE__ */ c(
|
|
1435
1293
|
"div",
|
|
1436
1294
|
{
|
|
1437
1295
|
onPointerDown: s,
|
|
@@ -1452,64 +1310,65 @@ function Gt({
|
|
|
1452
1310
|
);
|
|
1453
1311
|
}
|
|
1454
1312
|
export {
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1313
|
+
tt as ActionBar,
|
|
1314
|
+
Pt as BASE_PLUGINS,
|
|
1315
|
+
ee as CheckboxPlugin,
|
|
1316
|
+
Vt as DEFAULT_BOOK,
|
|
1317
|
+
Zt as DEFAULT_GRID,
|
|
1318
|
+
Lt as DEFAULT_PAGE,
|
|
1319
|
+
Xt as DEFAULT_PAPER,
|
|
1320
|
+
Kt as DEFAULT_PAPER_MARGIN,
|
|
1321
|
+
Jt as DEFAULT_PAPER_SIZES,
|
|
1322
|
+
ct as DefaultSelectionActionBarOverlay,
|
|
1323
|
+
Tt as FloatingWidget,
|
|
1324
|
+
Qt as LineType,
|
|
1325
|
+
pe as Note,
|
|
1326
|
+
Ht as NoteEdit,
|
|
1327
|
+
Ot as NoteForm,
|
|
1328
|
+
Z as NoteMode,
|
|
1329
|
+
Rt as NoteView,
|
|
1330
|
+
A as PaperSizePreset,
|
|
1331
|
+
te as SelectPlugin,
|
|
1332
|
+
mt as Sidebar,
|
|
1333
|
+
W as TextPlugin,
|
|
1334
|
+
Nt as ValidationSeverity,
|
|
1335
|
+
$t as addPage,
|
|
1336
|
+
It as blockLayoutWidget,
|
|
1337
|
+
Ct as canvasActionsWidget,
|
|
1338
|
+
Ut as cleanValues,
|
|
1339
|
+
St as clipboardWidget,
|
|
1340
|
+
j as createBlockId,
|
|
1341
|
+
Ze as createCanvasActionsWidget,
|
|
1342
|
+
Xe as createClipboardWidget,
|
|
1343
|
+
Ke as createHistoryWidget,
|
|
1344
|
+
Qe as createPageNavigationWidget,
|
|
1345
|
+
je as createPluginRegistry,
|
|
1346
|
+
et as createSelectionDeleteWidget,
|
|
1347
|
+
eo as deserializeBook,
|
|
1348
|
+
to as deserializePage,
|
|
1349
|
+
oo as deserializeValues,
|
|
1350
|
+
Wt as ensurePageIds,
|
|
1351
|
+
At as getDefaultActionBarSections,
|
|
1352
|
+
Dt as getDefaultSidebarTabs,
|
|
1353
|
+
Ft as gridSettingsWidget,
|
|
1354
|
+
Bt as historyWidget,
|
|
1355
|
+
oe as insertPage,
|
|
1356
|
+
no as isBook,
|
|
1357
|
+
ao as isLegacyFormSchema,
|
|
1358
|
+
io as migrate,
|
|
1359
|
+
so as migrateBook,
|
|
1360
|
+
ro as migrateFormSchemaToBook,
|
|
1361
|
+
lo as migratePage,
|
|
1362
|
+
jt as movePage,
|
|
1363
|
+
Et as pageNavigationWidget,
|
|
1364
|
+
Gt as paperSettingsWidget,
|
|
1365
|
+
co as parseBook,
|
|
1366
|
+
lt as printNote,
|
|
1367
|
+
ne as removePage,
|
|
1368
|
+
zt as selectionDeleteWidget,
|
|
1369
|
+
uo as serializeBook,
|
|
1370
|
+
po as serializePage,
|
|
1371
|
+
L as setPage,
|
|
1372
|
+
wt as useNoteContext,
|
|
1373
|
+
qt as validateBook
|
|
1515
1374
|
};
|