@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/index.mjs CHANGED
@@ -1,19 +1,19 @@
1
- import { C as ne, S as ae, T as F, s as O, c as W, i as ie, r as re, u as se, a as le, b as ce, B as V, d as de, n as L, e as ue, f as pe, g as me, h as ge, N as ye } from "./paperSettingsWidget-DgDoBA0P.js";
2
- import { D as Zt, j as Xt, k as Jt, l as Kt, m as Qt, V as eo, o as to, p as oo, q as no, t as ao, v as io, w as ro, x as so } from "./paperSettingsWidget-DgDoBA0P.js";
3
- import { useReducer as he, useRef as T, useCallback as I, useMemo as D, useState as Y, isValidElement as be, Fragment as fe, memo as Z, forwardRef as ve, useEffect as ke, createElement as xe } from "react";
4
- import { P as E, u as we, D as Pe, N as X, S as J } from "./sidebarPortal-C06y4JSP.js";
5
- import { a as co, b as uo, c as po, d as mo, L as go, e as yo, f as ho, g as bo, p as fo, s as vo, h as ko } from "./sidebarPortal-C06y4JSP.js";
6
- import { flushSync as Ce } from "react-dom";
7
- import { createRoot as Se } from "react-dom/client";
8
- import { jsx as d, jsxs as M, Fragment as Be } from "react/jsx-runtime";
9
- import { s as $, A as Ie, I as N, C as Ae, a as De, b as Ee, D as ze, c as Te, P as Me, G as _e, u as Ve, S as Oe, d as Le, g as Ne, e as He, f as Re, h as je, O as $e, T as Fe, i as Ue, j as We, k as Ge } from "./PalettePanel-CtXsH6Cb.js";
10
- import './index.css';function qe(e) {
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 Ye(e) {
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: qe(o),
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 Ze = {
54
- "flex-start": "left",
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 rt = {
64
+ const qe = {
207
65
  selectedBlockIds: [],
208
66
  pageIdx: 0,
209
67
  clipboard: []
210
68
  };
211
- function st({
69
+ function Ye({
212
70
  book: e,
213
71
  handleBookChange: t
214
72
  }) {
215
- const [o, n] = he(
216
- it,
217
- rt
218
- ), { selectedBlockIds: a, pageIdx: i } = o, c = T(e);
219
- c.current = e;
220
- const r = T(o);
221
- r.current = o;
222
- const m = I(
223
- (s, l) => {
224
- const y = c.current, g = r.current.pageIdx, h = y.pages[g];
225
- if (!h) return;
226
- const v = h.blocks.map((B) => {
227
- const A = s[B.id];
228
- return A ? { ...B, ...A } : B;
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
- O(y, g, { ...h, blocks: v }),
232
- l
89
+ L(m, d, { ...y, blocks: k }),
90
+ r
233
91
  );
234
- const x = r.current.selectedBlockIds, C = x.map((B) => {
235
- var U;
236
- const A = (U = s[B]) == null ? void 0 : U.id;
237
- return typeof A == "string" ? A : B;
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, A) => B !== x[A]) && n({ type: "setSelectedBlockIds", ids: C });
97
+ C.some((B, E) => B !== x[E]) && n({ type: "setSelectedBlockIds", ids: C });
240
98
  },
241
99
  [t]
242
- ), p = I(
100
+ ), u = I(
243
101
  (s) => {
244
- const l = c.current, y = r.current.pageIdx, g = l.pages[y];
245
- if (!g) return;
246
- const h = new Set(s), v = g.blocks.filter(
247
- (x) => !h.has(x.id)
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(O(l, y, { ...g, blocks: v })), n({ type: "setSelectedBlockIds", ids: [] });
107
+ t(L(r, m, { ...d, blocks: k })), n({ type: "setSelectedBlockIds", ids: [] });
250
108
  },
251
109
  [t]
252
- ), u = I((s) => {
253
- const l = c.current, y = r.current.pageIdx, g = l.pages[y];
254
- if (!g) return;
255
- const h = g.blocks.filter((v) => s.includes(v.id));
256
- n({ type: "setClipboard", blocks: h });
257
- }, []), k = I(
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 l = c.current, y = r.current.pageIdx, g = l.pages[y];
260
- if (!g) return;
261
- const h = g.blocks.filter((C) => s.includes(C.id)), v = g.grid, x = h.map((C) => ({
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: W(C.kind),
121
+ id: j(C.kind),
264
122
  layout: {
265
123
  ...C.layout,
266
- x: Math.min(C.layout.x + 1, v.colCount - C.layout.w),
267
- y: Math.min(C.layout.y + 1, v.rowCount - C.layout.h)
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
- O(l, y, {
272
- ...g,
273
- blocks: [...g.blocks, ...x]
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
- ), f = I(() => {
282
- const s = r.current.clipboard;
139
+ ), b = I(() => {
140
+ const s = l.current.clipboard;
283
141
  if (s.length === 0) return;
284
- const l = c.current, y = r.current.pageIdx, g = l.pages[y];
285
- if (!g) return;
286
- const h = g.grid, v = s.map((x) => ({
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: W(x.kind),
146
+ id: j(x.kind),
289
147
  layout: {
290
148
  ...x.layout,
291
- x: Math.min(x.layout.x + 1, h.colCount - x.layout.w),
292
- y: Math.min(x.layout.y + 1, h.rowCount - x.layout.h)
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
- O(l, y, {
297
- ...g,
298
- blocks: [...g.blocks, ...v]
154
+ L(r, m, {
155
+ ...d,
156
+ blocks: [...d.blocks, ...k]
299
157
  })
300
158
  ), n({
301
159
  type: "setSelectedBlockIds",
302
- ids: v.map((x) => x.id)
160
+ ids: k.map((x) => x.id)
303
161
  });
304
- }, [t]), P = I(() => {
305
- var h;
306
- const s = c.current, l = r.current.pageIdx, y = s.pages[l], g = {
307
- grid: y ? y.grid : ((h = s.pages[0]) == null ? void 0 : h.grid) ?? { colCount: 12, rowCount: 24 },
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(ie(s, l, g)), n({ type: "setPageIdx", idx: l + 1 });
168
+ t(oe(s, r, d)), n({ type: "setPageIdx", idx: r + 1 });
311
169
  }, [t]), S = I(() => {
312
- const s = c.current, l = r.current.pageIdx;
170
+ const s = g.current, r = l.current.pageIdx;
313
171
  if (s.pages.length <= 1) return;
314
- const y = re(s, l);
315
- t(y), n({
172
+ const m = ne(s, r);
173
+ t(m), n({
316
174
  type: "setPageIdx",
317
- idx: Math.min(l, y.pages.length - 1)
175
+ idx: Math.min(r, m.pages.length - 1)
318
176
  });
319
- }, [t]), z = D(
177
+ }, [t]), D = z(
320
178
  () => ({
321
179
  paste: {
322
- execute: f,
323
- isEnabled: () => r.current.clipboard.length > 0
180
+ execute: b,
181
+ isEnabled: () => l.current.clipboard.length > 0
324
182
  },
325
183
  delete: {
326
- execute: () => p(r.current.selectedBlockIds),
327
- isEnabled: () => r.current.selectedBlockIds.length > 0
184
+ execute: () => u(l.current.selectedBlockIds),
185
+ isEnabled: () => l.current.selectedBlockIds.length > 0
328
186
  },
329
187
  copy: {
330
- execute: () => u(r.current.selectedBlockIds),
331
- isEnabled: () => r.current.selectedBlockIds.length > 0
188
+ execute: () => p(l.current.selectedBlockIds),
189
+ isEnabled: () => l.current.selectedBlockIds.length > 0
332
190
  },
333
191
  duplicate: {
334
- execute: () => k(r.current.selectedBlockIds),
335
- isEnabled: () => r.current.selectedBlockIds.length > 0
192
+ execute: () => f(l.current.selectedBlockIds),
193
+ isEnabled: () => l.current.selectedBlockIds.length > 0
336
194
  },
337
195
  addPage: {
338
- execute: P,
196
+ execute: w,
339
197
  isEnabled: () => !0
340
198
  },
341
199
  deletePage: {
342
200
  execute: S,
343
- isEnabled: () => c.current.pages.length > 1
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((l) => typeof l == "string")
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: l, options: y } = s;
358
- m(l, y);
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
- f,
366
- p,
223
+ b,
367
224
  u,
368
- k,
369
- P,
225
+ p,
226
+ f,
227
+ w,
370
228
  S,
371
- m
229
+ h
372
230
  ]
373
231
  );
374
232
  return {
375
- editorState: D(
233
+ editorState: z(
376
234
  () => ({
377
235
  selectedBlockIds: a,
378
236
  pageIdx: i
379
237
  }),
380
238
  [a, i]
381
239
  ),
382
- actionHandlers: z,
240
+ actionHandlers: D,
383
241
  selectedBlockIds: a
384
242
  };
385
243
  }
386
- function Lt({
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: c, historyActionHandlers: r } = se({
250
+ const a = T(null), { book: i, handleBookChange: g, historyActionHandlers: l } = ae({
393
251
  initialBook: e
394
- }), [m, p] = Y(
252
+ }), [h, u] = q(
395
253
  o ?? {}
396
- ), u = I((s) => {
397
- s.length !== 0 && p((l) => {
254
+ ), p = I((s) => {
255
+ s.length !== 0 && u((r) => {
398
256
  if (!s.some(
399
- ({ id: h, value: v }) => v === void 0 ? h in l : l[h] !== v
400
- )) return l;
401
- const g = { ...l };
402
- for (const { id: h, value: v } of s)
403
- v === void 0 ? delete g[h] : g[h] = v;
404
- return g;
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: k, actionHandlers: f } = st({
264
+ }, []), { editorState: f, actionHandlers: b } = Ye({
407
265
  book: i,
408
- handleBookChange: c
409
- }), P = {
410
- pageIdx: k.pageIdx,
266
+ handleBookChange: g
267
+ }), w = {
268
+ pageIdx: f.pageIdx,
411
269
  ...n ? { extra: n } : {}
412
- }, S = le(
270
+ }, S = ie(
413
271
  i,
414
- c,
415
- P
416
- ), z = ce({
417
- ...r,
418
- ...f
272
+ g,
273
+ w
274
+ ), D = se({
275
+ ...l,
276
+ ...b
419
277
  });
420
- return { context: D(
278
+ return { context: z(
421
279
  () => ({
422
280
  book: i,
423
- onBookChange: c,
281
+ onBookChange: g,
424
282
  pluginRegistry: t,
425
283
  containerRef: a,
426
284
  bindingContext: S,
427
- actionContext: z,
428
- values: m,
429
- onValuesChange: u,
430
- editorState: k
285
+ actionContext: D,
286
+ values: h,
287
+ onValuesChange: p,
288
+ editorState: f
431
289
  }),
432
290
  [
433
291
  i,
434
- c,
292
+ g,
435
293
  t,
436
294
  S,
437
- z,
438
- m,
439
- u,
440
- k
295
+ D,
296
+ h,
297
+ p,
298
+ f
441
299
  ]
442
300
  ) };
443
301
  }
444
- const b = {
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
- }, H = { value: 2, unit: "mm" };
470
- function w(e, t, o) {
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: H,
477
- right: H,
478
- bottom: H,
479
- left: H
334
+ top: R,
335
+ right: R,
336
+ bottom: R,
337
+ left: R
480
338
  };
481
339
  }
482
- function lt(e = "canvas-actions") {
340
+ function Ze(e = "canvas-actions") {
483
341
  return {
484
342
  props: {
485
343
  book: {
486
344
  paper: {
487
345
  size: {
488
- preset: E.CUSTOM,
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: w(
508
- b.selectAll,
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: w(
518
- b.deselectAll,
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: w(
528
- b.delete,
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: w(
538
- b.copy,
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: w(
548
- b.paste,
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: w(
558
- b.duplicate,
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: w(
568
- b.undo,
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: w(
578
- b.redo,
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 Nt = lt();
592
- function ct(e = "clipboard") {
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: E.CUSTOM,
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: w(b.copy, "copy")
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: w(b.paste, "paste")
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: w(b.duplicate, "duplicate")
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 Ht = ct();
640
- function dt(e = "history") {
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: E.CUSTOM,
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: w(b.undo, "undo")
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: w(b.redo, "redo")
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 Rt = dt(), R = {
539
+ const Bt = Ke(), N = {
682
540
  size: {
683
- preset: E.CUSTOM
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
- }, ut = {
694
- margin: R.margin,
695
- autoHeight: R.autoHeight,
696
- autoWidth: R.autoWidth
697
- }, jt = {
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
- ...ut,
559
+ ...Je,
702
560
  size: {
703
- preset: E.CUSTOM,
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
- ...L("layout-x-value", "layout.x"),
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
- ...L("layout-y-value", "layout.y"),
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
- ...L("layout-w-value", "layout.w"),
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
- ...L("layout-h-value", "layout.h"),
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: [F, de]
660
+ plugins: [W, re]
803
661
  };
804
- function pt(e) {
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: E.CUSTOM,
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: b.prevPage,
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: b.nextPage,
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: b.addPage,
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: b.deletePage,
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, F]
771
+ plugins: [V, W]
914
772
  };
915
773
  }
916
- const $t = pt({});
917
- function mt(e = "selection") {
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: E.CUSTOM,
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: w(b.selectAll, "select_all")
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: w(b.deselectAll, "deselect_all")
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: w(b.delete, "delete")
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 Ft = mt(), gt = ({
822
+ const zt = et(), tt = ({
965
823
  sections: e = [],
966
824
  className: t,
967
825
  style: o
968
- }) => /* @__PURE__ */ d(
826
+ }) => /* @__PURE__ */ c(
969
827
  "div",
970
828
  {
971
- className: `${$.container}${t ? ` ${t}` : ""}`,
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 = be(n) && n.key != null ? n.key : `section-${a}`;
976
- return /* @__PURE__ */ M(fe, { children: [
977
- a > 0 && /* @__PURE__ */ d(Ie, {}),
978
- /* @__PURE__ */ d("div", { className: $.section, children: n })
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
- gt.displayName = "ActionBar";
984
- const yt = "_printContainer_e2bnt_1", ht = "_pageBreak_e2bnt_6", q = {
985
- printContainer: yt,
986
- pageBreak: ht
987
- }, ee = Z(
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 } = we(
847
+ const { paperPx: a, getBlockRectPx: i } = ke(
990
848
  t,
991
849
  e.grid,
992
- Pe
993
- ), c = o ? { get: (m) => o[m] ?? null, set: () => {
994
- } } : void 0, r = e.blocks.filter(
995
- (m) => !me(m.hiddenBinding, c)
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__ */ d(
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__ */ d(
1007
- ge,
864
+ children: /* @__PURE__ */ c(
865
+ ue,
1008
866
  {
1009
- blocks: r,
867
+ blocks: l,
1010
868
  pluginRegistry: n,
1011
- mode: X.VIEW,
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
- ee.displayName = "PrintPage";
1024
- const te = ve(
1025
- ({ book: e, values: t, pluginRegistry: o, printSettings: n, className: a, style: i }, c) => {
1026
- const r = ue(e, n), m = pe(
1027
- r,
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 ke(() => {
1031
- var k, f;
1032
- (k = document.getElementById("printable-note-page-style")) == null || k.remove(), (f = document.getElementById("tatamicks-book-page-style")) == null || f.remove();
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
- return u.id = "tatamicks-book-page-style", u.textContent = m, document.head.appendChild(u), () => {
1037
- var P, S;
1038
- (P = document.getElementById("printable-note-page-style")) == null || P.remove(), (S = document.getElementById("tatamicks-book-page-style")) == null || S.remove();
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
- }, [m]), /* @__PURE__ */ d(
898
+ }, [h]), /* @__PURE__ */ c(
1041
899
  "div",
1042
900
  {
1043
- ref: c,
1044
- className: [q.printContainer, a].filter(Boolean).join(" "),
901
+ ref: g,
902
+ className: [G.printContainer, a].filter(Boolean).join(" "),
1045
903
  style: i,
1046
- children: e.pages.map((p, u) => {
1047
- const k = p.id ?? (p.blocks.map((f) => f.id).join("_") || `page-${u}`);
1048
- return /* @__PURE__ */ d(
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: u < e.pages.length - 1 ? q.pageBreak : void 0,
1052
- children: /* @__PURE__ */ d(
1053
- ee,
909
+ className: p < e.pages.length - 1 ? G.pageBreak : void 0,
910
+ children: /* @__PURE__ */ c(
911
+ K,
1054
912
  {
1055
- page: p,
1056
- paper: r,
913
+ page: u,
914
+ paper: l,
1057
915
  values: t,
1058
916
  pluginRegistry: o
1059
917
  }
1060
918
  )
1061
919
  },
1062
- k
920
+ f
1063
921
  );
1064
922
  })
1065
923
  }
1066
924
  );
1067
925
  }
1068
926
  );
1069
- te.displayName = "NotePrint";
1070
- const bt = Z(te);
1071
- function ft(e) {
927
+ J.displayName = "NotePrint";
928
+ const at = Y(J);
929
+ function it(e) {
1072
930
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1073
931
  }
1074
- function vt(e, t) {
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 c = Array.from(document.querySelectorAll("style")).map((u) => u.outerHTML).join(`
1083
- `), r = Array.from(
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((u) => u.outerHTML).join(`
1086
- `), m = e.innerHTML;
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>${ft(o)}</title>${r}${c}<style>*{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;}</style></head><body>${m}</body></html>`
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 p = () => {
948
+ const u = () => {
1091
949
  document.body.contains(n) && document.body.removeChild(n);
1092
950
  };
1093
951
  a.addEventListener("afterprint", () => {
1094
- p();
952
+ u();
1095
953
  }), setTimeout(() => {
1096
954
  a.focus(), a.print();
1097
955
  }, 0);
1098
956
  }
1099
- function kt(e, t, o, n) {
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 = Se(a);
1103
- Ce(() => {
960
+ const i = Pe(a);
961
+ xe(() => {
1104
962
  i.render(
1105
- xe(bt, { book: e, values: t, pluginRegistry: o, printSettings: n })
963
+ be(at, { book: e, values: t, pluginRegistry: o, printSettings: n })
1106
964
  );
1107
- }), vt(a), i.unmount(), document.body.removeChild(a);
965
+ }), st(a), i.unmount(), document.body.removeChild(a);
1108
966
  }
1109
- function xt(e, t) {
1110
- kt(
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 oe = ({
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(Be, { children: [
1125
- /* @__PURE__ */ d(
1126
- N,
982
+ }) => /* @__PURE__ */ M(we, { children: [
983
+ /* @__PURE__ */ c(
984
+ O,
1127
985
  {
1128
- icon: /* @__PURE__ */ d(Ae, { "aria-hidden": "true" }),
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: $.sectionLabel, children: [
994
+ /* @__PURE__ */ M("span", { className: U.sectionLabel, children: [
1137
995
  e + 1,
1138
996
  " / ",
1139
997
  t
1140
998
  ] }),
1141
- /* @__PURE__ */ d(
1142
- N,
999
+ /* @__PURE__ */ c(
1000
+ O,
1143
1001
  {
1144
- icon: /* @__PURE__ */ d(De, { "aria-hidden": "true" }),
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__ */ d(
1153
- N,
1010
+ n !== void 0 && /* @__PURE__ */ c(
1011
+ O,
1154
1012
  {
1155
- icon: /* @__PURE__ */ d(Ee, { "aria-hidden": "true" }),
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__ */ d(
1163
- N,
1020
+ a !== void 0 && /* @__PURE__ */ c(
1021
+ O,
1164
1022
  {
1165
- icon: /* @__PURE__ */ d(ze, { "aria-hidden": "true" }),
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
- oe.displayName = "PageNavigationSection";
1175
- function Ut({
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, r = e.editorState.pageIdx, m = a.pages[r] ?? a.pages[0], p = [
1181
- /* @__PURE__ */ d(
1182
- Te,
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 ?? (() => xt(e))
1044
+ onPrint: o ?? (() => lt(e))
1187
1045
  },
1188
1046
  "canvas"
1189
1047
  ),
1190
- /* @__PURE__ */ d(
1191
- Me,
1048
+ /* @__PURE__ */ c(
1049
+ Ae,
1192
1050
  {
1193
1051
  paper: a.paper,
1194
- onPaperChange: (u) => i({ ...a, paper: u })
1052
+ onPaperChange: (p) => i({ ...a, paper: p })
1195
1053
  },
1196
1054
  "paper"
1197
1055
  ),
1198
- /* @__PURE__ */ d(
1199
- _e,
1056
+ /* @__PURE__ */ c(
1057
+ De,
1200
1058
  {
1201
- grid: m.grid,
1202
- onGridChange: (u) => {
1203
- const k = a.pages.map(
1204
- (f, P) => P === r ? { ...f, grid: u } : f
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: k });
1064
+ i({ ...a, pages: f });
1207
1065
  }
1208
1066
  },
1209
1067
  "grid"
1210
1068
  )
1211
1069
  ];
1212
- return p.push(
1213
- /* @__PURE__ */ d(
1214
- oe,
1070
+ return u.push(
1071
+ /* @__PURE__ */ c(
1072
+ Q,
1215
1073
  {
1216
- pageIdx: r,
1074
+ pageIdx: l,
1217
1075
  pageCount: a.pages.length,
1218
- onPageChange: (u) => n.execute("goToPage", u),
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
- ), p;
1083
+ ), u;
1226
1084
  }
1227
- const wt = ({
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: c } = e, r = e.editorState, m = T(null), p = r.selectedBlockIds ?? [], u = D(() => {
1235
- const f = new Set(
1236
- i.pages.flatMap((P) => P.blocks.map((S) => S.id))
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 p.filter((P) => f.has(P));
1239
- }, [p, i]), k = Ve(c ?? m, u) ?? null;
1240
- return /* @__PURE__ */ d(
1241
- Oe,
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: k,
1101
+ selectionBoundingBox: f,
1244
1102
  isDragging: o,
1245
1103
  zIndex: n,
1246
- children: /* @__PURE__ */ d(
1247
- Le,
1104
+ children: /* @__PURE__ */ c(
1105
+ _e,
1248
1106
  {
1249
- items: Ne({
1107
+ items: Ve({
1250
1108
  context: e,
1251
1109
  gridSize: t,
1252
1110
  onActionFeedback: a
1253
1111
  }),
1254
- onPointerDown: (f) => f.stopPropagation()
1112
+ onPointerDown: (b) => b.stopPropagation()
1255
1113
  }
1256
1114
  )
1257
1115
  }
1258
1116
  );
1259
1117
  };
1260
- wt.displayName = "DefaultSelectionActionBarOverlay";
1261
- function Wt({
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__ */ d(He, { context: e, gridSize: t }) : /* @__PURE__ */ d(Re, { context: e })
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__ */ d(
1278
- je,
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__ */ d($e, { context: e })
1148
+ content: /* @__PURE__ */ c(Re, { context: e })
1291
1149
  }
1292
1150
  ];
1293
1151
  }
1294
- const Pt = "_container_ymana_1", Ct = "_tabHeader_ymana_12", St = "_tabContent_ymana_19", j = {
1295
- container: Pt,
1296
- tabHeader: Ct,
1297
- tabContent: St
1298
- }, Bt = ({ tabs: e, defaultTab: t, className: o }) => {
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__ */ d(
1159
+ return /* @__PURE__ */ c(
1302
1160
  "div",
1303
1161
  {
1304
- className: `${j.container} ${o || ""}`,
1305
- ...J,
1306
- children: /* @__PURE__ */ M(Fe, { defaultValue: n, variant: "default", children: [
1307
- /* @__PURE__ */ d(Ue, { className: j.tabHeader, children: e.map((i) => /* @__PURE__ */ d(We, { value: i.value, children: i.label }, i.value)) }),
1308
- e.map((i) => /* @__PURE__ */ d(
1309
- Ge,
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: j.tabContent,
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
- Bt.displayName = "Sidebar";
1322
- const It = {
1179
+ mt.displayName = "Sidebar";
1180
+ const gt = {
1323
1181
  selectedBlockIds: [],
1324
1182
  pageIdx: 0
1325
1183
  };
1326
- function Gt({
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: c,
1334
- onContainerPointerDown: r,
1335
- style: m,
1336
- context: p
1191
+ onClose: g,
1192
+ onContainerPointerDown: l,
1193
+ style: h,
1194
+ context: u
1337
1195
  }) {
1338
- const u = D(
1339
- () => Ye([...t.plugins, ...o ?? []]),
1196
+ const p = z(
1197
+ () => je([...t.plugins, ...o ?? []]),
1340
1198
  [t.plugins, o]
1341
- ), k = T(null), f = D(
1199
+ ), f = T(null), b = z(
1342
1200
  () => ({
1343
- get: (l) => (p.book, p.bindingContext.get(l)),
1344
- set: (l, y) => p.bindingContext.set(l, y)
1201
+ get: (r) => (u.book, u.bindingContext.get(r)),
1202
+ set: (r, m) => u.bindingContext.set(r, m)
1345
1203
  }),
1346
- [p.bindingContext, p.book]
1347
- ), P = D(
1204
+ [u.bindingContext, u.book]
1205
+ ), w = z(
1348
1206
  () => ({
1349
1207
  book: t.props.book,
1350
1208
  onBookChange: () => {
1351
1209
  },
1352
- pluginRegistry: u,
1353
- containerRef: k,
1354
- bindingContext: f,
1355
- actionContext: p.actionContext,
1356
- editorState: It,
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
- u,
1362
- f,
1363
- p.actionContext
1219
+ p,
1220
+ b,
1221
+ u.actionContext
1364
1222
  ]
1365
- ), [S, z] = Y(0.5), _ = T({ x: 0, zoom: 0.5 }), s = (l) => {
1366
- l.preventDefault(), l.stopPropagation(), _.current = { x: l.clientX, zoom: S };
1367
- const y = (h) => {
1368
- const v = h.clientX - _.current.x;
1369
- z(
1370
- Math.max(0.25, Math.min(2, _.current.zoom + v / 400))
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
- }, g = () => {
1373
- window.removeEventListener("pointermove", y), window.removeEventListener("pointerup", g);
1230
+ }, d = () => {
1231
+ window.removeEventListener("pointermove", m), window.removeEventListener("pointerup", d);
1374
1232
  };
1375
- window.addEventListener("pointermove", y), window.addEventListener("pointerup", g);
1233
+ window.addEventListener("pointermove", m), window.addEventListener("pointerup", d);
1376
1234
  };
1377
1235
  return /* @__PURE__ */ M(
1378
1236
  "div",
1379
1237
  {
1380
- onPointerDown: r,
1381
- ...J,
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
- ...m
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__ */ d("span", { style: { fontSize: 11, color: "#555", whiteSpace: "nowrap" }, children: e }),
1412
- /* @__PURE__ */ d(
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: (l) => l.stopPropagation(),
1417
- onClick: c,
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__ */ d("div", { style: { pointerEvents: a ? "none" : "auto", zoom: S }, children: /* @__PURE__ */ d(ye, { mode: X.EDIT, context: P }) }),
1434
- /* @__PURE__ */ d(
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
- gt as ActionBar,
1456
- Ot as BASE_PLUGINS,
1457
- ne as CheckboxPlugin,
1458
- Zt as DEFAULT_BOOK,
1459
- co as DEFAULT_GRID,
1460
- Xt as DEFAULT_PAGE,
1461
- uo as DEFAULT_PAPER,
1462
- po as DEFAULT_PAPER_MARGIN,
1463
- mo as DEFAULT_PAPER_SIZES,
1464
- wt as DefaultSelectionActionBarOverlay,
1465
- Gt as FloatingWidget,
1466
- go as LineType,
1467
- ye as Note,
1468
- Jt as NoteEdit,
1469
- Kt as NoteForm,
1470
- X as NoteMode,
1471
- Qt as NoteView,
1472
- E as PaperSizePreset,
1473
- ae as SelectPlugin,
1474
- Bt as Sidebar,
1475
- F as TextPlugin,
1476
- eo as ValidationSeverity,
1477
- to as addPage,
1478
- jt as blockLayoutWidget,
1479
- Nt as canvasActionsWidget,
1480
- oo as cleanValues,
1481
- Ht as clipboardWidget,
1482
- W as createBlockId,
1483
- lt as createCanvasActionsWidget,
1484
- ct as createClipboardWidget,
1485
- dt as createHistoryWidget,
1486
- pt as createPageNavigationWidget,
1487
- Ye as createPluginRegistry,
1488
- mt as createSelectionDeleteWidget,
1489
- yo as deserializeBook,
1490
- ho as deserializePage,
1491
- bo as deserializeValues,
1492
- no as ensurePageIds,
1493
- Ut as getDefaultActionBarSections,
1494
- Wt as getDefaultSidebarTabs,
1495
- ao as gridSettingsWidget,
1496
- Rt as historyWidget,
1497
- ie as insertPage,
1498
- ot as isBook,
1499
- tt as isLegacyFormSchema,
1500
- Vt as migrate,
1501
- nt as migrateBook,
1502
- at as migrateFormSchemaToBook,
1503
- io as movePage,
1504
- $t as pageNavigationWidget,
1505
- ro as paperSettingsWidget,
1506
- fo as parseBook,
1507
- xt as printNote,
1508
- re as removePage,
1509
- Ft as selectionDeleteWidget,
1510
- vo as serializeBook,
1511
- ko as serializePage,
1512
- O as setPage,
1513
- Lt as useNoteContext,
1514
- so as validateBook
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
  };