nhn / toast-ui.vue-editor

This repository is DEPRECATED! GO TO 👉 https://github.com/nhn/tui.editor/tree/master/apps/vue-editor
MIT License
229 stars 47 forks source link

fix: viewer is not using exts prop (ref #16) #18

Closed rodumani closed 5 years ago

rodumani commented 5 years ago

Please check if the PR fulfills these requirements

Description

Although PR #17 has added exts property in Viewer, it is not used anywhere.

Despite of it, examples of viewer storybook are working because its Editor has initialized extensions at editor storybook. Extensions of viewer is not configured by viewer storybook itself. If you try viewer storybook without editor storybook, extensions are not working.

So this PR fix Viewer to use its exts property.

Also, scrollSync extension in viewer storybook is causing error.

Cannot read property 'get' of undefined
TypeError: Cannot read property 'get' of undefined
    at scrollSyncExtension (http://localhost:6006/vendors~main.566b849c84711d1f2149.bundle.js:188532:18)
    at http://localhost:6006/vendors~main.566b849c84711d1f2149.bundle.js:151695:15
    at Array.forEach (<anonymous>)
    at ExtManager.applyExtension (http://localhost:6006/vendors~main.566b849c84711d1f2149.bundle.js:151686:17)
    at new ToastUIEditorViewer (http://localhost:6006/vendors~main.566b849c84711d1f2149.bundle.js:154061:26)
    at Function.factory (http://localhost:6006/vendors~main.566b849c84711d1f2149.bundle.js:159353:21)
    at VueComponent.mounted (http://localhost:6006/main.1574541a3aa60a44d3a5.hot-update.js:64:69)
    at invokeWithErrorHandling (http://localhost:6006/vendors~main.566b849c84711d1f2149.bundle.js:196508:57)
    at callHook (http://localhost:6006/vendors~main.566b849c84711d1f2149.bundle.js:198825:7)
    at Object.insert (http://localhost:6006/vendors~main.566b849c84711d1f2149.bundle.js:197773:7)

Because viewer does not need scrollSync extension, this PR removes it from viewer storybook.

In addition, as minor change, this PR removes unused import from storybooks.