@salism3/dsh-latex-editor 1.1.6 → 1.1.7
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/client.js +50 -10
- package/cordis.patch.yml +1 -10
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -983,17 +983,24 @@ function defineLatexEditorPlugin(require) {
|
|
|
983
983
|
|
|
984
984
|
function LatexHeaderCornerToggle() {
|
|
985
985
|
const handleToggle = () => {
|
|
986
|
-
if (!ctx.layout) return;
|
|
987
986
|
try {
|
|
988
987
|
const col = document.querySelector('[data-rightbar-col]');
|
|
989
988
|
const isOpen = col && col.offsetWidth > 40 && window.getComputedStyle(col).display !== 'none';
|
|
990
989
|
if (isOpen) {
|
|
991
|
-
ctx.layout.closeRightbar
|
|
990
|
+
if (ctx.layout && typeof ctx.layout.closeRightbar === 'function') {
|
|
991
|
+
ctx.layout.closeRightbar();
|
|
992
|
+
}
|
|
992
993
|
} else {
|
|
993
|
-
ctx.
|
|
994
|
+
if (ctx.sidebarRight && typeof ctx.sidebarRight.openTab === 'function') {
|
|
995
|
+
ctx.sidebarRight.openTab('latex-preview');
|
|
996
|
+
} else if (ctx.layout && typeof ctx.layout.openRightbar === 'function') {
|
|
997
|
+
ctx.layout.openRightbar(true, false);
|
|
998
|
+
}
|
|
994
999
|
}
|
|
995
1000
|
} catch (e) {
|
|
996
|
-
ctx.layout.openRightbar
|
|
1001
|
+
if (ctx.layout && typeof ctx.layout.openRightbar === 'function') {
|
|
1002
|
+
ctx.layout.openRightbar(true, false);
|
|
1003
|
+
}
|
|
997
1004
|
}
|
|
998
1005
|
};
|
|
999
1006
|
|
|
@@ -1050,14 +1057,47 @@ function defineLatexEditorPlugin(require) {
|
|
|
1050
1057
|
} catch (e) {}
|
|
1051
1058
|
}
|
|
1052
1059
|
|
|
1053
|
-
// 5. Daftarkan
|
|
1060
|
+
// 5. Daftarkan tab jenis 'latex-preview' ke dalam sistem sidebarRight bawaan DSH
|
|
1061
|
+
ctx.inject(['sidebarRightTabs', 'sidebarRight'], () => {
|
|
1062
|
+
try {
|
|
1063
|
+
ctx.sidebarRightTabs.register({
|
|
1064
|
+
id: '@salism3/dsh-latex-editor/tab',
|
|
1065
|
+
kind: 'latex-preview',
|
|
1066
|
+
title: () => 'Pratinjau PDF',
|
|
1067
|
+
guide: [
|
|
1068
|
+
{
|
|
1069
|
+
id: 'latex-pdf-entry',
|
|
1070
|
+
order: 1,
|
|
1071
|
+
title: () => 'Pratinjau PDF LaTeX',
|
|
1072
|
+
description: () => 'Buka pratinjau dokumen PDF secara langsung',
|
|
1073
|
+
icon: () => h('span', { style: { fontSize: '18px' } }, '📄'),
|
|
1074
|
+
},
|
|
1075
|
+
],
|
|
1076
|
+
});
|
|
1077
|
+
} catch (e) {
|
|
1078
|
+
console.warn('[latex-editor] sidebarRightTabs.register error:', e);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
// Buka tab latex-preview sebagai tab aktif di panel kanan
|
|
1082
|
+
const activatePdfTab = () => {
|
|
1083
|
+
try {
|
|
1084
|
+
if (ctx.sidebarRight && typeof ctx.sidebarRight.openTab === 'function') {
|
|
1085
|
+
ctx.sidebarRight.openTab('latex-preview');
|
|
1086
|
+
}
|
|
1087
|
+
} catch (e) {}
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
activatePdfTab();
|
|
1091
|
+
setTimeout(activatePdfTab, 400);
|
|
1092
|
+
});
|
|
1093
|
+
|
|
1094
|
+
// 6. Daftarkan konten panel pratinjau PDF ke dalam slot 'sidebar.right.pane.tab'
|
|
1054
1095
|
if (ctx.slots && typeof ctx.slots.inject === 'function') {
|
|
1055
|
-
// Gantikan tab 'Mulai' bawaan di sidebar kanan dengan Pratinjau PDF LaTeX
|
|
1056
1096
|
ctx.slots.inject('sidebar.right.pane.tab', () =>
|
|
1057
1097
|
ctx.slots.register(
|
|
1058
1098
|
{
|
|
1059
1099
|
name: 'sidebar.right.pane.tab',
|
|
1060
|
-
key: '@
|
|
1100
|
+
key: '@salism3/dsh-latex-editor/tab',
|
|
1061
1101
|
},
|
|
1062
1102
|
LatexPdfPreviewPane
|
|
1063
1103
|
)
|
|
@@ -1067,7 +1107,7 @@ function defineLatexEditorPlugin(require) {
|
|
|
1067
1107
|
ctx.slots.register(
|
|
1068
1108
|
{
|
|
1069
1109
|
name: 'sidebar.right.pane.tab.title',
|
|
1070
|
-
key: '@
|
|
1110
|
+
key: '@salism3/dsh-latex-editor/tab',
|
|
1071
1111
|
},
|
|
1072
1112
|
() => '📄 Pratinjau PDF'
|
|
1073
1113
|
)
|
|
@@ -1083,7 +1123,7 @@ function defineLatexEditorPlugin(require) {
|
|
|
1083
1123
|
)
|
|
1084
1124
|
);
|
|
1085
1125
|
|
|
1086
|
-
//
|
|
1126
|
+
// Override tombol toggle corner [|] di kanan atas sesi untuk buka/tutup PDF Preview
|
|
1087
1127
|
ctx.slots.inject('conversation.session.header.corner', () =>
|
|
1088
1128
|
ctx.slots.register(
|
|
1089
1129
|
{
|
|
@@ -1094,7 +1134,7 @@ function defineLatexEditorPlugin(require) {
|
|
|
1094
1134
|
)
|
|
1095
1135
|
);
|
|
1096
1136
|
|
|
1097
|
-
//
|
|
1137
|
+
// Daftarkan tab PDF ke dalam slot 'conversation.view' (untuk mode mobile)
|
|
1098
1138
|
ctx.slots.inject('conversation.view', () =>
|
|
1099
1139
|
ctx.slots.register(
|
|
1100
1140
|
{
|
package/cordis.patch.yml
CHANGED
|
@@ -43,19 +43,10 @@
|
|
|
43
43
|
- id: entry-customization
|
|
44
44
|
disabled: true
|
|
45
45
|
|
|
46
|
-
# 4b. Hilangkan File Explorer
|
|
46
|
+
# 4b. Hilangkan File Explorer (tab file tree pada sidebar kanan).
|
|
47
47
|
- id: ui-sidebar-files
|
|
48
48
|
disabled: true
|
|
49
49
|
|
|
50
|
-
- id: ui-sidebar-terminal
|
|
51
|
-
disabled: true
|
|
52
|
-
|
|
53
|
-
- id: ui-sidebar-browser
|
|
54
|
-
disabled: true
|
|
55
|
-
|
|
56
|
-
- id: ui-sidebar-documentpreview
|
|
57
|
-
disabled: true
|
|
58
|
-
|
|
59
50
|
# 4c. Hilangkan tombol "Open in App" (File Explorer bawaan, VS Code, Git Bash di header sesi)
|
|
60
51
|
- id: ui-open-in-app
|
|
61
52
|
disabled: true
|
package/package.json
CHANGED