@lemoncat7/dsh-knowledge 1.1.2 → 1.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemoncat7/dsh-knowledge",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Local and remote knowledge bases for DeepSeek Harness, with scoped recall, controlled write-back, and a Web management console",
5
5
  "keywords": [
6
6
  "deepseek-harness",
package/web/app.js CHANGED
@@ -1344,6 +1344,14 @@ function renderMarkdownPreview(markdown) {
1344
1344
  if (!markdown.trim()) return element('div', { class: 'markdown-preview is-empty', role: 'document' }, '暂无正文')
1345
1345
  const preview = element('div', { class: 'markdown-preview', role: 'document' })
1346
1346
  preview.innerHTML = window.DshKnowledgeMarkdown.renderMarkdown(markdown)
1347
+ preview.querySelectorAll('table').forEach(table => {
1348
+ const scroller = element('div', {
1349
+ class: 'markdown-table-scroll', role: 'region', tabindex: '0',
1350
+ 'aria-label': '表格内容,可横向滚动',
1351
+ })
1352
+ table.replaceWith(scroller)
1353
+ scroller.append(table)
1354
+ })
1347
1355
  return preview
1348
1356
  }
1349
1357
 
package/web/styles.css CHANGED
@@ -171,6 +171,7 @@ html,
171
171
  .note-tree,
172
172
  .note-editor-scroll,
173
173
  .markdown-preview pre,
174
+ .markdown-table-scroll,
174
175
  .candidate-comparison pre,
175
176
  .dialog-body,
176
177
  .textarea {
@@ -178,16 +179,16 @@ html,
178
179
  scrollbar-color: var(--scrollbar-thumb) transparent;
179
180
  }
180
181
 
181
- :where(html, .mount-table, .note-tree, .note-editor-scroll, .markdown-preview pre, .candidate-comparison pre, .dialog-body, .textarea)::-webkit-scrollbar {
182
+ :where(html, .mount-table, .note-tree, .note-editor-scroll, .markdown-preview pre, .markdown-table-scroll, .candidate-comparison pre, .dialog-body, .textarea)::-webkit-scrollbar {
182
183
  width: 8px;
183
184
  height: 8px;
184
185
  }
185
186
 
186
- :where(html, .mount-table, .note-tree, .note-editor-scroll, .markdown-preview pre, .candidate-comparison pre, .dialog-body, .textarea)::-webkit-scrollbar-track {
187
+ :where(html, .mount-table, .note-tree, .note-editor-scroll, .markdown-preview pre, .markdown-table-scroll, .candidate-comparison pre, .dialog-body, .textarea)::-webkit-scrollbar-track {
187
188
  background: transparent;
188
189
  }
189
190
 
190
- :where(html, .mount-table, .note-tree, .note-editor-scroll, .markdown-preview pre, .candidate-comparison pre, .dialog-body, .textarea)::-webkit-scrollbar-thumb {
191
+ :where(html, .mount-table, .note-tree, .note-editor-scroll, .markdown-preview pre, .markdown-table-scroll, .candidate-comparison pre, .dialog-body, .textarea)::-webkit-scrollbar-thumb {
191
192
  min-width: 28px;
192
193
  min-height: 28px;
193
194
  border: 2px solid transparent;
@@ -196,7 +197,7 @@ html,
196
197
  background-clip: padding-box;
197
198
  }
198
199
 
199
- :where(html, .mount-table, .note-tree, .note-editor-scroll, .markdown-preview pre, .candidate-comparison pre, .dialog-body, .textarea)::-webkit-scrollbar-thumb:hover {
200
+ :where(html, .mount-table, .note-tree, .note-editor-scroll, .markdown-preview pre, .markdown-table-scroll, .candidate-comparison pre, .dialog-body, .textarea)::-webkit-scrollbar-thumb:hover {
200
201
  background: var(--scrollbar-thumb-hover);
201
202
  background-clip: padding-box;
202
203
  }
@@ -713,7 +714,15 @@ html,
713
714
  .note-tree-new { min-height: 30px; gap: 7px; border-radius: 7px; padding: 4px 8px; color: var(--text-tertiary); font-size: 11px; }
714
715
  .note-tree-footer { border-top: 1px solid var(--border); padding: 8px 11px; }
715
716
  .note-tree-empty { padding: 28px 12px; color: var(--text-tertiary); font-size: 12px; text-align: center; }
716
- .note-editor { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--surface); }
717
+ .note-editor {
718
+ min-width: 0;
719
+ min-height: 0;
720
+ display: grid;
721
+ grid-template-rows: auto minmax(0, 1fr) auto;
722
+ background: var(--surface);
723
+ container-name: note-editor;
724
+ container-type: inline-size;
725
+ }
717
726
  .note-editor-empty { place-items: center; display: grid; padding: 32px; }
718
727
  .note-empty-content { max-width: 360px; text-align: center; }
719
728
  .note-empty-content h3 { margin: 16px 0 5px; font-size: 17px; }
@@ -722,7 +731,7 @@ html,
722
731
  .note-editor-toolbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); padding: 9px 14px 9px 20px; }
723
732
  .note-breadcrumb { min-width: 0; display: flex; align-items: center; gap: 7px; overflow: hidden; color: var(--text-tertiary); font-size: 11px; white-space: nowrap; }
724
733
  .note-breadcrumb strong { overflow: hidden; color: var(--text-secondary); font-weight: 560; text-overflow: ellipsis; }
725
- .note-editor-actions { display: flex; align-items: center; gap: 6px; }
734
+ .note-editor-actions { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
726
735
  .editor-save-status { margin-right: 4px; color: var(--text-tertiary); font-size: 10px; white-space: nowrap; }
727
736
  .note-mode-switch { display: inline-flex; gap: 2px; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: var(--surface-soft); }
728
737
  .note-mode-switch button { min-width: 48px; min-height: 28px; border: 0; border-radius: 6px; padding: 4px 9px; background: transparent; color: var(--text-tertiary); font-size: 11px; font-weight: 600; }
@@ -747,6 +756,7 @@ html,
747
756
  .document-finalized-banner small { color: var(--text-tertiary); white-space: nowrap; }
748
757
  .note-paper {
749
758
  width: 100%;
759
+ min-width: 0;
750
760
  min-height: 100%;
751
761
  margin: 0;
752
762
  padding: clamp(34px, 5cqi, 72px) max(clamp(24px, 6cqi, 84px), calc((100% - 1120px) / 2)) 90px;
@@ -757,7 +767,7 @@ html,
757
767
  .note-document-meta { display: flex; flex-wrap: wrap; gap: 7px 16px; margin: 14px 0 30px; color: var(--text-tertiary); font-size: 10px; }
758
768
  .note-body-editor { width: 100%; min-height: 420px; border: 0; padding: 0 0 80px; resize: none; overflow: hidden; background: transparent; color: var(--text-secondary); font-family: inherit; font-size: 15px; line-height: 1.82; outline: none; }
759
769
  .note-body-editor::placeholder { color: color-mix(in srgb, var(--text-tertiary) 70%, transparent); }
760
- .markdown-preview { min-height: 420px; padding-bottom: 80px; color: var(--text-secondary); font-size: 15px; line-height: 1.78; overflow-wrap: anywhere; }
770
+ .markdown-preview { min-width: 0; max-width: 100%; min-height: 420px; padding-bottom: 80px; color: var(--text-secondary); font-size: 15px; line-height: 1.78; overflow-wrap: anywhere; }
761
771
  .markdown-preview.is-empty { color: var(--text-tertiary); }
762
772
  .markdown-preview > :first-child { margin-top: 0; }
763
773
  .markdown-preview > :last-child { margin-bottom: 0; }
@@ -774,10 +784,23 @@ html,
774
784
  .markdown-preview blockquote { border-left: 3px solid color-mix(in srgb, var(--accent) 35%, var(--border)); padding: .1em 0 .1em 1em; color: var(--text-tertiary); }
775
785
  .markdown-preview code, .markdown-preview pre { font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
776
786
  .markdown-preview :not(pre) > code { border: 1px solid var(--border); border-radius: 5px; padding: .12em .35em; background: var(--surface-soft); color: var(--text); font-size: .9em; }
777
- .markdown-preview pre { overflow: auto; margin: 1.15em 0; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--surface-soft); color: var(--text); font-size: 13px; line-height: 1.65; tab-size: 2; }
787
+ .markdown-preview pre { max-width: 100%; overflow: auto; margin: 1.15em 0; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--surface-soft); color: var(--text); font-size: 13px; line-height: 1.65; tab-size: 2; }
778
788
  .markdown-preview pre code { font: inherit; }
779
- .markdown-preview table { width: 100%; margin: 1.15em 0; border-collapse: collapse; font-size: 13px; }
789
+ .markdown-table-scroll {
790
+ width: 100%;
791
+ max-width: 100%;
792
+ overflow-x: auto;
793
+ margin: 1.15em 0;
794
+ border: 1px solid var(--border);
795
+ border-radius: 10px;
796
+ overscroll-behavior-inline: contain;
797
+ touch-action: pan-x pan-y;
798
+ -webkit-overflow-scrolling: touch;
799
+ }
800
+ .markdown-table-scroll:focus-visible { outline-offset: 2px; }
801
+ .markdown-preview table { width: max-content; min-width: 100%; margin: 0; border-collapse: collapse; font-size: 13px; }
780
802
  .markdown-preview th, .markdown-preview td { border-bottom: 1px solid var(--border); padding: 9px 11px; text-align: left; vertical-align: top; }
803
+ .markdown-preview tbody tr:last-child td { border-bottom: 0; }
781
804
  .markdown-preview th { color: var(--text); font-weight: 650; }
782
805
  .markdown-preview hr { height: 1px; margin: 2em 0; border: 0; background: var(--border); }
783
806
  .markdown-preview img { max-width: 100%; height: auto; border-radius: 10px; }
@@ -802,6 +825,32 @@ html,
802
825
  .note-tags-field input { width: min(100%, 360px); }
803
826
  .note-format-hint { margin-left: auto; color: var(--text-tertiary); font-size: 9px; white-space: nowrap; }
804
827
 
828
+ @container note-editor (max-width: 700px) {
829
+ .note-editor-toolbar {
830
+ min-height: 0;
831
+ display: grid;
832
+ grid-template-columns: minmax(0, 1fr);
833
+ align-items: stretch;
834
+ gap: 7px;
835
+ padding: 9px 12px;
836
+ }
837
+
838
+ .note-editor-actions {
839
+ width: 100%;
840
+ justify-content: flex-start;
841
+ }
842
+
843
+ .note-mode-switch { margin-right: auto; }
844
+ .editor-save-status { margin-left: auto; }
845
+ }
846
+
847
+ @container note-editor (max-width: 480px) {
848
+ .note-breadcrumb { display: none; }
849
+ .note-mode-switch { flex: 1 1 112px; }
850
+ .note-mode-switch button { min-width: 0; flex: 1; }
851
+ .note-editor-actions > .button { flex: 1 1 auto; }
852
+ }
853
+
805
854
  .list { display: grid; gap: 8px; }
806
855
  .list-row {
807
856
  min-width: 0;
@@ -1039,10 +1088,6 @@ html,
1039
1088
  .note-editor { grid-column: 1; }
1040
1089
  .note-tree-header { padding-left: 11px; }
1041
1090
  .note-tree-header span, .tree-document-copy small, .tree-count { display: none; }
1042
- .note-editor-toolbar { align-items: flex-start; padding: 8px 10px 8px 14px; }
1043
- .note-breadcrumb { display: none; }
1044
- .note-editor-actions { width: 100%; justify-content: flex-end; }
1045
- .note-mode-switch { margin-right: auto; }
1046
1091
  .note-paper { padding: 32px 24px 60px; }
1047
1092
  .document-finalized-banner { grid-template-columns: 1fr; margin: 12px; }
1048
1093
  .document-finalized-banner p { grid-column: 1; }