Skip to content

Commit d4c949a

Browse files
committed
fix: update PDFObject import for compatibility with dev and prod builds; fix mousewheel import
1 parent 2321d6b commit d4c949a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

public/js/extra.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
import Prism from 'prismjs'
55
import hljs from 'highlight.js'
6-
import PDFObject from 'pdfobject'
6+
// Fix PDFObject import to work with both dev and prod builds
7+
import * as PDFObjectModule from 'pdfobject'
8+
79
import { saveAs } from 'file-saver'
810

911
import escapeHTML from 'lodash/escape'
@@ -65,6 +67,8 @@ import { instance as vizInstance } from '@viz-js/viz'
6567
let viz = null
6668
vizInstance().then(instance => { viz = instance })
6769

70+
const PDFObject = PDFObjectModule.default || PDFObjectModule
71+
6872
const ui = getUIElements()
6973

7074
// auto update last change

public/js/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ import '@hackmd/ot/lib/undo-manager'
102102
// import '@hackmd/ot/lib/client'
103103
import '@hackmd/ot/lib/editor-client'
104104

105-
import mousewhell from 'jquery-mousewheel'
105+
import * as mousewheel from 'jquery-mousewheel'
106106
import '@vendor/jquery-textcomplete/jquery.textcomplete'
107107
import '@vendor/jquery-ui/jquery-ui.min.js'
108108
import '@vendor/bootstrap/tooltip.min.js'
@@ -226,7 +226,8 @@ import '@css/extra.css'
226226
import '@css/site.css'
227227
import 'spin.js/spin.css'
228228

229-
mousewhell($)
229+
const mw = mousewheel.default || mousewheel // Fix for mousewheel import
230+
mw($)
230231

231232
// ot.Client = Client
232233
// ot.EditorClient = EditorClient

0 commit comments

Comments
 (0)