@tatamicks/core 0.3.1 → 1.0.1
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/README.md +518 -81
- package/dist/PalettePanel-CtXsH6Cb.js +5137 -0
- package/dist/PalettePanel-CtXsH6Cb.js.map +1 -0
- package/dist/PalettePanel-Dipvtj7D.cjs +9 -0
- package/dist/PalettePanel-Dipvtj7D.cjs.map +1 -0
- package/dist/PalettePanel.css +1 -0
- package/dist/canvas.cjs +1 -0
- package/dist/canvas.cjs.map +1 -0
- package/dist/canvas.mjs +354 -0
- package/dist/canvas.mjs.map +1 -0
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +3 -1
- package/dist/index.css.d.ts +2 -0
- package/dist/index.mjs +1424 -6889
- package/dist/index.mjs.map +1 -1
- package/dist/paperSettingsWidget-DgDoBA0P.js +5137 -0
- package/dist/paperSettingsWidget-DgDoBA0P.js.map +1 -0
- package/dist/paperSettingsWidget-sLJsIUxS.cjs +2 -0
- package/dist/paperSettingsWidget-sLJsIUxS.cjs.map +1 -0
- package/dist/paperSettingsWidget.css +1 -0
- package/dist/shell.cjs +1 -0
- package/dist/shell.cjs.map +1 -0
- package/dist/shell.mjs +65 -0
- package/dist/shell.mjs.map +1 -0
- package/dist/sidebarPortal-C06y4JSP.js +723 -0
- package/dist/sidebarPortal-C06y4JSP.js.map +1 -0
- package/dist/sidebarPortal-C3HszQyp.cjs +1 -0
- package/dist/sidebarPortal-C3HszQyp.cjs.map +1 -0
- package/dist/src/canvas.d.ts +2523 -0
- package/dist/src/index.d.ts +1801 -2880
- package/dist/src/shell.d.ts +1982 -0
- package/package.json +21 -8
- package/dist/index.js +0 -70
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._container_1xv5c_4{display:flex;flex-direction:row;align-items:center;gap:4px;padding:6px 8px;background-color:var(--de-bg-secondary, #f9fafb);border:1px solid var(--de-border-color, #e5e7eb);border-radius:6px;flex-wrap:wrap}._section_1xv5c_16{display:flex;flex-direction:row;align-items:center;gap:4px}._divider_1xv5c_23{width:1px;height:20px;background-color:var(--de-border-color, #d1d5db);flex-shrink:0;margin:0 2px}._sectionLabel_1xv5c_31{font-size:11px;color:var(--de-text-secondary, #6b7280);white-space:nowrap;-webkit-user-select:none;user-select:none}._select_1xv5c_38{height:28px;padding:0 4px;border:1px solid var(--de-border-color, #d1d5db);border-radius:4px;background-color:var(--de-bg-primary, #ffffff);color:var(--de-text-primary, #374151);font-size:12px;cursor:pointer;outline:none}._select_1xv5c_38:hover{border-color:var(--de-border-hover, #9ca3af)}._select_1xv5c_38:focus{border-color:var(--de-primary-color, #6366f1);box-shadow:0 0 0 2px #6366f133}._numberInput_1xv5c_59{width:48px;height:28px;padding:0 4px;border:1px solid var(--de-border-color, #d1d5db);border-radius:4px;background-color:var(--de-bg-primary, #ffffff);color:var(--de-text-primary, #374151);font-size:12px;text-align:center;outline:none}._numberInput_1xv5c_59:hover{border-color:var(--de-border-hover, #9ca3af)}._numberInput_1xv5c_59:focus{border-color:var(--de-primary-color, #6366f1);box-shadow:0 0 0 2px #6366f133}._numberInput_1xv5c_59::-webkit-inner-spin-button,._numberInput_1xv5c_59::-webkit-outer-spin-button{opacity:1}._heightModeSwitch_1xv5c_87{display:inline-flex;align-items:center;gap:3px}._switchLabel_1xv5c_93{font-size:.625rem;font-weight:600;color:var(--de-text-tertiary, #9ca3af);-webkit-user-select:none;user-select:none;white-space:nowrap}._switchLabelActive_1xv5c_101{color:var(--de-text-primary, #374151)}._toggle_1xv5c_105{position:relative;width:28px;height:16px;border-radius:8px;background-color:var(--de-border-color, #d1d5db);border:none;cursor:pointer;padding:0;flex-shrink:0;transition:background-color .2s}._toggle_1xv5c_105[aria-checked=true]{background-color:var(--de-primary-color, #3b82f6)}._thumb_1xv5c_122{position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background-color:#fff;transition:left .2s;pointer-events:none}._toggle_1xv5c_105[aria-checked=true] ._thumb_1xv5c_122{left:14px}._container_1tnp6_5{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}._container_1tnp6_5:has(._input_1tnp6_13:disabled){cursor:not-allowed;opacity:.6}._input_1tnp6_13{width:1rem;height:1rem;cursor:pointer;accent-color:var(--de-primary-color, #3b82f6)}._input_1tnp6_13:disabled{cursor:not-allowed}._label_1tnp6_29{font-size:.875rem;line-height:1.5;color:var(--de-text-color, #000000)}._header_1c1mq_6{display:flex;align-items:center;gap:4px;width:100%;margin:0;padding:.25rem .75rem;background-color:var(--de-bg-secondary, #f9fafb);border:none;border-bottom:1px solid var(--de-bg-hover, #f3f4f6);border-top:1px solid var(--de-bg-hover, #f3f4f6);text-align:left;box-sizing:border-box}button._header_1c1mq_6{cursor:pointer}button._header_1c1mq_6:hover{background-color:var(--de-bg-hover, #f3f4f6)}._title_1c1mq_32{font-size:.7rem;font-weight:700;color:var(--de-text-secondary, #6b7280);text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._actions_1c1mq_43{flex-shrink:0}._titleGroup_1c1mq_49{flex:1;display:flex;align-items:center;gap:4px;min-width:0;overflow:hidden}._infoIcon_1c1mq_60{display:inline-flex;align-items:center;justify-content:center;width:.9375rem;height:.9375rem;border-radius:9999px;background-color:var(--de-border-color, #d1d5db);color:#fff;font-size:.625rem;font-weight:700;font-style:normal;font-family:inherit;line-height:1;cursor:help;-webkit-user-select:none;user-select:none;flex-shrink:0;transition:background-color .15s}._infoIcon_1c1mq_60:hover{background-color:var(--de-primary-color, #3b82f6)}._chevron_1c1mq_84{flex-shrink:0;font-size:.9rem;transition:transform .18s;display:inline-block;transform:rotate(-90deg)}._chevronOpen_1c1mq_92{transform:rotate(0)}._statusBadge_1c1mq_98{flex-shrink:0;padding:.1em .45em;border-radius:.25rem;font-size:.6rem;font-weight:600;letter-spacing:.03em;line-height:1.4}._statusBadgeOn_1c1mq_108{background-color:var(--de-badge-on-bg, #dbeafe);color:var(--de-primary-dark, #1d4ed8)}._statusBadgeOff_1c1mq_113{background-color:var(--de-bg-hover, #f3f4f6);color:var(--de-text-tertiary, #9ca3af)}._content_1c1mq_120{padding:.6rem .1875rem;display:flex;flex-direction:column;gap:8px}._contentNoPadding_1c1mq_127{display:flex;flex-direction:column}._container_1cdzu_5{display:flex;align-items:center;gap:.25rem;min-width:0;position:relative}._colorButton_1cdzu_13{width:2rem;height:1.5rem;padding:0;border:1px solid var(--de-border-color, #d1d5db);border-radius:.25rem;cursor:pointer;transition:border-color .15s ease-in-out;background:repeating-conic-gradient(#e5e7eb,#e5e7eb 25%,#fff 0%,#fff 50%) 50% / 8px 8px}._colorButton_1cdzu_13:hover:not(:disabled){border-color:var(--de-primary-color, #3b82f6)}._colorButton_1cdzu_13:focus{outline:none;border-color:var(--de-primary-color, #3b82f6);box-shadow:0 0 0 3px var(--de-primary-shadow, rgba(59, 130, 246, .1))}._colorButton_1cdzu_13:disabled{cursor:not-allowed;opacity:.6}._textInputWrapper_1cdzu_40{display:flex;align-items:center;flex:1;min-width:0;border:1px solid var(--de-border-color, #d1d5db);border-radius:.25rem;background-color:var(--de-input-background, #ffffff);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}._textInputWrapper_1cdzu_40:focus-within{border-color:var(--de-primary-color, #3b82f6);box-shadow:0 0 0 3px var(--de-primary-shadow, rgba(59, 130, 246, .1))}._textInputWrapper_1cdzu_40:has(input:disabled){background-color:var(--de-input-disabled-background, #f3f4f6)}._textInputPrefix_1cdzu_62{padding-left:.375rem;font-size:.75rem;font-family:ui-monospace,Cascadia Code,Source Code Pro,Menlo,Consolas,DejaVu Sans Mono,monospace;color:var(--de-text-secondary, #6b7280);-webkit-user-select:none;user-select:none}._textInput_1cdzu_40{flex:1;min-width:0;padding:.25rem .375rem;font-size:.75rem;font-family:ui-monospace,Cascadia Code,Source Code Pro,Menlo,Consolas,DejaVu Sans Mono,monospace;line-height:1.25;border:none;background:transparent;color:var(--de-text-color, #000000)}._textInput_1cdzu_40:focus{outline:none}._textInput_1cdzu_40:disabled{color:var(--de-input-disabled-color, #9ca3af);cursor:not-allowed}._popover_1cdzu_96{position:absolute;top:calc(100% + .25rem);left:0;padding:.5rem;background:var(--de-popover-background, #ffffff);border:1px solid var(--de-border-color, #d1d5db);border-radius:.5rem;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;width:fit-content;min-width:180px}._palette_1cdzu_112{display:grid;grid-template-columns:repeat(10,1fr);gap:.05rem;margin-bottom:.5rem}._paletteButton_1cdzu_119{width:1.2rem;height:1.2rem;padding:0;border:2px solid var(--de-border-color, #d1d5db);border-radius:50%;cursor:pointer;transition:border-color .15s ease-in-out,transform .15s ease-in-out}._paletteButton_1cdzu_119:hover{border-color:var(--de-primary-color, #3b82f6);transform:scale(1.1)}._paletteButton_1cdzu_119:focus{outline:none;border-color:var(--de-primary-color, #3b82f6);box-shadow:0 0 0 3px var(--de-primary-shadow, rgba(59, 130, 246, .1))}._paletteButton_1cdzu_119._selected_1cdzu_142{border-color:var(--de-primary-color, #3b82f6);border-width:2px;box-shadow:0 0 0 2px var(--de-primary-shadow, rgba(59, 130, 246, .2))}._transparentPaletteButton_1cdzu_148{background:repeating-conic-gradient(#d1d5db,#d1d5db 25%,#fff 0%,#fff 50%) 50% / 8px 8px}._rgbaInputs_1cdzu_154{display:flex;gap:.25rem;padding-top:.5rem;border-top:1px solid var(--de-border-color, #e5e7eb)}._rgbaInputGroup_1cdzu_161{display:flex;flex-direction:column;align-items:center;gap:.25rem}._rgbaInputs_1cdzu_154 ._rgbaInputGroup_1cdzu_161 input[type=number]{padding:.25rem .2rem;font-size:.75rem;text-align:center;line-height:1.2}._rgbaLabel_1cdzu_175{font-size:.75rem;font-weight:600;color:var(--de-text-secondary, #6b7280);-webkit-user-select:none;user-select:none}._hexInput_1cdzu_183{display:flex;align-items:center;gap:.5rem;padding-top:.5rem;margin-top:.5rem;border-top:1px solid var(--de-border-color, #e5e7eb)}._hexLabel_1cdzu_192{font-size:.75rem;font-weight:600;color:var(--de-text-secondary, #6b7280);-webkit-user-select:none;user-select:none;min-width:2.5rem}._hexTextInput_1cdzu_200{flex:1;min-width:0;padding:.375rem .5rem;font-size:.75rem;font-family:ui-monospace,Cascadia Code,Source Code Pro,Menlo,Consolas,DejaVu Sans Mono,monospace;line-height:1.25;border:1px solid var(--de-border-color, #d1d5db);border-radius:.25rem;background-color:var(--de-input-background, #ffffff);color:var(--de-text-color, #000000);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}._hexTextInput_1cdzu_200:focus{outline:none;border-color:var(--de-primary-color, #3b82f6);box-shadow:0 0 0 3px var(--de-primary-shadow, rgba(59, 130, 246, .1))}._hexTextInput_1cdzu_200:disabled{background-color:var(--de-input-disabled-background, #f3f4f6);color:var(--de-input-disabled-color, #9ca3af);cursor:not-allowed}._input_14n56_5{width:100%;padding:.25rem .375rem;font-size:.75rem;line-height:1.25;border:1px solid var(--de-border-color, #d1d5db);border-radius:.25rem;background-color:var(--de-input-background, #ffffff);color:var(--de-text-color, #000000);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}._input_14n56_5:focus{outline:none;border-color:var(--de-primary-color, #3b82f6);box-shadow:0 0 0 3px var(--de-primary-shadow, rgba(59, 130, 246, .1))}._input_14n56_5:disabled{background-color:var(--de-input-disabled-background, #f3f4f6);color:var(--de-input-disabled-color, #9ca3af);cursor:not-allowed}._input_14n56_5::-webkit-outer-spin-button,._input_14n56_5::-webkit-inner-spin-button{height:1.5rem}._container_1n9lj_5{display:flex;gap:0;align-items:stretch;min-width:0;border:1px solid var(--de-border-color, #d1d5db);border-radius:.25rem;background-color:var(--de-input-background, #ffffff);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}._container_1n9lj_5:focus-within{border-color:var(--de-primary-color, #3b82f6);box-shadow:0 0 0 3px var(--de-primary-shadow, rgba(59, 130, 246, .1))}._valueInput_1n9lj_23{flex:1;min-width:0;padding:.25rem .375rem;font-size:.75rem;line-height:1.25;border:none;border-radius:.25rem 0 0 .25rem;background-color:transparent;color:var(--de-text-color, #000000)}._valueInput_1n9lj_23:focus{outline:none}._valueInput_1n9lj_23:disabled{background-color:var(--de-input-disabled-background, #f3f4f6);color:var(--de-input-disabled-color, #9ca3af);cursor:not-allowed}._unitSelect_1n9lj_45{flex-shrink:0;min-width:3rem;padding:.25rem .375rem;font-size:.75rem;line-height:1.25;border:none;border-left:1px solid var(--de-border-color, #d1d5db);border-radius:0 .25rem .25rem 0;background-color:var(--de-input-background-secondary, #f9fafb);color:var(--de-text-color, #000000);cursor:pointer}._unitSelect_1n9lj_45:focus{outline:none}._container_1n9lj_5:has(._valueInput_1n9lj_23:disabled),._container_1n9lj_5:has(._unitSelect_1n9lj_45:disabled){background-color:var(--de-input-disabled-background, #f3f4f6);border-color:var(--de-border-color, #d1d5db);box-shadow:none}._valueInput_1n9lj_23:disabled{color:var(--de-input-disabled-color, #9ca3af);cursor:not-allowed}._unitSelect_1n9lj_45:disabled{background-color:transparent;color:var(--de-input-disabled-color, #9ca3af);cursor:not-allowed}._container_14f2v_5{position:relative;width:100%;min-width:0}._select_14f2v_11{width:100%;min-width:0;padding:.25rem 1.75rem .25rem .375rem;font-size:.75rem;line-height:1.25;border:1px solid var(--de-border-color, #d1d5db);border-radius:.25rem;background-color:var(--de-input-background, #ffffff);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right .375rem center;background-size:.875rem;color:var(--de-text-color, #000000);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}._select_14f2v_11:focus{outline:none;border-color:var(--de-primary-color, #3b82f6);box-shadow:0 0 0 3px var(--de-primary-shadow, rgba(59, 130, 246, .1))}._select_14f2v_11:disabled{background-color:var(--de-input-disabled-background, #f3f4f6);color:var(--de-input-disabled-color, #9ca3af);cursor:not-allowed}._placeholderOverlay_14f2v_44{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;padding:.5rem 1.75rem .25rem .375rem;font-size:.75rem;line-height:1.25;color:var(--de-input-placeholder-color, #9ca3af);pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box}._button_16snt_1{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--de-border-color, #d1d5db);border-radius:4px;background-color:var(--de-bg-primary, #ffffff);color:var(--de-text-primary, #374151);font-size:14px;cursor:pointer;transition:background-color .1s,border-color .1s,opacity .1s;line-height:1}._button_16snt_1:hover:not(:disabled){background-color:var(--de-bg-hover, #f3f4f6);border-color:var(--de-border-hover, #9ca3af)}._button_16snt_1:active:not(:disabled){background-color:var(--de-bg-active, #e5e7eb)}._button_16snt_1:disabled{opacity:.4;cursor:not-allowed}._container_ytzac_4{width:100%;height:100%;background-color:var(--de-bg-primary, #ffffff);border-left:1px solid var(--de-border-color, #e5e7eb);display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}._container_ytzac_4 *,._container_ytzac_4 *:before,._container_ytzac_4 *:after{box-sizing:border-box}._scrollArea_ytzac_21{flex:1;overflow-y:auto;overflow-x:hidden;width:100%}._emptyState_ytzac_29{display:flex;align-items:center;justify-content:center;height:100%;color:var(--de-text-tertiary, #9ca3af);font-size:.875rem;padding:1rem;text-align:center}._root_vttth_1{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box}._list_vttth_9{display:flex;flex-direction:row;border-bottom:1px solid var(--de-border-color, #e5e7eb);background-color:var(--de-bg-primary, #ffffff)}._list_vttth_9[data-variant=segmented]{padding:4px;gap:4px;border-bottom:none;background-color:var(--de-bg-secondary, #f3f4f6);border-radius:6px}._trigger_vttth_24{padding:8px 16px;border:none;background:none;cursor:pointer;font-size:14px;font-weight:500;color:var(--de-text-secondary, #6b7280);transition:all .2s ease;position:relative}._trigger_vttth_24:hover{color:var(--de-text-primary, #1f2937)}._trigger_vttth_24[data-state=active]{color:var(--de-primary-color, #3b82f6)}._trigger_vttth_24[data-variant=default][data-state=active]:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background-color:var(--de-primary-color, #3b82f6)}._trigger_vttth_24[data-variant=segmented]{border-radius:4px;padding:6px 12px}._trigger_vttth_24[data-variant=segmented][data-state=active]{background-color:var(--de-bg-primary, #ffffff);box-shadow:0 1px 3px #0000001a}._trigger_vttth_24:disabled{opacity:.5;cursor:not-allowed}._content_vttth_69{flex:1;display:flex;flex-direction:column;width:100%;box-sizing:border-box}._input_jxjyc_5{width:100%;box-sizing:border-box;padding:.25rem .375rem;font-size:.75rem;font-family:inherit;line-height:1.25;border:1px solid var(--de-border-color, #d1d5db);border-radius:.25rem;background-color:var(--de-input-background, #ffffff);color:var(--de-text-color, #000000);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}._input_jxjyc_5:focus{outline:none;border-color:var(--de-primary-color, #3b82f6);box-shadow:0 0 0 3px var(--de-primary-shadow, rgba(59, 130, 246, .1))}._input_jxjyc_5:disabled{background-color:var(--de-input-disabled-background, #f3f4f6);color:var(--de-input-disabled-color, #9ca3af);cursor:not-allowed}textarea._input_jxjyc_5{resize:vertical;min-height:3rem}._container_1gf2q_1{display:flex;flex-direction:column;gap:.5rem;width:100%;box-sizing:border-box}._grid_1gf2q_9{display:grid;grid-template-columns:repeat(4,1fr);gap:.5rem}._field_1gf2q_15{display:flex;align-items:center;gap:.5rem;width:100%}._label_1gf2q_22{font-size:.75rem;color:var(--de-text-secondary, #6b7280);width:12px;flex-shrink:0;display:flex;justify-content:center;margin-bottom:.1rem}._inputWrapper_1gf2q_32{flex:1;min-width:0;display:flex}._group_xhfvf_1{display:inline-flex;border:1px solid var(--de-border-color, #d1d5db);padding:0;margin:0;gap:0;border-radius:.25rem;overflow:hidden;background-color:var(--de-bg-secondary, #f9fafb)}._btn_xhfvf_13{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:1.75rem;padding:0;border:none;border-right:1px solid var(--de-border-color, #d1d5db);background-color:transparent;color:var(--de-text-secondary, #6b7280);cursor:pointer;transition:background-color .12s,color .12s;flex-shrink:0}._btn_xhfvf_13:last-child{border-right:none}._btn_xhfvf_13:hover:not(:disabled){background-color:var(--de-bg-active, #e5e7eb);color:var(--de-text-primary, #374151)}._btn_xhfvf_13:disabled{cursor:not-allowed;opacity:.5}._active_xhfvf_46{background-color:var(--de-primary-color, #2563eb);color:#fff}._active_xhfvf_46:hover:not(:disabled){background-color:var(--de-primary-dark, #1d4ed8);color:#fff}._btn_xhfvf_13 svg{display:block;width:1rem;height:1rem;pointer-events:none}._group_1uyid_1{display:inline-flex;border:1px solid var(--de-border-color, #d1d5db);padding:0;margin:0;gap:0;border-radius:.25rem;overflow:hidden;background-color:var(--de-bg-secondary, #f9fafb)}._btn_1uyid_13{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:1.75rem;padding:0;border:none;border-right:1px solid var(--de-border-color, #d1d5db);background-color:transparent;color:var(--de-text-secondary, #6b7280);cursor:pointer;transition:background-color .12s,color .12s;flex-shrink:0}._btn_1uyid_13:last-child{border-right:none}._btn_1uyid_13:hover:not(:disabled){background-color:var(--de-bg-active, #e5e7eb);color:var(--de-text-primary, #374151)}._btn_1uyid_13:disabled{cursor:not-allowed;opacity:.5}._active_1uyid_46{background-color:var(--de-primary-color, #2563eb);color:#fff}._iconBold_1uyid_52{font-weight:700;font-size:.875rem;font-family:Georgia,serif;line-height:1}._iconItalic_1uyid_59{font-style:italic;font-size:.875rem;font-family:Georgia,serif;line-height:1}._iconUnderline_1uyid_66{text-decoration:underline;font-size:.875rem;font-family:Georgia,serif;line-height:1}._iconLineThrough_1uyid_73{text-decoration:line-through;font-size:.875rem;font-family:Georgia,serif;line-height:1}._root_12n4v_6{display:grid;grid-template-columns:1fr 8rem;gap:4px;align-items:center}._fontFamilyCell_12n4v_13,._fontSizeCell_12n4v_14,._colorCell_12n4v_15{min-width:0}._root_111zo_7{display:flex;flex-direction:column;gap:6px}._linkLabel_111zo_14{display:flex;align-items:center;gap:4px;font-size:11px;color:var(--de-text-secondary, #666);cursor:pointer;-webkit-user-select:none;user-select:none;flex-shrink:0}._linkLabel_111zo_14 input[type=checkbox]{cursor:pointer;accent-color:var(--de-primary-color, #3b82f6)}._allRow_111zo_31{display:flex;align-items:center;justify-content:center}._grid_111zo_38{display:flex;flex-direction:column;align-items:center;gap:4px}._sideRow_111zo_45{display:flex;align-items:center;justify-content:center;gap:8px}._cell_111zo_53{width:96px;flex-shrink:0}._spacer_111zo_59{width:48px;flex-shrink:0}._bar_13lr1_4{display:inline-flex;flex-direction:row;align-items:center;gap:2px;padding:4px 6px;border:1px solid var(--de-border-color, #d1d5db);border-radius:6px;background-color:var(--de-bg-primary, #ffffff);box-shadow:0 2px 8px #0000001f,0 1px 3px #00000014}._divider_13lr1_18{width:1px;height:18px;background-color:var(--de-bg-active, #e5e7eb);margin:0 2px}._barWrapper_13lr1_26{position:relative;display:inline-block}._popover_13lr1_31{position:absolute;top:calc(100% + 4px);left:0;z-index:1;background-color:var(--de-bg-primary, #ffffff);border:1px solid var(--de-border-color, #d1d5db);border-radius:6px;box-shadow:0 4px 16px #00000024,0 1px 4px #00000014;padding:12px;min-width:320px;max-height:480px;overflow-y:auto}._container_3lvww_1{display:flex;flex-direction:column;gap:.5rem;width:100%;box-sizing:border-box}._row_3lvww_9{display:flex;align-items:center;gap:.5rem}._label_3lvww_15{font-size:.9rem;color:var(--de-text-secondary, #6b7280);width:1.5rem;flex-shrink:0;display:flex;justify-content:center}._inputWrapper_3lvww_24{flex:1;min-width:0;display:flex;flex-direction:column}._error_3lvww_31{font-size:.75rem;color:var(--de-error-color, #dc2626);margin-top:.25rem}._container_2zb6l_1{width:100%;height:100%;background-color:var(--de-bg-primary, #ffffff);border-left:1px solid var(--de-border-color, #e5e7eb);display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}._container_2zb6l_1 *,._container_2zb6l_1 *:before,._container_2zb6l_1 *:after{box-sizing:border-box}._scrollArea_2zb6l_18{flex:1;overflow-y:auto;overflow-x:hidden;width:100%}._fields_2zb6l_25{display:flex;flex-direction:column;gap:1rem;width:100%;box-sizing:border-box}._emptyState_2zb6l_33{display:flex;align-items:center;justify-content:center;height:100%;color:var(--de-text-tertiary, #9ca3af);font-size:.875rem;padding:1rem;text-align:center}._kindSelector_qrad9_1{display:flex;flex-wrap:wrap;gap:.25rem;padding:.5rem .75rem;border-bottom:1px solid var(--de-border-color, #e5e7eb)}._kindTab_qrad9_9{display:inline-flex;align-items:center;justify-content:center;padding:.25rem .625rem;font-size:.75rem;border:1px solid var(--de-border-color, #d1d5db);border-radius:.25rem;background-color:var(--de-bg-secondary, #f9fafb);color:var(--de-text-primary, #374151);cursor:pointer;white-space:nowrap;transition:background-color .1s,color .1s}._kindTab_qrad9_9:hover{background-color:var(--de-bg-hover, #f3f4f6)}._kindTabActive_qrad9_30{background-color:var(--de-primary-color, #2563eb);color:#fff;border-color:var(--de-primary-color, #2563eb)}._kindTabActive_qrad9_30:hover{background-color:var(--de-primary-dark, #1d4ed8)}._kindTabIcon_qrad9_40{width:1rem;height:1rem}._propertyList_qrad9_46{display:flex;flex-direction:column;gap:0;padding:.25rem 0}._propRow_qrad9_54{display:flex;align-items:center;justify-content:space-between;padding:.375rem .75rem;border-bottom:1px solid var(--de-border-color, #f3f4f6);gap:.5rem}._propRow_qrad9_54:last-child{border-bottom:none}._propInfo_qrad9_67{display:flex;align-items:center;gap:.5rem;flex:1;min-width:0}._propKind_qrad9_75{font-family:monospace;font-size:.75rem;color:var(--de-text-primary, #374151)}._customBadge_qrad9_81{font-size:.625rem;font-weight:600;padding:.1rem .375rem;border-radius:.25rem;background-color:#eff6ff;color:var(--de-primary-color, #2563eb);border:1px solid #bfdbfe;white-space:nowrap}._propActions_qrad9_92{display:flex;gap:.25rem;flex-shrink:0}._setButton_qrad9_98,._resetButton_qrad9_99{padding:.25rem .625rem;font-size:.7rem;border-radius:.25rem;border:1px solid;cursor:pointer;transition:all .1s}._setButton_qrad9_98{background-color:var(--de-bg-secondary, #f9fafb);border-color:var(--de-border-color, #d1d5db);color:var(--de-text-primary, #374151)}._setButton_qrad9_98:hover{background-color:#eff6ff;border-color:#93c5fd;color:var(--de-primary-color, #2563eb)}._resetButton_qrad9_99{background-color:#fef2f2;border-color:#fca5a5;color:var(--de-error-color, #dc2626)}._resetButton_qrad9_99:hover{background-color:#fee2e2}._emptyState_qrad9_131{padding:1rem .75rem;color:var(--de-text-tertiary, #9ca3af);font-size:.8rem;text-align:center}._description_12dfx_4{margin:0 0 8px;font-size:.7rem;color:var(--de-text-tertiary, #9ca3af)}._list_12dfx_10{display:flex;flex-direction:column;gap:8px;list-style:none;margin:0;padding:0}._item_12dfx_19{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:var(--de-bg-secondary, #f5f5f5);border:1px solid var(--de-border-color, #e0e0e0);border-radius:4px;font-size:12px;cursor:grab;transition:all .2s}._item_12dfx_19:active{cursor:grabbing}._item_12dfx_19._dragging_12dfx_36{opacity:.5;cursor:grabbing}._item_12dfx_19._selected_12dfx_41{border-color:var(--de-accent-color, #2196f3);background-color:var(--de-accent-light, rgba(33, 150, 243, .1))}._dragHandle_12dfx_46{display:flex;align-items:center;justify-content:center;width:20px;height:20px;margin-right:8px;color:var(--de-text-secondary, #666);pointer-events:none}._item_12dfx_19:hover:not(._ghost_12dfx_57){box-shadow:0 0 0 2px var(--de-accent-color, #2196f3)}._item_12dfx_19._ghost_12dfx_57{opacity:.45;border:2px dashed var(--de-accent-color, #2196f3);background-color:var(--de-accent-light, rgba(33, 150, 243, .08));cursor:default}._itemInfo_12dfx_68{display:flex;flex-direction:column;gap:4px;flex:1}._itemId_12dfx_75{font-weight:500;color:var(--de-text-primary, #333)}._itemMeta_12dfx_80{display:flex;gap:8px;font-size:11px;color:var(--de-text-secondary, #666)}._itemKind_12dfx_87{font-family:monospace}._itemIndex_12dfx_91{color:var(--de-accent-color, #2196f3)}._itemActions_12dfx_95{display:flex;gap:4px}._actionButton_12dfx_100{display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--de-border-color, #e0e0e0);border-radius:4px;background-color:var(--de-bg-primary, #fff);color:var(--de-text-secondary, #666);cursor:pointer;transition:all .2s}._actionButton_12dfx_100:hover{background-color:var(--de-accent-light, rgba(33, 150, 243, .1));border-color:var(--de-accent-color, #2196f3);color:var(--de-accent-color, #2196f3)}._actionButton_12dfx_100:active{transform:scale(.95)}._actionButton_12dfx_100:disabled{opacity:.4;cursor:not-allowed}._actionButton_12dfx_100:disabled:hover{background-color:var(--de-bg-primary, #fff);border-color:var(--de-border-color, #e0e0e0);color:var(--de-text-secondary, #666)}._empty_12dfx_136{padding:24px;text-align:center;font-size:12px;color:var(--de-text-secondary, #666);background-color:var(--de-bg-secondary, #f5f5f5);border-radius:4px}._container_1x0zd_4{display:flex;flex-direction:row;align-items:center;gap:4px;padding:6px 8px;border-bottom:1px solid var(--de-border-color, #e5e7eb);background-color:var(--de-bg-secondary, #f9fafb);flex-shrink:0;flex-wrap:wrap}._group_1x0zd_16{display:flex;flex-direction:row;gap:2px}._divider_1x0zd_22{width:1px;height:20px;background-color:var(--de-border-color, #d1d5db);flex-shrink:0;margin:0 2px}._field_69k7e_6{display:flex;flex-direction:column;gap:6px}._field_69k7e_6._horizontal_69k7e_12{flex-direction:row;align-items:center;gap:4px}._label_69k7e_18{font-size:12px;font-weight:500;color:var(--de-text-secondary, #666)}._field_69k7e_6._horizontal_69k7e_12 ._label_69k7e_18{min-width:32px;flex-shrink:0}._gridSizeRow_69k7e_29{display:flex;gap:16px}._gridSizeRow_69k7e_29>._field_69k7e_6{flex:1;min-width:0}._topRow_2ni80_6{display:flex;align-items:center;justify-content:center;position:relative}._linkSwitch_2ni80_15{position:absolute;left:0;display:inline-flex;align-items:center;gap:3px}._switchLabel_2ni80_23{font-size:.625rem;font-weight:600;color:var(--de-text-tertiary, #9ca3af);-webkit-user-select:none;user-select:none;white-space:nowrap}._switchLabelActive_2ni80_31{color:var(--de-text-primary, #374151)}._toggle_2ni80_35{position:relative;width:28px;height:16px;border-radius:8px;background-color:var(--de-border-color, #d1d5db);border:none;cursor:pointer;padding:0;flex-shrink:0;transition:background-color .2s}._toggle_2ni80_35[aria-checked=true]{background-color:var(--de-primary-color, #3b82f6)}._thumb_2ni80_52{position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background-color:#fff;transition:left .2s;pointer-events:none}._toggle_2ni80_35[aria-checked=true] ._thumb_2ni80_52{left:14px}._topCell_2ni80_70{width:120px;flex-shrink:0}._sideCell_2ni80_75{width:120px;flex-shrink:0;min-width:0}._bottomCell_2ni80_81{width:120px;align-self:center}._sideMargins_2ni80_88{display:flex;gap:36px;justify-content:center}._grid_ddemj_5{display:grid;grid-template-columns:repeat(8,1fr);gap:4px 8px;align-items:center}._colSpan2_ddemj_13{grid-column:span 2}._colSpan3_ddemj_18{grid-column:span 3;min-width:0}._label_ddemj_23{font-size:12px;font-weight:500;color:var(--de-text-secondary, #666);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._modeLabel_ddemj_32{font-size:11px;font-weight:500;color:var(--de-text-secondary, #666);white-space:nowrap}._modeToggle_ddemj_40{grid-column:span 3;display:inline-flex;align-items:center;gap:4px}._switchLabel_ddemj_47{font-size:.625rem;font-weight:600;color:var(--de-text-tertiary, #9ca3af);-webkit-user-select:none;user-select:none;white-space:nowrap}._switchLabelActive_ddemj_55{color:var(--de-text-primary, #374151)}._toggle_ddemj_59{position:relative;width:28px;height:16px;border-radius:8px;background-color:var(--de-border-color, #d1d5db);border:none;cursor:pointer;padding:0;flex-shrink:0;transition:background-color .2s}._toggle_ddemj_59[aria-checked=true]{background-color:var(--de-primary-color, #3b82f6)}._thumb_ddemj_76{position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background-color:#fff;transition:left .2s;pointer-events:none}._toggle_ddemj_59[aria-checked=true] ._thumb_ddemj_76{left:14px}._checkboxCell_ddemj_92{display:flex;justify-content:center;align-items:center}._buttonGroup_5h1ft_1{display:flex;flex-direction:column;gap:8px}._button_5h1ft_1{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px 16px;border:1px solid var(--de-border-color, #e0e0e0);border-radius:4px;background-color:var(--de-bg-primary, #fff);color:var(--de-text-primary, #333);font-size:13px;font-weight:500;cursor:pointer;transition:all .2s}._button_5h1ft_1:hover{background-color:var(--de-accent-light, rgba(33, 150, 243, .1));border-color:var(--de-accent-color, #2196f3);color:var(--de-accent-color, #2196f3)}._button_5h1ft_1:active{transform:scale(.98)}._error_5h1ft_33{padding:12px;background-color:var(--de-error-bg, #ffebee);border:1px solid var(--de-error-border, #ef5350);border-radius:4px;color:var(--de-error-text, #c62828);font-size:12px;line-height:1.5;word-break:break-word}._container_16a0l_1{display:flex;flex-direction:column;width:100%;height:100%;background-color:var(--de-bg-secondary, #fafafa);overflow:hidden;box-sizing:border-box}._paletteItems_16a0l_11{flex:1;width:100%;padding:12px;overflow-y:auto;display:flex;flex-direction:column;gap:12px;box-sizing:border-box}._item_16a0l_23{display:flex;flex-direction:column;width:100%;border:1px solid var(--de-border-color, #d1d5db);border-radius:6px;background-color:var(--de-bg-primary, #ffffff);text-align:left;transition:all .2s ease;-webkit-user-select:none;user-select:none;box-sizing:border-box;flex-shrink:0;overflow:hidden}._item_16a0l_23:hover{background-color:var(--de-bg-hover, #f3f4f6);border-color:var(--de-border-hover, #9ca3af);box-shadow:0 2px 4px #0000000d}._item_16a0l_23:focus-visible{outline:2px solid var(--de-primary-color, #3b82f6);outline-offset:2px}._itemName_16a0l_49{width:100%;padding:12px;font-weight:600;font-size:14px;color:var(--de-text-primary, #1f2937);background:transparent;border:none;cursor:grab;text-align:left;transition:background-color .2s ease}._itemName_16a0l_49:hover{background-color:var(--de-bg-hover, #f9fafb)}._itemName_16a0l_49:active{cursor:grabbing;background-color:var(--de-bg-active, #f3f4f6)}._itemName_16a0l_49:focus-visible{outline:2px solid var(--de-primary-color, #3b82f6);outline-offset:-2px}._itemPreview_16a0l_77{width:100%;height:80px;padding:8px;border-top:1px solid var(--de-border-light, #e5e7eb);overflow:hidden;background:var(--de-bg-canvas, #f9fafb);display:flex;align-items:center;justify-content:center;position:relative;flex-shrink:0;box-sizing:border-box}._itemPreview_16a0l_77:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:1000;cursor:grab;pointer-events:auto}._itemPreview_16a0l_77>*{width:200px;height:100px;transform:scale(.6);transform-origin:center center;pointer-events:none;border:1px solid var(--de-border-light, #e5e7eb);border-radius:4px;background:var(--de-bg-primary, #ffffff);box-shadow:0 1px 3px #0000001a}._itemPreview_16a0l_77 *,._itemPreview_16a0l_77 *:before,._itemPreview_16a0l_77 *:after{pointer-events:none}._itemInfo_16a0l_126{display:flex;flex-direction:column}._itemDescription_16a0l_131{font-size:12px;color:var(--de-text-secondary, #6b7280);margin-bottom:4px}._itemSize_16a0l_137{font-size:11px;color:var(--de-text-tertiary, #9ca3af)}
|
package/dist/canvas.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./paperSettingsWidget-sLJsIUxS.cjs"),t=require("./sidebarPortal-C3HszQyp.cjs");function r(i){return{book:{paper:{size:{preset:t.PaperSizePreset.CUSTOM,width:{value:50,unit:"mm"},height:{value:10,unit:"mm"}},margin:{top:{value:0,unit:"mm"},right:{value:0,unit:"mm"},bottom:{value:0,unit:"mm"},left:{value:0,unit:"mm"}},autoHeight:!0,autoWidth:!0},pages:[{grid:{colCount:3,rowCount:1,cols:{1:{value:8,unit:"mm"},2:{value:15,unit:"mm"}}},blocks:[{...e.numberInputBlock(`${i}-value`,`${i}.value`),layout:{x:0,y:0,w:1,h:1}},{id:`${i}-stepper`,kind:"stepper",layout:{x:1,y:0,w:1,h:1},props:{binding:`${i}.value`,step:1,min:0}},{...e.unitSelectBlock(`${i}-unit`,`${i}.unit`),layout:{x:2,y:0,w:1,h:1}}]}]}}}const n={size:{preset:t.PaperSizePreset.CUSTOM,width:{value:120,unit:"mm"},height:{value:8,unit:"mm"}},margin:{top:{value:0,unit:"mm"},right:{value:0,unit:"mm"},bottom:{value:0,unit:"mm"},left:{value:0,unit:"mm"}},autoHeight:!0,autoWidth:!0},o={colCount:9,rowCount:1,cols:{1:{value:8,unit:"mm"},2:{value:16,unit:"mm"},4:{value:8,unit:"mm"},5:{value:16,unit:"mm"},7:{value:8,unit:"mm"},8:{value:16,unit:"mm"}}},a={book:{paper:n,pages:[{grid:o,blocks:[{id:"margin-bulk-label",kind:"text",layout:{x:0,y:0,w:2,h:1},initValue:"一括",behavior:{readOnly:!0},props:{horizontal:"center",vertical:"center"}},{id:"margin-bulk-checkbox",kind:"checkbox",layout:{x:2,y:0,w:1,h:1},props:{binding:"margin.bulk"}},{...e.numberInputBlock("margin-top-value","margin.top.value"),layout:{x:3,y:0,w:1,h:1},hiddenBinding:"margin.bulk"},{id:"margin-top-stepper",kind:"stepper",layout:{x:4,y:0,w:1,h:1},props:{binding:"margin.top.value",step:1,min:0},hiddenBinding:"margin.bulk"},{...e.unitSelectBlock("margin-top-unit","margin.top.unit"),layout:{x:5,y:0,w:1,h:1},hiddenBinding:"margin.bulk"},{...e.numberInputBlock("margin-all-value","margin.all.value"),layout:{x:3,y:0,w:1,h:1},hiddenBinding:{path:"margin.bulk",neq:!0}},{id:"margin-all-stepper",kind:"stepper",layout:{x:4,y:0,w:1,h:1},props:{binding:"margin.all.value",step:1,min:0},hiddenBinding:{path:"margin.bulk",neq:!0}},{...e.unitSelectBlock("margin-all-unit","margin.all.unit"),layout:{x:5,y:0,w:1,h:1},hiddenBinding:{path:"margin.bulk",neq:!0}}]}]}},l={book:{paper:n,pages:[{grid:o,blocks:[{...e.numberInputBlock("margin-left-value","margin.left.value"),layout:{x:0,y:0,w:1,h:1}},{id:"margin-left-stepper",kind:"stepper",layout:{x:1,y:0,w:1,h:1},props:{binding:"margin.left.value",step:1,min:0}},{...e.unitSelectBlock("margin-left-unit","margin.left.unit"),layout:{x:2,y:0,w:1,h:1}},{...e.numberInputBlock("margin-right-value","margin.right.value"),layout:{x:6,y:0,w:1,h:1}},{id:"margin-right-stepper",kind:"stepper",layout:{x:7,y:0,w:1,h:1},props:{binding:"margin.right.value",step:1,min:0}},{...e.unitSelectBlock("margin-right-unit","margin.right.unit"),layout:{x:8,y:0,w:1,h:1}}]}]}},u={book:{paper:n,pages:[{grid:o,blocks:[{...e.numberInputBlock("margin-bottom-value","margin.bottom.value"),layout:{x:3,y:0,w:1,h:1}},{id:"margin-bottom-stepper",kind:"stepper",layout:{x:4,y:0,w:1,h:1},props:{binding:"margin.bottom.value",step:1,min:0}},{...e.unitSelectBlock("margin-bottom-unit","margin.bottom.unit"),layout:{x:5,y:0,w:1,h:1}}]}]}},p={props:{book:{paper:{size:{preset:t.PaperSizePreset.CUSTOM,width:{value:120,unit:"mm"},height:{value:24,unit:"mm"}},margin:{top:{value:0,unit:"mm"},right:{value:0,unit:"mm"},bottom:{value:0,unit:"mm"},left:{value:0,unit:"mm"}},autoHeight:!0,autoWidth:!0},pages:[{grid:{colCount:1,rowCount:3,rows:{0:{value:8,unit:"mm"},1:{value:8,unit:"mm"},2:{value:8,unit:"mm"}}},blocks:[{id:"row-bulk-top",kind:"note",layout:{x:0,y:0,w:1,h:1},behavior:{heightFit:!0},props:a},{id:"row-left-right",kind:"note",layout:{x:0,y:1,w:1,h:1},behavior:{heightFit:!0},props:l,hiddenBinding:"margin.bulk"},{id:"row-bottom",kind:"note",layout:{x:0,y:2,w:1,h:1},behavior:{heightFit:!0},props:u,hiddenBinding:"margin.bulk"}]}]}},plugins:[e.CheckboxPlugin,e.NoteBlockPlugin,e.SelectPlugin,e.StepperPlugin,e.TextPlugin]};exports.BlockBorder=e.BlockBorder;exports.BlockCanvas=e.BlockCanvas;exports.BlockContainer=e.BlockContainer;exports.BlockGuideBorder=e.BlockGuideBorder;exports.BlockLayer=e.BlockLayer;exports.BlockRenderer=e.BlockRenderer;exports.ButtonPlugin=e.ButtonPlugin;exports.ButtonRenderer=e.ButtonRenderer;exports.CheckboxRenderer=e.CheckboxRenderer;exports.DEFAULT_GUIDE_BORDER=e.DEFAULT_GUIDE_BORDER;exports.DragType=e.DragType;exports.InteractionLayer=e.InteractionLayer;exports.InteractionMode=e.InteractionMode;exports.NoteBlockPlugin=e.NoteBlockPlugin;exports.NoteBlockRenderer=e.NoteBlockRenderer;exports.PAPER_SIZE_BLOCKS=e.PAPER_SIZE_BLOCKS;exports.ResizeHandle=e.ResizeHandle;exports.SelectRenderer=e.SelectRenderer;exports.StepperPlugin=e.StepperPlugin;exports.StepperRenderer=e.StepperRenderer;exports.TextRenderer=e.TextRenderer;exports.ValidationOverlay=e.ValidationOverlay;exports.buttonActionProp=e.buttonActionProp;exports.buttonContentProp=e.buttonContentProp;exports.evaluateCheckboxValidation=e.evaluateCheckboxValidation;exports.evaluateValidation=e.evaluateValidation;exports.executeButtonAction=e.executeButtonAction;exports.fontStyleProp=e.fontStyleProp;exports.getButtonActionActive=e.getButtonActionActive;exports.getInteractionMode=e.getInteractionMode;exports.getPaperSize=e.getPaperSize;exports.gridColCountWidget=e.gridColCountWidget;exports.gridRowCountWidget=e.gridRowCountWidget;exports.hasValidationRule=e.hasValidationRule;exports.isButtonActionEnabled=e.isButtonActionEnabled;exports.numberInputBlock=e.numberInputBlock;exports.paddingProp=e.paddingProp;exports.paperOrientationWidget=e.paperOrientationWidget;exports.paperPresetSelectWidget=e.paperPresetSelectWidget;exports.paperSizeWidget=e.paperSizeWidget;exports.placeholderProp=e.placeholderProp;exports.requiredProp=e.requiredProp;exports.resolveEffectivePaper=e.resolveEffectivePaper;exports.selectConfigProp=e.selectConfigProp;exports.stepperBehaviorProp=e.stepperBehaviorProp;exports.stepperStyleProp=e.stepperStyleProp;exports.unitSelectBlock=e.unitSelectBlock;exports.useBookActionContext=e.useBookActionContext;exports.useBookBindingContext=e.useBookBindingContext;exports.useBookHistory=e.useBookHistory;exports.useInteractionState=e.useInteractionState;exports.ACTUAL_UNITS=t.ACTUAL_UNITS;exports.ALL_UNITS=t.ALL_UNITS;exports.BORDER_UNITS=t.BORDER_UNITS;exports.DEFAULT_DPI=t.DEFAULT_DPI;exports.FONT_UNITS=t.FONT_UNITS;exports.GRID_UNITS=t.GRID_UNITS;exports.HorizontalAlign=t.HorizontalAlign;exports.InputType=t.InputType;exports.PADDING_UNITS=t.PADDING_UNITS;exports.PAPER_UNITS=t.PAPER_UNITS;exports.SIZE_UNITS=t.SIZE_UNITS;exports.Units=t.Units;exports.VerticalAlign=t.VerticalAlign;exports.WhiteSpace=t.WhiteSpace;exports.WordWrap=t.WordWrap;exports.alignmentProp=t.alignmentProp;exports.checkboxStyleProp=t.checkboxStyleProp;exports.dimensionToString=t.dimensionToString;exports.isValue=t.isValue;exports.startBlockDrag=t.startBlockDrag;exports.stringToDimension=t.stringToDimension;exports.textBehaviorProp=t.textBehaviorProp;exports.textValidationProp=t.textValidationProp;exports.toMm=t.toMm;exports.toPx=t.toPx;exports.validatePage=t.validatePage;exports.validateValues=t.validateValues;exports.dimensionInputWidget=r;exports.marginSettingsWidget=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas.cjs","sources":["../src/canvas/widgets/common/dimensionInputWidget.ts","../src/canvas/widgets/margin/marginSettingsWidget.ts"],"sourcesContent":["import { PaperSizePreset } from \"../../../types/paper\";\nimport { numberInputBlock } from \"../primitives/numberInputBlock\";\nimport { unitSelectBlock } from \"../primitives/unitSelectBlock\";\n\nimport type { NoteBlockProps } from \"../../blocks/note\";\n\n/**\n * Dimension<PaperUnit> バインディング用の 2 列入力 atom widget。\n *\n * @remarks\n * **Canvas** — カスタムシェル構築専用。\n *\n * 列 0 (1fr): 数値入力テキストブロック → `{binding}.value`\n *\n * 列 1 (15mm): 単位 select ブロック → `{binding}.unit`\n *\n * binding には Dimension のルートパス(例: \"paper.size.width\")を渡す。\n *\n * autoWidth: true により widget 自体もコンテナ幅いっぱいに広がる。\n *\n * @example\n * ```ts\n * // NoteBlock として使う場合\n * {\n * id: \"width-input\",\n * kind: \"note\",\n * layout: { x: 0, y: 0, w: 5, h: 2 },\n * props: dimensionInputWidget(\"paper.size.width\"),\n * }\n * ```\n */\nexport function dimensionInputWidget(binding: string): NoteBlockProps {\n\treturn {\n\t\tbook: {\n\t\t\tpaper: {\n\t\t\t\tsize: {\n\t\t\t\t\tpreset: PaperSizePreset.CUSTOM,\n\t\t\t\t\twidth: { value: 50, unit: \"mm\" },\n\t\t\t\t\theight: { value: 10, unit: \"mm\" },\n\t\t\t\t},\n\t\t\t\tmargin: {\n\t\t\t\t\ttop: { value: 0, unit: \"mm\" },\n\t\t\t\t\tright: { value: 0, unit: \"mm\" },\n\t\t\t\t\tbottom: { value: 0, unit: \"mm\" },\n\t\t\t\t\tleft: { value: 0, unit: \"mm\" },\n\t\t\t\t},\n\t\t\t\tautoHeight: true,\n\t\t\t\tautoWidth: true,\n\t\t\t},\n\t\t\tpages: [\n\t\t\t\t{\n\t\t\t\t\t// 列 0: 1fr(省略 = デフォルト)→ 入力欄が残幅を占有\n\t\t\t\t\t// 列 1: 8mm 固定 → stepper (+/- ボタン)\n\t\t\t\t\t// 列 2: 15mm 固定 → 単位 select\n\t\t\t\t\tgrid: {\n\t\t\t\t\t\tcolCount: 3,\n\t\t\t\t\t\trowCount: 1,\n\t\t\t\t\t\tcols: {\n\t\t\t\t\t\t\t1: { value: 8, unit: \"mm\" },\n\t\t\t\t\t\t\t2: { value: 15, unit: \"mm\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tblocks: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...numberInputBlock(`${binding}-value`, `${binding}.value`),\n\t\t\t\t\t\t\tlayout: { x: 0, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: `${binding}-stepper`,\n\t\t\t\t\t\t\tkind: \"stepper\",\n\t\t\t\t\t\t\tlayout: { x: 1, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\t\tprops: { binding: `${binding}.value`, step: 1, min: 0 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...unitSelectBlock(`${binding}-unit`, `${binding}.unit`),\n\t\t\t\t\t\t\tlayout: { x: 2, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t};\n}\n","import { PaperSizePreset } from \"../../../types/paper\";\nimport { CheckboxPlugin } from \"../../blocks/checkbox\";\nimport { NoteBlockPlugin } from \"../../blocks/note\";\nimport { SelectPlugin } from \"../../blocks/select\";\nimport { StepperPlugin } from \"../../blocks/stepper\";\nimport { TextPlugin } from \"../../blocks/text\";\nimport { numberInputBlock } from \"../primitives/numberInputBlock\";\nimport { unitSelectBlock } from \"../primitives/unitSelectBlock\";\n\nimport type { Value } from \"../../../types/value\";\nimport type { NoteBlockProps } from \"../../blocks/note\";\nimport type { WidgetDef } from \"../types\";\n\n// NoteBlockProps はランタイムには JSON 互換だが、TS が再帰型の静的証明をできないため\n// このヘルパー経由で単一箇所にキャストを限定する。\nfunction notePropsAsRecord(props: NoteBlockProps): Record<string, Value> {\n\t// NoteBlockProps は JSON 互換だが TS が再帰型の静的証明をできないため as unknown as が必要\n\treturn props as unknown as Record<string, Value>;\n}\n\n// 行 widget 共通のペーパー設定(高さ 8mm・幅 120mm・余白なし・ autoFit)\nconst ROW_PAPER = {\n\tsize: {\n\t\tpreset: PaperSizePreset.CUSTOM,\n\t\twidth: { value: 120, unit: \"mm\" as const },\n\t\theight: { value: 8, unit: \"mm\" as const },\n\t},\n\tmargin: {\n\t\ttop: { value: 0, unit: \"mm\" as const },\n\t\tright: { value: 0, unit: \"mm\" as const },\n\t\tbottom: { value: 0, unit: \"mm\" as const },\n\t\tleft: { value: 0, unit: \"mm\" as const },\n\t},\n\tautoHeight: true,\n\tautoWidth: true,\n};\n\n// 行 widget 共通の 9 列グリッド定義\n// 列 0 (1fr) : 一括ラベル / 左 value / (空)\n// 列 1 (8mm) : (空) / 左 stepper / (空)\n// 列 2 (15mm) : checkbox / 左 unit / (空)\n// 列 3 (1fr) : 上 value / (空) / 下 value\n// 列 4 (8mm) : 上 stepper / (空) / 下 stepper\n// 列 5 (15mm) : 上 unit / (空) / 下 unit\n// 列 6 (1fr) : (空) / 右 value / (空)\n// 列 7 (8mm) : (空) / 右 stepper/ (空)\n// 列 8 (15mm) : (空) / 右 unit / (空)\nconst ROW_GRID = {\n\tcolCount: 9,\n\trowCount: 1,\n\tcols: {\n\t\t1: { value: 8, unit: \"mm\" as const },\n\t\t2: { value: 16, unit: \"mm\" as const },\n\t\t4: { value: 8, unit: \"mm\" as const },\n\t\t5: { value: 16, unit: \"mm\" as const },\n\t\t7: { value: 8, unit: \"mm\" as const },\n\t\t8: { value: 16, unit: \"mm\" as const },\n\t},\n};\n\n// 行 0: 一括 checkbox + 上マージン(常に表示)\n// - margin-top-* 系は個別モード時のみ表示(hiddenBinding: \"margin.bulk\")\n// - margin-all-* 系は一括モード時のみ表示(hiddenBinding: { path: \"margin.bulk\", neq: true })\nconst ROW_BULK_TOP: NoteBlockProps = {\n\tbook: {\n\t\tpaper: ROW_PAPER,\n\t\tpages: [\n\t\t\t{\n\t\t\t\tgrid: ROW_GRID,\n\t\t\t\tblocks: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-bulk-label\",\n\t\t\t\t\t\tkind: \"text\",\n\t\t\t\t\t\tlayout: { x: 0, y: 0, w: 2, h: 1 },\n\t\t\t\t\t\tinitValue: \"一括\",\n\t\t\t\t\t\tbehavior: { readOnly: true },\n\t\t\t\t\t\tprops: { horizontal: \"center\", vertical: \"center\" },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-bulk-checkbox\",\n\t\t\t\t\t\tkind: \"checkbox\",\n\t\t\t\t\t\tlayout: { x: 2, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\tprops: { binding: \"margin.bulk\" },\n\t\t\t\t\t},\n\t\t\t\t\t// 個別モード: 上マージン入力(bulk=false 時のみ)\n\t\t\t\t\t{\n\t\t\t\t\t\t...numberInputBlock(\"margin-top-value\", \"margin.top.value\"),\n\t\t\t\t\t\tlayout: { x: 3, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\thiddenBinding: \"margin.bulk\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-top-stepper\",\n\t\t\t\t\t\tkind: \"stepper\",\n\t\t\t\t\t\tlayout: { x: 4, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\tprops: { binding: \"margin.top.value\", step: 1, min: 0 },\n\t\t\t\t\t\thiddenBinding: \"margin.bulk\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...unitSelectBlock(\"margin-top-unit\", \"margin.top.unit\"),\n\t\t\t\t\t\tlayout: { x: 5, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\thiddenBinding: \"margin.bulk\",\n\t\t\t\t\t},\n\t\t\t\t\t// 一括モード: 全辺共通マージン入力(bulk=true 時のみ)\n\t\t\t\t\t{\n\t\t\t\t\t\t...numberInputBlock(\"margin-all-value\", \"margin.all.value\"),\n\t\t\t\t\t\tlayout: { x: 3, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\thiddenBinding: { path: \"margin.bulk\", neq: true },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-all-stepper\",\n\t\t\t\t\t\tkind: \"stepper\",\n\t\t\t\t\t\tlayout: { x: 4, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\tprops: { binding: \"margin.all.value\", step: 1, min: 0 },\n\t\t\t\t\t\thiddenBinding: { path: \"margin.bulk\", neq: true },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...unitSelectBlock(\"margin-all-unit\", \"margin.all.unit\"),\n\t\t\t\t\t\tlayout: { x: 5, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\thiddenBinding: { path: \"margin.bulk\", neq: true },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n};\n\n// 行 1: 左・右マージン(個別時のみ表示)\nconst ROW_LEFT_RIGHT: NoteBlockProps = {\n\tbook: {\n\t\tpaper: ROW_PAPER,\n\t\tpages: [\n\t\t\t{\n\t\t\t\tgrid: ROW_GRID,\n\t\t\t\tblocks: [\n\t\t\t\t\t{\n\t\t\t\t\t\t...numberInputBlock(\"margin-left-value\", \"margin.left.value\"),\n\t\t\t\t\t\tlayout: { x: 0, y: 0, w: 1, h: 1 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-left-stepper\",\n\t\t\t\t\t\tkind: \"stepper\",\n\t\t\t\t\t\tlayout: { x: 1, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\tprops: { binding: \"margin.left.value\", step: 1, min: 0 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...unitSelectBlock(\"margin-left-unit\", \"margin.left.unit\"),\n\t\t\t\t\t\tlayout: { x: 2, y: 0, w: 1, h: 1 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...numberInputBlock(\"margin-right-value\", \"margin.right.value\"),\n\t\t\t\t\t\tlayout: { x: 6, y: 0, w: 1, h: 1 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-right-stepper\",\n\t\t\t\t\t\tkind: \"stepper\",\n\t\t\t\t\t\tlayout: { x: 7, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\tprops: { binding: \"margin.right.value\", step: 1, min: 0 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...unitSelectBlock(\"margin-right-unit\", \"margin.right.unit\"),\n\t\t\t\t\t\tlayout: { x: 8, y: 0, w: 1, h: 1 },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n};\n\n// 行 2(末尾): 下マージン(個別時のみ表示)\nconst ROW_BOTTOM: NoteBlockProps = {\n\tbook: {\n\t\tpaper: ROW_PAPER,\n\t\tpages: [\n\t\t\t{\n\t\t\t\tgrid: ROW_GRID,\n\t\t\t\tblocks: [\n\t\t\t\t\t{\n\t\t\t\t\t\t...numberInputBlock(\"margin-bottom-value\", \"margin.bottom.value\"),\n\t\t\t\t\t\tlayout: { x: 3, y: 0, w: 1, h: 1 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-bottom-stepper\",\n\t\t\t\t\t\tkind: \"stepper\",\n\t\t\t\t\t\tlayout: { x: 4, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\tprops: { binding: \"margin.bottom.value\", step: 1, min: 0 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...unitSelectBlock(\"margin-bottom-unit\", \"margin.bottom.unit\"),\n\t\t\t\t\t\tlayout: { x: 5, y: 0, w: 1, h: 1 },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n};\n\n/**\n * マージン設定 compound widget(3 行・行 widget 構成)。\n *\n * @remarks\n * **Canvas** — カスタムシェル構築専用。\n *\n * - 行 0(常に表示): 一括 checkbox\n * + 上マージン入力(個別時) ← hiddenBinding: \"margin.bulk\"\n * + 全辺共通マージン入力(一括時) ← hiddenBinding: { path: \"margin.bulk\", neq: true }\n * - 行 1(個別時): 左・右マージン ← hiddenBinding: \"margin.bulk\"\n * - 行 2(個別時・末尾): 下マージン ← hiddenBinding: \"margin.bulk\"\n *\n * binding:\n * - `margin.bulk` / `margin.all` / `margin.top` / `margin.left` / `margin.right` / `margin.bottom`\n */\nexport const marginSettingsWidget: WidgetDef = {\n\tprops: {\n\t\tbook: {\n\t\t\tpaper: {\n\t\t\t\tsize: {\n\t\t\t\t\tpreset: PaperSizePreset.CUSTOM,\n\t\t\t\t\twidth: { value: 120, unit: \"mm\" },\n\t\t\t\t\theight: { value: 24, unit: \"mm\" },\n\t\t\t\t},\n\t\t\t\tmargin: {\n\t\t\t\t\ttop: { value: 0, unit: \"mm\" },\n\t\t\t\t\tright: { value: 0, unit: \"mm\" },\n\t\t\t\t\tbottom: { value: 0, unit: \"mm\" },\n\t\t\t\t\tleft: { value: 0, unit: \"mm\" },\n\t\t\t\t},\n\t\t\t\tautoHeight: true,\n\t\t\t\tautoWidth: true,\n\t\t\t},\n\t\t\tpages: [\n\t\t\t\t{\n\t\t\t\t\tgrid: {\n\t\t\t\t\t\tcolCount: 1,\n\t\t\t\t\t\trowCount: 3,\n\t\t\t\t\t\trows: {\n\t\t\t\t\t\t\t0: { value: 8, unit: \"mm\" },\n\t\t\t\t\t\t\t1: { value: 8, unit: \"mm\" },\n\t\t\t\t\t\t\t2: { value: 8, unit: \"mm\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tblocks: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"row-bulk-top\",\n\t\t\t\t\t\t\tkind: \"note\",\n\t\t\t\t\t\t\tlayout: { x: 0, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\t\tbehavior: { heightFit: true },\n\t\t\t\t\t\t\tprops: notePropsAsRecord(ROW_BULK_TOP),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"row-left-right\",\n\t\t\t\t\t\t\tkind: \"note\",\n\t\t\t\t\t\t\tlayout: { x: 0, y: 1, w: 1, h: 1 },\n\t\t\t\t\t\t\tbehavior: { heightFit: true },\n\t\t\t\t\t\t\tprops: notePropsAsRecord(ROW_LEFT_RIGHT),\n\t\t\t\t\t\t\thiddenBinding: \"margin.bulk\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"row-bottom\",\n\t\t\t\t\t\t\tkind: \"note\",\n\t\t\t\t\t\t\tlayout: { x: 0, y: 2, w: 1, h: 1 },\n\t\t\t\t\t\t\tbehavior: { heightFit: true },\n\t\t\t\t\t\t\tprops: notePropsAsRecord(ROW_BOTTOM),\n\t\t\t\t\t\t\thiddenBinding: \"margin.bulk\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\tplugins: [\n\t\tCheckboxPlugin,\n\t\tNoteBlockPlugin,\n\t\tSelectPlugin,\n\t\tStepperPlugin,\n\t\tTextPlugin,\n\t],\n};\n"],"names":["dimensionInputWidget","binding","PaperSizePreset","numberInputBlock","unitSelectBlock","ROW_PAPER","ROW_GRID","ROW_BULK_TOP","ROW_LEFT_RIGHT","ROW_BOTTOM","marginSettingsWidget","CheckboxPlugin","NoteBlockPlugin","SelectPlugin","StepperPlugin","TextPlugin"],"mappings":"gLA+BO,SAASA,EAAqBC,EAAiC,CACrE,MAAO,CACN,KAAM,CACL,MAAO,CACN,KAAM,CACL,OAAQC,EAAAA,gBAAgB,OACxB,MAAO,CAAE,MAAO,GAAI,KAAM,IAAA,EAC1B,OAAQ,CAAE,MAAO,GAAI,KAAM,IAAA,CAAK,EAEjC,OAAQ,CACP,IAAK,CAAE,MAAO,EAAG,KAAM,IAAA,EACvB,MAAO,CAAE,MAAO,EAAG,KAAM,IAAA,EACzB,OAAQ,CAAE,MAAO,EAAG,KAAM,IAAA,EAC1B,KAAM,CAAE,MAAO,EAAG,KAAM,IAAA,CAAK,EAE9B,WAAY,GACZ,UAAW,EAAA,EAEZ,MAAO,CACN,CAIC,KAAM,CACL,SAAU,EACV,SAAU,EACV,KAAM,CACL,EAAG,CAAE,MAAO,EAAG,KAAM,IAAA,EACrB,EAAG,CAAE,MAAO,GAAI,KAAM,IAAA,CAAK,CAC5B,EAED,O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AE,UAAW,EAAA,EACvB,MAAyBC,EACzB,cAAe,aAAA,EAEhB,CACC,GAAI,aACJ,KAAM,OACN,OAAQ,CAAE,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,CAAA,EAC/B,SAAU,CAAE,UAAW,EAAA,EACvB,MAAyBC,EACzB,cAAe,aAAA,CAChB,CACD,CACD,CACD,CACD,EAED,QAAS,CACRE,EAAAA,eACAC,EAAAA,gBACAC,EAAAA,aACAC,EAAAA,cACAC,EAAAA,UAAA,CAEF"}
|
package/dist/canvas.mjs
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { n as a, y as e, C as r, z as u, S as l, d as s, T as m } from "./paperSettingsWidget-DgDoBA0P.js";
|
|
2
|
+
import { A as x, E as B, F as P, G as w, h as S, H as R, B as T, I as C, J as I, K as f, L as _, M as A, O as W, P as O, Q as U, R as E, U as D, W as N, X as z, Y as L, Z as V, _ as F, $ as H, a0 as G, a1 as M, a2 as $, a3 as q, a4 as K, a5 as Z, a6 as j, a7 as J, a8 as Q, a9 as X, aa as Y, ab as tt, ac as at, ad as et, ae as it, af as nt, e as ot, ag as rt, ah as ut, ai as lt, b as st, a as mt, u as pt, aj as gt } from "./paperSettingsWidget-DgDoBA0P.js";
|
|
3
|
+
import { P as i } from "./sidebarPortal-C06y4JSP.js";
|
|
4
|
+
import { A as ht, i as vt, B as ct, D as yt, F as kt, G as bt, H as xt, I as Bt, j as Pt, k as wt, l as St, U as Rt, V as Tt, W as Ct, m as It, n as ft, o as _t, q as At, r as Wt, t as Ot, v as Ut, w as Et, x as Dt, y as Nt, z as zt, C as Lt, E as Vt } from "./sidebarPortal-C06y4JSP.js";
|
|
5
|
+
function c(t) {
|
|
6
|
+
return {
|
|
7
|
+
book: {
|
|
8
|
+
paper: {
|
|
9
|
+
size: {
|
|
10
|
+
preset: i.CUSTOM,
|
|
11
|
+
width: { value: 50, unit: "mm" },
|
|
12
|
+
height: { value: 10, unit: "mm" }
|
|
13
|
+
},
|
|
14
|
+
margin: {
|
|
15
|
+
top: { value: 0, unit: "mm" },
|
|
16
|
+
right: { value: 0, unit: "mm" },
|
|
17
|
+
bottom: { value: 0, unit: "mm" },
|
|
18
|
+
left: { value: 0, unit: "mm" }
|
|
19
|
+
},
|
|
20
|
+
autoHeight: !0,
|
|
21
|
+
autoWidth: !0
|
|
22
|
+
},
|
|
23
|
+
pages: [
|
|
24
|
+
{
|
|
25
|
+
// 列 0: 1fr(省略 = デフォルト)→ 入力欄が残幅を占有
|
|
26
|
+
// 列 1: 8mm 固定 → stepper (+/- ボタン)
|
|
27
|
+
// 列 2: 15mm 固定 → 単位 select
|
|
28
|
+
grid: {
|
|
29
|
+
colCount: 3,
|
|
30
|
+
rowCount: 1,
|
|
31
|
+
cols: {
|
|
32
|
+
1: { value: 8, unit: "mm" },
|
|
33
|
+
2: { value: 15, unit: "mm" }
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
blocks: [
|
|
37
|
+
{
|
|
38
|
+
...a(`${t}-value`, `${t}.value`),
|
|
39
|
+
layout: { x: 0, y: 0, w: 1, h: 1 }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: `${t}-stepper`,
|
|
43
|
+
kind: "stepper",
|
|
44
|
+
layout: { x: 1, y: 0, w: 1, h: 1 },
|
|
45
|
+
props: { binding: `${t}.value`, step: 1, min: 0 }
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
...e(`${t}-unit`, `${t}.unit`),
|
|
49
|
+
layout: { x: 2, y: 0, w: 1, h: 1 }
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const n = {
|
|
58
|
+
size: {
|
|
59
|
+
preset: i.CUSTOM,
|
|
60
|
+
width: { value: 120, unit: "mm" },
|
|
61
|
+
height: { value: 8, unit: "mm" }
|
|
62
|
+
},
|
|
63
|
+
margin: {
|
|
64
|
+
top: { value: 0, unit: "mm" },
|
|
65
|
+
right: { value: 0, unit: "mm" },
|
|
66
|
+
bottom: { value: 0, unit: "mm" },
|
|
67
|
+
left: { value: 0, unit: "mm" }
|
|
68
|
+
},
|
|
69
|
+
autoHeight: !0,
|
|
70
|
+
autoWidth: !0
|
|
71
|
+
}, o = {
|
|
72
|
+
colCount: 9,
|
|
73
|
+
rowCount: 1,
|
|
74
|
+
cols: {
|
|
75
|
+
1: { value: 8, unit: "mm" },
|
|
76
|
+
2: { value: 16, unit: "mm" },
|
|
77
|
+
4: { value: 8, unit: "mm" },
|
|
78
|
+
5: { value: 16, unit: "mm" },
|
|
79
|
+
7: { value: 8, unit: "mm" },
|
|
80
|
+
8: { value: 16, unit: "mm" }
|
|
81
|
+
}
|
|
82
|
+
}, p = {
|
|
83
|
+
book: {
|
|
84
|
+
paper: n,
|
|
85
|
+
pages: [
|
|
86
|
+
{
|
|
87
|
+
grid: o,
|
|
88
|
+
blocks: [
|
|
89
|
+
{
|
|
90
|
+
id: "margin-bulk-label",
|
|
91
|
+
kind: "text",
|
|
92
|
+
layout: { x: 0, y: 0, w: 2, h: 1 },
|
|
93
|
+
initValue: "一括",
|
|
94
|
+
behavior: { readOnly: !0 },
|
|
95
|
+
props: { horizontal: "center", vertical: "center" }
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: "margin-bulk-checkbox",
|
|
99
|
+
kind: "checkbox",
|
|
100
|
+
layout: { x: 2, y: 0, w: 1, h: 1 },
|
|
101
|
+
props: { binding: "margin.bulk" }
|
|
102
|
+
},
|
|
103
|
+
// 個別モード: 上マージン入力(bulk=false 時のみ)
|
|
104
|
+
{
|
|
105
|
+
...a("margin-top-value", "margin.top.value"),
|
|
106
|
+
layout: { x: 3, y: 0, w: 1, h: 1 },
|
|
107
|
+
hiddenBinding: "margin.bulk"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: "margin-top-stepper",
|
|
111
|
+
kind: "stepper",
|
|
112
|
+
layout: { x: 4, y: 0, w: 1, h: 1 },
|
|
113
|
+
props: { binding: "margin.top.value", step: 1, min: 0 },
|
|
114
|
+
hiddenBinding: "margin.bulk"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
...e("margin-top-unit", "margin.top.unit"),
|
|
118
|
+
layout: { x: 5, y: 0, w: 1, h: 1 },
|
|
119
|
+
hiddenBinding: "margin.bulk"
|
|
120
|
+
},
|
|
121
|
+
// 一括モード: 全辺共通マージン入力(bulk=true 時のみ)
|
|
122
|
+
{
|
|
123
|
+
...a("margin-all-value", "margin.all.value"),
|
|
124
|
+
layout: { x: 3, y: 0, w: 1, h: 1 },
|
|
125
|
+
hiddenBinding: { path: "margin.bulk", neq: !0 }
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: "margin-all-stepper",
|
|
129
|
+
kind: "stepper",
|
|
130
|
+
layout: { x: 4, y: 0, w: 1, h: 1 },
|
|
131
|
+
props: { binding: "margin.all.value", step: 1, min: 0 },
|
|
132
|
+
hiddenBinding: { path: "margin.bulk", neq: !0 }
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
...e("margin-all-unit", "margin.all.unit"),
|
|
136
|
+
layout: { x: 5, y: 0, w: 1, h: 1 },
|
|
137
|
+
hiddenBinding: { path: "margin.bulk", neq: !0 }
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
}, g = {
|
|
144
|
+
book: {
|
|
145
|
+
paper: n,
|
|
146
|
+
pages: [
|
|
147
|
+
{
|
|
148
|
+
grid: o,
|
|
149
|
+
blocks: [
|
|
150
|
+
{
|
|
151
|
+
...a("margin-left-value", "margin.left.value"),
|
|
152
|
+
layout: { x: 0, y: 0, w: 1, h: 1 }
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: "margin-left-stepper",
|
|
156
|
+
kind: "stepper",
|
|
157
|
+
layout: { x: 1, y: 0, w: 1, h: 1 },
|
|
158
|
+
props: { binding: "margin.left.value", step: 1, min: 0 }
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
...e("margin-left-unit", "margin.left.unit"),
|
|
162
|
+
layout: { x: 2, y: 0, w: 1, h: 1 }
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
...a("margin-right-value", "margin.right.value"),
|
|
166
|
+
layout: { x: 6, y: 0, w: 1, h: 1 }
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: "margin-right-stepper",
|
|
170
|
+
kind: "stepper",
|
|
171
|
+
layout: { x: 7, y: 0, w: 1, h: 1 },
|
|
172
|
+
props: { binding: "margin.right.value", step: 1, min: 0 }
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
...e("margin-right-unit", "margin.right.unit"),
|
|
176
|
+
layout: { x: 8, y: 0, w: 1, h: 1 }
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
}, d = {
|
|
183
|
+
book: {
|
|
184
|
+
paper: n,
|
|
185
|
+
pages: [
|
|
186
|
+
{
|
|
187
|
+
grid: o,
|
|
188
|
+
blocks: [
|
|
189
|
+
{
|
|
190
|
+
...a("margin-bottom-value", "margin.bottom.value"),
|
|
191
|
+
layout: { x: 3, y: 0, w: 1, h: 1 }
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: "margin-bottom-stepper",
|
|
195
|
+
kind: "stepper",
|
|
196
|
+
layout: { x: 4, y: 0, w: 1, h: 1 },
|
|
197
|
+
props: { binding: "margin.bottom.value", step: 1, min: 0 }
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
...e("margin-bottom-unit", "margin.bottom.unit"),
|
|
201
|
+
layout: { x: 5, y: 0, w: 1, h: 1 }
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
}, y = {
|
|
208
|
+
props: {
|
|
209
|
+
book: {
|
|
210
|
+
paper: {
|
|
211
|
+
size: {
|
|
212
|
+
preset: i.CUSTOM,
|
|
213
|
+
width: { value: 120, unit: "mm" },
|
|
214
|
+
height: { value: 24, unit: "mm" }
|
|
215
|
+
},
|
|
216
|
+
margin: {
|
|
217
|
+
top: { value: 0, unit: "mm" },
|
|
218
|
+
right: { value: 0, unit: "mm" },
|
|
219
|
+
bottom: { value: 0, unit: "mm" },
|
|
220
|
+
left: { value: 0, unit: "mm" }
|
|
221
|
+
},
|
|
222
|
+
autoHeight: !0,
|
|
223
|
+
autoWidth: !0
|
|
224
|
+
},
|
|
225
|
+
pages: [
|
|
226
|
+
{
|
|
227
|
+
grid: {
|
|
228
|
+
colCount: 1,
|
|
229
|
+
rowCount: 3,
|
|
230
|
+
rows: {
|
|
231
|
+
0: { value: 8, unit: "mm" },
|
|
232
|
+
1: { value: 8, unit: "mm" },
|
|
233
|
+
2: { value: 8, unit: "mm" }
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
blocks: [
|
|
237
|
+
{
|
|
238
|
+
id: "row-bulk-top",
|
|
239
|
+
kind: "note",
|
|
240
|
+
layout: { x: 0, y: 0, w: 1, h: 1 },
|
|
241
|
+
behavior: { heightFit: !0 },
|
|
242
|
+
props: p
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
id: "row-left-right",
|
|
246
|
+
kind: "note",
|
|
247
|
+
layout: { x: 0, y: 1, w: 1, h: 1 },
|
|
248
|
+
behavior: { heightFit: !0 },
|
|
249
|
+
props: g,
|
|
250
|
+
hiddenBinding: "margin.bulk"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
id: "row-bottom",
|
|
254
|
+
kind: "note",
|
|
255
|
+
layout: { x: 0, y: 2, w: 1, h: 1 },
|
|
256
|
+
behavior: { heightFit: !0 },
|
|
257
|
+
props: d,
|
|
258
|
+
hiddenBinding: "margin.bulk"
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
plugins: [
|
|
266
|
+
r,
|
|
267
|
+
u,
|
|
268
|
+
l,
|
|
269
|
+
s,
|
|
270
|
+
m
|
|
271
|
+
]
|
|
272
|
+
};
|
|
273
|
+
export {
|
|
274
|
+
ht as ACTUAL_UNITS,
|
|
275
|
+
vt as ALL_UNITS,
|
|
276
|
+
ct as BORDER_UNITS,
|
|
277
|
+
x as BlockBorder,
|
|
278
|
+
B as BlockCanvas,
|
|
279
|
+
P as BlockContainer,
|
|
280
|
+
w as BlockGuideBorder,
|
|
281
|
+
S as BlockLayer,
|
|
282
|
+
R as BlockRenderer,
|
|
283
|
+
T as ButtonPlugin,
|
|
284
|
+
C as ButtonRenderer,
|
|
285
|
+
I as CheckboxRenderer,
|
|
286
|
+
yt as DEFAULT_DPI,
|
|
287
|
+
f as DEFAULT_GUIDE_BORDER,
|
|
288
|
+
_ as DragType,
|
|
289
|
+
kt as FONT_UNITS,
|
|
290
|
+
bt as GRID_UNITS,
|
|
291
|
+
xt as HorizontalAlign,
|
|
292
|
+
Bt as InputType,
|
|
293
|
+
A as InteractionLayer,
|
|
294
|
+
W as InteractionMode,
|
|
295
|
+
u as NoteBlockPlugin,
|
|
296
|
+
O as NoteBlockRenderer,
|
|
297
|
+
Pt as PADDING_UNITS,
|
|
298
|
+
U as PAPER_SIZE_BLOCKS,
|
|
299
|
+
wt as PAPER_UNITS,
|
|
300
|
+
E as ResizeHandle,
|
|
301
|
+
St as SIZE_UNITS,
|
|
302
|
+
D as SelectRenderer,
|
|
303
|
+
s as StepperPlugin,
|
|
304
|
+
N as StepperRenderer,
|
|
305
|
+
z as TextRenderer,
|
|
306
|
+
Rt as Units,
|
|
307
|
+
L as ValidationOverlay,
|
|
308
|
+
Tt as VerticalAlign,
|
|
309
|
+
Ct as WhiteSpace,
|
|
310
|
+
It as WordWrap,
|
|
311
|
+
ft as alignmentProp,
|
|
312
|
+
V as buttonActionProp,
|
|
313
|
+
F as buttonContentProp,
|
|
314
|
+
_t as checkboxStyleProp,
|
|
315
|
+
c as dimensionInputWidget,
|
|
316
|
+
At as dimensionToString,
|
|
317
|
+
H as evaluateCheckboxValidation,
|
|
318
|
+
G as evaluateValidation,
|
|
319
|
+
M as executeButtonAction,
|
|
320
|
+
$ as fontStyleProp,
|
|
321
|
+
q as getButtonActionActive,
|
|
322
|
+
K as getInteractionMode,
|
|
323
|
+
Z as getPaperSize,
|
|
324
|
+
j as gridColCountWidget,
|
|
325
|
+
J as gridRowCountWidget,
|
|
326
|
+
Q as hasValidationRule,
|
|
327
|
+
X as isButtonActionEnabled,
|
|
328
|
+
Wt as isValue,
|
|
329
|
+
y as marginSettingsWidget,
|
|
330
|
+
a as numberInputBlock,
|
|
331
|
+
Y as paddingProp,
|
|
332
|
+
tt as paperOrientationWidget,
|
|
333
|
+
at as paperPresetSelectWidget,
|
|
334
|
+
et as paperSizeWidget,
|
|
335
|
+
it as placeholderProp,
|
|
336
|
+
nt as requiredProp,
|
|
337
|
+
ot as resolveEffectivePaper,
|
|
338
|
+
rt as selectConfigProp,
|
|
339
|
+
Ot as startBlockDrag,
|
|
340
|
+
ut as stepperBehaviorProp,
|
|
341
|
+
lt as stepperStyleProp,
|
|
342
|
+
Ut as stringToDimension,
|
|
343
|
+
Et as textBehaviorProp,
|
|
344
|
+
Dt as textValidationProp,
|
|
345
|
+
Nt as toMm,
|
|
346
|
+
zt as toPx,
|
|
347
|
+
e as unitSelectBlock,
|
|
348
|
+
st as useBookActionContext,
|
|
349
|
+
mt as useBookBindingContext,
|
|
350
|
+
pt as useBookHistory,
|
|
351
|
+
gt as useInteractionState,
|
|
352
|
+
Lt as validatePage,
|
|
353
|
+
Vt as validateValues
|
|
354
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas.mjs","sources":["../src/canvas/widgets/common/dimensionInputWidget.ts","../src/canvas/widgets/margin/marginSettingsWidget.ts"],"sourcesContent":["import { PaperSizePreset } from \"../../../types/paper\";\nimport { numberInputBlock } from \"../primitives/numberInputBlock\";\nimport { unitSelectBlock } from \"../primitives/unitSelectBlock\";\n\nimport type { NoteBlockProps } from \"../../blocks/note\";\n\n/**\n * Dimension<PaperUnit> バインディング用の 2 列入力 atom widget。\n *\n * @remarks\n * **Canvas** — カスタムシェル構築専用。\n *\n * 列 0 (1fr): 数値入力テキストブロック → `{binding}.value`\n *\n * 列 1 (15mm): 単位 select ブロック → `{binding}.unit`\n *\n * binding には Dimension のルートパス(例: \"paper.size.width\")を渡す。\n *\n * autoWidth: true により widget 自体もコンテナ幅いっぱいに広がる。\n *\n * @example\n * ```ts\n * // NoteBlock として使う場合\n * {\n * id: \"width-input\",\n * kind: \"note\",\n * layout: { x: 0, y: 0, w: 5, h: 2 },\n * props: dimensionInputWidget(\"paper.size.width\"),\n * }\n * ```\n */\nexport function dimensionInputWidget(binding: string): NoteBlockProps {\n\treturn {\n\t\tbook: {\n\t\t\tpaper: {\n\t\t\t\tsize: {\n\t\t\t\t\tpreset: PaperSizePreset.CUSTOM,\n\t\t\t\t\twidth: { value: 50, unit: \"mm\" },\n\t\t\t\t\theight: { value: 10, unit: \"mm\" },\n\t\t\t\t},\n\t\t\t\tmargin: {\n\t\t\t\t\ttop: { value: 0, unit: \"mm\" },\n\t\t\t\t\tright: { value: 0, unit: \"mm\" },\n\t\t\t\t\tbottom: { value: 0, unit: \"mm\" },\n\t\t\t\t\tleft: { value: 0, unit: \"mm\" },\n\t\t\t\t},\n\t\t\t\tautoHeight: true,\n\t\t\t\tautoWidth: true,\n\t\t\t},\n\t\t\tpages: [\n\t\t\t\t{\n\t\t\t\t\t// 列 0: 1fr(省略 = デフォルト)→ 入力欄が残幅を占有\n\t\t\t\t\t// 列 1: 8mm 固定 → stepper (+/- ボタン)\n\t\t\t\t\t// 列 2: 15mm 固定 → 単位 select\n\t\t\t\t\tgrid: {\n\t\t\t\t\t\tcolCount: 3,\n\t\t\t\t\t\trowCount: 1,\n\t\t\t\t\t\tcols: {\n\t\t\t\t\t\t\t1: { value: 8, unit: \"mm\" },\n\t\t\t\t\t\t\t2: { value: 15, unit: \"mm\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tblocks: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...numberInputBlock(`${binding}-value`, `${binding}.value`),\n\t\t\t\t\t\t\tlayout: { x: 0, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: `${binding}-stepper`,\n\t\t\t\t\t\t\tkind: \"stepper\",\n\t\t\t\t\t\t\tlayout: { x: 1, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\t\tprops: { binding: `${binding}.value`, step: 1, min: 0 },\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...unitSelectBlock(`${binding}-unit`, `${binding}.unit`),\n\t\t\t\t\t\t\tlayout: { x: 2, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t};\n}\n","import { PaperSizePreset } from \"../../../types/paper\";\nimport { CheckboxPlugin } from \"../../blocks/checkbox\";\nimport { NoteBlockPlugin } from \"../../blocks/note\";\nimport { SelectPlugin } from \"../../blocks/select\";\nimport { StepperPlugin } from \"../../blocks/stepper\";\nimport { TextPlugin } from \"../../blocks/text\";\nimport { numberInputBlock } from \"../primitives/numberInputBlock\";\nimport { unitSelectBlock } from \"../primitives/unitSelectBlock\";\n\nimport type { Value } from \"../../../types/value\";\nimport type { NoteBlockProps } from \"../../blocks/note\";\nimport type { WidgetDef } from \"../types\";\n\n// NoteBlockProps はランタイムには JSON 互換だが、TS が再帰型の静的証明をできないため\n// このヘルパー経由で単一箇所にキャストを限定する。\nfunction notePropsAsRecord(props: NoteBlockProps): Record<string, Value> {\n\t// NoteBlockProps は JSON 互換だが TS が再帰型の静的証明をできないため as unknown as が必要\n\treturn props as unknown as Record<string, Value>;\n}\n\n// 行 widget 共通のペーパー設定(高さ 8mm・幅 120mm・余白なし・ autoFit)\nconst ROW_PAPER = {\n\tsize: {\n\t\tpreset: PaperSizePreset.CUSTOM,\n\t\twidth: { value: 120, unit: \"mm\" as const },\n\t\theight: { value: 8, unit: \"mm\" as const },\n\t},\n\tmargin: {\n\t\ttop: { value: 0, unit: \"mm\" as const },\n\t\tright: { value: 0, unit: \"mm\" as const },\n\t\tbottom: { value: 0, unit: \"mm\" as const },\n\t\tleft: { value: 0, unit: \"mm\" as const },\n\t},\n\tautoHeight: true,\n\tautoWidth: true,\n};\n\n// 行 widget 共通の 9 列グリッド定義\n// 列 0 (1fr) : 一括ラベル / 左 value / (空)\n// 列 1 (8mm) : (空) / 左 stepper / (空)\n// 列 2 (15mm) : checkbox / 左 unit / (空)\n// 列 3 (1fr) : 上 value / (空) / 下 value\n// 列 4 (8mm) : 上 stepper / (空) / 下 stepper\n// 列 5 (15mm) : 上 unit / (空) / 下 unit\n// 列 6 (1fr) : (空) / 右 value / (空)\n// 列 7 (8mm) : (空) / 右 stepper/ (空)\n// 列 8 (15mm) : (空) / 右 unit / (空)\nconst ROW_GRID = {\n\tcolCount: 9,\n\trowCount: 1,\n\tcols: {\n\t\t1: { value: 8, unit: \"mm\" as const },\n\t\t2: { value: 16, unit: \"mm\" as const },\n\t\t4: { value: 8, unit: \"mm\" as const },\n\t\t5: { value: 16, unit: \"mm\" as const },\n\t\t7: { value: 8, unit: \"mm\" as const },\n\t\t8: { value: 16, unit: \"mm\" as const },\n\t},\n};\n\n// 行 0: 一括 checkbox + 上マージン(常に表示)\n// - margin-top-* 系は個別モード時のみ表示(hiddenBinding: \"margin.bulk\")\n// - margin-all-* 系は一括モード時のみ表示(hiddenBinding: { path: \"margin.bulk\", neq: true })\nconst ROW_BULK_TOP: NoteBlockProps = {\n\tbook: {\n\t\tpaper: ROW_PAPER,\n\t\tpages: [\n\t\t\t{\n\t\t\t\tgrid: ROW_GRID,\n\t\t\t\tblocks: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-bulk-label\",\n\t\t\t\t\t\tkind: \"text\",\n\t\t\t\t\t\tlayout: { x: 0, y: 0, w: 2, h: 1 },\n\t\t\t\t\t\tinitValue: \"一括\",\n\t\t\t\t\t\tbehavior: { readOnly: true },\n\t\t\t\t\t\tprops: { horizontal: \"center\", vertical: \"center\" },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-bulk-checkbox\",\n\t\t\t\t\t\tkind: \"checkbox\",\n\t\t\t\t\t\tlayout: { x: 2, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\tprops: { binding: \"margin.bulk\" },\n\t\t\t\t\t},\n\t\t\t\t\t// 個別モード: 上マージン入力(bulk=false 時のみ)\n\t\t\t\t\t{\n\t\t\t\t\t\t...numberInputBlock(\"margin-top-value\", \"margin.top.value\"),\n\t\t\t\t\t\tlayout: { x: 3, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\thiddenBinding: \"margin.bulk\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-top-stepper\",\n\t\t\t\t\t\tkind: \"stepper\",\n\t\t\t\t\t\tlayout: { x: 4, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\tprops: { binding: \"margin.top.value\", step: 1, min: 0 },\n\t\t\t\t\t\thiddenBinding: \"margin.bulk\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...unitSelectBlock(\"margin-top-unit\", \"margin.top.unit\"),\n\t\t\t\t\t\tlayout: { x: 5, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\thiddenBinding: \"margin.bulk\",\n\t\t\t\t\t},\n\t\t\t\t\t// 一括モード: 全辺共通マージン入力(bulk=true 時のみ)\n\t\t\t\t\t{\n\t\t\t\t\t\t...numberInputBlock(\"margin-all-value\", \"margin.all.value\"),\n\t\t\t\t\t\tlayout: { x: 3, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\thiddenBinding: { path: \"margin.bulk\", neq: true },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-all-stepper\",\n\t\t\t\t\t\tkind: \"stepper\",\n\t\t\t\t\t\tlayout: { x: 4, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\tprops: { binding: \"margin.all.value\", step: 1, min: 0 },\n\t\t\t\t\t\thiddenBinding: { path: \"margin.bulk\", neq: true },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...unitSelectBlock(\"margin-all-unit\", \"margin.all.unit\"),\n\t\t\t\t\t\tlayout: { x: 5, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\thiddenBinding: { path: \"margin.bulk\", neq: true },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n};\n\n// 行 1: 左・右マージン(個別時のみ表示)\nconst ROW_LEFT_RIGHT: NoteBlockProps = {\n\tbook: {\n\t\tpaper: ROW_PAPER,\n\t\tpages: [\n\t\t\t{\n\t\t\t\tgrid: ROW_GRID,\n\t\t\t\tblocks: [\n\t\t\t\t\t{\n\t\t\t\t\t\t...numberInputBlock(\"margin-left-value\", \"margin.left.value\"),\n\t\t\t\t\t\tlayout: { x: 0, y: 0, w: 1, h: 1 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-left-stepper\",\n\t\t\t\t\t\tkind: \"stepper\",\n\t\t\t\t\t\tlayout: { x: 1, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\tprops: { binding: \"margin.left.value\", step: 1, min: 0 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...unitSelectBlock(\"margin-left-unit\", \"margin.left.unit\"),\n\t\t\t\t\t\tlayout: { x: 2, y: 0, w: 1, h: 1 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...numberInputBlock(\"margin-right-value\", \"margin.right.value\"),\n\t\t\t\t\t\tlayout: { x: 6, y: 0, w: 1, h: 1 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-right-stepper\",\n\t\t\t\t\t\tkind: \"stepper\",\n\t\t\t\t\t\tlayout: { x: 7, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\tprops: { binding: \"margin.right.value\", step: 1, min: 0 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...unitSelectBlock(\"margin-right-unit\", \"margin.right.unit\"),\n\t\t\t\t\t\tlayout: { x: 8, y: 0, w: 1, h: 1 },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n};\n\n// 行 2(末尾): 下マージン(個別時のみ表示)\nconst ROW_BOTTOM: NoteBlockProps = {\n\tbook: {\n\t\tpaper: ROW_PAPER,\n\t\tpages: [\n\t\t\t{\n\t\t\t\tgrid: ROW_GRID,\n\t\t\t\tblocks: [\n\t\t\t\t\t{\n\t\t\t\t\t\t...numberInputBlock(\"margin-bottom-value\", \"margin.bottom.value\"),\n\t\t\t\t\t\tlayout: { x: 3, y: 0, w: 1, h: 1 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"margin-bottom-stepper\",\n\t\t\t\t\t\tkind: \"stepper\",\n\t\t\t\t\t\tlayout: { x: 4, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\tprops: { binding: \"margin.bottom.value\", step: 1, min: 0 },\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...unitSelectBlock(\"margin-bottom-unit\", \"margin.bottom.unit\"),\n\t\t\t\t\t\tlayout: { x: 5, y: 0, w: 1, h: 1 },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n};\n\n/**\n * マージン設定 compound widget(3 行・行 widget 構成)。\n *\n * @remarks\n * **Canvas** — カスタムシェル構築専用。\n *\n * - 行 0(常に表示): 一括 checkbox\n * + 上マージン入力(個別時) ← hiddenBinding: \"margin.bulk\"\n * + 全辺共通マージン入力(一括時) ← hiddenBinding: { path: \"margin.bulk\", neq: true }\n * - 行 1(個別時): 左・右マージン ← hiddenBinding: \"margin.bulk\"\n * - 行 2(個別時・末尾): 下マージン ← hiddenBinding: \"margin.bulk\"\n *\n * binding:\n * - `margin.bulk` / `margin.all` / `margin.top` / `margin.left` / `margin.right` / `margin.bottom`\n */\nexport const marginSettingsWidget: WidgetDef = {\n\tprops: {\n\t\tbook: {\n\t\t\tpaper: {\n\t\t\t\tsize: {\n\t\t\t\t\tpreset: PaperSizePreset.CUSTOM,\n\t\t\t\t\twidth: { value: 120, unit: \"mm\" },\n\t\t\t\t\theight: { value: 24, unit: \"mm\" },\n\t\t\t\t},\n\t\t\t\tmargin: {\n\t\t\t\t\ttop: { value: 0, unit: \"mm\" },\n\t\t\t\t\tright: { value: 0, unit: \"mm\" },\n\t\t\t\t\tbottom: { value: 0, unit: \"mm\" },\n\t\t\t\t\tleft: { value: 0, unit: \"mm\" },\n\t\t\t\t},\n\t\t\t\tautoHeight: true,\n\t\t\t\tautoWidth: true,\n\t\t\t},\n\t\t\tpages: [\n\t\t\t\t{\n\t\t\t\t\tgrid: {\n\t\t\t\t\t\tcolCount: 1,\n\t\t\t\t\t\trowCount: 3,\n\t\t\t\t\t\trows: {\n\t\t\t\t\t\t\t0: { value: 8, unit: \"mm\" },\n\t\t\t\t\t\t\t1: { value: 8, unit: \"mm\" },\n\t\t\t\t\t\t\t2: { value: 8, unit: \"mm\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tblocks: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"row-bulk-top\",\n\t\t\t\t\t\t\tkind: \"note\",\n\t\t\t\t\t\t\tlayout: { x: 0, y: 0, w: 1, h: 1 },\n\t\t\t\t\t\t\tbehavior: { heightFit: true },\n\t\t\t\t\t\t\tprops: notePropsAsRecord(ROW_BULK_TOP),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"row-left-right\",\n\t\t\t\t\t\t\tkind: \"note\",\n\t\t\t\t\t\t\tlayout: { x: 0, y: 1, w: 1, h: 1 },\n\t\t\t\t\t\t\tbehavior: { heightFit: true },\n\t\t\t\t\t\t\tprops: notePropsAsRecord(ROW_LEFT_RIGHT),\n\t\t\t\t\t\t\thiddenBinding: \"margin.bulk\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"row-bottom\",\n\t\t\t\t\t\t\tkind: \"note\",\n\t\t\t\t\t\t\tlayout: { x: 0, y: 2, w: 1, h: 1 },\n\t\t\t\t\t\t\tbehavior: { heightFit: true },\n\t\t\t\t\t\t\tprops: notePropsAsRecord(ROW_BOTTOM),\n\t\t\t\t\t\t\thiddenBinding: \"margin.bulk\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\tplugins: [\n\t\tCheckboxPlugin,\n\t\tNoteBlockPlugin,\n\t\tSelectPlugin,\n\t\tStepperPlugin,\n\t\tTextPlugin,\n\t],\n};\n"],"names":["dimensionInputWidget","binding","PaperSizePreset","numberInputBlock","unitSelectBlock","ROW_PAPER","ROW_GRID","ROW_BULK_TOP","ROW_LEFT_RIGHT","ROW_BOTTOM","marginSettingsWidget","CheckboxPlugin","NoteBlockPlugin","SelectPlugin","StepperPlugin","TextPlugin"],"mappings":";;;;AA+BO,SAASA,EAAqBC,GAAiC;AACrE,SAAO;AAAA,IACN,MAAM;AAAA,MACL,OAAO;AAAA,QACN,MAAM;AAAA,UACL,QAAQC,EAAgB;AAAA,UACxB,OAAO,EAAE,OAAO,IAAI,MAAM,KAAA;AAAA,UAC1B,QAAQ,EAAE,OAAO,IAAI,MAAM,KAAA;AAAA,QAAK;AAAA,QAEjC,QAAQ;AAAA,UACP,KAAK,EAAE,OAAO,GAAG,MAAM,KAAA;AAAA,UACvB,OAAO,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cACC,IAAI;AAAA,cACJ,MAAM;AAAA,cACN,QAAQ,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAA;AAAA,cAC/B,UAAU,EAAE,WAAW,GAAA;AAAA,cACvB,OAAyBK;AAAA,YAAY;AAAA,YAEtC;AAAA,cACC,IAAI;AAAA,cACJ,MAAM;AAAA,cACN,QAAQ,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAA;AAAA,cAC/B,UAAU,EAAE,WAAW,GAAA;AAAA,cACvB,OAAyBC;AAAA,cACzB,eAAe;AAAA,YAAA;AAAA,YAEhB;AAAA,cACC,IAAI;AAAA,cACJ,MAAM;AAAA,cACN,QAAQ,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAA;AAAA,cAC/B,UAAU,EAAE,WAAW,GAAA;AAAA,cACvB,OAAyBC;AAAA,cACzB,eAAe;AAAA,YAAA;AAAA,UAChB;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAED,SAAS;AAAA,IACRE;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA;AAEF;"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const i=require("./paperSettingsWidget-sLJsIUxS.cjs"),m=require("react"),f=require("./sidebarPortal-C3HszQyp.cjs"),ie=require("react-dom"),re=require("react-dom/client"),s=require("react/jsx-runtime"),v=require("./PalettePanel-Dipvtj7D.cjs");function se(e){const t={};for(const o of e.properties)Object.assign(t,o.defaultProps);return t}function V(e){const t=new Set;for(const o of e){if(t.has(o.kind))throw new Error(`[createPluginRegistry] duplicate plugin kind: "${o.kind}". Each kind must be registered only once.`);t.add(o.kind)}return Object.fromEntries(e.map(o=>{if(!o.Renderer)throw new Error(`[createPluginRegistry] plugin "${o.kind}" is missing a Renderer. Ensure you are passing a full BlockPlugin.`);return[o.kind,{kind:o.kind,meta:o.meta,properties:o.properties,defaultProps:se(o),Renderer:o.Renderer,...typeof o.migrateProps=="function"?{migrateProps:o.migrateProps}:{},...typeof o.validateProps=="function"?{validateProps:o.validateProps}:{},...typeof o.validateValue=="function"?{validateValue:o.validateValue}:{}}]}))}const le={"flex-start":"left",center:"center","flex-end":"right"},ce={"flex-start":"top",center:"center","flex-end":"bottom"};function ue(e){return typeof e=="object"&&e!==null&&e.value===1&&e.unit==="fr"}function L(e){const t={};for(let o=0;o<e.length;o++){const n=e[o];n!==void 0&&!ue(n)&&(t[o]=n)}return t}function H(e){if(typeof e!="object"||e===null)throw new Error("grid must be an object");const t=e;if(Array.isArray(t.cols)&&Array.isArray(t.rows)){const o=t.cols,n=t.rows,a={colCount:o.length,rowCount:n.length},r=L(o);Object.keys(r).length>0&&(a.cols=r);const d=L(n);return Object.keys(d).length>0&&(a.rows=d),a}return e}function de(e){if(!("isIndividual"in e))return e;const t={...e},o=t.isIndividual??!0,n=t.all;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}function pe(e){const t={...e};if("justifyContent"in t){const o=t.justifyContent;t.horizontal=le[o]??o,delete t.justifyContent}if("alignItems"in t){const o=t.alignItems;t.vertical=ce[o]??o,delete t.alignItems}return t}function W(e){if(typeof e!="object"||e===null)return e;let t={...e};return t=de(t),t=pe(t),t}function ge(e,t){if(typeof e!="object"||e===null)throw new Error("page must be an object");const o={...e};return"grid"in o&&(o.grid=H(o.grid)),Array.isArray(o.blocks)&&(o.blocks=o.blocks.map(n=>{if(typeof n=="object"&&n!==null){const a={...n};"props"in a&&(a.props=W(a.props));const r=typeof a.kind=="string"?a.kind:void 0;if(r&&t){const d=t[r];d!=null&&d.migrateProps&&(a.props=d.migrateProps(a.props))}return a}return n})),{grid:o.grid,blocks:o.blocks,...o.blockDefaults!==void 0?{blockDefaults:o.blockDefaults}:{},...o.metaData!==void 0?{metaData:o.metaData}:{}}}function $(e){return typeof e=="object"&&e!==null&&!("pages"in e)&&"grid"in e&&"blocks"in e}function F(e){return typeof e=="object"&&e!==null&&"pages"in e}function U(e,t){if(typeof e!="object"||e===null)throw new Error("Book must be a JSON object");const o={...e};return Array.isArray(o.pages)&&(o.pages=o.pages.map(n=>ge(n,t))),{paper:o.paper,pages:o.pages,...o.metaData!==void 0?{metaData:o.metaData}:{}}}function G(e,t){if(typeof e!="object"||e===null)throw new Error("Schema must be a JSON object");const o={...e},n={};if("grid"in o&&(n.grid=H(o.grid),delete o.grid),"blocks"in o){const d=o.blocks;Array.isArray(d)&&(n.blocks=d.map(l=>{if(typeof l=="object"&&l!==null){const y={...l};"props"in y&&(y.props=W(y.props));const g=typeof y.kind=="string"?y.kind:void 0;if(g&&t){const p=t[g];p!=null&&p.migrateProps&&(y.props=p.migrateProps(y.props))}return y}return l})),delete o.blocks}"metaData"in o&&(n.metaData=o.metaData,delete o.metaData);const a={};"paper"in o&&(a.paper=o.paper,delete o.paper);const r={grid:n.grid,blocks:n.blocks??[],...n.metaData!==void 0?{metaData:n.metaData}:{}};return{paper:a.paper,pages:[r]}}function me(e,t){if($(e))return G(e,t);if(F(e))return U(e,t);throw new Error(`入力データの形式を判別できません。
|
|
2
|
+
形式 A(旧 FormSchema): トップレベルに 'grid' と 'blocks' が必要
|
|
3
|
+
形式 B(Book): トップレベルに 'pages' が必要`)}const ye=[i.CheckboxPlugin,i.SelectPlugin,i.TextPlugin];function he(e,t){switch(t.type){case"setSelectedBlockIds":return{...e,selectedBlockIds:t.ids};case"setPageIdx":return{...e,pageIdx:t.idx};case"setClipboard":return{...e,clipboard:t.blocks}}}const be={selectedBlockIds:[],pageIdx:0,clipboard:[]};function ve({book:e,handleBookChange:t}){const[o,n]=m.useReducer(he,be),{selectedBlockIds:a,pageIdx:r}=o,d=m.useRef(e);d.current=e;const l=m.useRef(o);l.current=o;const y=m.useCallback((c,u)=>{const b=d.current,h=l.current.pageIdx,k=b.pages[h];if(!k)return;const w=k.blocks.map(E=>{const j=c[E.id];return j?{...E,...j}:E});t(i.setPage(b,h,{...k,blocks:w}),u);const C=l.current.selectedBlockIds,A=C.map(E=>{var N;const j=(N=c[E])==null?void 0:N.id;return typeof j=="string"?j:E});A.some((E,j)=>E!==C[j])&&n({type:"setSelectedBlockIds",ids:A})},[t]),g=m.useCallback(c=>{const u=d.current,b=l.current.pageIdx,h=u.pages[b];if(!h)return;const k=new Set(c),w=h.blocks.filter(C=>!k.has(C.id));t(i.setPage(u,b,{...h,blocks:w})),n({type:"setSelectedBlockIds",ids:[]})},[t]),p=m.useCallback(c=>{const u=d.current,b=l.current.pageIdx,h=u.pages[b];if(!h)return;const k=h.blocks.filter(w=>c.includes(w.id));n({type:"setClipboard",blocks:k})},[]),S=m.useCallback(c=>{const u=d.current,b=l.current.pageIdx,h=u.pages[b];if(!h)return;const k=h.blocks.filter(A=>c.includes(A.id)),w=h.grid,C=k.map(A=>({...A,id:i.createBlockId(A.kind),layout:{...A.layout,x:Math.min(A.layout.x+1,w.colCount-A.layout.w),y:Math.min(A.layout.y+1,w.rowCount-A.layout.h)}}));t(i.setPage(u,b,{...h,blocks:[...h.blocks,...C]})),n({type:"setSelectedBlockIds",ids:C.map(A=>A.id)})},[t]),x=m.useCallback(()=>{const c=l.current.clipboard;if(c.length===0)return;const u=d.current,b=l.current.pageIdx,h=u.pages[b];if(!h)return;const k=h.grid,w=c.map(C=>({...C,id:i.createBlockId(C.kind),layout:{...C.layout,x:Math.min(C.layout.x+1,k.colCount-C.layout.w),y:Math.min(C.layout.y+1,k.rowCount-C.layout.h)}}));t(i.setPage(u,b,{...h,blocks:[...h.blocks,...w]})),n({type:"setSelectedBlockIds",ids:w.map(C=>C.id)})},[t]),I=m.useCallback(()=>{var k;const c=d.current,u=l.current.pageIdx,b=c.pages[u],h={grid:b?b.grid:((k=c.pages[0])==null?void 0:k.grid)??{colCount:12,rowCount:24},blocks:[]};t(i.insertPage(c,u,h)),n({type:"setPageIdx",idx:u+1})},[t]),D=m.useCallback(()=>{const c=d.current,u=l.current.pageIdx;if(c.pages.length<=1)return;const b=i.removePage(c,u);t(b),n({type:"setPageIdx",idx:Math.min(u,b.pages.length-1)})},[t]),z=m.useMemo(()=>({paste:{execute:x,isEnabled:()=>l.current.clipboard.length>0},delete:{execute:()=>g(l.current.selectedBlockIds),isEnabled:()=>l.current.selectedBlockIds.length>0},copy:{execute:()=>p(l.current.selectedBlockIds),isEnabled:()=>l.current.selectedBlockIds.length>0},duplicate:{execute:()=>S(l.current.selectedBlockIds),isEnabled:()=>l.current.selectedBlockIds.length>0},addPage:{execute:I,isEnabled:()=>!0},deletePage:{execute:D,isEnabled:()=>d.current.pages.length>1},selectBlocks:{execute:c=>n({type:"setSelectedBlockIds",ids:c}),isEnabled:()=>!0,validatePayload:c=>Array.isArray(c)&&c.every(u=>typeof u=="string")},goToPage:{execute:c=>n({type:"setPageIdx",idx:c}),isEnabled:()=>!0,validatePayload:c=>typeof c=="number"},updateBlocks:{execute:c=>{const{updates:u,options:b}=c;y(u,b)},isEnabled:()=>!0,validatePayload:c=>typeof c=="object"&&c!==null&&"updates"in c&&typeof c.updates=="object"}}),[x,g,p,S,I,D,y]);return{editorState:m.useMemo(()=>({selectedBlockIds:a,pageIdx:r}),[a,r]),actionHandlers:z,selectedBlockIds:a}}function fe({initialBook:e,pluginRegistry:t,defaultValues:o,extra:n}){const a=m.useRef(null),{book:r,handleBookChange:d,historyActionHandlers:l}=i.useBookHistory({initialBook:e}),[y,g]=m.useState(o??{}),p=m.useCallback(c=>{c.length!==0&&g(u=>{if(!c.some(({id:k,value:w})=>w===void 0?k in u:u[k]!==w))return u;const h={...u};for(const{id:k,value:w}of c)w===void 0?delete h[k]:h[k]=w;return h})},[]),{editorState:S,actionHandlers:x}=ve({book:r,handleBookChange:d}),I={pageIdx:S.pageIdx,...n?{extra:n}:{}},D=i.useBookBindingContext(r,d,I),z=i.useBookActionContext({...l,...x});return{context:m.useMemo(()=>({book:r,onBookChange:d,pluginRegistry:t,containerRef:a,bindingContext:D,actionContext:z,values:y,onValuesChange:p,editorState:S}),[r,d,t,D,z,y,p,S])}}const P={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",deselectAll:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z",delete:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z",copy:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",paste:"M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z",duplicate:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z",undo:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z",redo:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z",prevPage:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",nextPage:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",addPage:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",deletePage:"M19 13H5v-2h14v2z"},M={value:2,unit:"mm"};function B(e,t,o){return{iconPath:e,label:"",action:t,...o?{title:o}:{},top:M,right:M,bottom:M,left:M}}function q(e="canvas-actions"){return{props:{book:{paper:{size:{preset:f.PaperSizePreset.CUSTOM,width:{value:160,unit:"mm"},height:{value:20,unit:"mm"}},margin:{top:{value:0,unit:"mm"},right:{value:0,unit:"mm"},bottom:{value:0,unit:"mm"},left:{value:0,unit:"mm"}}},pages:[{grid:{colCount:8,rowCount:1},blocks:[{id:`${e}-select-all`,kind:"button",layout:{x:0,y:0,w:1,h:1},props:B(P.selectAll,"select_all","すべて選択")},{id:`${e}-deselect-all`,kind:"button",layout:{x:1,y:0,w:1,h:1},props:B(P.deselectAll,"deselect_all","選択を解除")},{id:`${e}-delete`,kind:"button",layout:{x:2,y:0,w:1,h:1},props:B(P.delete,"delete","削除 (Delete / Backspace)")},{id:`${e}-copy`,kind:"button",layout:{x:3,y:0,w:1,h:1},props:B(P.copy,"copy","コピー (Ctrl+C / Cmd+C)")},{id:`${e}-paste`,kind:"button",layout:{x:4,y:0,w:1,h:1},props:B(P.paste,"paste","貼り付け (Ctrl+V / Cmd+V)")},{id:`${e}-duplicate`,kind:"button",layout:{x:5,y:0,w:1,h:1},props:B(P.duplicate,"duplicate","複製 (Ctrl+D / Cmd+D)")},{id:`${e}-undo`,kind:"button",layout:{x:6,y:0,w:1,h:1},props:B(P.undo,"undo","元に戻す (Ctrl+Z / Cmd+Z)")},{id:`${e}-redo`,kind:"button",layout:{x:7,y:0,w:1,h:1},props:B(P.redo,"redo","やり直し (Ctrl+Y / Cmd+Y)")}]}]}},plugins:[i.ButtonPlugin]}}const ke=q();function Z(e="clipboard"){return{props:{book:{paper:{size:{preset:f.PaperSizePreset.CUSTOM,width:{value:60,unit:"mm"},height:{value:20,unit:"mm"}},margin:{top:{value:0,unit:"mm"},right:{value:0,unit:"mm"},bottom:{value:0,unit:"mm"},left:{value:0,unit:"mm"}}},pages:[{grid:{colCount:3,rowCount:1},blocks:[{id:`${e}-copy`,kind:"button",layout:{x:0,y:0,w:1,h:1},props:B(P.copy,"copy")},{id:`${e}-paste`,kind:"button",layout:{x:1,y:0,w:1,h:1},props:B(P.paste,"paste")},{id:`${e}-duplicate`,kind:"button",layout:{x:2,y:0,w:1,h:1},props:B(P.duplicate,"duplicate")}]}]}},plugins:[i.ButtonPlugin]}}const Pe=Z();function Y(e="history"){return{props:{book:{paper:{size:{preset:f.PaperSizePreset.CUSTOM,width:{value:40,unit:"mm"},height:{value:20,unit:"mm"}},margin:{top:{value:0,unit:"mm"},right:{value:0,unit:"mm"},bottom:{value:0,unit:"mm"},left:{value:0,unit:"mm"}}},pages:[{grid:{colCount:2,rowCount:1},blocks:[{id:`${e}-undo`,kind:"button",layout:{x:0,y:0,w:1,h:1},props:B(P.undo,"undo")},{id:`${e}-redo`,kind:"button",layout:{x:1,y:0,w:1,h:1},props:B(P.redo,"redo")}]}]}},plugins:[i.ButtonPlugin]}}const xe=Y(),_={size:{preset:f.PaperSizePreset.CUSTOM},margin:{top:{value:0,unit:"mm"},right:{value:0,unit:"mm"},bottom:{value:0,unit:"mm"},left:{value:0,unit:"mm"}},autoHeight:!0,autoWidth:!0},we={margin:_.margin,autoHeight:_.autoHeight,autoWidth:_.autoWidth},Se={props:{book:{paper:{...we,size:{preset:f.PaperSizePreset.CUSTOM,width:{value:160,unit:"mm"},height:{value:8,unit:"mm"}}},pages:[{grid:{colCount:12,rowCount:1,cols:{2:{value:8,unit:"mm"},5:{value:8,unit:"mm"},8:{value:8,unit:"mm"},11:{value:8,unit:"mm"}}},blocks:[{id:"layout-x-label",kind:"text",layout:{x:0,y:0,w:1,h:1},initValue:"X",behavior:{readOnly:!0},props:{horizontal:"center",vertical:"center"}},{...i.numberInputBlock("layout-x-value","layout.x"),layout:{x:1,y:0,w:1,h:1}},{id:"layout-x-stepper",kind:"stepper",layout:{x:2,y:0,w:1,h:1},props:{binding:"layout.x",step:1,min:0}},{id:"layout-y-label",kind:"text",layout:{x:3,y:0,w:1,h:1},initValue:"Y",behavior:{readOnly:!0},props:{horizontal:"center",vertical:"center"}},{...i.numberInputBlock("layout-y-value","layout.y"),layout:{x:4,y:0,w:1,h:1}},{id:"layout-y-stepper",kind:"stepper",layout:{x:5,y:0,w:1,h:1},props:{binding:"layout.y",step:1,min:0}},{id:"layout-w-label",kind:"text",layout:{x:6,y:0,w:1,h:1},initValue:"W",behavior:{readOnly:!0},props:{horizontal:"center",vertical:"center"}},{...i.numberInputBlock("layout-w-value","layout.w"),layout:{x:7,y:0,w:1,h:1}},{id:"layout-w-stepper",kind:"stepper",layout:{x:8,y:0,w:1,h:1},props:{binding:"layout.w",step:1,min:1}},{id:"layout-h-label",kind:"text",layout:{x:9,y:0,w:1,h:1},initValue:"H",behavior:{readOnly:!0},props:{horizontal:"center",vertical:"center"}},{...i.numberInputBlock("layout-h-value","layout.h"),layout:{x:10,y:0,w:1,h:1}},{id:"layout-h-stepper",kind:"stepper",layout:{x:11,y:0,w:1,h:1},props:{binding:"layout.h",step:1,min:1}}]}]}},plugins:[i.TextPlugin,i.StepperPlugin]};function K(e){const{pageIdx:t,pageCount:o}=e,n=t!==void 0?String(t+1):"—",a=o!==void 0?String(o):"—";return{props:{book:{paper:{size:{preset:f.PaperSizePreset.CUSTOM,width:{value:130,unit:"mm"},height:{value:20,unit:"mm"}},margin:{top:{value:0,unit:"mm"},right:{value:0,unit:"mm"},bottom:{value:0,unit:"mm"},left:{value:0,unit:"mm"}}},pages:[{grid:{colCount:7,rowCount:1,cols:{2:{value:10,unit:"mm"}}},blocks:[{id:"prev-page",kind:"button",layout:{x:0,y:0,w:1,h:1},props:{iconPath:P.prevPage,label:"",action:"prev_page"}},{id:"page-current",kind:"text",layout:{x:1,y:0,w:1,h:1},behavior:{readOnly:!0},initValue:n,props:{horizontal:"right",vertical:"center",fontSize:{value:25,unit:"pt"}}},{id:"page-separator",kind:"text",layout:{x:2,y:0,w:1,h:1},behavior:{readOnly:!0},initValue:"/",props:{horizontal:"center",vertical:"center",fontSize:{value:25,unit:"pt"}}},{id:"page-total",kind:"text",layout:{x:3,y:0,w:1,h:1},behavior:{readOnly:!0},initValue:a,props:{horizontal:"left",vertical:"center",fontSize:{value:25,unit:"pt"}}},{id:"next-page",kind:"button",layout:{x:4,y:0,w:1,h:1},props:{iconPath:P.nextPage,label:"",action:"next_page"}},{id:"add-page",kind:"button",layout:{x:5,y:0,w:1,h:1},props:{iconPath:P.addPage,label:"",action:"add_page"}},{id:"delete-page",kind:"button",layout:{x:6,y:0,w:1,h:1},props:{iconPath:P.deletePage,label:"",action:"delete_page"}}]}]}},plugins:[i.ButtonPlugin,i.TextPlugin]}}const Ce=K({});function X(e="selection"){return{props:{book:{paper:{size:{preset:f.PaperSizePreset.CUSTOM,width:{value:60,unit:"mm"},height:{value:20,unit:"mm"}},margin:{top:{value:0,unit:"mm"},right:{value:0,unit:"mm"},bottom:{value:0,unit:"mm"},left:{value:0,unit:"mm"}}},pages:[{grid:{colCount:3,rowCount:1},blocks:[{id:`${e}-select-all`,kind:"button",layout:{x:0,y:0,w:1,h:1},props:B(P.selectAll,"select_all")},{id:`${e}-deselect-all`,kind:"button",layout:{x:1,y:0,w:1,h:1},props:B(P.deselectAll,"deselect_all")},{id:`${e}-delete`,kind:"button",layout:{x:2,y:0,w:1,h:1},props:B(P.delete,"delete")}]}]}},plugins:[i.ButtonPlugin]}}const Be=X(),J=({sections:e=[],className:t,style:o})=>s.jsx("div",{className:`${v.styles.container}${t?` ${t}`:""}`,style:o,"data-testid":"action-bar",children:e.map((n,a)=>{const r=m.isValidElement(n)&&n.key!=null?n.key:`section-${a}`;return s.jsxs(m.Fragment,{children:[a>0&&s.jsx(v.ActionBarDivider,{}),s.jsx("div",{className:v.styles.section,children:n})]},r)})});J.displayName="ActionBar";const Ie="_printContainer_e2bnt_1",Ae="_pageBreak_e2bnt_6",O={printContainer:Ie,pageBreak:Ae},Q=m.memo(({page:e,paper:t,values:o,pluginRegistry:n})=>{const{paperPx:a,getBlockRectPx:r}=f.useGridCalc(t,e.grid,f.DEFAULT_DPI),d=o?{get:y=>o[y]??null,set:()=>{}}:void 0,l=e.blocks.filter(y=>!i.evalHiddenBinding(y.hiddenBinding,d));return s.jsx("div",{style:{position:"relative",width:`${a.canvas.width}px`,height:`${a.canvas.height}px`,backgroundColor:"#fff"},children:s.jsx(i.BlockLayer,{blocks:l,pluginRegistry:n,mode:f.NoteMode.VIEW,values:o??{},blockDefaults:e.blockDefaults,getBlockRectPx:r,showGuides:!1,showBorder:!0})})});Q.displayName="PrintPage";const ee=m.forwardRef(({book:e,values:t,pluginRegistry:o,printSettings:n,className:a,style:r},d)=>{const l=i.resolveEffectivePaper(e,n),y=i.buildPageCss(l,n==null?void 0:n.margin);return m.useEffect(()=>{var S,x;(S=document.getElementById("printable-note-page-style"))==null||S.remove(),(x=document.getElementById("tatamicks-book-page-style"))==null||x.remove();const g=document.createElement("style");g.id="printable-note-page-style",g.textContent=y,document.head.appendChild(g);const p=document.createElement("style");return p.id="tatamicks-book-page-style",p.textContent=y,document.head.appendChild(p),()=>{var I,D;(I=document.getElementById("printable-note-page-style"))==null||I.remove(),(D=document.getElementById("tatamicks-book-page-style"))==null||D.remove()}},[y]),s.jsx("div",{ref:d,className:[O.printContainer,a].filter(Boolean).join(" "),style:r,children:e.pages.map((g,p)=>{const S=g.id??(g.blocks.map(x=>x.id).join("_")||`page-${p}`);return s.jsx("div",{className:p<e.pages.length-1?O.pageBreak:void 0,children:s.jsx(Q,{page:g,paper:l,values:t,pluginRegistry:o})},S)})})});ee.displayName="NotePrint";const De=m.memo(ee);function Ee(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function je(e,t){const o=document.title,n=document.createElement("iframe");n.style.cssText="position:fixed;top:0;left:0;width:100%;height:100%;visibility:hidden;z-index:-9999;border:none;",document.body.appendChild(n);const a=n.contentWindow,r=n.contentDocument??(a==null?void 0:a.document);if(!r||!a){document.body.removeChild(n);return}const d=Array.from(document.querySelectorAll("style")).map(p=>p.outerHTML).join(`
|
|
4
|
+
`),l=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).map(p=>p.outerHTML).join(`
|
|
5
|
+
`),y=e.innerHTML;r.open(),r.write(`<!DOCTYPE html><html><head><meta charset="utf-8" /><title>${Ee(o)}</title>${l}${d}<style>*{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;}</style></head><body>${y}</body></html>`),r.close();const g=()=>{document.body.contains(n)&&document.body.removeChild(n)};a.addEventListener("afterprint",()=>{g()}),setTimeout(()=>{a.focus(),a.print()},0)}function ze(e,t,o,n){const a=document.createElement("div");a.style.cssText="position:absolute;top:-9999px;left:-9999px;",document.body.appendChild(a);const r=re.createRoot(a);ie.flushSync(()=>{r.render(m.createElement(De,{book:e,values:t,pluginRegistry:o,printSettings:n}))}),je(a),r.unmount(),document.body.removeChild(a)}function te(e,t){ze(e.book,e.values,e.pluginRegistry,t)}const oe=({pageIdx:e,pageCount:t,onPageChange:o,onAddPage:n,onDeletePage:a,canDeletePage:r=!0})=>s.jsxs(s.Fragment,{children:[s.jsx(v.IconActionButton,{icon:s.jsx(v.ChevronLeftIcon,{"aria-hidden":"true"}),label:"前のページへ",title:"前のページへ",onClick:()=>o(Math.max(0,e-1)),disabled:e===0,preventFocusOnMouseDown:!0}),s.jsxs("span",{className:v.styles.sectionLabel,children:[e+1," / ",t]}),s.jsx(v.IconActionButton,{icon:s.jsx(v.ChevronRightIcon,{"aria-hidden":"true"}),label:"次のページへ",title:"次のページへ",onClick:()=>o(Math.min(t-1,e+1)),disabled:e>=t-1,preventFocusOnMouseDown:!0}),n!==void 0&&s.jsx(v.IconActionButton,{icon:s.jsx(v.AddPageIcon,{"aria-hidden":"true"}),label:"ページを追加",title:"ページを追加",onClick:n,preventFocusOnMouseDown:!0}),a!==void 0&&s.jsx(v.IconActionButton,{icon:s.jsx(v.DeletePageIcon,{"aria-hidden":"true"}),label:"ページを削除",title:"ページを削除",onClick:a,disabled:!r,preventFocusOnMouseDown:!0})]});oe.displayName="PageNavigationSection";function Te({context:e,onActionFeedback:t,onPrint:o}){const{actionContext:n}=e,{book:a,onBookChange:r}=e,l=e.editorState.pageIdx,y=a.pages[l]??a.pages[0],g=[s.jsx(v.CanvasActionSection,{actionContext:n,onActionFeedback:t,onPrint:o??(()=>te(e))},"canvas"),s.jsx(v.PaperSettingsSection,{paper:a.paper,onPaperChange:p=>r({...a,paper:p})},"paper"),s.jsx(v.GridSettingsSection,{grid:y.grid,onGridChange:p=>{const S=a.pages.map((x,I)=>I===l?{...x,grid:p}:x);r({...a,pages:S})}},"grid")];return g.push(s.jsx(oe,{pageIdx:l,pageCount:a.pages.length,onPageChange:p=>n.execute("goToPage",p),onAddPage:()=>n.execute("addPage"),onDeletePage:()=>n.execute("deletePage"),canDeletePage:a.pages.length>1},"page-nav")),g}const ne=({context:e,gridSize:t,isDragging:o,zIndex:n,onActionFeedback:a})=>{const{book:r,containerRef:d}=e,l=e.editorState,y=m.useRef(null),g=l.selectedBlockIds??[],p=m.useMemo(()=>{const x=new Set(r.pages.flatMap(I=>I.blocks.map(D=>D.id)));return g.filter(I=>x.has(I))},[g,r]),S=v.useSelectionBounds(d??y,p)??null;return s.jsx(v.SelectionActionBarOverlay,{selectionBoundingBox:S,isDragging:o,zIndex:n,children:s.jsx(v.SelectionActionBar,{items:v.getDefaultSelectionActionBarItems({context:e,gridSize:t,onActionFeedback:a}),onPointerDown:x=>x.stopPropagation()})})};ne.displayName="DefaultSelectionActionBarOverlay";function Me({context:e,gridSize:t,onBlockHover:o,onBlockDragChange:n,onActionFeedback:a}){return[{value:"block",label:"ブロック",content:(e.editorState.selectedBlockIds??[]).length>0?s.jsx(v.DefaultBlockPropertyPanel,{context:e,gridSize:t}):s.jsx(v.PalettePanel,{context:e})},{value:"canvas",label:"キャンバス",content:s.jsx(v.DefaultCanvasPanel,{context:e,onBlockHover:o,onBlockDragChange:n,onActionFeedback:a})},{value:"other",label:"その他",content:s.jsx(v.OtherPanel,{context:e})}]}const _e="_container_ymana_1",Re="_tabHeader_ymana_12",Ne="_tabContent_ymana_19",R={container:_e,tabHeader:Re,tabContent:Ne},ae=({tabs:e,defaultTab:t,className:o})=>{var a;const n=t??((a=e[0])==null?void 0:a.value)??"";return s.jsx("div",{className:`${R.container} ${o||""}`,...f.SIDEBAR_PORTAL_PROPS,children:s.jsxs(v.Tabs,{defaultValue:n,variant:"default",children:[s.jsx(v.TabsList,{className:R.tabHeader,children:e.map(r=>s.jsx(v.TabsTrigger,{value:r.value,children:r.label},r.value))}),e.map(r=>s.jsx(v.TabsContent,{value:r.value,className:R.tabContent,children:r.content},r.value))]})})};ae.displayName="Sidebar";const Le={selectedBlockIds:[],pageIdx:0};function Oe({label:e,widget:t,extraPlugins:o,position:n,isDragging:a,onTitlePointerDown:r,onClose:d,onContainerPointerDown:l,style:y,context:g}){const p=m.useMemo(()=>V([...t.plugins,...o??[]]),[t.plugins,o]),S=m.useRef(null),x=m.useMemo(()=>({get:u=>(g.book,g.bindingContext.get(u)),set:(u,b)=>g.bindingContext.set(u,b)}),[g.bindingContext,g.book]),I=m.useMemo(()=>({book:t.props.book,onBookChange:()=>{},pluginRegistry:p,containerRef:S,bindingContext:x,actionContext:g.actionContext,editorState:Le,values:{}}),[t.props.book,p,x,g.actionContext]),[D,z]=m.useState(.5),T=m.useRef({x:0,zoom:.5}),c=u=>{u.preventDefault(),u.stopPropagation(),T.current={x:u.clientX,zoom:D};const b=k=>{const w=k.clientX-T.current.x;z(Math.max(.25,Math.min(2,T.current.zoom+w/400)))},h=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",b),window.addEventListener("pointerup",h)};return s.jsxs("div",{onPointerDown:l,...f.SIDEBAR_PORTAL_PROPS,style:{position:"fixed",left:n.x,top:n.y,zIndex:a?375e4:37e5,background:"#fff",border:"1px solid #d1d5db",borderRadius:6,boxShadow:a?"0 8px 24px rgba(0,0,0,0.2)":"0 2px 8px rgba(0,0,0,0.12)",...y},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"3px 4px 3px 8px",background:"#f9fafb",borderBottom:"1px solid #e5e7eb",borderRadius:"6px 6px 0 0",cursor:"move",userSelect:"none",gap:4},onPointerDown:r,children:[s.jsx("span",{style:{fontSize:11,color:"#555",whiteSpace:"nowrap"},children:e}),s.jsx("button",{type:"button",onPointerDown:u=>u.stopPropagation(),onClick:d,style:{background:"none",border:"none",cursor:"pointer",fontSize:12,color:"#9ca3af",padding:"0 2px",lineHeight:1},children:"✕"})]}),s.jsx("div",{style:{pointerEvents:a?"none":"auto",zoom:D},children:s.jsx(i.Note,{mode:f.NoteMode.EDIT,context:I})}),s.jsx("div",{onPointerDown:c,style:{position:"absolute",bottom:0,right:0,width:14,height:14,cursor:"se-resize",background:"linear-gradient(135deg, transparent 50%, #9ca3af 50%)",borderRadius:"0 0 6px 0"}})]})}exports.CheckboxPlugin=i.CheckboxPlugin;exports.DEFAULT_BOOK=i.DEFAULT_BOOK;exports.DEFAULT_PAGE=i.DEFAULT_PAGE;exports.Note=i.Note;exports.NoteEdit=i.NoteEdit;exports.NoteForm=i.NoteForm;exports.NoteView=i.NoteView;exports.SelectPlugin=i.SelectPlugin;exports.TextPlugin=i.TextPlugin;exports.ValidationSeverity=i.ValidationSeverity;exports.addPage=i.addPage;exports.cleanValues=i.cleanValues;exports.createBlockId=i.createBlockId;exports.ensurePageIds=i.ensurePageIds;exports.gridSettingsWidget=i.gridSettingsWidget;exports.insertPage=i.insertPage;exports.movePage=i.movePage;exports.paperSettingsWidget=i.paperSettingsWidget;exports.removePage=i.removePage;exports.setPage=i.setPage;exports.validateBook=i.validateBook;exports.DEFAULT_GRID=f.DEFAULT_GRID;exports.DEFAULT_PAPER=f.DEFAULT_PAPER;exports.DEFAULT_PAPER_MARGIN=f.DEFAULT_PAPER_MARGIN;exports.DEFAULT_PAPER_SIZES=f.DEFAULT_PAPER_SIZES;exports.LineType=f.LineType;exports.NoteMode=f.NoteMode;exports.PaperSizePreset=f.PaperSizePreset;exports.deserializeBook=f.deserializeBook;exports.deserializePage=f.deserializePage;exports.deserializeValues=f.deserializeValues;exports.parseBook=f.parseBook;exports.serializeBook=f.serializeBook;exports.serializePage=f.serializePage;exports.ActionBar=J;exports.BASE_PLUGINS=ye;exports.DefaultSelectionActionBarOverlay=ne;exports.FloatingWidget=Oe;exports.Sidebar=ae;exports.blockLayoutWidget=Se;exports.canvasActionsWidget=ke;exports.clipboardWidget=Pe;exports.createCanvasActionsWidget=q;exports.createClipboardWidget=Z;exports.createHistoryWidget=Y;exports.createPageNavigationWidget=K;exports.createPluginRegistry=V;exports.createSelectionDeleteWidget=X;exports.getDefaultActionBarSections=Te;exports.getDefaultSidebarTabs=Me;exports.historyWidget=xe;exports.isBook=F;exports.isLegacyFormSchema=$;exports.migrate=me;exports.migrateBook=U;exports.migrateFormSchemaToBook=G;exports.pageNavigationWidget=Ce;exports.printNote=te;exports.selectionDeleteWidget=Be;exports.useNoteContext=fe;
|