jit-pdf 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ :root{--jit-color-primary: #1677ff;--jit-color-primary-deep: #0958d9;--jit-color-surface: #f4f8ff;--jit-color-surface-strong: #e8f3ff;--jit-color-border: #cfe0ff;--jit-color-text: #14324f;--jit-color-muted: #5a7089;--jit-color-success: #18a058;--jit-color-danger: #d03050;--jit-color-white: #ffffff}.jit-pdf-shell,.jit-pdf-editor{height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);color:var(--jit-color-text);background:radial-gradient(circle at top left,rgba(22,119,255,.16),transparent 28%),linear-gradient(180deg,#f8fbff,#eef5ff);overflow:hidden}.jit-ribbon{display:grid;gap:8px;padding:8px 14px 10px;border-bottom:1px solid var(--jit-color-border);background:linear-gradient(180deg,#fffffff5,#f2f8fff5);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);overflow:visible}.jit-ribbon__topbar{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:12px;align-items:center;min-width:0}.jit-ribbon__document,.jit-ribbon__actions,.jit-ribbon__meta{display:flex;gap:8px;align-items:center}.jit-ribbon__meta{justify-content:center;min-width:0}.jit-ribbon__bar{display:flex;flex-wrap:wrap;gap:8px;align-items:start;overflow:visible}.jit-ribbon__tabs{display:flex;gap:2px;align-items:end;padding:0 4px;border-bottom:1px solid rgba(22,119,255,.14)}.jit-ribbon__tab{position:relative;min-width:76px;padding:10px 14px 9px;border:0;border-radius:12px 12px 0 0;background:transparent;color:var(--jit-color-muted);font-size:13px;font-weight:700;cursor:pointer;transition:color .18s ease,background .18s ease,box-shadow .18s ease}.jit-ribbon__tab:hover{background:#1677ff0f;color:var(--jit-color-primary-deep)}.jit-ribbon__tab.is-active{background:linear-gradient(180deg,#fff,#eef5ff);color:var(--jit-color-primary-deep);box-shadow:inset 0 1px #ffffffe6,0 0 0 1px #1677ff24}.jit-ribbon__panels{min-width:0;overflow:visible}.jit-ribbon__section{display:flex;align-items:center;min-width:0;padding:2px 10px 2px 0;border-right:1px solid rgba(22,119,255,.12);background:transparent;min-height:0;align-self:center}.jit-ribbon__bar>.jit-ribbon__section:last-child{border-right:0;padding-right:0}.jit-ribbon__section-body{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.jit-ribbon__section-body:not(.jit-ribbon__section-body--tools):not(.jit-ribbon__section-body--search):not(.jit-ribbon__section-body--save){display:flex}.jit-ribbon__section-body--tools{display:flex;flex-wrap:wrap}.jit-ribbon__section-body--search{min-width:0;width:100%}.jit-ribbon__section-body--save{display:flex}.jit-ribbon__section-label{display:none}.jit-ribbon__badge{padding:3px 8px;border-radius:999px;background:var(--jit-color-primary);color:#fff;font-size:11px;font-weight:700}.jit-ribbon__page{font-size:11px;color:var(--jit-color-muted)}.jit-ribbon__action{position:relative;border-radius:10px;border:1px solid var(--jit-color-border);background:var(--jit-color-white);min-height:28px;padding:0 8px;font-size:11px;cursor:pointer;white-space:nowrap}.jit-ribbon__actions{justify-content:flex-end;flex-wrap:wrap}.jit-toolbar__title{display:flex;flex-direction:column;gap:3px;min-width:0}.jit-toolbar__title strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.jit-toolbar__title span{color:var(--jit-color-muted);font-size:11px}.jit-ribbon button:disabled{cursor:not-allowed;opacity:.55}.jit-toolbar__toggle{display:none}.jit-icon-button{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:0;width:34px;min-width:34px;height:34px;min-height:34px;padding:0;border-radius:10px;border:1px solid transparent;background:transparent;color:var(--jit-color-text);cursor:pointer;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.jit-icon-button svg,.jit-search-box svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8}.jit-icon-button span{display:none}.jit-icon-button:hover,.jit-ribbon__action:hover{border-color:var(--jit-color-primary);background:#1677ff14;box-shadow:0 6px 18px #1677ff1a;transform:translateY(-1px)}.jit-icon-button.is-active{border-color:var(--jit-color-primary);color:var(--jit-color-primary-deep);background:#1677ff1f}.jit-icon-button--primary{color:var(--jit-color-primary-deep);border-color:#1677ff4d;background:#1677ff1a}.jit-icon-button.is-danger{color:var(--jit-color-danger)}.jit-ribbon__tab[data-tooltip]:before,.jit-ribbon__tab[data-tooltip]:after,.jit-ribbon__action[data-tooltip]:before,.jit-ribbon__action[data-tooltip]:after,.jit-icon-button[aria-label]:before,.jit-icon-button[aria-label]:after,.jit-sidebar__collapse[aria-label]:before,.jit-sidebar__collapse[aria-label]:after,.jit-inspector-toggle[aria-label]:before,.jit-inspector-toggle[aria-label]:after,.jit-inspector__close[aria-label]:before,.jit-inspector__close[aria-label]:after{opacity:0;pointer-events:none;transition:opacity .16s ease,transform .16s ease}.jit-ribbon__tab[data-tooltip]:before,.jit-ribbon__action[data-tooltip]:before,.jit-icon-button[aria-label]:before,.jit-sidebar__collapse[aria-label]:before,.jit-inspector-toggle[aria-label]:before,.jit-inspector__close[aria-label]:before{content:"";position:absolute;left:50%;top:calc(100% + 4px);transform:translate(-50%,4px);border-width:0 5px 5px;border-style:solid;border-color:transparent transparent rgba(20,50,79,.9);z-index:20}.jit-ribbon__tab[data-tooltip]:after,.jit-ribbon__action[data-tooltip]:after,.jit-icon-button[aria-label]:after,.jit-sidebar__collapse[aria-label]:after,.jit-inspector-toggle[aria-label]:after,.jit-inspector__close[aria-label]:after{position:absolute;left:50%;top:calc(100% + 9px);transform:translate(-50%,4px);padding:6px 10px;border-radius:10px;background:#14324feb;color:#fff;font-size:11px;font-weight:600;line-height:1;white-space:nowrap;box-shadow:0 10px 24px #14324f38;z-index:21}.jit-ribbon__tab[data-tooltip]:after,.jit-ribbon__action[data-tooltip]:after{content:attr(data-tooltip)}.jit-icon-button[aria-label]:after,.jit-sidebar__collapse[aria-label]:after,.jit-inspector-toggle[aria-label]:after,.jit-inspector__close[aria-label]:after{content:attr(aria-label)}.jit-ribbon__tab[data-tooltip]:where(:hover,:focus-visible):before,.jit-ribbon__tab[data-tooltip]:where(:hover,:focus-visible):after,.jit-ribbon__action[data-tooltip]:where(:hover,:focus-visible):before,.jit-ribbon__action[data-tooltip]:where(:hover,:focus-visible):after,.jit-icon-button[aria-label]:where(:hover,:focus-visible):before,.jit-icon-button[aria-label]:where(:hover,:focus-visible):after,.jit-sidebar__collapse[aria-label]:where(:hover,:focus-visible):before,.jit-sidebar__collapse[aria-label]:where(:hover,:focus-visible):after,.jit-inspector-toggle[aria-label]:where(:hover,:focus-visible):before,.jit-inspector-toggle[aria-label]:where(:hover,:focus-visible):after,.jit-inspector__close[aria-label]:where(:hover,:focus-visible):before,.jit-inspector__close[aria-label]:where(:hover,:focus-visible):after{opacity:1;transform:translate(-50%)}.jit-search-box{display:flex;align-items:center;gap:6px;min-width:0;flex:1 1 260px;padding:0 8px;min-height:34px;border-radius:10px;border:1px solid var(--jit-color-border);background:#fff}.jit-search-box input{width:100%;min-height:32px;border:0;outline:0;background:transparent;font-size:12px}.jit-zoom-chip{display:inline-flex;align-items:center;justify-content:center;min-width:68px;height:34px;padding:0 10px;border-radius:10px;border:1px solid var(--jit-color-border);background:#1677ff14;color:var(--jit-color-primary-deep);font-size:11px;font-weight:700}.jit-ribbon__section--nav,.jit-ribbon__section--view,.jit-ribbon__section--history,.jit-ribbon__section--save,.jit-ribbon__bar--annotate .jit-ribbon__section--tools{flex:0 0 auto}.jit-ribbon__bar--annotate .jit-ribbon__section--style{flex:1 1 320px}.jit-ribbon__bar--annotate .jit-ribbon__section--hint{flex:0 1 260px}.jit-ribbon__bar--view .jit-ribbon__section--layout{flex:0 0 auto}.jit-ribbon__bar--view .jit-ribbon__section--summary,.jit-ribbon__bar--review .jit-ribbon__section--summary{flex:0 1 260px}.jit-ribbon__bar--review .jit-ribbon__section--search-wide{flex:1 1 360px}.jit-ribbon__bar--review .jit-ribbon__section--save{flex:0 0 auto}.jit-ribbon__hint,.jit-ribbon__summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-height:34px}.jit-ribbon__hint strong,.jit-ribbon__summary strong{font-size:13px;color:var(--jit-color-primary-deep)}.jit-ribbon__hint p,.jit-ribbon__summary span{margin:0;font-size:12px;line-height:1.4;color:var(--jit-color-muted)}.jit-ribbon__metric{display:inline-flex;align-items:center;gap:8px;min-height:34px;padding:0 10px;border-radius:10px;background:#1677ff14;white-space:nowrap}.jit-ribbon__metric em{font-style:normal;font-size:11px;font-weight:600;color:var(--jit-color-muted)}.jit-ribbon__hint-chip{display:inline-flex;align-items:center;min-height:28px;padding:0 10px;border-radius:999px;background:#d0305014;color:var(--jit-color-danger);font-size:11px;font-weight:700;white-space:nowrap}.jit-ribbon__hint-chip.is-danger{background:#d030501a;color:var(--jit-color-danger)}.jit-ribbon__hint-action{min-height:28px;padding:0 12px;border:1px solid rgba(208,48,80,.22);border-radius:999px;background:linear-gradient(180deg,#f25f7a,#d03050);color:#fff;font-size:11px;font-weight:700;cursor:pointer;box-shadow:0 10px 18px #d0305033}.jit-ribbon__hint-action:disabled{cursor:not-allowed;opacity:.48;box-shadow:none}.jit-layout{display:grid;position:relative;grid-template-columns:212px minmax(0,1fr);gap:16px;min-height:0;padding:16px;box-sizing:border-box}.jit-layout.is-left-collapsed{grid-template-columns:56px minmax(0,1fr)}.jit-sidebar,.jit-canvas{border:1px solid var(--jit-color-border);border-radius:22px;background:#ffffffe0;box-shadow:0 18px 50px #1f548c14;min-height:0;overflow:hidden}.jit-sidebar{display:flex;flex-direction:column}.jit-sidebar__header{display:flex;align-items:center;justify-content:space-between;padding:14px 14px 12px;font-size:14px;font-weight:700;color:var(--jit-color-primary-deep);border-bottom:1px solid var(--jit-color-border);background:linear-gradient(180deg,#f6faff,#edf5ff)}.jit-sidebar__headline{display:grid;gap:2px}.jit-sidebar__headline strong{font-size:13px}.jit-sidebar__headline span{font-size:11px;font-weight:600;color:var(--jit-color-muted)}.jit-sidebar__collapse{position:relative;width:26px;height:26px;border:1px solid var(--jit-color-border);border-radius:8px;background:#fff;color:var(--jit-color-primary-deep);cursor:pointer}.jit-sidebar--left.is-collapsed .jit-sidebar__header{justify-content:center;padding:12px 8px}.jit-sidebar__empty{padding:20px;color:var(--jit-color-muted)}.jit-canvas{position:relative;display:flex;min-width:0;min-height:0;padding:18px;background:radial-gradient(circle at top center,rgba(22,119,255,.08),transparent 36%),linear-gradient(180deg,#f1f7fff5,#e8f1fff5);overflow:hidden}.jit-right-rail{position:absolute;top:18px;right:18px;z-index:13;display:flex;flex-direction:column;align-items:flex-end;gap:10px;pointer-events:auto}.jit-viewport,.jit-zoom-surface,.jit-scroller{min-height:0}.jit-viewport{width:100%;height:100%;overflow:auto;overscroll-behavior:contain;scroll-snap-type:y proximity;border-radius:18px;padding:14px 0 28px}.jit-zoom-surface{min-width:100%;min-height:100%;overflow:hidden}.jit-scroller{width:min(100%,1120px);min-width:100%;margin:0 auto}.jit-state{display:grid;place-items:center;height:100%;color:var(--jit-color-muted);font-size:15px}.jit-state--error{color:var(--jit-color-danger)}.jit-page{position:relative;margin:0 auto;border-radius:10px;background:#fff;box-shadow:0 18px 46px #0f396e1f;overflow:hidden;scroll-snap-align:start;scroll-snap-stop:always}.jit-page img{pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.jit-thumbnails{position:relative;flex:1;min-height:0;padding:12px 10px 18px;background:linear-gradient(180deg,#f8fbfff0,#eff6fff0)}.jit-thumbnail{position:absolute;left:12px;right:12px;display:grid;gap:8px;align-content:start;padding:10px;border:1px solid rgba(22,119,255,.08);border-radius:16px;background:#ffffffb8;text-align:center;cursor:pointer;box-sizing:border-box;overflow:hidden;transition:border-color .18s ease,background .18s ease,box-shadow .18s ease,transform .18s ease}.jit-thumbnail:hover{background:#fffffff5;border-color:#1677ff2e;box-shadow:0 10px 22px #1677ff14;transform:translateY(-1px)}.jit-thumbnail.is-active{background:#e8f3fff5;border-color:#1677ff4d;box-shadow:0 12px 26px #1677ff1a}.jit-thumbnail__paper{display:grid;place-items:center;min-height:0;height:calc(100% - 30px);padding:8px;border-radius:12px;background:linear-gradient(180deg,#fff,#f7fbff);box-shadow:inset 0 0 0 1px #1677ff14;overflow:hidden}.jit-thumbnail__image{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;box-shadow:0 8px 18px #0f396e1f}.jit-thumbnail__label{font-size:11px;font-weight:600;color:var(--jit-color-muted)}.jit-thumbnail__meta{display:flex;align-items:center;justify-content:space-between;gap:8px}.jit-thumbnail__current{display:inline-flex;align-items:center;justify-content:center;min-height:20px;padding:0 7px;border-radius:999px;background:#1677ff1f;color:var(--jit-color-primary-deep);font-size:10px;font-weight:700}.jit-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px 16px 12px}.jit-meta div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid rgba(22,119,255,.12);border-radius:14px;background:#f8fbffeb}.jit-meta dt{font-size:11px;color:var(--jit-color-muted);white-space:nowrap}.jit-meta dd{margin:0;font-size:13px;font-weight:700;text-align:right}.jit-panel-note{margin:0 16px 16px;padding:12px 14px;border-radius:16px;background:var(--jit-color-surface);color:var(--jit-color-muted);font-size:12px;line-height:1.55}.jit-note-editor{display:grid;gap:12px;margin:0 16px 16px;padding:14px;min-width:0;border:1px solid rgba(22,119,255,.14);border-radius:18px;background:linear-gradient(180deg,#f8fbfff5,#ecf4fff5)}.jit-note-editor__header{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:12px;min-width:0}.jit-note-editor__header>div{display:grid;gap:4px;min-width:0;flex:1 1 180px}.jit-note-editor__title-row{display:flex;align-items:center;gap:8px;min-width:0}.jit-note-editor__header strong{font-size:13px;color:var(--jit-color-primary-deep);word-break:break-word}.jit-note-editor__header span,.jit-note-editor__field span,.jit-note-editor__footer span{font-size:11px;color:var(--jit-color-muted)}.jit-note-editor__delete{width:28px;height:28px;display:inline-grid;place-items:center;padding:0;flex:0 0 auto;border:1px solid rgba(208,48,80,.18);border-radius:10px;background:#d0305014;color:var(--jit-color-danger);cursor:pointer}.jit-note-editor__delete svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8}.jit-note-editor__field{display:grid;gap:6px;min-width:0}.jit-note-editor__field textarea{width:100%;max-width:100%;min-height:128px;resize:vertical;padding:12px 14px;box-sizing:border-box;border:1px solid rgba(22,119,255,.14);border-radius:14px;background:#fff;color:var(--jit-color-text);font:inherit;font-size:13px;line-height:1.7;outline:none;transition:border-color .18s ease,box-shadow .18s ease}.jit-note-editor__field textarea:focus{border-color:#1677ff61;box-shadow:0 0 0 4px #1677ff14}.jit-note-editor__footer{display:flex;align-items:center;justify-content:space-between;gap:12px}.jit-note-editor__footer strong{font-size:12px;color:var(--jit-color-primary-deep)}.jit-annotation-drawer{position:absolute;top:74px;right:18px;z-index:12;display:flex;width:min(380px,calc(100vw - 52px));height:calc(100% - 92px);max-height:none;flex-direction:column;border-radius:16px;border:1px solid rgba(22,119,255,.12);background:#fffffff5;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);box-shadow:0 18px 44px #12488624;overflow:hidden;pointer-events:none;opacity:0;transform:translate(calc(100% + 24px));transition:opacity .22s ease,transform .22s ease}.jit-annotation-drawer.is-open{opacity:1;pointer-events:auto;transform:translate(0)}.jit-annotation-panel__header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid rgba(22,119,255,.12);background:linear-gradient(180deg,#f7fbff,#eef5ff)}.jit-annotation-panel__header-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px}.jit-annotation-panel__header div{display:grid;gap:2px;min-width:0}.jit-annotation-panel__header strong{font-size:13px;color:var(--jit-color-primary-deep)}.jit-annotation-panel__header span,.jit-annotation-panel__empty p{margin:0;font-size:11px;color:var(--jit-color-muted)}.jit-annotation-panel__action{min-height:28px;padding:0 10px;border:1px solid rgba(208,48,80,.18);border-radius:10px;background:linear-gradient(180deg,#f25f7a,#d03050);color:#fff;font-size:11px;font-weight:700;cursor:pointer;white-space:nowrap;box-shadow:0 10px 18px #d030502e}.jit-annotation-panel__action:disabled{cursor:not-allowed;opacity:.48;box-shadow:none}.jit-annotation-panel__action--secondary{border-color:#1677ff29;background:#1677ff0f;color:var(--jit-color-primary-deep);box-shadow:none}.jit-annotation-panel__close{position:relative;width:28px;height:28px;display:grid;place-items:center;border:1px solid rgba(22,119,255,.12);border-radius:10px;background:#fff;color:var(--jit-color-primary-deep);cursor:pointer}.jit-annotation-panel__close svg,.jit-annotation-drawer-toggle svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.jit-annotation-panel__body{display:flex;flex:1 1 auto;min-height:0;flex-direction:column}.jit-annotation-toolbar{display:grid;grid-template-columns:minmax(0,1fr) 132px;gap:10px;padding:12px;border-bottom:1px solid rgba(22,119,255,.1);background:#f4f8ffc2}.jit-annotation-toolbar__search{display:flex;align-items:center;gap:8px;min-width:0;padding:0 10px;min-height:36px;border:1px solid rgba(22,119,255,.12);border-radius:12px;background:#fff}.jit-annotation-toolbar__search svg{width:15px;height:15px;stroke:var(--jit-color-muted);fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8}.jit-annotation-toolbar__search input,.jit-annotation-toolbar__filter select{width:100%;min-height:34px;border:0;outline:0;background:transparent;font-size:12px;color:var(--jit-color-text)}.jit-annotation-toolbar__filter{display:grid;gap:4px}.jit-annotation-toolbar__filter span{font-size:10px;font-weight:700;color:var(--jit-color-muted)}.jit-annotation-toolbar__filter select{padding:0 10px;border:1px solid rgba(22,119,255,.12);border-radius:12px;background:#fff}.jit-annotation-list{display:grid;gap:10px;padding:12px;overflow:auto}.jit-annotation-group{display:grid;gap:8px}.jit-annotation-group__header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 2px}.jit-annotation-group__header strong{font-size:12px;color:var(--jit-color-primary-deep)}.jit-annotation-group__header span{font-size:10px;font-weight:700;color:var(--jit-color-muted)}.jit-annotation-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:start}.jit-annotation-item.is-batch-selected .jit-annotation-item__main{border-color:#d0305033}.jit-annotation-item__selector{width:20px;height:20px;margin-top:10px;display:grid;place-items:center;border:1px solid rgba(22,119,255,.18);border-radius:6px;background:#fff;cursor:pointer}.jit-annotation-item__selector span{width:10px;height:10px;border-radius:3px;background:var(--jit-color-danger)}.jit-annotation-item__main{display:grid;gap:8px;padding:12px;border:1px solid rgba(22,119,255,.1);border-radius:14px;background:#fff;text-align:left;cursor:pointer}.jit-annotation-item.is-selected .jit-annotation-item__main{border-color:#1677ff47;box-shadow:0 10px 24px #1677ff14}.jit-annotation-item__meta{display:flex;align-items:center;justify-content:space-between;gap:10px}.jit-annotation-item__meta strong{font-size:12px;color:var(--jit-color-text)}.jit-annotation-item__meta span{font-size:10px;font-weight:700;color:var(--jit-color-muted)}.jit-annotation-item__main p{margin:0;font-size:12px;line-height:1.5;color:var(--jit-color-muted);display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.jit-annotation-item__chips{display:flex;flex-wrap:wrap;gap:6px}.jit-annotation-chip{display:inline-flex;align-items:center;min-height:20px;padding:0 8px;border-radius:999px;background:#1677ff14;color:var(--jit-color-primary-deep);font-size:10px;font-weight:700}.jit-annotation-chip.is-active{background:#18a0581f;color:var(--jit-color-success)}.jit-annotation-chip.is-warning{background:#d030501a;color:var(--jit-color-danger)}.jit-annotation-item__delete{position:relative;width:32px;height:32px;display:grid;place-items:center;border:1px solid rgba(208,48,80,.14);border-radius:10px;background:#fff;color:var(--jit-color-danger);cursor:pointer}.jit-annotation-item__delete svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8}.jit-annotation-panel__empty{padding:16px 14px}.jit-ribbon__section--style{min-width:0}.jit-style-panel{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 12px;align-content:center}.jit-style-row{display:grid;gap:4px;align-content:start}.jit-style-label{font-size:10px;font-weight:700;color:var(--jit-color-muted);white-space:nowrap}.jit-color-palette{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.jit-color-swatch{width:18px;height:18px;flex:0 0 auto;border-radius:999px;border:2px solid rgba(255,255,255,.88);box-shadow:0 0 0 1px #14324f1f;cursor:pointer}.jit-color-swatch.is-active{box-shadow:0 0 0 2px #1677ff3d,0 0 0 1px #14324f1f}.jit-style-control{display:grid;grid-template-columns:minmax(0,1fr) 38px;gap:8px;align-items:center;min-height:24px}.jit-style-control input[type=range]{width:100%;accent-color:var(--jit-color-primary)}.jit-style-control span{font-size:11px;font-weight:700;color:var(--jit-color-primary-deep);text-align:right}.jit-style-hint{margin:0;font-size:11px;line-height:1.45;color:var(--jit-color-muted)}.jit-sidebar__collapse svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.jit-inspector-toggle{position:relative;z-index:1;width:38px;height:38px;display:grid;place-items:center;align-self:flex-end;border:1px solid rgba(22,119,255,.18);border-radius:12px;background:#ffffffeb;color:var(--jit-color-primary-deep);box-shadow:0 12px 28px #1677ff1f;cursor:pointer}.jit-annotation-drawer-toggle{position:relative;z-index:1;width:38px;height:38px;display:grid;place-items:center;border:1px solid rgba(22,119,255,.18);border-radius:12px;background:#ffffffeb;color:var(--jit-color-primary-deep);box-shadow:0 12px 28px #1677ff1f;cursor:pointer}.jit-annotation-drawer-toggle svg,.jit-inspector-toggle svg,.jit-inspector__close svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.jit-inspector{position:absolute;top:74px;right:18px;width:min(320px,calc(100vw - 52px));height:0;max-height:0;display:none;flex-direction:column;border:1px solid rgba(22,119,255,.16);border-radius:20px;background:#fffffff2;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);box-shadow:0 18px 48px #12488624;overflow:hidden;pointer-events:auto}.jit-inspector.is-open{display:flex;height:min(560px,calc(100vh - 180px));max-height:min(560px,calc(100vh - 180px));min-height:320px}.jit-inspector__header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 10px;border-bottom:1px solid rgba(22,119,255,.12);background:linear-gradient(180deg,#f7fbff,#eef5ff)}.jit-inspector__header>div{display:flex;align-items:center;gap:8px;min-width:0}.jit-inspector__header strong{font-size:14px;color:var(--jit-color-primary-deep);white-space:nowrap}.jit-inspector__header span{font-size:11px;color:var(--jit-color-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.jit-inspector__close{position:relative;width:30px;height:30px;display:grid;place-items:center;border:1px solid rgba(22,119,255,.12);border-radius:10px;background:#fff;color:var(--jit-color-primary-deep);cursor:pointer}.jit-inspector__body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-bottom:8px}@media (max-width: 1100px){.jit-toolbar__toggle{display:inline-flex}.jit-ribbon__topbar{grid-template-columns:minmax(0,1fr)}.jit-ribbon__meta{justify-content:flex-start}.jit-ribbon__tabs{flex-wrap:wrap}.jit-ribbon__bar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.jit-ribbon__bar>.jit-ribbon__section{grid-column:span 1!important;padding-right:0;border-right:0}.jit-ribbon__hint,.jit-ribbon__summary{align-items:flex-start}.jit-ribbon__section-body--tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.jit-ribbon__section-body--search{display:grid;grid-template-columns:minmax(0,1fr) repeat(3,minmax(68px,1fr))}.jit-style-panel{grid-template-columns:repeat(2,minmax(0,1fr))}.jit-right-rail{top:212px;right:16px}.jit-annotation-drawer{top:268px;right:16px;width:min(340px,calc(100vw - 32px));height:calc(100vh - 284px)}.jit-inspector{top:268px;right:16px}.jit-annotation-panel__header{align-items:flex-start;flex-direction:column}.jit-annotation-panel__header-actions{width:100%;flex-wrap:wrap}.jit-annotation-toolbar,.jit-layout,.jit-layout.is-left-collapsed{grid-template-columns:minmax(0,1fr)}.jit-sidebar{position:fixed;top:196px;bottom:16px;width:min(320px,calc(100vw - 32px));z-index:10;transform:translate(-120%);transition:transform .24s ease}.jit-sidebar.is-open{transform:translate(0)}.jit-sidebar--left{left:16px}.jit-sidebar--right{right:16px;left:auto;transform:translate(120%)}.jit-sidebar--right.is-open{transform:translate(0)}.jit-inspector.is-open{height:min(420px,calc(100vh - 300px));max-height:min(420px,calc(100vh - 300px));min-height:260px}}@media (max-width: 760px){.jit-ribbon{padding-inline:10px}.jit-ribbon__tab{min-width:auto;padding-inline:12px}.jit-ribbon__bar{display:grid;grid-template-columns:minmax(0,1fr)}.jit-ribbon__bar>.jit-ribbon__section{grid-column:span 1!important}.jit-ribbon__actions{width:100%;justify-content:flex-start;flex-wrap:wrap}.jit-ribbon__section-body--tools,.jit-ribbon__section-body--save,.jit-ribbon__section-body--search{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.jit-meta{grid-template-columns:minmax(0,1fr)}.jit-search-box{grid-column:span 2}.jit-layout{padding:12px}.jit-style-panel{grid-template-columns:minmax(0,1fr)}.jit-canvas{padding:12px}.jit-right-rail{top:12px;right:12px;gap:8px}.jit-annotation-drawer{top:108px;right:12px;width:min(320px,calc(100vw - 24px));height:calc(100vh - 120px)}.jit-annotation-item{grid-template-columns:auto minmax(0,1fr)}.jit-annotation-item__delete{grid-column:2;justify-self:end}.jit-inspector{top:108px;right:12px;width:min(300px,calc(100vw - 24px))}.jit-inspector.is-open{height:min(360px,calc(100vh - 140px));max-height:min(360px,calc(100vh - 140px));min-height:220px}}
@@ -0,0 +1,128 @@
1
+ export type SaveReason = "manual-save" | "redaction-save";
2
+ export declare const FILE_ERROR_CODES: {
3
+ readonly FILE_NOT_FOUND: "FILE_NOT_FOUND";
4
+ readonly INVALID_FILE_ID: "INVALID_FILE_ID";
5
+ readonly NON_PDF_FILE: "NON_PDF_FILE";
6
+ readonly PATH_NOT_ALLOWED: "PATH_NOT_ALLOWED";
7
+ readonly SAVE_COPY_FAILED: "SAVE_COPY_FAILED";
8
+ readonly FILE_TOO_LARGE: "FILE_TOO_LARGE";
9
+ readonly INVALID_RANGE: "INVALID_RANGE";
10
+ readonly EMPTY_BODY: "EMPTY_BODY";
11
+ };
12
+ export type FileErrorCode = (typeof FILE_ERROR_CODES)[keyof typeof FILE_ERROR_CODES];
13
+ export interface ApiErrorPayload {
14
+ code: FileErrorCode;
15
+ message: string;
16
+ details?: string;
17
+ }
18
+ export interface PdfFileNode {
19
+ kind: "file";
20
+ id: string;
21
+ name: string;
22
+ relativePath: string;
23
+ size: number;
24
+ updatedAt: string;
25
+ }
26
+ export interface PdfDirectoryNode {
27
+ kind: "directory";
28
+ name: string;
29
+ relativePath: string;
30
+ children: FileTreeNode[];
31
+ }
32
+ export type FileTreeNode = PdfDirectoryNode | PdfFileNode;
33
+ export interface FileListResponse {
34
+ rootDir: string;
35
+ items: FileTreeNode[];
36
+ }
37
+ export interface FileMeta {
38
+ id: string;
39
+ name: string;
40
+ relativePath: string;
41
+ size: number;
42
+ updatedAt: string;
43
+ pageCount: number | null;
44
+ }
45
+ export interface UploadFileResult {
46
+ id: string;
47
+ name: string;
48
+ relativePath: string;
49
+ size: number;
50
+ updatedAt: string;
51
+ }
52
+ export interface FileHistoryItem {
53
+ id: string;
54
+ name: string;
55
+ relativePath: string;
56
+ size: number;
57
+ updatedAt: string;
58
+ }
59
+ export interface SaveCopyResult {
60
+ fileId: string;
61
+ fileName: string;
62
+ relativePath: string;
63
+ absolutePath: string;
64
+ savedAt: string;
65
+ size: number;
66
+ }
67
+ export interface DeleteFileResult {
68
+ fileId: string;
69
+ relativePath: string;
70
+ }
71
+ export type PdfSource = {
72
+ type: "remote";
73
+ fileId: string;
74
+ name?: string;
75
+ } | {
76
+ type: "local";
77
+ fileId: string;
78
+ name?: string;
79
+ } | {
80
+ type: "url";
81
+ url: string;
82
+ name?: string;
83
+ };
84
+ export type PdfAnnotationSnapshot = Record<string, unknown>;
85
+ export interface PdfEditorCapabilities {
86
+ annotation: boolean;
87
+ ink: boolean;
88
+ freeText: boolean;
89
+ redaction: boolean;
90
+ export: boolean;
91
+ thumbnail: boolean;
92
+ search: boolean;
93
+ }
94
+ export interface SaveCopyInput {
95
+ fileId: string;
96
+ fileName: string;
97
+ content: Blob;
98
+ reason?: SaveReason;
99
+ }
100
+ export interface PdfEditorService {
101
+ getFileList(): Promise<FileListResponse>;
102
+ getFileMeta(fileId: string): Promise<FileMeta>;
103
+ getFileHistory(fileId: string): Promise<FileHistoryItem[]>;
104
+ getFileStreamUrl(fileId: string): string;
105
+ uploadFile(file: File): Promise<UploadFileResult>;
106
+ deleteFile(fileId: string): Promise<DeleteFileResult>;
107
+ saveCopy(input: SaveCopyInput): Promise<SaveCopyResult>;
108
+ loadAnnotations(fileId: string): Promise<PdfAnnotationSnapshot[]>;
109
+ saveAnnotations(fileId: string, annotations: PdfAnnotationSnapshot[]): Promise<void>;
110
+ }
111
+ export interface JitPdfEditorProps {
112
+ source: PdfSource;
113
+ locale?: "zh-CN";
114
+ theme?: "blue-enterprise";
115
+ capabilities?: Partial<PdfEditorCapabilities>;
116
+ service: PdfEditorService;
117
+ readonly?: boolean;
118
+ }
119
+ export interface JitPdfEditorReadyEvent {
120
+ documentId: string;
121
+ }
122
+ export interface JitPdfEditorDirtyChangeEvent {
123
+ dirty: boolean;
124
+ }
125
+ export interface JitPdfEditorErrorEvent {
126
+ message: string;
127
+ cause?: unknown;
128
+ }
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "jit-pdf",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "企业级 PDF 预览与编辑 SDK,支持 Vue、浏览器挂载和 UMD 直引",
7
+ "keywords": [
8
+ "pdf",
9
+ "pdf-viewer",
10
+ "pdf-editor",
11
+ "vue",
12
+ "umd",
13
+ "sdk",
14
+ "annotation",
15
+ "redaction"
16
+ ],
17
+ "homepage": "https://github.com/jitOffice/jit-pdf-sdk",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/jitOffice/jit-pdf-sdk.git"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/jitOffice/jit-pdf-sdk/issues"
24
+ },
25
+ "main": "./dist/index.cjs",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "unpkg": "./dist/jit-pdf.umd.js",
29
+ "jsdelivr": "./dist/jit-pdf.umd.js",
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "sideEffects": [
34
+ "*.css"
35
+ ],
36
+ "exports": {
37
+ ".": {
38
+ "types": "./dist/index.d.ts",
39
+ "import": "./dist/index.js",
40
+ "require": "./dist/index.cjs"
41
+ },
42
+ "./browser": {
43
+ "types": "./dist/browser.d.ts",
44
+ "import": "./dist/browser.js",
45
+ "require": "./dist/browser.cjs"
46
+ },
47
+ "./styles.css": "./dist/style.css",
48
+ "./umd": "./dist/jit-pdf.umd.js"
49
+ },
50
+ "scripts": {
51
+ "build": "rm -rf dist dist-types && vue-tsc -p tsconfig.json --declaration --emitDeclarationOnly --outDir dist-types && vite build --config vite.lib.config.ts && vite build --config vite.umd.config.ts && cp -R dist-types/. dist/ && rm -rf dist-types"
52
+ },
53
+ "dependencies": {
54
+ "@embedpdf/core": "2.10.1",
55
+ "@embedpdf/engines": "2.10.1",
56
+ "@embedpdf/plugin-annotation": "2.10.1",
57
+ "@embedpdf/plugin-document-manager": "2.10.1",
58
+ "@embedpdf/plugin-export": "2.10.1",
59
+ "@embedpdf/plugin-history": "2.10.1",
60
+ "@embedpdf/plugin-interaction-manager": "2.10.1",
61
+ "@embedpdf/plugin-redaction": "2.10.1",
62
+ "@embedpdf/plugin-render": "2.10.1",
63
+ "@embedpdf/plugin-scroll": "2.10.1",
64
+ "@embedpdf/plugin-search": "2.10.1",
65
+ "@embedpdf/plugin-selection": "2.10.1",
66
+ "@embedpdf/plugin-thumbnail": "2.10.1",
67
+ "@embedpdf/plugin-tiling": "2.10.1",
68
+ "@embedpdf/plugin-viewport": "2.10.1",
69
+ "@embedpdf/plugin-zoom": "2.10.1",
70
+ "vue": "^3.5.13"
71
+ },
72
+ "devDependencies": {
73
+ "@vitejs/plugin-vue": "^5.2.3",
74
+ "typescript": "^5.8.3",
75
+ "vite": "^5.4.19",
76
+ "vue-tsc": "^2.2.8"
77
+ },
78
+ "peerDependencies": {
79
+ "vue": "^3.5.13"
80
+ },
81
+ "publishConfig": {
82
+ "access": "public"
83
+ }
84
+ }