@inpageedit/core 0.5.0 → 0.5.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.
Files changed (44) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +55 -55
  3. package/dist/ActionButton-BgbTKTg7.js.map +1 -1
  4. package/dist/InputBox-FIzJ-rPN.js.map +1 -1
  5. package/dist/Preferences-Bg3J5Ur9.js.map +1 -1
  6. package/dist/RadioBox-CaA8VgLu.js.map +1 -1
  7. package/dist/components/index.js.map +1 -1
  8. package/dist/{index-z5MR2HJ2.js → index-BIgWRk98.js} +302 -296
  9. package/dist/index-BIgWRk98.js.map +1 -0
  10. package/dist/{index-jKU6cYcH.js → index-BMmKF_kG.js} +5 -5
  11. package/dist/index-BMmKF_kG.js.map +1 -0
  12. package/dist/index-Bh70Udzi.js.map +1 -1
  13. package/dist/index-CBphMyYJ.js +5170 -0
  14. package/dist/index-CBphMyYJ.js.map +1 -0
  15. package/dist/{index-mMAGhnbR.js → index-CJLKdEqr.js} +2 -2
  16. package/dist/index-CJLKdEqr.js.map +1 -0
  17. package/dist/{index-CUXLgVhg.js → index-CX5H4xCe.js} +2 -2
  18. package/dist/index-CX5H4xCe.js.map +1 -0
  19. package/dist/index-CvhkVj_L.js.map +1 -1
  20. package/dist/{index-D3yG7jFv.js → index-DNm9SNqM.js} +13 -13
  21. package/dist/{index-D3yG7jFv.js.map → index-DNm9SNqM.js.map} +1 -1
  22. package/dist/{index-BxR7MsNM.js → index-Djd6Ddcm.js} +26 -25
  23. package/dist/index-Djd6Ddcm.js.map +1 -0
  24. package/dist/{index-Bo1hNwWJ.js → index-Dk3xR25y.js} +6 -6
  25. package/dist/index-Dk3xR25y.js.map +1 -0
  26. package/dist/{index-K73DMVec.js → index-QF8lvEam.js} +5 -5
  27. package/dist/index-QF8lvEam.js.map +1 -0
  28. package/dist/index.js +9 -5139
  29. package/dist/index.js.map +1 -1
  30. package/dist/models/WikiPage/index.d.ts +5 -4
  31. package/dist/plugins/BasePlugin.d.ts +12 -4
  32. package/dist/sleep-DpyIipK-.js.map +1 -1
  33. package/dist/style.css +1 -1
  34. package/lib/index.umd.js +32 -32
  35. package/lib/index.umd.js.map +1 -1
  36. package/lib/style.css +1 -1
  37. package/package.json +20 -19
  38. package/dist/index-Bo1hNwWJ.js.map +0 -1
  39. package/dist/index-BxR7MsNM.js.map +0 -1
  40. package/dist/index-CUXLgVhg.js.map +0 -1
  41. package/dist/index-K73DMVec.js.map +0 -1
  42. package/dist/index-jKU6cYcH.js.map +0 -1
  43. package/dist/index-mMAGhnbR.js.map +0 -1
  44. package/dist/index-z5MR2HJ2.js.map +0 -1
package/lib/style.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";:root{--ipe-modal-z: 1000;--ipe-modal-backdrop-bg: rgba(0, 0, 0, .5);--ipe-modal-bg: #ffffff;--ipe-modal-fg: #111827;--ipe-modal-fg--rgb: 17, 24, 39;--ipe-modal-muted: #6b7280;--ipe-modal-accent: #3b82f6;--ipe-modal-accent--rgb: 59, 130, 246;--ipe-modal-danger: #ef4444;--ipe-modal-danger--rgb: 239, 68, 68;--ipe-modal-radius: 16px;--ipe-modal-button-radius: 10px;--ipe-modal-shadow: 0 20px 40px rgba(0, 0, 0, .18);--ipe-modal-spacing: 16px;--ipe-modal-viewport-gap-y: 20px;--ipe-modal-window-max-w: 720px;--ipe-modal-anim: none;--ipe-modal-safe-area-top: env(safe-area-inset-top);--ipe-modal-safe-area-bottom: env(safe-area-inset-bottom);--ipe-modal-vh: 100vh}@supports (height: 100dvh){:root{--ipe-modal-vh: 100dvh}}:root{--ipe-modal-window-max-h: calc( var(--ipe-modal-vh) - var(--ipe-modal-safe-area-top) - var(--ipe-modal-safe-area-bottom) - (var(--ipe-modal-viewport-gap-y) * 2) )}html.ipe-modal-no-scroll,body.ipe-modal-no-scroll{overflow:hidden!important;touch-action:none;-webkit-overflow-scrolling:auto}body.ipe-modal-no-scroll{position:fixed;width:100%;left:0;right:0}.ipe-modal-backdrop{position:fixed;inset:0;z-index:var(--ipe-modal-z);background:transparent;transition:background .18s ease;pointer-events:none}.ipe-modal-backdrop.is-open{background:var(--ipe-modal-backdrop-bg);pointer-events:auto}.ipe-modal-modal{position:fixed;inset:0;z-index:calc(var(--ipe-modal-z) + 1);outline:none;overflow:auto;opacity:0;transform:translateY(8px) scale(.98);transition:opacity .18s ease,transform .22s ease;pointer-events:none;align-items:start;justify-items:center}.ipe-modal-modal.is-open{opacity:1;transform:none}.ipe-modal-modal.is-centered{display:grid;align-items:center}.ipe-modal-modal.is-centered .ipe-modal-modal__content{max-height:75dvh;overflow:auto}.ipe-modal-modal.is-fullscreen .ipe-modal-modal__window{width:100vw;height:var(--ipe-modal-vh);max-width:none;max-height:none;border-radius:0}.ipe-modal-modal.no-backdrop{position:absolute;inset:auto;display:block;padding:0;overflow:visible}.ipe-modal-modal.is-dragging{transition:none}.ipe-modal-modal.is-dragging .ipe-modal-modal__window{animation:none}.ipe-modal-modal.is-dragging .ipe-modal-modal__header{cursor:grabbing!important}.ipe-modal-modal__window{position:relative;background:var(--ipe-modal-bg);color:var(--ipe-modal-fg);border-radius:var(--ipe-modal-radius);box-shadow:var(--ipe-modal-shadow);max-width:var(--ipe-modal-window-max-w);width:min(92vw,var(--ipe-modal-window-max-w));overflow:hidden;display:block;animation:var(--ipe-modal-anim, none) .22s ease both;pointer-events:auto;overscroll-behavior:contain;margin-top:var(--ipe-modal-viewport-gap-y, 20px);margin-bottom:var(--ipe-modal-viewport-gap-y, 20px)}.size--dialog{max-width:420px}.size--small{max-width:520px}.size--smallToMedium{max-width:640px}.size--medium{max-width:720px}.size--mediumToLarge{max-width:860px}.size--large{max-width:1040px}.size--full{width:100vw;height:var(--ipe-modal-vh);max-width:none;max-height:none;border-radius:0}.size--auto{max-width:var(--ipe-modal-window-max-w)}.ipe-modal-modal__window.is-fixed-height{height:min(var(--ipe-modal-window-max-h),80vh)}.ipe-modal-modal__header{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;padding:calc(var(--ipe-modal-spacing) * .75) var(--ipe-modal-spacing);border-bottom:1px solid color-mix(in oklab,black 6%,transparent)}.ipe-modal-modal__title{font-size:1.1rem;font-weight:600;margin:0}.ipe-modal-modal__icons{display:inline-flex;gap:6px}.ipe-modal-modal__icon{width:28px;height:28px;border-radius:8px;border:0;background:transparent}.ipe-modal-modal__close{margin-left:6px;width:32px;height:32px;display:grid;place-items:center;border:0;border-radius:var(--ipe-modal-button-radius);background:transparent;font-size:22px;line-height:1;color:var(--ipe-modal-muted);cursor:pointer}.ipe-modal-modal__close:hover{background:#0000000f;color:var(--ipe-modal-fg)}.ipe-modal-modal__content{padding:var(--ipe-modal-spacing);overflow:visible;-webkit-overflow-scrolling:touch}.ipe-modal-modal__footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:calc(var(--ipe-modal-spacing) * .75) var(--ipe-modal-spacing);border-top:1px solid color-mix(in oklab,black 6%,transparent)}.ipe-modal-modal__buttons{display:inline-flex;gap:8px}.ipe-modal-toast-container{position:fixed;z-index:2000;display:flex;flex-direction:column;gap:8px;align-items:flex-end;pointer-events:none}.ipe-modal-toast-container.top{top:16px}.ipe-modal-toast-container.bottom{bottom:16px;flex-direction:column-reverse}.ipe-modal-toast-container.right{right:16px}.ipe-modal-toast-container.left{left:16px}.ipe-modal-modal__window.plugin--toast{width:300px;border-radius:calc(var(--ipe-modal-radius) * .5)}.ipe-modal-modal__window.plugin--toast .ipe-modal-modal__header{padding:.5em}.ipe-modal-modal__window.plugin--toast .ipe-modal-modal__close{width:20px;height:20px;font-size:16px}.ipe-modal-modal__window.plugin--toast .ipe-modal-modal__content{padding:1em .5em}.ipe-modal-modal__window.plugin--toast .ipe-modal-modal__footer{padding:0 .5em .5em}.ipe-modal-modal__window.plugin--toast .ipe-modal-btn{padding:.5em .75em}.ipe-modal-btn{--accent-color: #fff;--text-color: var(--ipe-modal-fg);--active-color: rgba(0, 0, 0, .1);appearance:none;border:1px solid rgba(0,0,0,.14);background:var(--accent-color);color:var(--text-color);padding:8px 12px;border-radius:var(--ipe-modal-button-radius);cursor:pointer;font:inherit;transition:all .2s}.ipe-modal-btn:hover{background:#0000000a}.ipe-modal-btn:disabled{opacity:.6;cursor:not-allowed}.ipe-modal-btn:active{background:#0000000f;box-shadow:0 0 0 2px var(--active-color)}.ipe-modal-btn:focus{box-shadow:0 0 0 2px var(--active-color)}.ipe-modal-btn.is-primary{--accent-color: var(--ipe-modal-accent);--text-color: #fff;--active-color: rgba(var(--ipe-modal-accent--rgb), .5);border-color:var(--accent-color);background:var(--accent-color)}.ipe-modal-btn.is-danger{--accent-color: var(--ipe-modal-danger);--text-color: #fff;--active-color: rgba(var(--ipe-modal-danger--rgb), .2);border-color:var(--accent-color);background:var(--accent-color);color:var(--text-color)}.ipe-modal-btn.is-ghost,.ipe-modal-btn.is-text{background:transparent}.ipe-modal-btn.is-ghost.is-primary{color:var(--ipe-modal-accent)}.ipe-modal-btn.is-ghost.is-danger{color:var(--ipe-modal-danger)}.ipe-modal-btn.is-text{border:0}.ipe-modal-modal__window.size--dialog .ipe-modal-modal__footer,.ipe-modal-modal__window.compact-buttons .ipe-modal-modal__footer{padding:0}.ipe-modal-modal__window.size--dialog .ipe-modal-modal__buttons--left,.ipe-modal-modal__window.compact-buttons .ipe-modal-modal__buttons--left{display:none}.ipe-modal-modal__window.size--dialog .ipe-modal-modal__buttons--right,.ipe-modal-modal__window.compact-buttons .ipe-modal-modal__buttons--right{flex:1;width:100%;display:flex;gap:0}.ipe-modal-modal__window.size--dialog .ipe-modal-btn,.ipe-modal-modal__window.compact-buttons .ipe-modal-btn{flex:1;border:0;margin:0;padding:1rem;border-radius:0}.ipe-modal-modal__window.size--dialog .ipe-modal-btn:not(:first-child),.ipe-modal-modal__window.compact-buttons .ipe-modal-btn:not(:first-child){border-left:1px solid rgba(0,0,0,.06)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}._ipe_progress_so6hn_1{position:relative;display:inline-block;width:100%;overflow:hidden;border:1px solid #c5c5c5;border-radius:100vmax;background-color:#fff;height:1em;--progress: 0%}._ipe_progress_so6hn_1[data-indeterminate=true]:before,._ipe_progress_so6hn_1[data-indeterminate=true]:after{content:"";position:absolute;top:0;bottom:0;left:0;background-color:#36c}._ipe_progress_so6hn_1[data-indeterminate=true]:before{animation:_progress-indeterminate-long_so6hn_1 2s linear infinite}._ipe_progress_so6hn_1[data-indeterminate=true]:after{animation:_progress-indeterminate-short_so6hn_1 2s linear infinite}._ipe_progress_so6hn_1[data-indeterminate=false]:before{content:"";position:absolute;top:0;bottom:0;left:0;width:var(--progress);background-color:#36c;transition:width .3s ease-in-out}@keyframes _progress-indeterminate-long_so6hn_1{0%{left:0;width:0}50%{left:30%;width:70%}75%{left:100%;width:0}}@keyframes _progress-indeterminate-short_so6hn_1{0%{left:0;width:0}50%{left:0;width:0}75%{left:0;width:25%}to{left:110%;width:0}}.theme-ipe{--color-primary: #36c;--color-primary-hover: #447ff5;--color-primary-active: #2a4b8d;--color-promary--rgb: 51, 102, 204;--color-white: #fff;--color-text-dark: #222;--color-text-medium: #252525;--color-text-hover: #454545;--color-bg-light: #f8f9fa;--color-bg-lighter: #fafafa;--color-bg-lightest: #f8f8f8;--color-bg-gray: #f4f4f4;--color-border-gray: #c8ccd1;--color-border-light: #efefef;--color-border-input: #ccc;--color-border-dark: #72777d;--color-border-disabled: #d6d6d6;--color-danger: #d33;--color-danger-hover: #ff4242;--color-danger-active: #d00;--color-danger--rgb: 211, 51, 51;--color-disabled-bg: #c8ccd1;--color-disabled-dark: #a0a0a0;--font-size-button: 14px;--font-size-label: 1rem;--font-weight-label: 700;--border-width: 1px;--border-width-radio-checked: 6px;--border-radius-button: 6px;--border-radius-input: 4px;--padding-button-y: .5em;--padding-button-x: 1em;--padding-button-dialog: 1em;--padding-input-y: .25em;--padding-input-x: .35em;--size-checkbox: 1.2em;--size-radio: 1.4em;--margin-checkbox-top: .15em;--margin-checkbox-right: .375em;--textarea-height: 50vh;--textarea-min-height: 20em;--line-height-input: 1.5em;--line-height-checkbox: 1.2em;--transition-fast: .1s;--transition-medium: .12s;--transition-slow: .2s;--ipe-modal-accent: var(--color-primary);--ipe-modal-danger: var(--color-danger);--ipe-modal-button-radius: var(--border-radius-button);font-size:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}.theme-ipe textarea[name=text]{width:100%;height:var(--textarea-height);min-height:var(--textarea-min-height);resize:vertical;border:var(--border-width) solid var(--color-border-input);border-radius:var(--border-radius-input);transition:all var(--transition-slow);line-height:var(--line-height-input);padding:var(--padding-input-y) var(--padding-input-x);outline:none}.theme-ipe textarea[name=text]:focus{border-color:var(--color-primary);box-shadow:inset 0 0 0 var(--border-width) var(--color-primary)}.theme-ipe textarea[name=text]:disabled{background-color:var(--color-disabled-bg);color:var(--color-white);cursor:not-allowed}.theme-ipe .ipe-input-box label{display:block;font-size:.875rem;margin-bottom:.5em;font-weight:500}.theme-ipe .ipe-input-box input[type=text],.theme-ipe .ipe-input-box input[type=number],.theme-ipe .ipe-input-box input[type=email],.theme-ipe .ipe-input-box input[type=password],.theme-ipe .ipe-input-box input[type=url],.theme-ipe .ipe-input-box input[type=tel],.theme-ipe .ipe-input-box input[type=search]{width:100%}.theme-ipe input{padding:var(--padding-input-y) var(--padding-input-x);border:var(--border-width) solid var(--color-border-input);border-radius:var(--border-radius-input);transition:all var(--transition-slow);line-height:var(--line-height-input);outline:none}.theme-ipe input:focus{border-color:var(--color-primary);box-shadow:inset 0 0 0 var(--border-width) var(--color-primary)}.theme-ipe label input[type=checkbox]+span,.theme-ipe label input[type=radio]+span{user-select:none;line-height:var(--line-height-checkbox)}.theme-ipe label input[type=checkbox]+span:before,.theme-ipe label input[type=radio]+span:before{content:" ";display:inline-block;width:var(--size-checkbox);height:var(--size-checkbox);margin-top:var(--margin-checkbox-top);margin-right:var(--margin-checkbox-right);border-radius:var(--border-radius-input);background-color:var(--color-bg-lightest);border:var(--border-width) solid var(--color-border-dark);cursor:pointer;transition:all var(--transition-medium)}.theme-ipe label input[type=radio]+span:before{border-radius:50%;box-sizing:border-box;vertical-align:text-bottom;width:var(--size-radio);height:var(--size-radio)}.theme-ipe label input[type=checkbox]:checked+span:before{content:" ";background-color:var(--color-primary);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kOyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgMTYgMTYiPjxnIGlkPSJjaGVja21hcmsiPjxwYXRoIGQ9Ik0xMy43NDkyKzMuNDkwOTVMNS44NjMxMisxMS42MzM3TDIuMjUwNzcrNy45NjA4MkwxLjQ4NzYrOC43NTc3OEw1Ljg2MzEyKzEzLjE5M0wxNC41MTI0KzQuMjg3OUwxMy43NDkyKzMuNDkwOTVaIiBvcGFjaXR5PSIxIiBmaWxsPSIjZmZmZmZmIi8+PC9nPjwvc3ZnPg==);background-repeat:no-repeat}.theme-ipe label input[type=radio]:checked+span:before{border-color:var(--color-primary);border-width:var(--border-width-radio-checked)}.theme-ipe label input[type=checkbox]:checked+span:hover:before{background-color:var(--color-primary-hover)}.theme-ipe label input[type=radio]:checked+span:hover:before{border-color:var(--color-primary-hover)}.theme-ipe label input[type=checkbox]:active+span:before,.theme-ipe label input[type=checkbox]:focus+span:before{box-shadow:0 0 0 2px rgba(var(--color-promary--rgb),.5);border-color:var(--color-primary)}.theme-ipe label input[type=checkbox],.theme-ipe label input[type=radio]{position:absolute;clip:rect(0,0,0,0)}.theme-ipe .cm-panel label input[type=checkbox],.theme-ipe .cm-panel label input[type=radio]{position:initial;clip:initial}.theme-ipe label input[type=checkbox]:disabled+span:before{border-color:var(--color-border-disabled)}.theme-ipe label input[type=radio]:disabled+span:before{background-color:var(--color-disabled-bg);border-color:var(--color-disabled-bg)}.theme-ipe label input[type=checkbox]:disabled:checked+span:before{background-color:var(--color-disabled-dark)}.theme-ipe label input[type=radio]:disabled:checked+span:before{background-color:var(--color-white)}.theme-ipe .ipe-radio-box span,.theme-ipe .ipe-checkbox span{vertical-align:middle}._mbox_5x43w_1{--border-color: #dfdfdf;--title-color: #efefef;--content-color: #ffffff;border-radius:.5rem;border:1px solid var(--title-color);border-left:6px solid var(--border-color);overflow:hidden;margin-bottom:1rem;position:relative}._mbox_5x43w_1 ._title_5x43w_12{background-color:var(--title-color);padding:.5rem 1rem;font-weight:700;font-size:1rem;line-height:1.2}._mbox_5x43w_1 ._content_5x43w_19{background-color:var(--content-color);padding:.5rem 1rem;font-size:1rem;line-height:1.5;max-height:14em;overflow:auto}._mbox_5x43w_1 ._close_5x43w_27{position:absolute;top:.5rem;right:.5rem;font-size:1.25rem;line-height:1rem;color:var(--border-color);cursor:pointer;user-select:none}._mbox_5x43w_1 ._close_5x43w_27:hover{filter:brightness(1.2)}._mbox_5x43w_1 ._close_5x43w_27:active{filter:brightness(.8)}._mbox_5x43w_1.mbox-type-note,._mbox_5x43w_1.mbox-type-info{--border-color: #1f6feb;--title-color: #AFD1FE;--content-color: #f3f9ff}._mbox_5x43w_1.mbox-type-tip,._mbox_5x43w_1.mbox-type-success{--border-color: #238636;--title-color: #E0F1E3;--content-color: #f9f9f9}._mbox_5x43w_1.mbox-type-important,._mbox_5x43w_1.mbox-type-done{--border-color: #8957e5;--title-color: #DDCBFC;--content-color: #f9f9f9}._mbox_5x43w_1.mbox-type-warning{--border-color: #9e6a03;--title-color: #E4CC9D;--content-color: #fff9db}._mbox_5x43w_1.mbox-type-caution,._mbox_5x43w_1.mbox-type-error{--border-color: #da3633;--title-color: #FCB9B6;--content-color: #f9f9f9}._twinSwapInput_1gdgl_9{display:grid;grid-template-columns:1fr auto 1fr;grid-template-areas:"input-left swap-button input-right";gap:1rem;align-items:end}@media (max-width: 768px){._twinSwapInput_1gdgl_9{grid-template-columns:1fr;grid-template-areas:"input-left" "swap-button" "input-right";gap:.75rem}}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23{display:flex;flex-direction:column}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23._inputLeft_1gdgl_27{grid-area:input-left}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23._inputRight_1gdgl_30{grid-area:input-right}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23 label{display:block;margin-bottom:.5em;font-weight:500;font-size:.875rem}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23 input{width:100%}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23 input:disabled{opacity:.75;cursor:not-allowed}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46{grid-area:swap-button;display:flex;align-items:center;justify-content:center}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button{position:relative;display:flex;align-items:center;justify-content:center;padding:0;border-radius:50%;width:2rem;height:2rem;border:none;background:#efefef;cursor:pointer;transition:all .2s ease}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button:hover{background:#e0e0e0}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button:active{background:#d0d0d0}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button:disabled{opacity:.75;cursor:not-allowed}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button svg{transition:all .2s ease;width:1.25rem;height:1.25rem}@media (max-width: 768px){._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button{transform:rotate(90deg)}}._diff-container_lq0si_2{--primary-text-color: #333;--secondary-text-color: #888;--container-bg-color: #fff;--border-color: #ccc;--del-bg: #fadad7;--del-color: #b30000;--ins-bg: #eaf2c2;--ins-color: #406619;--chunk-header-color: #8a008b;--result-bg: #f5f5f5;background:var(--result-bg);padding:1rem;margin:0;border-radius:3px;font-family:Maple Mono NF CN,Maple Mono NF,Maple Mono,JetBrainsMono Nerd Font,JetBrains Mono NF,JetBrains Mono,Consolas,Courier New,monospace;white-space:pre-wrap;overflow-x:auto;line-height:1.4em;color:var(--secondary-text-color);transition:color .25s ease}._diff-container_lq0si_2:hover{color:var(--primary-text-color)}._diff-container_lq0si_2 del{text-decoration:line-through;color:var(--del-color);background:var(--del-bg)}._diff-container_lq0si_2 ins{background:var(--ins-bg);color:var(--ins-color);text-decoration:underline}._diff-container_lq0si_2 del,._diff-container_lq0si_2 ins{font-weight:700}._diff-container_lq0si_2 ._chunk-header_lq0si_44{color:var(--chunk-header-color);text-decoration:none}#ipe-edit-toolbox{position:fixed;right:32px;bottom:32px;user-select:none;z-index:199}@media print{#ipe-edit-toolbox{display:none}}#ipe-edit-toolbox .ipe-toolbox-btn{color:#fff;background:#bebebe;text-align:center;height:35px;width:35px;font-size:20px;border:0;border-radius:50%;box-shadow:0 0 5px gray;text-shadow:0 0 2px #4c4c4c;padding:0;margin:0;cursor:pointer}#ipe-edit-toolbox #toolbox-toggle{position:absolute;right:0;bottom:0;width:42px;height:42px;background:#3f51b5;font-size:24px;line-height:1;margin:0;transition:all .26s ease-in-out;transform:rotate(0)}#ipe-edit-toolbox #toolbox-toggle.opened{transform:rotate(45deg)}#ipe-edit-toolbox .btn-group.group1 .btn-tip-group{transform:translate3d(0,100%,0)}#ipe-edit-toolbox .btn-group.group2 .btn-tip-group{transform:translate3d(100%,0,0)}#ipe-edit-toolbox .btn-group .btn-tip-group{transition-timing-function:ease-in-out;transition-duration:.3s;opacity:0}#ipe-edit-toolbox .btn-group.opened .btn-tip-group{transform:translateZ(0);opacity:1}#ipe-edit-toolbox .btn-group.opened .btn-tip-group:nth-of-type(1),#ipe-edit-toolbox .btn-group:not(.opened) .btn-tip-group:nth-of-type(3){transition-delay:0s}#ipe-edit-toolbox .btn-group .btn-tip-group:nth-of-type(2){transition-delay:.06s}#ipe-edit-toolbox .btn-group:not(.opened) .btn-tip-group:nth-of-type(1),#ipe-edit-toolbox .btn-group.opened .btn-tip-group:nth-of-type(3){transition-delay:.108s}#ipe-edit-toolbox .btn-group:not(.opened){transform:scaleZ(0);transition-delay:.408s}#ipe-edit-toolbox .btn-group.opened{transform:scaleZ(1)}#ipe-edit-toolbox .ipe-toolbox-btn#toolbox-toggle.click{box-shadow:0 0 4px gray,0 0 10px #444 inset}#toolbox-toggle.click:before{content:"";font-family:FontAwesome;display:block;position:absolute;bottom:50%;right:0;font-size:12px;transform:rotate(-45deg)}#ipe-edit-toolbox .ipe-toolbox-btn#edit-btn{background:#2196f3}#ipe-edit-toolbox .ipe-toolbox-btn#redirectfrom-btn{background:#00bcd4}#ipe-edit-toolbox .ipe-toolbox-btn#redirectto-btn{background:#009688}#ipe-edit-toolbox .ipe-toolbox-btn#deletepage-btn{background:#e91e63}#ipe-edit-toolbox .ipe-toolbox-btn#renamepage-btn{background:#ff5722}#ipe-edit-toolbox .ipe-toolbox-btn#preference-btn{background:#ffc107}#ipe-edit-toolbox .btn-group{position:absolute;float:right;list-style:none;margin:0}#ipe-edit-toolbox .btn-group.group1{bottom:41px;right:2px}#ipe-edit-toolbox .btn-group.group2{bottom:0;right:41px}#ipe-edit-toolbox .btn-group.group1 .btn-tip-group{margin-bottom:6px}#ipe-edit-toolbox .btn-group.group2 .btn-tip-group{margin-right:6px}#ipe-edit-toolbox .btn-group.opened{visibility:visible}#ipe-edit-toolbox .btn-tip-group .btn-tip{position:absolute;text-align:center;font-size:12px;width:6em;right:-20px;top:-2.1em;background:#fff;padding:0 4px;box-shadow:0 0 4px gray;pointer-events:none;display:none}#ipe-edit-toolbox .btn-tip-group:hover .btn-tip{display:block}#ipe-edit-toolbox .btn-tip-group .btn-tip:after{content:"";display:block;border:5px solid transparent;border-right-color:#fff;border-bottom-color:#fff;position:absolute;bottom:-4px;left:calc(50% - 2.5px);transform:rotate(45deg)}.tabs[data-v-1f988771]{--border-color: #efefef;--tab-color: #666;--active-color: #3366bb;display:flex;gap:.5em;border-bottom:1px solid #efefef;margin-bottom:1em}.tabs .tab[data-v-1f988771]{padding:.5em 1em;cursor:pointer;user-select:none;color:var(--tab-color);display:inline-block;transition:color .3s ease,box-shadow .3s ease}.tabs .tab.active[data-v-1f988771]{color:var(--active-color);box-shadow:inset 0 -.15em 0 0 var(--active-color)}
1
+ @charset "UTF-8";:root{--ipe-modal-z: 1000;--ipe-modal-backdrop-bg: rgba(0, 0, 0, .5);--ipe-modal-bg: #ffffff;--ipe-modal-fg: #111827;--ipe-modal-fg--rgb: 17, 24, 39;--ipe-modal-muted: #6b7280;--ipe-modal-accent: #3b82f6;--ipe-modal-accent--rgb: 59, 130, 246;--ipe-modal-danger: #ef4444;--ipe-modal-danger--rgb: 239, 68, 68;--ipe-modal-radius: 16px;--ipe-modal-button-radius: 10px;--ipe-modal-shadow: 0 20px 40px rgba(0, 0, 0, .18);--ipe-modal-spacing: 16px;--ipe-modal-viewport-gap-y: 20px;--ipe-modal-window-max-w: 720px;--ipe-modal-anim: none;--ipe-modal-safe-area-top: env(safe-area-inset-top);--ipe-modal-safe-area-bottom: env(safe-area-inset-bottom);--ipe-modal-vh: 100vh}@supports (height: 100dvh){:root{--ipe-modal-vh: 100dvh}}:root{--ipe-modal-window-max-h: calc( var(--ipe-modal-vh) - var(--ipe-modal-safe-area-top) - var(--ipe-modal-safe-area-bottom) - (var(--ipe-modal-viewport-gap-y) * 2) )}html.ipe-modal-no-scroll,body.ipe-modal-no-scroll{overflow:hidden!important;touch-action:none;-webkit-overflow-scrolling:auto}body.ipe-modal-no-scroll{position:fixed;width:100%;left:0;right:0}.ipe-modal-backdrop{position:fixed;inset:0;z-index:var(--ipe-modal-z);background:transparent;transition:background .18s ease;pointer-events:none}.ipe-modal-backdrop.is-open{background:var(--ipe-modal-backdrop-bg);pointer-events:auto}.ipe-modal-modal{position:fixed;inset:0;z-index:calc(var(--ipe-modal-z) + 1);outline:none;overflow:auto;opacity:0;transform:translateY(8px) scale(.98);transition:opacity .18s ease,transform .22s ease;pointer-events:none;align-items:start;justify-items:center}.ipe-modal-modal.is-open{opacity:1;transform:none}.ipe-modal-modal.is-centered{display:grid;align-items:center}.ipe-modal-modal.is-centered .ipe-modal-modal__content{max-height:75dvh;overflow:auto}.ipe-modal-modal.is-fullscreen .ipe-modal-modal__window{width:100vw;height:var(--ipe-modal-vh);max-width:none;max-height:none;border-radius:0}.ipe-modal-modal.no-backdrop{position:absolute;inset:auto;display:block;padding:0;overflow:visible}.ipe-modal-modal.is-dragging{transition:none}.ipe-modal-modal.is-dragging .ipe-modal-modal__window{animation:none}.ipe-modal-modal.is-dragging .ipe-modal-modal__header{cursor:grabbing!important}.ipe-modal-modal__window{position:relative;background:var(--ipe-modal-bg);color:var(--ipe-modal-fg);border-radius:var(--ipe-modal-radius);box-shadow:var(--ipe-modal-shadow);max-width:var(--ipe-modal-window-max-w);width:min(92vw,var(--ipe-modal-window-max-w));overflow:hidden;display:block;animation:var(--ipe-modal-anim, none) .22s ease both;pointer-events:auto;overscroll-behavior:contain;margin-top:var(--ipe-modal-viewport-gap-y, 20px);margin-bottom:var(--ipe-modal-viewport-gap-y, 20px)}.size--dialog{max-width:420px}.size--small{max-width:520px}.size--smallToMedium{max-width:640px}.size--medium{max-width:720px}.size--mediumToLarge{max-width:860px}.size--large{max-width:1040px}.size--full{width:100vw;height:var(--ipe-modal-vh);max-width:none;max-height:none;border-radius:0}.size--auto{max-width:var(--ipe-modal-window-max-w)}.ipe-modal-modal__window.is-fixed-height{height:min(var(--ipe-modal-window-max-h),80vh)}.ipe-modal-modal__header{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;padding:calc(var(--ipe-modal-spacing) * .75) var(--ipe-modal-spacing);border-bottom:1px solid color-mix(in oklab,black 6%,transparent)}.ipe-modal-modal__title{font-size:1.1rem;font-weight:600;margin:0}.ipe-modal-modal__icons{display:inline-flex;gap:6px}.ipe-modal-modal__icon{width:28px;height:28px;border-radius:8px;border:0;background:transparent}.ipe-modal-modal__close{margin-left:6px;width:32px;height:32px;display:grid;place-items:center;border:0;border-radius:var(--ipe-modal-button-radius);background:transparent;font-size:22px;line-height:1;color:var(--ipe-modal-muted);cursor:pointer}.ipe-modal-modal__close:hover{background:#0000000f;color:var(--ipe-modal-fg)}.ipe-modal-modal__content{padding:var(--ipe-modal-spacing);overflow:visible;-webkit-overflow-scrolling:touch}.ipe-modal-modal__footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:calc(var(--ipe-modal-spacing) * .75) var(--ipe-modal-spacing);border-top:1px solid color-mix(in oklab,black 6%,transparent)}.ipe-modal-modal__buttons{display:inline-flex;gap:8px}.ipe-modal-toast-container{position:fixed;z-index:2000;display:flex;flex-direction:column;gap:8px;align-items:flex-end;pointer-events:none}.ipe-modal-toast-container.top{top:16px}.ipe-modal-toast-container.bottom{bottom:16px;flex-direction:column-reverse}.ipe-modal-toast-container.right{right:16px}.ipe-modal-toast-container.left{left:16px}.ipe-modal-modal__window.plugin--toast{width:300px;border-radius:calc(var(--ipe-modal-radius) * .5)}.ipe-modal-modal__window.plugin--toast .ipe-modal-modal__header{padding:.5em}.ipe-modal-modal__window.plugin--toast .ipe-modal-modal__close{width:20px;height:20px;font-size:16px}.ipe-modal-modal__window.plugin--toast .ipe-modal-modal__content{padding:1em .5em}.ipe-modal-modal__window.plugin--toast .ipe-modal-modal__footer{padding:0 .5em .5em}.ipe-modal-modal__window.plugin--toast .ipe-modal-btn{padding:.5em .75em}.ipe-modal-btn{--accent-color: #fff;--text-color: var(--ipe-modal-fg);--active-color: rgba(0, 0, 0, .1);appearance:none;border:1px solid rgba(0,0,0,.14);background:var(--accent-color);color:var(--text-color);padding:8px 12px;border-radius:var(--ipe-modal-button-radius);cursor:pointer;font:inherit;transition:all .2s}.ipe-modal-btn:hover{background:#0000000a}.ipe-modal-btn:disabled{opacity:.6;cursor:not-allowed}.ipe-modal-btn:active{background:#0000000f;box-shadow:0 0 0 2px var(--active-color)}.ipe-modal-btn:focus{box-shadow:0 0 0 2px var(--active-color)}.ipe-modal-btn.is-primary{--accent-color: var(--ipe-modal-accent);--text-color: #fff;--active-color: rgba(var(--ipe-modal-accent--rgb), .5);border-color:var(--accent-color);background:var(--accent-color)}.ipe-modal-btn.is-danger{--accent-color: var(--ipe-modal-danger);--text-color: #fff;--active-color: rgba(var(--ipe-modal-danger--rgb), .2);border-color:var(--accent-color);background:var(--accent-color);color:var(--text-color)}.ipe-modal-btn.is-ghost,.ipe-modal-btn.is-text{background:transparent}.ipe-modal-btn.is-ghost.is-primary{color:var(--ipe-modal-accent)}.ipe-modal-btn.is-ghost.is-danger{color:var(--ipe-modal-danger)}.ipe-modal-btn.is-text{border:0}.ipe-modal-modal__window.size--dialog .ipe-modal-modal__footer,.ipe-modal-modal__window.compact-buttons .ipe-modal-modal__footer{padding:0}.ipe-modal-modal__window.size--dialog .ipe-modal-modal__buttons--left,.ipe-modal-modal__window.compact-buttons .ipe-modal-modal__buttons--left{display:none}.ipe-modal-modal__window.size--dialog .ipe-modal-modal__buttons--right,.ipe-modal-modal__window.compact-buttons .ipe-modal-modal__buttons--right{flex:1;width:100%;display:flex;gap:0}.ipe-modal-modal__window.size--dialog .ipe-modal-btn,.ipe-modal-modal__window.compact-buttons .ipe-modal-btn{flex:1;border:0;margin:0;padding:1rem;border-radius:0}.ipe-modal-modal__window.size--dialog .ipe-modal-btn:not(:first-child),.ipe-modal-modal__window.compact-buttons .ipe-modal-btn:not(:first-child){border-left:1px solid rgba(0,0,0,.06)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}._ipe_progress_so6hn_1{position:relative;display:inline-block;width:100%;overflow:hidden;border:1px solid #c5c5c5;border-radius:100vmax;background-color:#fff;height:1em;--progress: 0%}._ipe_progress_so6hn_1[data-indeterminate=true]:before,._ipe_progress_so6hn_1[data-indeterminate=true]:after{content:"";position:absolute;top:0;bottom:0;left:0;background-color:#36c}._ipe_progress_so6hn_1[data-indeterminate=true]:before{animation:_progress-indeterminate-long_so6hn_1 2s linear infinite}._ipe_progress_so6hn_1[data-indeterminate=true]:after{animation:_progress-indeterminate-short_so6hn_1 2s linear infinite}._ipe_progress_so6hn_1[data-indeterminate=false]:before{content:"";position:absolute;top:0;bottom:0;left:0;width:var(--progress);background-color:#36c;transition:width .3s ease-in-out}@keyframes _progress-indeterminate-long_so6hn_1{0%{left:0;width:0}50%{left:30%;width:70%}75%{left:100%;width:0}}@keyframes _progress-indeterminate-short_so6hn_1{0%{left:0;width:0}50%{left:0;width:0}75%{left:0;width:25%}to{left:110%;width:0}}.theme-ipe{--color-primary: #36c;--color-primary-hover: #447ff5;--color-primary-active: #2a4b8d;--color-promary--rgb: 51, 102, 204;--color-white: #fff;--color-text-dark: #222;--color-text-medium: #252525;--color-text-hover: #454545;--color-bg-light: #f8f9fa;--color-bg-lighter: #fafafa;--color-bg-lightest: #f8f8f8;--color-bg-gray: #f4f4f4;--color-border-gray: #c8ccd1;--color-border-light: #efefef;--color-border-input: #ccc;--color-border-dark: #72777d;--color-border-disabled: #d6d6d6;--color-danger: #d33;--color-danger-hover: #ff4242;--color-danger-active: #d00;--color-danger--rgb: 211, 51, 51;--color-disabled-bg: #c8ccd1;--color-disabled-dark: #a0a0a0;--font-size-button: 14px;--font-size-label: 1rem;--font-weight-label: 700;--border-width: 1px;--border-width-radio-checked: 6px;--border-radius-button: 6px;--border-radius-input: 4px;--padding-button-y: .5em;--padding-button-x: 1em;--padding-button-dialog: 1em;--padding-input-y: .25em;--padding-input-x: .35em;--size-checkbox: 1.2em;--size-radio: 1.4em;--margin-checkbox-top: .15em;--margin-checkbox-right: .375em;--textarea-height: 50vh;--textarea-min-height: 20em;--line-height-input: 1.5em;--line-height-checkbox: 1.2em;--transition-fast: .1s;--transition-medium: .12s;--transition-slow: .2s;--ipe-modal-accent: var(--color-primary);--ipe-modal-danger: var(--color-danger);--ipe-modal-button-radius: var(--border-radius-button);font-size:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}.theme-ipe textarea[name=text]{width:100%;height:var(--textarea-height);min-height:var(--textarea-min-height);resize:vertical;border:var(--border-width) solid var(--color-border-input);border-radius:var(--border-radius-input);transition:all var(--transition-slow);line-height:var(--line-height-input);padding:var(--padding-input-y) var(--padding-input-x);outline:none}.theme-ipe textarea[name=text]:focus{border-color:var(--color-primary);box-shadow:inset 0 0 0 var(--border-width) var(--color-primary)}.theme-ipe textarea[name=text]:disabled{background-color:var(--color-disabled-bg);color:var(--color-white);cursor:not-allowed}.theme-ipe .ipe-input-box label{display:block;font-size:.875rem;margin-bottom:.5em;font-weight:500}.theme-ipe .ipe-input-box input[type=text],.theme-ipe .ipe-input-box input[type=number],.theme-ipe .ipe-input-box input[type=email],.theme-ipe .ipe-input-box input[type=password],.theme-ipe .ipe-input-box input[type=url],.theme-ipe .ipe-input-box input[type=tel],.theme-ipe .ipe-input-box input[type=search]{width:100%}.theme-ipe input{padding:var(--padding-input-y) var(--padding-input-x);border:var(--border-width) solid var(--color-border-input);border-radius:var(--border-radius-input);transition:all var(--transition-slow);line-height:var(--line-height-input);outline:none}.theme-ipe input:focus{border-color:var(--color-primary);box-shadow:inset 0 0 0 var(--border-width) var(--color-primary)}.theme-ipe label input[type=checkbox]+span,.theme-ipe label input[type=radio]+span{user-select:none;line-height:var(--line-height-checkbox)}.theme-ipe label input[type=checkbox]+span:before,.theme-ipe label input[type=radio]+span:before{content:" ";display:inline-block;width:var(--size-checkbox);height:var(--size-checkbox);margin-top:var(--margin-checkbox-top);margin-right:var(--margin-checkbox-right);border-radius:var(--border-radius-input);background-color:var(--color-bg-lightest);border:var(--border-width) solid var(--color-border-dark);cursor:pointer;transition:all var(--transition-medium)}.theme-ipe label input[type=radio]+span:before{border-radius:50%;box-sizing:border-box;vertical-align:text-bottom;width:var(--size-radio);height:var(--size-radio)}.theme-ipe label input[type=checkbox]:checked+span:before{content:" ";background-color:var(--color-primary);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kOyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgMTYgMTYiPjxnIGlkPSJjaGVja21hcmsiPjxwYXRoIGQ9Ik0xMy43NDkyKzMuNDkwOTVMNS44NjMxMisxMS42MzM3TDIuMjUwNzcrNy45NjA4MkwxLjQ4NzYrOC43NTc3OEw1Ljg2MzEyKzEzLjE5M0wxNC41MTI0KzQuMjg3OUwxMy43NDkyKzMuNDkwOTVaIiBvcGFjaXR5PSIxIiBmaWxsPSIjZmZmZmZmIi8+PC9nPjwvc3ZnPg==);background-repeat:no-repeat}.theme-ipe label input[type=radio]:checked+span:before{border-color:var(--color-primary);border-width:var(--border-width-radio-checked)}.theme-ipe label input[type=checkbox]:checked+span:hover:before{background-color:var(--color-primary-hover)}.theme-ipe label input[type=radio]:checked+span:hover:before{border-color:var(--color-primary-hover)}.theme-ipe label input[type=checkbox]:active+span:before,.theme-ipe label input[type=checkbox]:focus+span:before{box-shadow:0 0 0 2px rgba(var(--color-promary--rgb),.5);border-color:var(--color-primary)}.theme-ipe label input[type=checkbox],.theme-ipe label input[type=radio]{position:absolute;clip:rect(0,0,0,0)}.theme-ipe .cm-panel label input[type=checkbox],.theme-ipe .cm-panel label input[type=radio]{position:initial;clip:initial}.theme-ipe label input[type=checkbox]:disabled+span:before{border-color:var(--color-border-disabled)}.theme-ipe label input[type=radio]:disabled+span:before{background-color:var(--color-disabled-bg);border-color:var(--color-disabled-bg)}.theme-ipe label input[type=checkbox]:disabled:checked+span:before{background-color:var(--color-disabled-dark)}.theme-ipe label input[type=radio]:disabled:checked+span:before{background-color:var(--color-white)}.theme-ipe .ipe-radio-box span,.theme-ipe .ipe-checkbox span{vertical-align:middle}._mbox_5x43w_1{--border-color: #dfdfdf;--title-color: #efefef;--content-color: #ffffff;border-radius:.5rem;border:1px solid var(--title-color);border-left:6px solid var(--border-color);overflow:hidden;margin-bottom:1rem;position:relative}._mbox_5x43w_1 ._title_5x43w_12{background-color:var(--title-color);padding:.5rem 1rem;font-weight:700;font-size:1rem;line-height:1.2}._mbox_5x43w_1 ._content_5x43w_19{background-color:var(--content-color);padding:.5rem 1rem;font-size:1rem;line-height:1.5;max-height:14em;overflow:auto}._mbox_5x43w_1 ._close_5x43w_27{position:absolute;top:.5rem;right:.5rem;font-size:1.25rem;line-height:1rem;color:var(--border-color);cursor:pointer;user-select:none}._mbox_5x43w_1 ._close_5x43w_27:hover{filter:brightness(1.2)}._mbox_5x43w_1 ._close_5x43w_27:active{filter:brightness(.8)}._mbox_5x43w_1.mbox-type-note,._mbox_5x43w_1.mbox-type-info{--border-color: #1f6feb;--title-color: #AFD1FE;--content-color: #f3f9ff}._mbox_5x43w_1.mbox-type-tip,._mbox_5x43w_1.mbox-type-success{--border-color: #238636;--title-color: #E0F1E3;--content-color: #f9f9f9}._mbox_5x43w_1.mbox-type-important,._mbox_5x43w_1.mbox-type-done{--border-color: #8957e5;--title-color: #DDCBFC;--content-color: #f9f9f9}._mbox_5x43w_1.mbox-type-warning{--border-color: #9e6a03;--title-color: #E4CC9D;--content-color: #fff9db}._mbox_5x43w_1.mbox-type-caution,._mbox_5x43w_1.mbox-type-error{--border-color: #da3633;--title-color: #FCB9B6;--content-color: #f9f9f9}._twinSwapInput_1gdgl_9{display:grid;grid-template-columns:1fr auto 1fr;grid-template-areas:"input-left swap-button input-right";gap:1rem;align-items:end}@media (max-width: 768px){._twinSwapInput_1gdgl_9{grid-template-columns:1fr;grid-template-areas:"input-left" "swap-button" "input-right";gap:.75rem}}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23{display:flex;flex-direction:column}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23._inputLeft_1gdgl_27{grid-area:input-left}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23._inputRight_1gdgl_30{grid-area:input-right}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23 label{display:block;margin-bottom:.5em;font-weight:500;font-size:.875rem}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23 input{width:100%}._twinSwapInput_1gdgl_9 ._inputWrapper_1gdgl_23 input:disabled{opacity:.75;cursor:not-allowed}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46{grid-area:swap-button;display:flex;align-items:center;justify-content:center}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button{position:relative;display:flex;align-items:center;justify-content:center;padding:0;border-radius:50%;width:2rem;height:2rem;border:none;background:#efefef;cursor:pointer;transition:all .2s ease}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button:hover{background:#e0e0e0}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button:active{background:#d0d0d0}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button:disabled{opacity:.75;cursor:not-allowed}._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button svg{transition:all .2s ease;width:1.25rem;height:1.25rem}@media (max-width: 768px){._twinSwapInput_1gdgl_9 ._swapButton_1gdgl_46 button{transform:rotate(90deg)}}._diff-container_lq0si_2{--primary-text-color: #333;--secondary-text-color: #888;--container-bg-color: #fff;--border-color: #ccc;--del-bg: #fadad7;--del-color: #b30000;--ins-bg: #eaf2c2;--ins-color: #406619;--chunk-header-color: #8a008b;--result-bg: #f5f5f5;background:var(--result-bg);padding:1rem;margin:0;border-radius:3px;font-family:Maple Mono NF CN,Maple Mono NF,Maple Mono,JetBrainsMono Nerd Font,JetBrains Mono NF,JetBrains Mono,Consolas,Courier New,monospace;white-space:pre-wrap;overflow-x:auto;line-height:1.4em;color:var(--secondary-text-color);transition:color .25s ease}._diff-container_lq0si_2:hover{color:var(--primary-text-color)}._diff-container_lq0si_2 del{text-decoration:line-through;color:var(--del-color);background:var(--del-bg)}._diff-container_lq0si_2 ins{background:var(--ins-bg);color:var(--ins-color);text-decoration:underline}._diff-container_lq0si_2 del,._diff-container_lq0si_2 ins{font-weight:700}._diff-container_lq0si_2 ._chunk-header_lq0si_44{color:var(--chunk-header-color);text-decoration:none}#ipe-edit-toolbox{position:fixed;right:32px;bottom:32px;user-select:none;z-index:199}@media print{#ipe-edit-toolbox{display:none}}#ipe-edit-toolbox .ipe-toolbox-btn{color:#fff;background:#bebebe;height:36px;width:36px;font-size:20px;line-height:1;border:0;border-radius:50%;box-shadow:0 0 8px #999;text-shadow:0 0 2px #4c4c4c;padding:0;margin:0;cursor:pointer;display:flex;align-items:center;justify-content:center}#ipe-edit-toolbox .ipe-toolbox-btn svg,#ipe-edit-toolbox .ipe-toolbox-btn img{line-height:1;width:1em;height:1em;vertical-align:middle}#ipe-edit-toolbox #toolbox-toggle{position:absolute;right:0;bottom:0;width:42px;height:42px;background:#3f51b5;font-size:32px;line-height:1;margin:0;transition:all .26s ease-in-out;transform:rotate(0)}#ipe-edit-toolbox #toolbox-toggle.opened{transform:rotate(45deg)}#ipe-edit-toolbox .btn-group.group1 .btn-tip-group{transform:translate3d(0,100%,0)}#ipe-edit-toolbox .btn-group.group2 .btn-tip-group{transform:translate3d(100%,0,0)}#ipe-edit-toolbox .btn-group .btn-tip-group{transition-timing-function:ease-in-out;transition-duration:.3s;opacity:0}#ipe-edit-toolbox .btn-group.opened .btn-tip-group{transform:translateZ(0);opacity:1}#ipe-edit-toolbox .btn-group.opened .btn-tip-group:nth-of-type(1),#ipe-edit-toolbox .btn-group:not(.opened) .btn-tip-group:nth-of-type(3){transition-delay:0s}#ipe-edit-toolbox .btn-group .btn-tip-group:nth-of-type(2){transition-delay:.06s}#ipe-edit-toolbox .btn-group:not(.opened) .btn-tip-group:nth-of-type(1),#ipe-edit-toolbox .btn-group.opened .btn-tip-group:nth-of-type(3){transition-delay:.108s}#ipe-edit-toolbox .btn-group:not(.opened){transform:scaleZ(0);transition-delay:.408s}#ipe-edit-toolbox .btn-group.opened{transform:scaleZ(1)}#ipe-edit-toolbox .ipe-toolbox-btn#toolbox-toggle.click{box-shadow:0 0 4px gray,0 0 10px #444 inset}#ipe-edit-toolbox .ipe-toolbox-btn#ipe-toolbox__quick-edit-btn{background:#2196f3}#ipe-edit-toolbox .ipe-toolbox-btn#ipe-toolbox__quick-redirect-btn{background:#00bcd4}#ipe-edit-toolbox .ipe-toolbox-btn#redirectto-btn{background:#009688}#ipe-edit-toolbox .ipe-toolbox-btn#ipe-toolbox__quick-delete-btn{background:#e91e63}#ipe-edit-toolbox .ipe-toolbox-btn#ipe-toolbox__quick-move-btn{background:#ff5722}#ipe-edit-toolbox .ipe-toolbox-btn#ipe-toolbox__preferences-btn{background:#ffc107}#ipe-edit-toolbox .btn-group{position:absolute;display:flex;gap:8px;list-style:none;margin:0}#ipe-edit-toolbox .btn-group.group1{bottom:49px;right:4px;flex-direction:column}#ipe-edit-toolbox .btn-group.group2{bottom:2px;right:49px}#ipe-edit-toolbox .btn-group.opened{visibility:visible}#ipe-edit-toolbox .btn-tip-group .btn-tip{position:absolute;text-align:center;font-size:12px;white-space:nowrap;left:50%;bottom:calc(100% + .5em);transform:translate(-50%);background:#fff;padding:.2em .5em;box-shadow:0 0 .5em #999;border-radius:.5em;pointer-events:none;opacity:0;transition:opacity .2s ease-in-out,bottom .2s ease-in-out}#ipe-edit-toolbox .btn-tip-group:hover .btn-tip{opacity:1;bottom:calc(100% + 1em)}#ipe-edit-toolbox .btn-tip-group .btn-tip:after{content:"";display:block;border:5px solid transparent;border-right-color:#fff;border-bottom-color:#fff;position:absolute;bottom:-8px;left:50%;transform:rotate(45deg) translate(-50%)}.tabs[data-v-a338c085]{--border-color: #efefef;--tab-color: #666;--active-color: #3366bb;display:flex;gap:.5em;border-bottom:1px solid #efefef;margin-bottom:1em}.tabs .tab[data-v-a338c085]{padding:.5em 1em;cursor:pointer;user-select:none;color:var(--tab-color);display:inline-block;transition:color .3s ease,box-shadow .3s ease}.tabs .tab.active[data-v-a338c085]{color:var(--active-color);box-shadow:inset 0 -.15em 0 0 var(--active-color)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inpageedit/core",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "🚀 Modular, Extensible Supercharged Plugin for MediaWiki",
5
5
  "author": "dragon-fish",
6
6
  "license": "MIT",
@@ -48,18 +48,18 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@eslint/eslintrc": "^3.3.1",
51
- "@eslint/js": "^9.36.0",
52
- "@microsoft/api-extractor": "^7.52.13",
51
+ "@eslint/js": "^9.37.0",
52
+ "@microsoft/api-extractor": "^7.53.1",
53
53
  "@prettier/plugin-pug": "^3.4.2",
54
54
  "@tabler/icons-vue": "^3.35.0",
55
- "@types/node": "^22.18.6",
56
- "@typescript-eslint/eslint-plugin": "^8.44.1",
57
- "@typescript-eslint/parser": "^8.44.1",
55
+ "@types/node": "^22.18.10",
56
+ "@typescript-eslint/eslint-plugin": "^8.46.1",
57
+ "@typescript-eslint/parser": "^8.46.1",
58
58
  "@vitejs/plugin-vue": "^6.0.1",
59
- "@vue/language-plugin-pug": "^3.0.8",
60
- "cross-env": "^10.0.0",
61
- "eslint": "^9.36.0",
62
- "fexios": "^3.1.0",
59
+ "@vue/language-plugin-pug": "^3.1.1",
60
+ "cross-env": "^10.1.0",
61
+ "eslint": "^9.37.0",
62
+ "fexios": "^3.2.0",
63
63
  "globals": "^16.4.0",
64
64
  "jsx-dom": "^8.1.6",
65
65
  "npm-run-all2": "^8.0.4",
@@ -67,12 +67,12 @@
67
67
  "pug": "^3.0.3",
68
68
  "rimraf": "^6.0.1",
69
69
  "sass-embedded": "^1.93.2",
70
- "tsx": "^4.20.5",
70
+ "tsx": "^4.20.6",
71
71
  "types-mediawiki": "^2.0.0",
72
- "typescript": "^5.9.2",
72
+ "typescript": "^5.9.3",
73
73
  "unplugin-auto-import": "^20.2.0",
74
74
  "unplugin-dts": "1.0.0-beta.6",
75
- "vite": "^7.1.7",
75
+ "vite": "^7.1.9",
76
76
  "vitest": "^3.2.4"
77
77
  },
78
78
  "dependencies": {
@@ -80,14 +80,11 @@
80
80
  "@inpageedit/logger": "^0.1.0",
81
81
  "diff": "^8.0.2",
82
82
  "localforage": "^1.10.0",
83
- "schemastery": "^3.17.0",
84
- "vue": "^3.5.21",
85
- "wiki-saikou": "^5.0.0",
83
+ "schemastery": "^3.17.1",
84
+ "vue": "^3.5.22",
85
+ "wiki-saikou": "^5.2.0",
86
86
  "schemastery-form": "^0.2.0"
87
87
  },
88
- "peerDependencies": {
89
- "fexios": "^3.1.0"
90
- },
91
88
  "keywords": [
92
89
  "mediawiki",
93
90
  "mediawiki-gadget",
@@ -101,9 +98,13 @@
101
98
  "bugs": {
102
99
  "url": "https://github.com/inpageedit/inpageedit-next/issues"
103
100
  },
101
+ "peerDependencies": {
102
+ "fexios": "^3.2.0"
103
+ },
104
104
  "scripts": {
105
105
  "start": "zx dev/scripts/setup-dev.ts",
106
106
  "dev": "vite",
107
+ "test": "vitest run ./src",
107
108
  "build": "run-p build:*",
108
109
  "build:import": "cross-env VITE_BUILD_FORMAT=import vite build",
109
110
  "build:bundle": "cross-env VITE_BUILD_FORMAT=bundle vite build",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-Bo1hNwWJ.js","sources":["../src/plugins/quick-preview/index.tsx"],"sourcesContent":["import { Inject, InPageEdit } from '@/InPageEdit'\nimport { type QuickEditInitPayload } from '@/plugins/quick-edit'\nimport { WikiPage } from '@/models/WikiPage'\nimport { MwApiParams } from 'wiki-saikou'\nimport { PageParseData } from '@/models/WikiPage/types/PageParseData'\nimport { IPEModal } from '@/services/ModalService/IPEModal.js'\n\ndeclare module '@/InPageEdit' {\n interface InPageEdit {\n quickPreview: PluginQuickPreview['quickPreview']\n }\n interface Events {\n 'quickPreview/showModal'(payload: {\n ctx: InPageEdit\n text: string\n modal: IPEModal\n wikiPage: WikiPage\n }): void\n 'quickPreview/loaded'(payload: {\n ctx: InPageEdit\n modal: IPEModal\n wikiPage: WikiPage\n text: string\n parseData: PageParseData\n }): void\n }\n}\n\n@Inject(['api', 'wikiPage', 'modal'])\nexport class PluginQuickPreview extends BasePlugin {\n constructor(public ctx: InPageEdit) {\n super(ctx, {}, 'quickPreview')\n }\n\n protected start(): Promise<void> | void {\n this.ctx.set('quickPreview', this.quickPreview.bind(this))\n this.ctx.on('quickEdit/wikiPage', this.injectQuickEdit.bind(this))\n }\n\n protected stop(): Promise<void> | void {\n this.ctx.off('quickEdit/wikiPage', this.injectQuickEdit.bind(this))\n }\n\n private injectQuickEdit({ ctx, modal, wikiPage }: QuickEditInitPayload) {\n let latestPreviewModal: IPEModal | undefined = undefined\n modal.addButton(\n {\n label: 'Preview',\n side: 'left',\n className: 'btn btn-secondary',\n method: () => {\n latestPreviewModal = this.quickPreview(\n (modal.get$content().querySelector<HTMLTextAreaElement>('textarea[name=\"text\"]')\n ?.value as string) || '',\n undefined,\n wikiPage,\n latestPreviewModal\n )\n },\n },\n 2\n )\n }\n\n quickPreview(text: string, params?: MwApiParams, wikiPage?: WikiPage, modal?: IPEModal) {\n wikiPage ||= this.ctx.wikiPage.newBlankPage({\n title: 'API',\n })\n\n if (!modal || modal.isDestroyed) {\n modal = this.ctx.modal\n .createObject({\n className: 'in-page-edit ipe-quickPreview',\n sizeClass: 'large',\n backdrop: false,\n draggable: true,\n })\n .init()\n }\n\n modal.show()\n modal.setTitle('Preview loading...')\n modal.setContent(<ProgressBar />)\n modal.bringToFront()\n this.ctx.emit('quickPreview/showModal', {\n ctx: this.ctx,\n text,\n modal,\n wikiPage,\n })\n\n wikiPage\n .preview(text, params)\n .then((ret) => {\n const {\n data: { parse },\n } = ret\n modal.setTitle(`Preview - ${parse.title}`)\n let outputRef: HTMLElement | null = null\n modal.setContent(\n (\n <section>\n <div\n ref={(el) => (outputRef = el)}\n className=\"mw-parser-output\"\n innerHTML={parse.text}\n ></div>\n </section>\n ) as HTMLElement\n )\n window.mw?.hook('wikipage.content').fire($(outputRef!))\n this.ctx.emit('quickPreview/loaded', {\n ctx: this.ctx,\n modal,\n wikiPage,\n text,\n parseData: parse,\n })\n })\n .catch((error) => {\n modal.setTitle('Preview failed')\n modal.setContent(\n <>\n <p>Failed to preview</p>\n <p>{error instanceof Error ? error.message : String(error)}</p>\n </>\n )\n })\n\n return modal\n }\n}\n"],"names":["_PluginQuickPreview_decorators","_init","_a","Inject","PluginQuickPreview","BasePlugin","ctx","modal","wikiPage","latestPreviewModal","text","params","jsx","ProgressBar","ret","parse","outputRef","el","error","jsxs","Fragment","__decoratorStart","__decorateElement","__runInitializers"],"mappings":";;;;;;;;;;;;;GAAAA,GAAAC,GAAAC;AA4BAF,IAAA,CAACG,EAAO,CAAC,OAAO,YAAY,OAAO,CAAC,CAAA;AAC7B,MAAMC,WAA2BF,IAAAG,GAAW;AAAA,EACjD,YAAmBC,GAAiB;AAClC,UAAMA,GAAK,CAAA,GAAI,cAAc,GADZ,KAAA,MAAAA;AAAA,EAEnB;AAAA,EAEU,QAA8B;AACtC,SAAK,IAAI,IAAI,gBAAgB,KAAK,aAAa,KAAK,IAAI,CAAC,GACzD,KAAK,IAAI,GAAG,sBAAsB,KAAK,gBAAgB,KAAK,IAAI,CAAC;AAAA,EACnE;AAAA,EAEU,OAA6B;AACrC,SAAK,IAAI,IAAI,sBAAsB,KAAK,gBAAgB,KAAK,IAAI,CAAC;AAAA,EACpE;AAAA,EAEQ,gBAAgB,EAAE,KAAAA,GAAK,OAAAC,GAAO,UAAAC,KAAkC;AACtE,QAAIC;AACJ,IAAAF,EAAM;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J,OAAO,IAAI,KAAK,kBAAkB,EAAE,KAAK,EAAEC,CAAU,CAAC,GACtD,KAAK,IAAI,KAAK,uBAAuB;AAAA,QACnC,KAAK,KAAK;AAAA,QACV,OAAAT;AAAA,QACA,UAAAC;AAAA,QACA,MAAAE;AAAA,QACA,WAAWK;AAAA,MAAA,CACZ;AAAA,IACH,CAAC,EACA,MAAM,CAACG,MAAU;AAChB,MAAAX,EAAM,SAAS,gBAAgB,GAC/BA,EAAM;AAAA,QACJY,gBAAAA,EAAAC,GAAA,EACE,UAAA;AAAA,UAAA,gBAAAR,EAAC,OAAE,UAAA,oBAAA,CAAiB;AAAA,UACpB,gBAAAA,EAAC,OAAG,UAAAM,aAAiB,QAAQA,EAAM,UAAU,OAAOA,CAAK,EAAA,CAAE;AAAA,QAAA,EAAA,CAC7D;AAAA,MAAA;AAAA,IAEJ,CAAC,GAEIX;AAAA,EACT;AACF;AAtGON,IAAAoB,EAAAnB,CAAA;AAAME,IAANkB,8BADPtB,GACaI,CAAA;AAANmB,EAAAtB,GAAA,GAAMG,CAAA;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-BxR7MsNM.js","sources":["../src/models/WikiPage/types/WatchlistAction.ts","../src/plugins/quick-edit/PluginQuickEditInArticleLinks.tsx","../src/utils/noop.ts","../src/plugins/quick-edit/index.tsx"],"sourcesContent":["export enum WatchlistAction {\n preferences = 'preferences',\n watch = 'watch',\n unwatch = 'unwatch',\n nochange = 'nochange',\n}\n","import { Inject, InPageEdit, Schema } from '@/InPageEdit'\nimport { QuickEditOptions } from '.'\n\n@Inject(['sitemeta', 'quickEdit'])\n@RegisterPreferences(\n Schema.object({\n redLinkEdit: Schema.boolean()\n .description('Show quick edit entry after red links')\n .default(true),\n }).description('In-article quick edit links'),\n {\n redLinkEdit: true,\n }\n)\nexport class PluginQuickEditInArticleLinks extends BasePlugin<{\n wikiBaseUrl: string\n wikiArticlePath: string\n wikiArticleBaseUrl: string\n wikiScriptBaseUrl: string\n linkClassName: string\n}> {\n constructor(ctx: InPageEdit) {\n const mwConfig = ctx.sitemeta.mwConfig\n const wikiArticlePath = mwConfig.wgArticlePath.replace('$1', '')\n const wikiBaseUrl = `${location.protocol}//${mwConfig.wgServer.split('//')[1]}`\n super(\n ctx,\n {\n wikiBaseUrl,\n wikiArticlePath,\n wikiArticleBaseUrl: `${wikiBaseUrl}${wikiArticlePath}`,\n wikiScriptBaseUrl: `${wikiBaseUrl}${mwConfig.wgScriptPath}`,\n linkClassName: 'ipe-quickEdit__in-article-link',\n },\n 'QuickEditInArticleLinks'\n )\n }\n\n protected async start() {\n mw.hook('wikipage.content').add(() => {\n const anchorList = document.querySelectorAll<HTMLAnchorElement>('#mw-content-text a[href]')\n anchorList.forEach((anchor) => {\n const info = this.checkEditAnchor(anchor)\n if (!info || anchor.dataset.ipeQuickEditLink) {\n return\n }\n\n const link = (\n <a\n href={`#/IPE/quickEdit/${info.title}`}\n className={this.config.linkClassName}\n style={{\n userSelect: 'none',\n marginLeft: '0.2em',\n verticalAlign: 'middle',\n }}\n onClick={(e) => {\n e.preventDefault()\n this.ctx.quickEdit(info)\n }}\n >\n <svg\n style=\"width: 1em; height: 1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"icon icon-tabler icons-tabler-outline icon-tabler-pencil-bolt\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4\" />\n <path d=\"M13.5 6.5l4 4\" />\n <path d=\"M19 16l-2 3h4l-2 3\" />\n </svg>\n </a>\n )\n\n anchor.insertAdjacentElement('afterend', link)\n anchor.dataset.ipeQuickEditLink = 'true'\n })\n })\n }\n\n stop() {\n document.querySelectorAll(`.${this.config.linkClassName}`).forEach((el) => el.remove())\n }\n\n checkEditAnchor(\n anchor: HTMLAnchorElement\n ): Pick<QuickEditOptions, 'title' | 'section' | 'revision' | 'createOnly'> | null {\n if (!(anchor instanceof HTMLAnchorElement)) {\n return null\n }\n\n const href = anchor.href || ''\n if (\n !href.startsWith(this.config.wikiArticleBaseUrl) &&\n !href.startsWith(this.config.wikiScriptBaseUrl)\n ) {\n return null\n }\n const hrefURL = new URL(href)\n const params = hrefURL.searchParams\n const action = params.get('action') || 'view'\n const title =\n params.get('title') ||\n decodeURI(hrefURL.pathname.substring(this.config.wikiArticlePath.length)) ||\n ''\n const section = params.get('section')?.replace(/^T-/, '') || undefined\n const revision = params.get('oldid')\n\n if (\n // 不合法的 title\n !title ||\n title.endsWith('.php') ||\n // 不是 edit 相关操作\n !['edit', 'editsource', 'editredlink', 'submit'].includes(action) ||\n // 暂时未兼容 undo\n params.get('undo') ||\n // 暂时未兼容 preload\n params.get('preload')\n ) {\n return null\n }\n\n let sectionNum: 'new' | number | undefined = undefined\n if (section === 'new') {\n sectionNum = 'new'\n } else if (section && /^\\d+$/.test(section)) {\n sectionNum = parseInt(section, 10)\n }\n\n return {\n title,\n section: sectionNum,\n revision: parseInt('' + revision, 10) || 0,\n createOnly: !!params.get('redlink'),\n }\n }\n}\n","export const noop = () => {}\n","import { Inject, InPageEdit, Schema } from '@/InPageEdit'\nimport { WikiPage } from '@/models/WikiPage'\nimport { WatchlistAction } from '@/models/WikiPage/types/WatchlistAction'\nimport { PluginQuickEditInArticleLinks } from './PluginQuickEditInArticleLinks'\nimport { IPEModal } from '@/services/ModalService/IPEModal'\n\ndeclare module '@/InPageEdit' {\n interface InPageEdit {\n quickEdit: PluginQuickEdit['quickEdit']\n }\n interface Events {\n 'quickEdit/initOptions'(payload: Omit<QuickEditInitPayload, 'modal' | 'wikiPage'>): void\n 'quickEdit/showModal'(payload: Omit<QuickEditInitPayload, 'wikiPage'>): void\n 'quickEdit/wikiPage'(payload: QuickEditInitPayload): void\n }\n}\n\nexport interface QuickEditOptions {\n title: string\n pageId: number\n revision: number\n /**\n * - `undefined` for full article edit\n * - `0` for the first section\n * - `\"new\"` for a new section\n */\n section: number | 'new' | undefined\n editMinor: boolean\n editSummary: string\n createOnly: boolean\n reloadAfterSave: boolean\n}\n\nexport interface QuickEditInitPayload {\n ctx: InPageEdit\n options: QuickEditOptions\n modal: IPEModal\n wikiPage: WikiPage\n}\n\nexport interface QuickEditSubmitPayload {\n text?: string\n summary?: string\n minor?: boolean\n createonly?: boolean\n watchlist?: WatchlistAction\n}\n\n@Inject(['api', 'wikiPage', 'modal', 'preferences'])\n@RegisterPreferences(\n Schema.object({\n editSummary: Schema.string()\n .description('Default edit summary for quick edits')\n .default('[IPE-NEXT] Quick edit'),\n editMinor: Schema.boolean().description('Whether to mark the edit as minor').default(false),\n outSideClose: Schema.boolean().description('Whether to close the modal outside').default(true),\n watchList: Schema.union([\n Schema.const(WatchlistAction.preferences).description('Follow my preferences'),\n Schema.const(WatchlistAction.nochange).description('Keep the current watchlist status'),\n Schema.const(WatchlistAction.watch).description('Add the page to watchlist'),\n Schema.const(WatchlistAction.unwatch).description('Remove the page from watchlist'),\n ])\n .description('Watchlist options')\n .default(WatchlistAction.preferences),\n })\n .description('Quick edit options')\n .extra('category', 'edit'),\n {\n editSummary: '[IPE-NEXT] Quick edit',\n editMinor: false,\n outSideClose: true,\n watchList: WatchlistAction.preferences,\n }\n)\nexport class PluginQuickEdit extends BasePlugin {\n private readonly DEFAULT_OPTIONS: QuickEditOptions = {\n title: '',\n pageId: 0,\n revision: 0,\n section: undefined,\n editMinor: false,\n editSummary: '',\n createOnly: false,\n reloadAfterSave: true,\n }\n\n constructor(public ctx: InPageEdit) {\n super(ctx, {}, 'quick-edit')\n }\n\n protected start(): Promise<void> | void {\n this.ctx.root.set('quickEdit', this.quickEdit.bind(this))\n this.ctx.inject(['toolbox'], (ctx) => {\n this.injectToolbox(ctx)\n ctx.on('dispose', () => {\n this.removeToolbox(ctx)\n })\n })\n\n this.ctx.plugin(PluginQuickEditInArticleLinks)\n }\n\n async quickEdit(payload?: string | Partial<QuickEditOptions>) {\n if (typeof payload === 'undefined') {\n payload = {}\n } else if (typeof payload === 'string') {\n payload = {\n title: payload,\n } as Partial<QuickEditOptions>\n }\n\n // @ts-expect-error legacy `page` option\n if (payload?.page) {\n // @ts-expect-error\n payload.title = payload.page\n // @ts-expect-error\n delete payload.page\n }\n\n if (!payload.title && !payload.pageId && !payload.revision) {\n this.logger.warn('None of the title, pageId or revision provided. Using defaults.')\n payload = {\n ...payload,\n title: mw.config.get('wgPageName'),\n pageId: mw.config.get('wgArticleId'),\n revision: mw.config.get('wgRevisionId'),\n }\n }\n\n const outSideClose = (await this.ctx.preferences.get<boolean>('outSideClose'))!\n const watchList = (await this.ctx.preferences.get<WatchlistAction>('watchList'))!\n const editSummary =\n typeof payload.editSummary === 'string'\n ? payload.editSummary\n : (await this.ctx.preferences.get<string>('editSummary'))!\n const editMinor =\n typeof payload.editMinor === 'boolean'\n ? payload.editMinor\n : (await this.ctx.preferences.get<boolean>('editMinor'))!\n\n const options: QuickEditOptions = {\n ...this.DEFAULT_OPTIONS,\n editSummary,\n editMinor,\n ...payload,\n }\n if (!options.editSummary) {\n options.editSummary = (await this.ctx.preferences.get<string>('editSummary')) || ''\n }\n if (!options) this.ctx.emit('quickEdit/initOptions', { ctx: this.ctx, options })\n\n const modal = this.ctx.modal\n .createObject({\n className: 'ipe-quickEdit',\n sizeClass: 'large',\n // backdrop: false,\n // draggable: true,\n center: false,\n outSideClose,\n })\n .init()\n modal.setTitle(\n (\n <>\n Loading: <u>{options.title}</u>\n </>\n ) as HTMLElement\n )\n modal.setContent(\n (\n <section\n className=\"ipe-quickEdit-loading\"\n style={{\n height: '70vh',\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <ProgressBar />\n </section>\n ) as HTMLElement\n )\n modal.addButton({\n side: 'right',\n type: 'button',\n className: 'is-danger is-ghost',\n label: 'Cancel',\n method() {\n modal.close()\n },\n })\n modal.show()\n this.ctx.emit('quickEdit/showModal', { ctx: this.ctx, modal, options })\n\n let wikiPage: WikiPage\n try {\n wikiPage = await this.getWikiPageFromPayload(options)\n } catch (e) {\n modal.close()\n this.ctx.modal.notify('error', {\n title: 'Error',\n content: e instanceof Error ? e.message : String(e),\n })\n return\n }\n modal.setTitle(\n (\n <>\n Quick {wikiPage.pageInfo.pageid === 0 ? 'Create' : 'Edit'}:{' '}\n <u>{wikiPage.pageInfo.title}</u>\n </>\n ) as HTMLElement\n )\n const editForm = (\n <form className=\"ipe-quickEdit-form\">\n {/* 页面不存在 */}\n {wikiPage.pageInfo.pageid === 0 && (\n <MBox title=\"Attention\" type=\"important\">\n <p>This page does not exist.</p>\n </MBox>\n )}\n <textarea className=\"editArea\" name=\"text\" id=\"wpTextbox1\">\n {wikiPage.revisions[0]?.content || ''}\n </textarea>\n <div\n class=\"ipe-quickEdit-options\"\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: '1rem',\n marginTop: '1rem',\n }}\n >\n <InputBox label=\"Summary\" id=\"summary\" name=\"summary\" value={options.editSummary} />\n <div className=\"ipe-input-box\">\n <label htmlFor=\"watchlist\" style={{ display: 'block' }}>\n Watchlist\n </label>\n <div style={{ display: 'flex', gap: '1rem' }}>\n {[\n WatchlistAction.preferences,\n WatchlistAction.nochange,\n WatchlistAction.watch,\n WatchlistAction.unwatch,\n ].map((action) => (\n <RadioBox\n key={action}\n name=\"watchlist\"\n value={action}\n inputProps={{ checked: watchList === action }}\n >\n {action}\n </RadioBox>\n ))}\n </div>\n </div>\n <div style={{ display: 'flex', gap: '1rem' }}>\n <CheckBox name=\"minor\" id=\"minor\" checked={options.editMinor}>\n Minor edit\n </CheckBox>\n <CheckBox name=\"reloadAfterSave\" id=\"reloadAfterSave\" checked={options.reloadAfterSave}>\n Reload after save\n </CheckBox>\n </div>\n </div>\n {/* Debug Info */}\n {import.meta.env.DEV && (\n <div className=\"debug\" style={{ marginTop: '1rem' }}>\n <details>\n <pre>{JSON.stringify(wikiPage.pageInfo, null, 2)}</pre>\n </details>\n </div>\n )}\n </form>\n ) as HTMLFormElement\n modal.setContent(editForm)\n // shamefully fix: make sure the submit button is always the first\n modal.addButton(\n {\n side: 'left',\n className: 'is-primary submit-btn',\n label: 'Submit',\n method: () => {\n const formData = new FormData(editForm)\n console.info(wikiPage, editForm, {\n text: formData.get('text') as string,\n summary: formData.get('summary') as string,\n minor: formData.get('minor') === 'on',\n })\n modal.setLoadingState(true)\n this.handleSubmit(\n { ctx: this.ctx, modal, wikiPage, options },\n {\n text: formData.get('text') as string,\n summary: formData.get('summary') as string,\n minor: formData.get('minor') === 'on',\n }\n )\n .then(async () => {\n modal.setOptions({\n beforeClose: noop,\n })\n modal.close()\n this.ctx.modal.notify('success', {\n title: 'Submission Successful',\n content: 'Your changes have been saved.',\n })\n if (formData.get('reloadAfterSave')) {\n await sleep(500)\n location.reload()\n }\n })\n .catch((error) => {\n this.ctx.modal.notify('error', {\n title: 'Submission Error',\n content: error instanceof Error ? error.message : String(error),\n })\n modal.setLoadingState(false)\n })\n },\n },\n 0\n )\n modal.setOptions({\n beforeClose: () => {\n const oldStr = wikiPage.revisions[0]?.content || ''\n const newStr = editForm.querySelector('textarea')?.value || ''\n if (newStr === oldStr) {\n return true\n } else {\n this.ctx.modal.confirm(\n {\n className: 'is-primary',\n title: 'Unsaved Changes',\n content:\n 'All edit contents will be lost after closing the modal. Are you sure you want to close?',\n center: true,\n okBtn: {\n label: 'Give Up',\n className: 'is-danger is-ghost',\n },\n cancelBtn: {\n label: 'Continue',\n className: 'is-primary is-ghost',\n },\n },\n (result) => {\n if (result) {\n modal.setOptions({\n beforeClose: noop,\n })\n modal.close()\n }\n return true\n }\n )\n return false\n }\n },\n })\n this.ctx.emit('quickEdit/wikiPage', {\n ctx: this.ctx,\n options,\n modal,\n wikiPage,\n })\n\n const beforeUnload = (e: BeforeUnloadEvent) => {\n if (editForm.querySelector('textarea')?.value === wikiPage.revisions[0]?.content) {\n return true\n }\n e.preventDefault()\n return 'You have unsaved changes. Are you sure you want to leave?'\n }\n window.addEventListener('beforeunload', beforeUnload)\n modal.on(modal.Event.Close, () => {\n window.removeEventListener('beforeunload', beforeUnload)\n })\n }\n\n private handleSubmit(init: QuickEditInitPayload, payload: QuickEditSubmitPayload) {\n const summary = payload.summary || ''\n const text = payload.text || ''\n const minor = payload.minor || false\n const createonly = payload.createonly || false\n const watchlist = payload.watchlist || WatchlistAction.nochange\n\n return init.wikiPage.edit(\n {\n summary,\n text,\n watchlist,\n },\n {\n minor,\n createonly,\n }\n )\n }\n\n private injectToolbox(ctx: InPageEdit) {\n ctx.toolbox.addButton({\n id: 'quick-edit',\n group: 'group1',\n index: 0,\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"icon icon-tabler icons-tabler-outline icon-tabler-edit\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1\" />\n <path d=\"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z\" />\n <path d=\"M16 5l3 3\" />\n </svg>\n ) as HTMLElement,\n tooltip: 'Edit this page quickly',\n onClick: () => this.quickEdit(),\n })\n }\n\n private async getWikiPageFromPayload(payload: Partial<QuickEditOptions>) {\n if (payload.revision) {\n return this.ctx.wikiPage.newFromRevision(payload.revision, payload.section)\n } else if (payload.pageId) {\n return this.ctx.wikiPage.newFromPageId(payload.pageId, payload.section)\n } else if (payload.title) {\n return this.ctx.wikiPage.newFromTitle(payload.title, false, payload.section)\n }\n throw new Error('Invalid payload')\n }\n\n protected removeToolbox(ctx: InPageEdit) {\n ctx.toolbox.removeButton('quick-edit')\n }\n}\n"],"names":["WatchlistAction","_PluginQuickEditInArticleLinks_decorators","_init","_a","Inject","RegisterPreferences","Schema","PluginQuickEditInArticleLinks","BasePlugin","ctx","mwConfig","wikiArticlePath","wikiBaseUrl","anchor","info","link","jsx","e","jsxs","el","href","hrefURL","params","action","title","section","revision","sectionNum","__decoratorStart","__decorateElement","__runInitializers","noop","_PluginQuickEdit_decorators","PluginQuickEdit","payload","outSideClose","watchList","editSummary","editMinor","options","modal","Fragment","ProgressBar","wikiPage","editForm","MBox","InputBox","RadioBox","CheckBox","formData","sleep","error","oldStr","result","beforeUnload","init","summary","text","minor","createonly","watchlist"],"mappings":";;;;;;AAAO,IAAKA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,QAAQ,SACRA,EAAA,UAAU,WACVA,EAAA,WAAW,YAJDA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;GCAZC,GAAAC,GAAAC;AAGAF,IAAA,CAACG,EAAO,CAAC,YAAY,WAAW,CAAC,GAChCC;AAAA,EACCC,EAAO,OAAO;AAAA,IACZ,aAAaA,EAAO,QAAA,EACjB,YAAY,uCAAuC,EACnD,QAAQ,EAAI;AAAA,EAAA,CAChB,EAAE,YAAY,6BAA6B;AAAA,EAC5C;AAAA,IACE,aAAa;AAAA,EAAA;AAEjB,CAAA;AACO,MAAMC,WAAsCJ,IAAAK,GAMhD;AAAA,EACD,YAAYC,GAAiB;AAC3B,UAAMC,IAAWD,EAAI,SAAS,UACxBE,IAAkBD,EAAS,cAAc,QAAQ,MAAM,EAAE,GACzDE,IAAc,GAAG,SAAS,QAAQ,KAAKF,EAAS,SAAS,MAAM,IAAI,EAAE,CAAC,CAAC;AAC7E;AAAA,MACED;AAAA,MACA;AAAA,QACE,aAAAG;AAAA,QACA,iBAAAD;AAAA,QACA,oBAAoB,GAAGC,CAAW,GAAGD,CAAe;AAAA,QACpD,mBAAmB,GAAGC,CAA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AACjB,aAAO,KAAK,IAAI,SAAS,cAAcA,EAAQ,QAAQA,EAAQ,OAAO;AACxE,QAAWA,EAAQ;AACjB,aAAO,KAAK,IAAI,SAAS,aAAaA,EAAQ,OAAO,IAAOA,EAAQ,OAAO;AAE7E,UAAM,IAAI,MAAM,iBAAiB;AAAA,EACnC;AAAA,EAEU,cAAczB,GAAiB;AACvC,IAAAA,EAAI,QAAQ,aAAa,YAAY;AAAA,EACvC;AACF;AAnXOP,IAAA0B,GAAAzB,CAAA;AAAM8B,IAANJ,4BA1BPG,GA0BaC,CAAA;AAANH,GAAA5B,GAAA,GAAM+B,CAAA;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-CUXLgVhg.js","sources":["../src/plugins/toolbox/index.tsx"],"sourcesContent":["import { Inject, InPageEdit, Schema, Service } from '@/InPageEdit'\nimport { ReactElement } from 'jsx-dom'\nimport './styles.scss'\n\ndeclare module '@/InPageEdit' {\n interface InPageEdit {\n toolbox: PluginToolbox\n }\n interface Events {\n 'toolbox/button/added'(payload: { ctx: InPageEdit; button: HTMLElement }): void\n 'toolbox/button/removed'(payload: { ctx: InPageEdit; id: string }): void\n }\n}\n\n@RegisterPreferences(\n Schema.object({\n toolboxAlwaysShow: Schema.boolean()\n .description('Make the toolbox opened by default')\n .default(false),\n }).description('Toolbox preferences'),\n {\n toolboxAlwaysShow: false,\n }\n)\n@Inject(['preferences'])\nexport class PluginToolbox extends Service {\n container!: HTMLElement\n private forceShow = false\n\n constructor(public ctx: InPageEdit) {\n super(ctx, 'toolbox', false)\n }\n\n protected async start(): Promise<void> {\n if (mw && mw.config.get('wgIsArticle') === false && !this.forceShow) {\n this.container = this.createIndicatorForNotArticlePage()\n } else {\n this.container = this.createToolbox()\n }\n document.body.appendChild(this.container)\n await sleep(0) // wait nextTick\n this.ctx.preferences.get('toolboxAlwaysShow').then((val) => {\n if (val) {\n this.container.querySelector('#toolbox-toggle')?.classList.add('opened')\n this.container.querySelectorAll('.btn-group').forEach((el) => {\n el.classList.add('opened')\n })\n }\n })\n }\n\n protected stop(): void | Promise<void> {\n this.container?.remove()\n }\n\n private createToolbox() {\n const toggler = (\n <button\n className=\"ipe-toolbox-btn\"\n id=\"toolbox-toggle\"\n onClick={function (e) {\n const isOpened = this.classList.contains('opened')\n this.classList.toggle('opened', !isOpened)\n element.querySelectorAll('.btn-group').forEach((el) => {\n el.classList.toggle('opened', !isOpened)\n })\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"icon icon-tabler icons-tabler-outline icon-tabler-plus\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 5l0 14\" />\n <path d=\"M5 12l14 0\" />\n </svg>\n </button>\n )\n const element = (\n <div id=\"ipe-edit-toolbox\">\n <ul className=\"btn-group group1\" style={{ display: 'flex', flexDirection: 'column' }}></ul>\n <ul className=\"btn-group group2\" style={{ display: 'flex', flexDirection: 'row' }}></ul>\n {toggler}\n </div>\n )\n\n return element as HTMLElement\n }\n\n private createIndicatorForNotArticlePage() {\n const indicator = (\n <div id=\"ipe-edit-toolbox\">\n <div\n id=\"ipe-toolbox-placeholder\"\n style=\"width: 0.75rem; height: 0.75rem; border-radius: 50%; background: #3f51b5; color: #fff; pointer-events: none;\"\n >\n <svg\n style=\"width: 0.5em; height: 0.5em; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"icon icon-tabler icons-tabler-outline icon-tabler-check\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M5 12l5 5l10 -10\" />\n </svg>\n </div>\n </div>\n )\n return indicator as HTMLElement\n }\n\n private normalizeButtonId(id: string) {\n if (!id) {\n id = Math.random().toString(36).substring(2, 8)\n }\n return `ipe-toolbox__${id.trim()}`.replace(/\\s\\.#/g, '-')\n }\n\n addButton(payload: {\n id: string\n group?: 'auto' | 'group1' | 'group2'\n icon: string | HTMLElement | SVGElement | ReactElement\n tooltip?: string | HTMLElement\n buttonProps?: Record<string, any>\n onClick?: (event: MouseEvent) => void\n index?: number\n }) {\n let { id, group, icon, tooltip, buttonProps, onClick, index } = payload\n id = this.normalizeButtonId(id)\n\n const existingButton = this.container.querySelector(`#${id}`)\n if (existingButton) {\n this.ctx.logger('toolbox').warn(`Button with id ${id} already exists, replacing it.`)\n existingButton.remove()\n }\n\n let groupEl: HTMLElement | null = null\n if (typeof group === 'undefined' || group === 'auto') {\n // 选择按钮最少的那一组,一样多就选第一组\n const group1 = this.container.querySelector('.btn-group.group1') as HTMLElement\n const group2 = this.container.querySelector('.btn-group.group2') as HTMLElement\n const group1Count = group1?.children.length || 0\n const group2Count = group2?.children.length || 0\n groupEl = group1Count <= group2Count ? group1 : group2\n } else {\n groupEl = this.container.querySelector(`.btn-group.${group}`)\n }\n if (!groupEl) throw new Error(`Button group ${group} not found`)\n\n const button = (\n <li class=\"btn-tip-group\" id={id} onClick={onClick}>\n <div class=\"btn-tip\">{tooltip}</div>\n <button id={`${id}-btn`} class=\"ipe-toolbox-btn\" {...buttonProps}>\n {icon}\n </button>\n </li>\n )\n\n if (typeof index === 'number') {\n if (index <= 0) {\n groupEl.prepend(button)\n } else if (index >= groupEl.children.length) {\n groupEl.appendChild(button)\n } else {\n groupEl.children[index]?.before(button)\n }\n } else {\n groupEl.appendChild(button)\n }\n\n this.ctx.emit('toolbox/button/added', {\n ctx: this.ctx,\n button: button as HTMLElement,\n })\n\n return button as HTMLElement\n }\n\n removeButton(id: string) {\n const button = this.container.querySelector(`.ipe-toolbox-btn#${id}`)\n button?.remove()\n this.ctx.emit('toolbox/button/removed', { ctx: this.ctx, id })\n }\n}\n"],"names":["_PluginToolbox_decorators","_init","_a","RegisterPreferences","Schema","Inject","PluginToolbox","Service","ctx","sleep","val","el","element","jsxs","jsx","e","isOpened","id","payload","group","icon","tooltip","buttonProps","onClick","index","existingButton","groupEl","group1","group2","group1Count","group2Count","button","__decoratorStart","__decorateElement","__runInitializers"],"mappings":";;;;;;;;;;;;;;;GAAAA,GAAAC,GAAAC;AAcAF,IAAA,CAACG;AAAA,EACCC,EAAO,OAAO;AAAA,IACZ,mBAAmBA,EAAO,QAAA,EACvB,YAAY,oCAAoC,EAChD,QAAQ,EAAK;AAAA,EAAA,CACjB,EAAE,YAAY,qBAAqB;AAAA,EACpC;AAAA,IACE,mBAAmB;AAAA,EAAA;AAEvB,GACCC,EAAO,CAAC,aAAa,CAAC,CAAA;AAChB,MAAMC,WAAsBJ,IAAAK,GAAQ;AAAA,EAIzC,YAAmBC,GAAiB;AAClC,UAAMA,GAAK,WAAW,EAAK,GADV,KAAA,MAAAA,GAHnB,KAAA,YAAA,QACA,KAAQ,YAAY;AAAA,EAIpB;AAAA,EAEA,MAAgB,QAAuB;AACrC,IAAI,MAAM,GAAG,OAAO,IAAI,aAAa,MAAM,MAAS,CAAC,KAAK,YACxD,KAAK,YAAY,KAAK,iCAAA,IAEtB,KAAK,YAAY,KAAK,cAAA,GAExB,SAAS,KAAK,YAAY,KAAK,SAAS,GACxC,MAAMC,EAAM,CAAC,GACb,KAAK,IAAI,YAAY,IAAI,mBAAmB,EAAE,KAAK,CAACC,MAAQ;AAC1D,MAAIA,MACF,KAAK,UAAU,cAAc,iBAAiB,GAAG,UAAU,IAAI,QAAQ,GACvE,KAAK,UAAU,iBAAiB,YAAY,EAAE,QAAQ,CAACC,MAAO;AAC5D,QAAAA,EAAG,UAAU,IAAI,QAAQ;AAAA,MAC3B,CAAC;AAAA,IAEL,CAAC;AAAA,EACH;AAAA,EAEU,OAA6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":["import { Inject, InPageEdit, Schema } from '@/InPageEdit'\nimport { IPEStorageItem, IPEStorageManager } from '@/services/StorageService'\n\ndeclare module '@/InPageEdit' {\n export interface InPageEdit {\n preferences: PluginPreferences\n }\n}\n\nexport interface InPageEditPreferenceUICategory {\n name: string\n label: string\n description?: string\n index?: number\n}\n\nexport interface InPageEditPreferenceUIRegistryItem {\n name: string\n schema: Schema\n defaults: Record<string, any>\n category: string\n}\n\n@Inject(['sitemeta', 'storage'])\nexport class PluginPreferences extends BasePlugin {\n private db: IPEStorageManager<any>\n public customRegistries: InPageEditPreferenceUIRegistryItem[] = []\n public categoryDefinitions: InPageEditPreferenceUICategory[] = []\n private _defaultPreferences: Record<string, any> = {}\n\n constructor(public ctx: InPageEdit) {\n super(ctx, {}, 'preferences')\n this.db = ctx.storage.createDatabse<any>('preferences', Infinity)\n this.ctx.set('preferences', this)\n }\n\n async start() {\n this.defineCategory({\n name: 'general',\n label: 'General',\n description: 'General settings',\n })\n this.defineCategory({\n name: 'edit',\n label: 'Editing',\n description: 'Settings related to editing content',\n })\n this.defineCategory({\n name: 'about',\n label: 'About',\n description: 'About InPageEdit',\n index: 99,\n })\n\n this.registerCustomConfig(\n 'about',\n Schema.object({\n about: Schema.const(\n <div className=\"prose\">\n <h2>✏️ InPageEdit NEXT</h2>\n <i>v{this.ctx.version}</i>\n <h2>Portal</h2>\n <div style=\"display: flex; flex-direction: column; gap: 1rem\">\n <ActionButton href=\"https://www.ipe.wiki\" style={{ display: 'block', width: '100%' }}>\n Official Website & Help Center\n </ActionButton>\n <ActionButton\n href=\"https://www.ipe.wiki/update/\"\n style={{ display: 'block', width: '100%' }}\n >\n Update Logs\n </ActionButton>\n </div>\n <h2>Join us</h2>\n <ul>\n <li>\n <strong>GitHub</strong>:{' '}\n <a href=\"https://github.com/inpageedit/inpageedit-next\" target=\"_blank\">\n inpageedit/inpageedit-next\n </a>\n </li>\n <li>\n <strong>QQ Group</strong>: 1026023666\n </li>\n </ul>\n <hr />\n <p>🚀 Modular, Extensible Supercharged Plugin for MediaWiki.</p>\n <p>InPageEdit-NEXT Copyright © 2025-present dragon-fish</p>\n </div>\n ).role('raw-html'),\n }).description(''),\n 'about',\n {}\n )\n\n import('./ui/index').then((module) => {\n const fork = this.ctx.plugin(module.PluginPreferencesUI)\n this.addDisposeHandler(() => {\n fork.dispose()\n })\n })\n }\n\n get<T = any>(key: string, fallback?: () => T | Promise<T>): Promise<T | null> {\n fallback ||= () => {\n const defaultValue = this.getDefaultValue(key)\n this.logger.info('default value used', defaultValue)\n return defaultValue as T\n }\n const value = this.db.get(key, undefined, fallback)\n return value\n }\n\n getDefaultValue(key: string) {\n return (this._defaultPreferences[key] ??= this.loadDefaultConfigs()[key])\n }\n\n set<T = any>(key: string, value: T): Promise<IPEStorageItem<T> | void> {\n const defaultValue = this.getDefaultValue(key)\n if (value === defaultValue) {\n return this.db.delete(key)\n } else {\n return this.db.set(key, value)\n }\n }\n\n async getAll() {\n const data = this.loadDefaultConfigs()\n await this.db.iterate((value: IPEStorageItem, key: string) => {\n data[key] = value\n })\n return data\n }\n\n private loadDefaultConfigs() {\n const data = {} as Record<string, any>\n this.getConfigRegistries().forEach((item) => {\n item.defaults &&\n Object.entries(item.defaults).forEach(([key, val]) => {\n data[key] = val\n this._defaultPreferences[key] = val\n })\n })\n return data\n }\n\n registerCustomConfig(\n name: string,\n schema: Schema,\n category: string,\n defaults: Record<string, any>\n ) {\n this.customRegistries.push({\n name,\n schema,\n category,\n defaults,\n })\n return this\n }\n\n getConfigRegistries(category?: string): InPageEditPreferenceUIRegistryItem[] {\n return Array.from(this.ctx.registry.entries())\n .map<{\n name: string\n schema: Schema\n defaults: Record<string, any>\n }>(([plugin, fork]) => {\n if (plugin === null) {\n return {\n name: 'root',\n schema: (InPageEdit as any)?.PreferencesSchema || null,\n defaults: (InPageEdit as any)?.PreferencesDefaults || {},\n }\n } else {\n return {\n name: plugin.name,\n schema: (plugin as any)?.PreferencesSchema || null,\n defaults: (plugin as any)?.PreferencesDefaults || {},\n }\n }\n })\n .filter((item) => item.schema !== null)\n .map((item) => {\n return {\n ...item,\n category: item.schema.meta.category || 'general',\n }\n })\n .concat(this.customRegistries)\n .filter((item) => !category || item.category === category)\n }\n\n defineCategory(category: InPageEditPreferenceUICategory) {\n const index = this.categoryDefinitions.findIndex((tab) => tab.name === category.name)\n if (index < 0) {\n this.categoryDefinitions.push(category)\n } else {\n this.categoryDefinitions[index] = category\n }\n this.categoryDefinitions.sort((a, b) => {\n return (a.index ?? 0) - (b.index ?? 0)\n })\n return this\n }\n\n getConfigCategories() {\n return this.categoryDefinitions\n }\n}\n"],"names":["_PluginPreferences_decorators","_init","_a","Inject","PluginPreferences","BasePlugin","ctx","Schema","jsxs","jsx","ActionButton","module","fork","key","fallback","defaultValue","value","data","item","val","name","schema","category","defaults","plugin","InPageEdit","index","tab","a","b","__decoratorStart","__decorateElement","__runInitializers"],"mappings":";;;;;;;;;;;;;;GAAAA,GAAAC,GAAAC;AAuBAF,IAAA,CAACG,EAAO,CAAC,YAAY,SAAS,CAAC,CAAA;AACxB,MAAMC,WAA0BF,IAAAG,GAAW;AAAA,EAMhD,YAAmBC,GAAiB;AAClC,UAAMA,GAAK,CAAA,GAAI,aAAa,GADX,KAAA,MAAAA,GALnB,KAAQ,KAAR,QACA,KAAO,mBAAyD,CAAA,GAChE,KAAO,sBAAwD,CAAA,GAC/D,KAAQ,sBAA2C,CAAA,GAIjD,KAAK,KAAKA,EAAI,QAAQ,cAAmB,eAAe,KAAQ,GAChE,KAAK,IAAI,IAAI,eAAe,IAAI;AAAA,EAClC;AAAA,EAEA,MAAM,QAAQ;AACZ,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA,CACd,GACD,KAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA,CACd,GACD,KAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,OAAO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pB,WAAO,KAAK;AAAA,EACd;AACF;AAzLO5B,IAAA6B,EAAA5B,CAAA;AAAME,IAAN2B,6BADP/B,GACaI,CAAA;AAAN4B,EAAA/B,GAAA,GAAMG,CAAA;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-jKU6cYcH.js","sources":["../src/plugins/quick-move/index.tsx"],"sourcesContent":["import { Inject, InPageEdit } from '@/InPageEdit'\n\ndeclare module '@/InPageEdit' {\n interface InPageEdit {\n quickMove: PluginQuickMove['quickMove']\n movePage: PluginQuickMove['movePage']\n }\n}\n\nexport interface MovePageOptions {\n from: string\n to: string\n reason?: string\n movetalk?: boolean\n movesubpages?: boolean\n noredirect?: boolean\n}\nexport interface QuickMoveOptions extends Partial<MovePageOptions> {\n lockFromField?: boolean\n lockToField?: boolean\n}\n\n@Inject(['modal', 'sitemeta'])\nexport class PluginQuickMove extends BasePlugin {\n constructor(public ctx: InPageEdit) {\n super(ctx, {}, 'quick-move')\n ctx.set('quickMove', this.quickMove.bind(this))\n ctx.set('movePage', this.movePage.bind(this))\n }\n\n protected start(): Promise<void> | void {\n this.ctx.inject(['toolbox'], (ctx) => {\n this.injectToolbox(ctx)\n })\n }\n\n private injectToolbox(ctx: InPageEdit) {\n const curPageName = window.mw?.config.get('wgPageName') || ''\n const canEdit = window.mw?.config.get('wgIsProbablyEditable')\n ctx.toolbox.addButton({\n id: 'quick-move',\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"icon icon-tabler icons-tabler-outline icon-tabler-forms\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3\" />\n <path d=\"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3\" />\n <path d=\"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7\" />\n <path d=\"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1\" />\n <path d=\"M17 12h.01\" />\n <path d=\"M13 12h.01\" />\n </svg>\n ),\n tooltip: 'Quick Move',\n group: 'group2',\n onClick: () => {\n this.quickMove(\n canEdit\n ? {\n lockFromField: true,\n from: curPageName,\n }\n : {}\n )\n },\n })\n }\n\n quickMove(options?: Partial<QuickMoveOptions>) {\n const modal = this.ctx.modal\n .createObject({\n title: 'Quick Move',\n content: (<ProgressBar />) as HTMLElement,\n className: 'quick-move compact-buttons',\n sizeClass: 'medium',\n center: true,\n })\n .init()\n\n let formRef: HTMLFormElement | null = null\n modal.setContent(\n (\n <form\n ref={(el) => (formRef = el)}\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: '1rem',\n }}\n onSubmit={(e) => {\n e.preventDefault()\n formRef?.checkValidity()\n if (!formRef?.reportValidity()) {\n return\n }\n const formData = new FormData(formRef!)\n const options = {\n from: formData.get('from')?.toString().trim()!,\n to: formData.get('to')?.toString().trim()!,\n reason: (formData.get('reason') as string) || '',\n movetalk: formData.get('movetalk') === 'on',\n movesubpages: formData.get('movesubpages') === 'on',\n noredirect: formData.get('noredirect') === 'on',\n }\n if (!options.from || !options.to) {\n this.ctx.modal.notify('error', {\n title: 'Failed to move',\n content: 'From and to are required.',\n })\n return\n }\n modal.setLoadingState(true)\n this.movePage(options)\n .then(() => {\n location.reload()\n })\n .catch((error) => {\n modal.setLoadingState(false)\n this.ctx.modal.notify('error', {\n title: 'Failed to move',\n content: error instanceof Error ? error.message : String(error),\n })\n })\n }}\n >\n <TwinSwapInput\n inputs={[\n {\n label: 'Move from',\n name: 'from',\n value: options?.from,\n required: true,\n },\n {\n label: 'Move to',\n name: 'to',\n value: options?.to,\n required: true,\n },\n ]}\n />\n <div>\n <CheckBox name=\"movetalk\" id=\"movetalk\" checked={options?.movetalk}>\n Move talk page\n </CheckBox>\n </div>\n <div>\n <CheckBox name=\"movesubpages\" id=\"movesubpages\" checked={options?.movesubpages}>\n Move subpage(s) (up to 100)\n </CheckBox>\n </div>\n {this.ctx.sitemeta.hasRight('suppressredirect') && (\n <div>\n <CheckBox name=\"noredirect\" id=\"noredirect\" checked={options?.noredirect}>\n Move without leaving a redirect\n </CheckBox>\n </div>\n )}\n <InputBox label=\"Reason\" id=\"reason\" name=\"reason\" value={options?.reason} />\n </form>\n ) as HTMLElement\n )\n\n modal.setButtons([\n {\n label: 'Move',\n className: 'is-primary is-ghost',\n method: () => {\n formRef?.dispatchEvent(new Event('submit'))\n },\n },\n ])\n\n return modal.show()\n }\n\n async movePage(options: MovePageOptions) {\n const { from, to, reason = '', ...rest } = options\n\n if (!from || !to) {\n throw new Error('From and to titles are required.')\n }\n if (from === to) {\n throw new Error('From and to titles cannot be the same.')\n }\n\n const wikiPage = await this.ctx.wikiPage.newFromTitle(from)\n return wikiPage.moveTo(to, reason, rest)\n }\n}\n"],"names":["_PluginQuickMove_decorators","_init","_a","Inject","PluginQuickMove","BasePlugin","ctx","curPageName","canEdit","jsxs","jsx","options","modal","ProgressBar","formRef","el","e","formData","error","TwinSwapInput","CheckBox","InputBox","from","to","reason","rest","__decoratorStart","__decorateElement","__runInitializers"],"mappings":";;;;;;;;;;;;;;;GAAAA,GAAAC,GAAAC;AAsBAF,IAAA,CAACG,EAAO,CAAC,SAAS,UAAU,CAAC,CAAA;AACtB,MAAMC,WAAwBF,IAAAG,GAAW;AAAA,EAC9C,YAAmBC,GAAiB;AAClC,UAAMA,GAAK,CAAA,GAAI,YAAY,GADV,KAAA,MAAAA,GAEjBA,EAAI,IAAI,aAAa,KAAK,UAAU,KAAK,IAAI,CAAC,GAC9CA,EAAI,IAAI,YAAY,KAAK,SAAS,KAAK,IAAI,CAAC;AAAA,EAC9C;AAAA,EAEU,QAA8B;AACtC,SAAK,IAAI,OAAO,CAAC,SAAS,GAAG,CAACA,MAAQ;AACpC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AI,GAAGC,MAASd;AAE3C,QAAI,CAACW,KAAQ,CAACC;AACZ,YAAM,IAAI,MAAM,kCAAkC;AAEpD,QAAID,MAASC;AACX,YAAM,IAAI,MAAM,wCAAwC;AAI1D,YADiB,MAAM,KAAK,IAAI,SAAS,aAAaD,CAAI,GAC1C,OAAOC,GAAIC,GAAQC,CAAI;AAAA,EACzC;AACF;AAhLOxB,IAAAyB,EAAAxB,CAAA;AAAME,IAANuB,2BADP3B,GACaI,CAAA;AAANwB,EAAA3B,GAAA,GAAMG,CAAA;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-mMAGhnbR.js","sources":["../src/plugins/quick-redirect/index.tsx"],"sourcesContent":["import { InPageEdit } from '@/InPageEdit'\n\ndeclare module '@/InPageEdit' {\n interface InPageEdit {\n quickRedirect: PluginQuickRedirect['quickRedirect']\n redirectPage: PluginQuickRedirect['redirectPage']\n }\n}\n\nexport interface RedirectPageOptions {\n from: string\n to: string\n reason?: string\n overwrite?: boolean\n}\nexport interface QuickRedirectOptions extends Partial<RedirectPageOptions> {}\n\nexport class PluginQuickRedirect extends BasePlugin {\n static readonly inject = ['api', 'wikiPage', 'modal']\n\n constructor(public ctx: InPageEdit) {\n super(ctx, {}, 'quick-redirect')\n }\n\n protected start(): Promise<void> | void {\n this.ctx.set('quickRedirect', this.quickRedirect.bind(this))\n this.ctx.set('redirectPage', this.redirectPage.bind(this))\n\n const curPageName = window.mw?.config.get('wgPageName') || ''\n const canEdit = window.mw?.config.get('wgIsProbablyEditable')\n this.ctx.inject(['toolbox'], (ctx) => {\n this.ctx = ctx\n ctx.toolbox.addButton({\n id: 'quick-redirect',\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"icon icon-tabler icons-tabler-outline icon-tabler-file-symlink\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M4 21v-4a3 3 0 0 1 3 -3h5\" />\n <path d=\"M9 17l3 -3l-3 -3\" />\n <path d=\"M14 3v4a1 1 0 0 0 1 1h4\" />\n <path d=\"M5 11v-6a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-9.5\" />\n </svg>\n ) as HTMLElement,\n tooltip: 'Quick Redirect',\n group: 'group1',\n onClick: () => {\n this.quickRedirect(\n canEdit\n ? {\n to: curPageName,\n }\n : {}\n )\n },\n })\n this.addDisposeHandler((ctx) => {\n ctx.toolbox.removeButton('quick-redirect')\n })\n })\n }\n\n protected stop(): Promise<void> | void {}\n\n quickRedirect(options?: Partial<QuickRedirectOptions>) {\n const modal = this.ctx.modal\n .createObject({\n title: 'Quick Redirect',\n content: (<ProgressBar />) as HTMLElement,\n className: 'quick-redirect compact-buttons',\n sizeClass: 'medium',\n center: true,\n })\n .init()\n\n let formRef: HTMLFormElement | null = null\n modal.setContent(\n (\n <form\n ref={(el) => (formRef = el)}\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: '1rem',\n }}\n onSubmit={(e) => {\n e.preventDefault()\n formRef?.checkValidity()\n if (!formRef?.reportValidity()) {\n return\n }\n const formData = new FormData(formRef!)\n const options = {\n from: formData.get('from')?.toString().trim()!,\n to: formData.get('to')?.toString().trim()!,\n reason: (formData.get('reason') as string) || '',\n overwrite: formData.get('overwrite') === 'on',\n }\n if (!options.from || !options.to) {\n this.ctx.modal.notify('error', {\n title: 'Failed to redirect',\n content: 'From and to are required.',\n })\n return\n }\n modal.setLoadingState(true)\n this.redirectPage(options)\n .then((res) => {\n modal.close()\n this.ctx.modal.notify('success', {\n title: 'Redirect successful',\n content: 'The redirect has been created.',\n })\n })\n .catch((error) => {\n modal.setLoadingState(false)\n this.ctx.modal.notify('error', {\n title: 'Failed to redirect',\n content: error instanceof Error ? error.message : String(error),\n })\n })\n }}\n >\n <TwinSwapInput\n inputs={[\n {\n label: 'From',\n name: 'from',\n value: options?.from,\n required: true,\n },\n {\n label: 'To',\n name: 'to',\n value: options?.to,\n required: true,\n },\n ]}\n />\n <InputBox label=\"Reason\" id=\"reason\" name=\"reason\" value={options?.reason} />\n <div>\n <CheckBox name=\"overwrite\" id=\"overwrite\" checked={options?.overwrite}>\n Force create redirect even if the from page already exists\n </CheckBox>\n </div>\n </form>\n ) as HTMLFormElement\n )\n modal.setButtons([\n {\n label: 'Create Redirect',\n className: 'is-primary is-ghost',\n method: () => {\n formRef?.dispatchEvent(new Event('submit'))\n },\n },\n ])\n\n return modal.show()\n }\n\n async redirectPage(options: RedirectPageOptions) {\n const { from, to, reason = '', overwrite = false } = options\n const wikiPage = await this.ctx.wikiPage.newBlankPage({\n title: from,\n })\n const content = `#REDIRECT [[:${to}]]`\n const res = await wikiPage.edit(\n {\n text: content,\n summary: reason,\n },\n {\n createonly: !overwrite,\n }\n )\n if (res.data?.errors) {\n throw new Error(res.data.errors[0].text, { cause: res })\n }\n return res\n }\n}\n"],"names":["PluginQuickRedirect","BasePlugin","ctx","curPageName","canEdit","jsxs","jsx","options","modal","ProgressBar","formRef","el","e","formData","res","error","TwinSwapInput","InputBox","CheckBox","from","to","reason","overwrite","wikiPage","content"],"mappings":";;;;AAiBO,MAAMA,UAA4BC,EAAW;AAAA,EAGlD,YAAmBC,GAAiB;AAClC,UAAMA,GAAK,CAAA,GAAI,gBAAgB,GADd,KAAA,MAAAA;AAAA,EAEnB;AAAA,EAJA,OAAA;AAAA,SAAgB,SAAS,CAAC,OAAO,YAAY,OAAO;AAAA,EAAA;AAAA,EAM1C,QAA8B;AACtC,SAAK,IAAI,IAAI,iBAAiB,KAAK,cAAc,KAAK,IAAI,CAAC,GAC3D,KAAK,IAAI,IAAI,gBAAgB,KAAK,aAAa,KAAK,IAAI,CAAC;AAEzD,UAAMC,IAAc,OAAO,IAAI,OAAO,IAAI,YAAY,KAAK,IACrDC,IAAU,OAAO,IAAI,OAAO,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