@docmentis/udoc-viewer 0.7.20 → 0.8.1
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/API-COMPARISON.md +441 -0
- package/LICENSE-APACHE +202 -0
- package/LICENSE-MIT +21 -0
- package/README.md +23 -1220
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +7 -0
- package/dist/version.js.map +1 -0
- package/dist/worker/worker-source.d.ts +3 -0
- package/dist/worker/worker-source.d.ts.map +1 -0
- package/dist/worker/worker-source.js +11 -0
- package/dist/worker/worker.d.ts +2 -0
- package/dist/worker/worker.d.ts.map +1 -0
- package/dist/worker/worker.js +5 -0
- package/dist/worker/worker.js.map +1 -0
- package/package.json +48 -59
- package/dist/package.json +0 -79
- package/dist/src/UDocClient.d.ts +0 -730
- package/dist/src/UDocClient.d.ts.map +0 -1
- package/dist/src/UDocClient.js +0 -649
- package/dist/src/UDocClient.js.map +0 -1
- package/dist/src/UDocViewer.d.ts +0 -883
- package/dist/src/UDocViewer.d.ts.map +0 -1
- package/dist/src/UDocViewer.js +0 -2180
- package/dist/src/UDocViewer.js.map +0 -1
- package/dist/src/fonts.d.ts +0 -47
- package/dist/src/fonts.d.ts.map +0 -1
- package/dist/src/fonts.js +0 -49
- package/dist/src/fonts.js.map +0 -1
- package/dist/src/index.d.ts +0 -13
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -5
- package/dist/src/index.js.map +0 -1
- package/dist/src/meta-url.d.ts +0 -2
- package/dist/src/meta-url.d.ts.map +0 -1
- package/dist/src/meta-url.js +0 -10
- package/dist/src/meta-url.js.map +0 -1
- package/dist/src/performance/PerformanceCounter.d.ts +0 -132
- package/dist/src/performance/PerformanceCounter.d.ts.map +0 -1
- package/dist/src/performance/PerformanceCounter.js +0 -129
- package/dist/src/performance/PerformanceCounter.js.map +0 -1
- package/dist/src/performance/index.d.ts +0 -2
- package/dist/src/performance/index.d.ts.map +0 -1
- package/dist/src/performance/index.js +0 -2
- package/dist/src/performance/index.js.map +0 -1
- package/dist/src/ui/framework/component.d.ts +0 -68
- package/dist/src/ui/framework/component.d.ts.map +0 -1
- package/dist/src/ui/framework/component.js +0 -97
- package/dist/src/ui/framework/component.js.map +0 -1
- package/dist/src/ui/framework/dom.d.ts +0 -19
- package/dist/src/ui/framework/dom.d.ts.map +0 -1
- package/dist/src/ui/framework/dom.js +0 -29
- package/dist/src/ui/framework/dom.js.map +0 -1
- package/dist/src/ui/framework/events.d.ts +0 -18
- package/dist/src/ui/framework/events.d.ts.map +0 -1
- package/dist/src/ui/framework/events.js +0 -23
- package/dist/src/ui/framework/events.js.map +0 -1
- package/dist/src/ui/framework/index.d.ts +0 -15
- package/dist/src/ui/framework/index.d.ts.map +0 -1
- package/dist/src/ui/framework/index.js +0 -15
- package/dist/src/ui/framework/index.js.map +0 -1
- package/dist/src/ui/framework/selectors.d.ts +0 -51
- package/dist/src/ui/framework/selectors.d.ts.map +0 -1
- package/dist/src/ui/framework/selectors.js +0 -28
- package/dist/src/ui/framework/selectors.js.map +0 -1
- package/dist/src/ui/framework/store.d.ts +0 -44
- package/dist/src/ui/framework/store.d.ts.map +0 -1
- package/dist/src/ui/framework/store.js +0 -79
- package/dist/src/ui/framework/store.js.map +0 -1
- package/dist/src/ui/viewer/a11y.d.ts +0 -26
- package/dist/src/ui/viewer/a11y.d.ts.map +0 -1
- package/dist/src/ui/viewer/a11y.js +0 -116
- package/dist/src/ui/viewer/a11y.js.map +0 -1
- package/dist/src/ui/viewer/actions.d.ts +0 -308
- package/dist/src/ui/viewer/actions.d.ts.map +0 -1
- package/dist/src/ui/viewer/actions.js +0 -2
- package/dist/src/ui/viewer/actions.js.map +0 -1
- package/dist/src/ui/viewer/animation-presets.d.ts +0 -37
- package/dist/src/ui/viewer/animation-presets.d.ts.map +0 -1
- package/dist/src/ui/viewer/animation-presets.js +0 -123
- package/dist/src/ui/viewer/animation-presets.js.map +0 -1
- package/dist/src/ui/viewer/animation.d.ts +0 -162
- package/dist/src/ui/viewer/animation.d.ts.map +0 -1
- package/dist/src/ui/viewer/animation.js +0 -506
- package/dist/src/ui/viewer/animation.js.map +0 -1
- package/dist/src/ui/viewer/annotation/LinkRenderer.d.ts +0 -9
- package/dist/src/ui/viewer/annotation/LinkRenderer.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/LinkRenderer.js +0 -17
- package/dist/src/ui/viewer/annotation/LinkRenderer.js.map +0 -1
- package/dist/src/ui/viewer/annotation/MarkupRenderer.d.ts +0 -21
- package/dist/src/ui/viewer/annotation/MarkupRenderer.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/MarkupRenderer.js +0 -136
- package/dist/src/ui/viewer/annotation/MarkupRenderer.js.map +0 -1
- package/dist/src/ui/viewer/annotation/ShapeRenderer.d.ts +0 -33
- package/dist/src/ui/viewer/annotation/ShapeRenderer.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/ShapeRenderer.js +0 -379
- package/dist/src/ui/viewer/annotation/ShapeRenderer.js.map +0 -1
- package/dist/src/ui/viewer/annotation/TextRenderer.d.ts +0 -23
- package/dist/src/ui/viewer/annotation/TextRenderer.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/TextRenderer.js +0 -196
- package/dist/src/ui/viewer/annotation/TextRenderer.js.map +0 -1
- package/dist/src/ui/viewer/annotation/index.d.ts +0 -9
- package/dist/src/ui/viewer/annotation/index.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/index.js +0 -10
- package/dist/src/ui/viewer/annotation/index.js.map +0 -1
- package/dist/src/ui/viewer/annotation/propertyUtils.d.ts +0 -29
- package/dist/src/ui/viewer/annotation/propertyUtils.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/propertyUtils.js +0 -151
- package/dist/src/ui/viewer/annotation/propertyUtils.js.map +0 -1
- package/dist/src/ui/viewer/annotation/render.d.ts +0 -24
- package/dist/src/ui/viewer/annotation/render.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/render.js +0 -191
- package/dist/src/ui/viewer/annotation/render.js.map +0 -1
- package/dist/src/ui/viewer/annotation/types.d.ts +0 -309
- package/dist/src/ui/viewer/annotation/types.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/types.js +0 -7
- package/dist/src/ui/viewer/annotation/types.js.map +0 -1
- package/dist/src/ui/viewer/annotation/utils.d.ts +0 -75
- package/dist/src/ui/viewer/annotation/utils.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/utils.js +0 -250
- package/dist/src/ui/viewer/annotation/utils.js.map +0 -1
- package/dist/src/ui/viewer/components/AnnotationPanel.d.ts +0 -20
- package/dist/src/ui/viewer/components/AnnotationPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/AnnotationPanel.js +0 -276
- package/dist/src/ui/viewer/components/AnnotationPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/AttachmentsPanel.d.ts +0 -8
- package/dist/src/ui/viewer/components/AttachmentsPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/AttachmentsPanel.js +0 -16
- package/dist/src/ui/viewer/components/AttachmentsPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/BookmarksPanel.d.ts +0 -8
- package/dist/src/ui/viewer/components/BookmarksPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/BookmarksPanel.js +0 -16
- package/dist/src/ui/viewer/components/BookmarksPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/Branding.d.ts +0 -49
- package/dist/src/ui/viewer/components/Branding.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/Branding.js +0 -334
- package/dist/src/ui/viewer/components/Branding.js.map +0 -1
- package/dist/src/ui/viewer/components/ColorSelect.d.ts +0 -26
- package/dist/src/ui/viewer/components/ColorSelect.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/ColorSelect.js +0 -120
- package/dist/src/ui/viewer/components/ColorSelect.js.map +0 -1
- package/dist/src/ui/viewer/components/FloatingToolbar.d.ts +0 -10
- package/dist/src/ui/viewer/components/FloatingToolbar.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/FloatingToolbar.js +0 -396
- package/dist/src/ui/viewer/components/FloatingToolbar.js.map +0 -1
- package/dist/src/ui/viewer/components/FontsPanel.d.ts +0 -12
- package/dist/src/ui/viewer/components/FontsPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/FontsPanel.js +0 -141
- package/dist/src/ui/viewer/components/FontsPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/LayersPanel.d.ts +0 -12
- package/dist/src/ui/viewer/components/LayersPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/LayersPanel.js +0 -139
- package/dist/src/ui/viewer/components/LayersPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/LeftPanel.d.ts +0 -11
- package/dist/src/ui/viewer/components/LeftPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/LeftPanel.js +0 -296
- package/dist/src/ui/viewer/components/LeftPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/LoadingOverlay.d.ts +0 -13
- package/dist/src/ui/viewer/components/LoadingOverlay.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/LoadingOverlay.js +0 -146
- package/dist/src/ui/viewer/components/LoadingOverlay.js.map +0 -1
- package/dist/src/ui/viewer/components/NumberInput.d.ts +0 -32
- package/dist/src/ui/viewer/components/NumberInput.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/NumberInput.js +0 -101
- package/dist/src/ui/viewer/components/NumberInput.js.map +0 -1
- package/dist/src/ui/viewer/components/OutlinePanel.d.ts +0 -11
- package/dist/src/ui/viewer/components/OutlinePanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/OutlinePanel.js +0 -307
- package/dist/src/ui/viewer/components/OutlinePanel.js.map +0 -1
- package/dist/src/ui/viewer/components/PasswordDialog.d.ts +0 -16
- package/dist/src/ui/viewer/components/PasswordDialog.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/PasswordDialog.js +0 -179
- package/dist/src/ui/viewer/components/PasswordDialog.js.map +0 -1
- package/dist/src/ui/viewer/components/PermitNoticeOverlay.d.ts +0 -27
- package/dist/src/ui/viewer/components/PermitNoticeOverlay.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/PermitNoticeOverlay.js +0 -79
- package/dist/src/ui/viewer/components/PermitNoticeOverlay.js.map +0 -1
- package/dist/src/ui/viewer/components/PrintDialog.d.ts +0 -34
- package/dist/src/ui/viewer/components/PrintDialog.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/PrintDialog.js +0 -317
- package/dist/src/ui/viewer/components/PrintDialog.js.map +0 -1
- package/dist/src/ui/viewer/components/RightPanel.d.ts +0 -10
- package/dist/src/ui/viewer/components/RightPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/RightPanel.js +0 -154
- package/dist/src/ui/viewer/components/RightPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/SearchPanel.d.ts +0 -21
- package/dist/src/ui/viewer/components/SearchPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/SearchPanel.js +0 -323
- package/dist/src/ui/viewer/components/SearchPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/SheetTabBar.d.ts +0 -9
- package/dist/src/ui/viewer/components/SheetTabBar.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/SheetTabBar.js +0 -57
- package/dist/src/ui/viewer/components/SheetTabBar.js.map +0 -1
- package/dist/src/ui/viewer/components/Spread.d.ts +0 -85
- package/dist/src/ui/viewer/components/Spread.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/Spread.js +0 -749
- package/dist/src/ui/viewer/components/Spread.js.map +0 -1
- package/dist/src/ui/viewer/components/SubToolbar.d.ts +0 -11
- package/dist/src/ui/viewer/components/SubToolbar.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/SubToolbar.js +0 -722
- package/dist/src/ui/viewer/components/SubToolbar.js.map +0 -1
- package/dist/src/ui/viewer/components/ThumbnailPanel.d.ts +0 -12
- package/dist/src/ui/viewer/components/ThumbnailPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/ThumbnailPanel.js +0 -290
- package/dist/src/ui/viewer/components/ThumbnailPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/Toolbar.d.ts +0 -12
- package/dist/src/ui/viewer/components/Toolbar.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/Toolbar.js +0 -761
- package/dist/src/ui/viewer/components/Toolbar.js.map +0 -1
- package/dist/src/ui/viewer/components/ViewModeMenu.d.ts +0 -10
- package/dist/src/ui/viewer/components/ViewModeMenu.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/ViewModeMenu.js +0 -206
- package/dist/src/ui/viewer/components/ViewModeMenu.js.map +0 -1
- package/dist/src/ui/viewer/components/Viewport.d.ts +0 -28
- package/dist/src/ui/viewer/components/Viewport.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/Viewport.js +0 -1721
- package/dist/src/ui/viewer/components/Viewport.js.map +0 -1
- package/dist/src/ui/viewer/effects.d.ts +0 -8
- package/dist/src/ui/viewer/effects.d.ts.map +0 -1
- package/dist/src/ui/viewer/effects.js +0 -452
- package/dist/src/ui/viewer/effects.js.map +0 -1
- package/dist/src/ui/viewer/i18n/ar.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/ar.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/ar.js +0 -198
- package/dist/src/ui/viewer/i18n/ar.js.map +0 -1
- package/dist/src/ui/viewer/i18n/de.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/de.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/de.js +0 -198
- package/dist/src/ui/viewer/i18n/de.js.map +0 -1
- package/dist/src/ui/viewer/i18n/en.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/en.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/en.js +0 -200
- package/dist/src/ui/viewer/i18n/en.js.map +0 -1
- package/dist/src/ui/viewer/i18n/es.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/es.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/es.js +0 -198
- package/dist/src/ui/viewer/i18n/es.js.map +0 -1
- package/dist/src/ui/viewer/i18n/fr.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/fr.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/fr.js +0 -198
- package/dist/src/ui/viewer/i18n/fr.js.map +0 -1
- package/dist/src/ui/viewer/i18n/index.d.ts +0 -27
- package/dist/src/ui/viewer/i18n/index.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/index.js +0 -88
- package/dist/src/ui/viewer/i18n/index.js.map +0 -1
- package/dist/src/ui/viewer/i18n/ja.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/ja.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/ja.js +0 -198
- package/dist/src/ui/viewer/i18n/ja.js.map +0 -1
- package/dist/src/ui/viewer/i18n/ko.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/ko.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/ko.js +0 -198
- package/dist/src/ui/viewer/i18n/ko.js.map +0 -1
- package/dist/src/ui/viewer/i18n/pt-BR.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/pt-BR.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/pt-BR.js +0 -198
- package/dist/src/ui/viewer/i18n/pt-BR.js.map +0 -1
- package/dist/src/ui/viewer/i18n/ru.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/ru.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/ru.js +0 -198
- package/dist/src/ui/viewer/i18n/ru.js.map +0 -1
- package/dist/src/ui/viewer/i18n/types.d.ts +0 -176
- package/dist/src/ui/viewer/i18n/types.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/types.js +0 -2
- package/dist/src/ui/viewer/i18n/types.js.map +0 -1
- package/dist/src/ui/viewer/i18n/zh-CN.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/zh-CN.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/zh-CN.js +0 -198
- package/dist/src/ui/viewer/i18n/zh-CN.js.map +0 -1
- package/dist/src/ui/viewer/i18n/zh-TW.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/zh-TW.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/zh-TW.js +0 -198
- package/dist/src/ui/viewer/i18n/zh-TW.js.map +0 -1
- package/dist/src/ui/viewer/icons.d.ts +0 -77
- package/dist/src/ui/viewer/icons.d.ts.map +0 -1
- package/dist/src/ui/viewer/icons.js +0 -109
- package/dist/src/ui/viewer/icons.js.map +0 -1
- package/dist/src/ui/viewer/index.d.ts +0 -6
- package/dist/src/ui/viewer/index.d.ts.map +0 -1
- package/dist/src/ui/viewer/index.js +0 -6
- package/dist/src/ui/viewer/index.js.map +0 -1
- package/dist/src/ui/viewer/layout/index.d.ts +0 -3
- package/dist/src/ui/viewer/layout/index.d.ts.map +0 -1
- package/dist/src/ui/viewer/layout/index.js +0 -3
- package/dist/src/ui/viewer/layout/index.js.map +0 -1
- package/dist/src/ui/viewer/layout/pixelAlign.d.ts +0 -8
- package/dist/src/ui/viewer/layout/pixelAlign.d.ts.map +0 -1
- package/dist/src/ui/viewer/layout/pixelAlign.js +0 -42
- package/dist/src/ui/viewer/layout/pixelAlign.js.map +0 -1
- package/dist/src/ui/viewer/layout/spreadLayout.d.ts +0 -155
- package/dist/src/ui/viewer/layout/spreadLayout.d.ts.map +0 -1
- package/dist/src/ui/viewer/layout/spreadLayout.js +0 -574
- package/dist/src/ui/viewer/layout/spreadLayout.js.map +0 -1
- package/dist/src/ui/viewer/navigation.d.ts +0 -91
- package/dist/src/ui/viewer/navigation.d.ts.map +0 -1
- package/dist/src/ui/viewer/navigation.js +0 -59
- package/dist/src/ui/viewer/navigation.js.map +0 -1
- package/dist/src/ui/viewer/reducer.d.ts +0 -4
- package/dist/src/ui/viewer/reducer.d.ts.map +0 -1
- package/dist/src/ui/viewer/reducer.js +0 -841
- package/dist/src/ui/viewer/reducer.js.map +0 -1
- package/dist/src/ui/viewer/search/index.d.ts +0 -2
- package/dist/src/ui/viewer/search/index.d.ts.map +0 -1
- package/dist/src/ui/viewer/search/index.js +0 -2
- package/dist/src/ui/viewer/search/index.js.map +0 -1
- package/dist/src/ui/viewer/search/search.d.ts +0 -31
- package/dist/src/ui/viewer/search/search.d.ts.map +0 -1
- package/dist/src/ui/viewer/search/search.js +0 -446
- package/dist/src/ui/viewer/search/search.js.map +0 -1
- package/dist/src/ui/viewer/shell.d.ts +0 -65
- package/dist/src/ui/viewer/shell.d.ts.map +0 -1
- package/dist/src/ui/viewer/shell.js +0 -366
- package/dist/src/ui/viewer/shell.js.map +0 -1
- package/dist/src/ui/viewer/state.d.ts +0 -313
- package/dist/src/ui/viewer/state.d.ts.map +0 -1
- package/dist/src/ui/viewer/state.js +0 -157
- package/dist/src/ui/viewer/state.js.map +0 -1
- package/dist/src/ui/viewer/styles-inline.d.ts +0 -2
- package/dist/src/ui/viewer/styles-inline.d.ts.map +0 -1
- package/dist/src/ui/viewer/styles-inline.js +0 -3526
- package/dist/src/ui/viewer/styles-inline.js.map +0 -1
- package/dist/src/ui/viewer/text/index.d.ts +0 -6
- package/dist/src/ui/viewer/text/index.d.ts.map +0 -1
- package/dist/src/ui/viewer/text/index.js +0 -6
- package/dist/src/ui/viewer/text/index.js.map +0 -1
- package/dist/src/ui/viewer/text/render.d.ts +0 -18
- package/dist/src/ui/viewer/text/render.d.ts.map +0 -1
- package/dist/src/ui/viewer/text/render.js +0 -480
- package/dist/src/ui/viewer/text/render.js.map +0 -1
- package/dist/src/ui/viewer/text/selection.d.ts +0 -12
- package/dist/src/ui/viewer/text/selection.d.ts.map +0 -1
- package/dist/src/ui/viewer/text/selection.js +0 -69
- package/dist/src/ui/viewer/text/selection.js.map +0 -1
- package/dist/src/ui/viewer/tools/AnnotationDrawController.d.ts +0 -21
- package/dist/src/ui/viewer/tools/AnnotationDrawController.d.ts.map +0 -1
- package/dist/src/ui/viewer/tools/AnnotationDrawController.js +0 -410
- package/dist/src/ui/viewer/tools/AnnotationDrawController.js.map +0 -1
- package/dist/src/ui/viewer/tools/AnnotationSelectController.d.ts +0 -22
- package/dist/src/ui/viewer/tools/AnnotationSelectController.d.ts.map +0 -1
- package/dist/src/ui/viewer/tools/AnnotationSelectController.js +0 -378
- package/dist/src/ui/viewer/tools/AnnotationSelectController.js.map +0 -1
- package/dist/src/ui/viewer/tools/AnnotationUndoManager.d.ts +0 -29
- package/dist/src/ui/viewer/tools/AnnotationUndoManager.d.ts.map +0 -1
- package/dist/src/ui/viewer/tools/AnnotationUndoManager.js +0 -144
- package/dist/src/ui/viewer/tools/AnnotationUndoManager.js.map +0 -1
- package/dist/src/ui/viewer/tools/ViewToolController.d.ts +0 -20
- package/dist/src/ui/viewer/tools/ViewToolController.d.ts.map +0 -1
- package/dist/src/ui/viewer/tools/ViewToolController.js +0 -179
- package/dist/src/ui/viewer/tools/ViewToolController.js.map +0 -1
- package/dist/src/ui/viewer/transition-gl.d.ts +0 -25
- package/dist/src/ui/viewer/transition-gl.d.ts.map +0 -1
- package/dist/src/ui/viewer/transition-gl.js +0 -823
- package/dist/src/ui/viewer/transition-gl.js.map +0 -1
- package/dist/src/ui/viewer/transition.d.ts +0 -26
- package/dist/src/ui/viewer/transition.d.ts.map +0 -1
- package/dist/src/ui/viewer/transition.js +0 -1383
- package/dist/src/ui/viewer/transition.js.map +0 -1
- package/dist/src/wasm/LICENSE +0 -112
- package/dist/src/wasm/udoc.d.ts +0 -1338
- package/dist/src/wasm/udoc.js +0 -2645
- package/dist/src/wasm/udoc_bg.wasm +0 -0
- package/dist/src/wasm/udoc_bg.wasm.d.ts +0 -58
- package/dist/src/worker/WorkerClient.d.ts +0 -489
- package/dist/src/worker/WorkerClient.d.ts.map +0 -1
- package/dist/src/worker/WorkerClient.js +0 -1383
- package/dist/src/worker/WorkerClient.js.map +0 -1
- package/dist/src/worker/index.d.ts +0 -4
- package/dist/src/worker/index.d.ts.map +0 -1
- package/dist/src/worker/index.js +0 -2
- package/dist/src/worker/index.js.map +0 -1
- package/dist/src/worker/wasmError.d.ts +0 -17
- package/dist/src/worker/wasmError.d.ts.map +0 -1
- package/dist/src/worker/wasmError.js +0 -28
- package/dist/src/worker/wasmError.js.map +0 -1
- package/dist/src/worker/worker-inline.d.ts +0 -2
- package/dist/src/worker/worker-inline.d.ts.map +0 -1
- package/dist/src/worker/worker-inline.js +0 -2
- package/dist/src/worker/worker-inline.js.map +0 -1
- package/dist/src/worker/worker.d.ts +0 -530
- package/dist/src/worker/worker.d.ts.map +0 -1
- package/dist/src/worker/worker.js +0 -2935
- package/dist/src/worker/worker.js.map +0 -1
|
@@ -1,722 +0,0 @@
|
|
|
1
|
-
import { subscribeSelector } from "../../framework/selectors";
|
|
2
|
-
import { DEFAULT_TOOL_OPTIONS } from "../state";
|
|
3
|
-
import { annotationToToolOptions, applyToolOptionsToAnnotation, getEditableOptionsForAnnotation, } from "../annotation/propertyUtils";
|
|
4
|
-
import { createNumberInput } from "./NumberInput";
|
|
5
|
-
import { createColorSelect } from "./ColorSelect";
|
|
6
|
-
import { ICON_SUBTOOL_SELECT, ICON_SUBTOOL_FREEHAND, ICON_SUBTOOL_LINE, ICON_SUBTOOL_ARROW, ICON_SUBTOOL_RECTANGLE, ICON_SUBTOOL_ELLIPSE, ICON_SUBTOOL_POLYGON, ICON_SUBTOOL_POLYLINE, ICON_SUBTOOL_HIGHLIGHT, ICON_SUBTOOL_UNDERLINE, ICON_SUBTOOL_STRIKETHROUGH, ICON_SUBTOOL_SQUIGGLY, ICON_LINE_SOLID, ICON_LINE_DASHED, ICON_LINE_DOTTED, ICON_ARROW_NONE, ICON_ARROW_OPEN, ICON_ARROW_CLOSED, ICON_STROKE_WIDTH, ICON_OPACITY, ICON_FONT_SIZE, ICON_DELETE, ICON_UNDO, ICON_REDO, } from "../icons";
|
|
7
|
-
const ANNOTATE_SUB_TOOLS = [
|
|
8
|
-
{ id: "select", icon: ICON_SUBTOOL_SELECT, labelKey: "tools.select" },
|
|
9
|
-
{ id: "freehand", icon: ICON_SUBTOOL_FREEHAND, labelKey: "tools.freehand" },
|
|
10
|
-
{ id: "line", icon: ICON_SUBTOOL_LINE, labelKey: "tools.line" },
|
|
11
|
-
{ id: "arrow", icon: ICON_SUBTOOL_ARROW, labelKey: "tools.arrow" },
|
|
12
|
-
{ id: "rectangle", icon: ICON_SUBTOOL_RECTANGLE, labelKey: "tools.rectangle" },
|
|
13
|
-
{ id: "ellipse", icon: ICON_SUBTOOL_ELLIPSE, labelKey: "tools.ellipse" },
|
|
14
|
-
{ id: "polygon", icon: ICON_SUBTOOL_POLYGON, labelKey: "tools.polygon" },
|
|
15
|
-
{ id: "polyline", icon: ICON_SUBTOOL_POLYLINE, labelKey: "tools.polyline" },
|
|
16
|
-
];
|
|
17
|
-
const MARKUP_SUB_TOOLS = [
|
|
18
|
-
{ id: "select", icon: ICON_SUBTOOL_SELECT, labelKey: "tools.select" },
|
|
19
|
-
{ id: "highlight", icon: ICON_SUBTOOL_HIGHLIGHT, labelKey: "tools.highlight" },
|
|
20
|
-
{ id: "underline", icon: ICON_SUBTOOL_UNDERLINE, labelKey: "tools.underline" },
|
|
21
|
-
{ id: "strikethrough", icon: ICON_SUBTOOL_STRIKETHROUGH, labelKey: "tools.strikethrough" },
|
|
22
|
-
{ id: "squiggly", icon: ICON_SUBTOOL_SQUIGGLY, labelKey: "tools.squiggly" },
|
|
23
|
-
];
|
|
24
|
-
const SUB_TOOLS_MAP = { annotate: ANNOTATE_SUB_TOOLS, markup: MARKUP_SUB_TOOLS };
|
|
25
|
-
const TOOL_OPTIONS_CONFIG = {
|
|
26
|
-
freehand: ["strokeColor", "strokeWidth", "opacity"],
|
|
27
|
-
line: ["strokeColor", "strokeWidth", "opacity", "lineStyle"],
|
|
28
|
-
arrow: ["strokeColor", "strokeWidth", "opacity", "lineStyle", "arrowHead"],
|
|
29
|
-
rectangle: ["strokeColor", "fillColor", "strokeWidth", "opacity", "lineStyle"],
|
|
30
|
-
ellipse: ["strokeColor", "fillColor", "strokeWidth", "opacity", "lineStyle"],
|
|
31
|
-
polygon: ["strokeColor", "fillColor", "strokeWidth", "opacity", "lineStyle"],
|
|
32
|
-
polyline: ["strokeColor", "strokeWidth", "opacity", "lineStyle"],
|
|
33
|
-
highlight: ["strokeColor", "opacity"],
|
|
34
|
-
underline: ["strokeColor"],
|
|
35
|
-
strikethrough: ["strokeColor"],
|
|
36
|
-
squiggly: ["strokeColor"],
|
|
37
|
-
};
|
|
38
|
-
const LINE_STYLE_DEFS = [
|
|
39
|
-
{ id: "solid", icon: ICON_LINE_SOLID, labelKey: "tools.lineStyleSolid" },
|
|
40
|
-
{ id: "dashed", icon: ICON_LINE_DASHED, labelKey: "tools.lineStyleDashed" },
|
|
41
|
-
{ id: "dotted", icon: ICON_LINE_DOTTED, labelKey: "tools.lineStyleDotted" },
|
|
42
|
-
];
|
|
43
|
-
const ARROW_HEAD_DEFS = [
|
|
44
|
-
{ id: "none", icon: ICON_ARROW_NONE, labelKey: "tools.arrowHeadNone" },
|
|
45
|
-
{ id: "open", icon: ICON_ARROW_OPEN, labelKey: "tools.arrowHeadOpen" },
|
|
46
|
-
{ id: "closed", icon: ICON_ARROW_CLOSED, labelKey: "tools.arrowHeadClosed" },
|
|
47
|
-
];
|
|
48
|
-
function resolveAnnotation(s) {
|
|
49
|
-
const sel = s.selectedAnnotation;
|
|
50
|
-
if (!sel)
|
|
51
|
-
return null;
|
|
52
|
-
const list = s.pageAnnotations.get(sel.pageIndex);
|
|
53
|
-
if (!list || sel.annotationIndex >= list.length)
|
|
54
|
-
return null;
|
|
55
|
-
return list[sel.annotationIndex];
|
|
56
|
-
}
|
|
57
|
-
function selectSlice(s) {
|
|
58
|
-
const at = s.activeTool;
|
|
59
|
-
return {
|
|
60
|
-
activeTool: at,
|
|
61
|
-
activeSubTool: at.kind === "annotate" || at.kind === "markup" ? at.sub : null,
|
|
62
|
-
toolOptions: s.toolOptions,
|
|
63
|
-
selectedAnnotation: s.selectedAnnotation,
|
|
64
|
-
selectedAnnotationObj: resolveAnnotation(s),
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function sliceEqual(a, b) {
|
|
68
|
-
return (a.activeTool === b.activeTool &&
|
|
69
|
-
a.activeSubTool === b.activeSubTool &&
|
|
70
|
-
a.toolOptions === b.toolOptions &&
|
|
71
|
-
a.selectedAnnotation === b.selectedAnnotation &&
|
|
72
|
-
a.selectedAnnotationObj === b.selectedAnnotationObj);
|
|
73
|
-
}
|
|
74
|
-
// ====================================================================================
|
|
75
|
-
// createSubToolbar
|
|
76
|
-
// ====================================================================================
|
|
77
|
-
export function createSubToolbar() {
|
|
78
|
-
const el = document.createElement("div");
|
|
79
|
-
el.className = "udoc-subtoolbar";
|
|
80
|
-
el.setAttribute("role", "toolbar");
|
|
81
|
-
el.style.display = "none";
|
|
82
|
-
const toolsSection = document.createElement("div");
|
|
83
|
-
toolsSection.className = "udoc-subtoolbar__tools";
|
|
84
|
-
const dividerEl = document.createElement("div");
|
|
85
|
-
dividerEl.className = "udoc-subtoolbar__divider";
|
|
86
|
-
const optionsSection = document.createElement("div");
|
|
87
|
-
optionsSection.className = "udoc-subtoolbar__options";
|
|
88
|
-
// Undo/redo section (right end, after options)
|
|
89
|
-
const undoDivider = document.createElement("div");
|
|
90
|
-
undoDivider.className = "udoc-subtoolbar__divider";
|
|
91
|
-
undoDivider.style.display = "none";
|
|
92
|
-
const undoSection = document.createElement("div");
|
|
93
|
-
undoSection.className = "udoc-subtoolbar__undo";
|
|
94
|
-
undoSection.style.display = "none";
|
|
95
|
-
el.append(toolsSection, dividerEl, optionsSection, undoDivider, undoSection);
|
|
96
|
-
// ---- Mutable state ----
|
|
97
|
-
let containerRef = null;
|
|
98
|
-
let unsubRender = null;
|
|
99
|
-
const currentToolBtns = new Map();
|
|
100
|
-
let currentToolSet = null;
|
|
101
|
-
let builtSubTool = null;
|
|
102
|
-
/** Annotation type for which controls were built (when editing a selected annotation). */
|
|
103
|
-
let builtForAnnotationType = null;
|
|
104
|
-
let activeSubTool = null;
|
|
105
|
-
let openPanel = null;
|
|
106
|
-
// ---- Lazy-created option controls ----
|
|
107
|
-
let strokeColorSelect = null;
|
|
108
|
-
let fillColorSelect = null;
|
|
109
|
-
let strokeWidthInput = null;
|
|
110
|
-
let opacityInput = null;
|
|
111
|
-
let fontSizeInput = null;
|
|
112
|
-
// Delete button for select tool
|
|
113
|
-
let deleteBtn = null;
|
|
114
|
-
// Line style & arrow head (panels + triggers)
|
|
115
|
-
const lineStylePanel = document.createElement("div");
|
|
116
|
-
lineStylePanel.className = "udoc-linestyle-panel";
|
|
117
|
-
lineStylePanel.addEventListener("click", (e) => e.stopPropagation());
|
|
118
|
-
const arrowHeadPanel = document.createElement("div");
|
|
119
|
-
arrowHeadPanel.className = "udoc-arrowhead-panel";
|
|
120
|
-
arrowHeadPanel.addEventListener("click", (e) => e.stopPropagation());
|
|
121
|
-
let lineStyleTrigger = null;
|
|
122
|
-
let arrowHeadTrigger = null;
|
|
123
|
-
// ---- Panel management ----
|
|
124
|
-
function closeAllPanels() {
|
|
125
|
-
openPanel = null;
|
|
126
|
-
strokeColorSelect?.close();
|
|
127
|
-
fillColorSelect?.close();
|
|
128
|
-
lineStylePanel.classList.remove("udoc-linestyle-panel--open");
|
|
129
|
-
arrowHeadPanel.classList.remove("udoc-arrowhead-panel--open");
|
|
130
|
-
strokeWidthInput?.close();
|
|
131
|
-
opacityInput?.close();
|
|
132
|
-
fontSizeInput?.close();
|
|
133
|
-
}
|
|
134
|
-
const onDocumentClick = () => closeAllPanels();
|
|
135
|
-
function openPanelAt(key, trigger) {
|
|
136
|
-
const wasOpen = openPanel === key;
|
|
137
|
-
closeAllPanels();
|
|
138
|
-
if (wasOpen)
|
|
139
|
-
return;
|
|
140
|
-
const rect = trigger.getBoundingClientRect();
|
|
141
|
-
const cRect = containerRef.getBoundingClientRect();
|
|
142
|
-
const left = `${rect.left - cRect.left}px`;
|
|
143
|
-
if (key === "strokeColor")
|
|
144
|
-
strokeColorSelect?.open(rect, cRect);
|
|
145
|
-
else if (key === "fillColor")
|
|
146
|
-
fillColorSelect?.open(rect, cRect);
|
|
147
|
-
else if (key === "strokeWidth")
|
|
148
|
-
strokeWidthInput?.open(rect, cRect);
|
|
149
|
-
else if (key === "opacity")
|
|
150
|
-
opacityInput?.open(rect, cRect);
|
|
151
|
-
else if (key === "fontSize")
|
|
152
|
-
fontSizeInput?.open(rect, cRect);
|
|
153
|
-
else if (key === "lineStyle") {
|
|
154
|
-
lineStylePanel.style.left = left;
|
|
155
|
-
lineStylePanel.classList.add("udoc-linestyle-panel--open");
|
|
156
|
-
}
|
|
157
|
-
else if (key === "arrowHead") {
|
|
158
|
-
arrowHeadPanel.style.left = left;
|
|
159
|
-
arrowHeadPanel.classList.add("udoc-arrowhead-panel--open");
|
|
160
|
-
}
|
|
161
|
-
openPanel = key;
|
|
162
|
-
}
|
|
163
|
-
// ---- Dispatch helper ----
|
|
164
|
-
/** Whether we are currently showing controls for a selected annotation (vs drawing tool). */
|
|
165
|
-
let editingAnnotation = false;
|
|
166
|
-
function dispatchOpt(store, key, value) {
|
|
167
|
-
if (editingAnnotation) {
|
|
168
|
-
// Apply the change to the selected annotation
|
|
169
|
-
const state = store.getState();
|
|
170
|
-
const sel = state.selectedAnnotation;
|
|
171
|
-
if (!sel)
|
|
172
|
-
return;
|
|
173
|
-
const list = state.pageAnnotations.get(sel.pageIndex);
|
|
174
|
-
if (!list || sel.annotationIndex >= list.length)
|
|
175
|
-
return;
|
|
176
|
-
const annotation = list[sel.annotationIndex];
|
|
177
|
-
const updated = applyToolOptionsToAnnotation(annotation, { [key]: value });
|
|
178
|
-
store.dispatch({
|
|
179
|
-
type: "UPDATE_ANNOTATION",
|
|
180
|
-
pageIndex: sel.pageIndex,
|
|
181
|
-
annotationIndex: sel.annotationIndex,
|
|
182
|
-
annotation: updated,
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
else if (activeSubTool) {
|
|
186
|
-
store.dispatch({ type: "SET_TOOL_OPTION", subTool: activeSubTool, key, value });
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
// ---- Mount ----
|
|
190
|
-
function mount(container, store, i18n, undoManager) {
|
|
191
|
-
containerRef = container;
|
|
192
|
-
container.appendChild(el);
|
|
193
|
-
container.appendChild(lineStylePanel);
|
|
194
|
-
container.appendChild(arrowHeadPanel);
|
|
195
|
-
el.setAttribute("aria-label", i18n.t("tools.subtoolbar"));
|
|
196
|
-
document.addEventListener("click", onDocumentClick);
|
|
197
|
-
// ---- Undo/redo buttons ----
|
|
198
|
-
if (undoManager) {
|
|
199
|
-
const undoBtn = document.createElement("button");
|
|
200
|
-
undoBtn.className = "udoc-subtoolbar__btn";
|
|
201
|
-
undoBtn.innerHTML = ICON_UNDO;
|
|
202
|
-
undoBtn.title = i18n.t("tools.undo");
|
|
203
|
-
undoBtn.setAttribute("aria-label", i18n.t("tools.undo"));
|
|
204
|
-
undoBtn.disabled = true;
|
|
205
|
-
undoBtn.addEventListener("click", () => undoManager.undo());
|
|
206
|
-
const redoBtn = document.createElement("button");
|
|
207
|
-
redoBtn.className = "udoc-subtoolbar__btn";
|
|
208
|
-
redoBtn.innerHTML = ICON_REDO;
|
|
209
|
-
redoBtn.title = i18n.t("tools.redo");
|
|
210
|
-
redoBtn.setAttribute("aria-label", i18n.t("tools.redo"));
|
|
211
|
-
redoBtn.disabled = true;
|
|
212
|
-
redoBtn.addEventListener("click", () => undoManager.redo());
|
|
213
|
-
undoSection.append(undoBtn, redoBtn);
|
|
214
|
-
undoSection.style.display = "";
|
|
215
|
-
undoDivider.style.display = "";
|
|
216
|
-
undoManager.subscribe(() => {
|
|
217
|
-
undoBtn.disabled = !undoManager.canUndo();
|
|
218
|
-
redoBtn.disabled = !undoManager.canRedo();
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
const applyState = (slice) => {
|
|
222
|
-
const kind = slice.activeTool.kind;
|
|
223
|
-
const visible = kind === "annotate" || kind === "markup";
|
|
224
|
-
el.style.display = visible ? "flex" : "none";
|
|
225
|
-
if (!visible) {
|
|
226
|
-
closeAllPanels();
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
const toolSet = kind;
|
|
230
|
-
const subTools = SUB_TOOLS_MAP[toolSet];
|
|
231
|
-
if (!subTools)
|
|
232
|
-
return;
|
|
233
|
-
// Rebuild tool buttons if tool set changed
|
|
234
|
-
if (currentToolSet !== toolSet) {
|
|
235
|
-
currentToolSet = toolSet;
|
|
236
|
-
toolsSection.innerHTML = "";
|
|
237
|
-
currentToolBtns.clear();
|
|
238
|
-
for (const def of subTools) {
|
|
239
|
-
const btn = document.createElement("button");
|
|
240
|
-
btn.className = "udoc-subtoolbar__btn";
|
|
241
|
-
btn.innerHTML = def.icon;
|
|
242
|
-
btn.title = i18n.t(def.labelKey);
|
|
243
|
-
btn.setAttribute("aria-label", i18n.t(def.labelKey));
|
|
244
|
-
btn.addEventListener("click", () => {
|
|
245
|
-
const at = store.getState().activeTool;
|
|
246
|
-
const currentSub = at.kind === "annotate" || at.kind === "markup" ? at.sub : null;
|
|
247
|
-
if (currentSub === def.id && (def.id === "polygon" || def.id === "polyline")) {
|
|
248
|
-
document.dispatchEvent(new Event("udoc-finish-drawing"));
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
store.dispatch({ type: "SET_SUB_TOOL", subTool: def.id });
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
toolsSection.appendChild(btn);
|
|
255
|
-
currentToolBtns.set(def.id, btn);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
for (const [id, btn] of currentToolBtns) {
|
|
259
|
-
btn.classList.toggle("udoc-subtoolbar__btn--active", id === slice.activeSubTool);
|
|
260
|
-
}
|
|
261
|
-
if (!slice.activeSubTool) {
|
|
262
|
-
optionsSection.innerHTML = "";
|
|
263
|
-
builtSubTool = null;
|
|
264
|
-
builtForAnnotationType = null;
|
|
265
|
-
editingAnnotation = false;
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
activeSubTool = slice.activeSubTool;
|
|
269
|
-
// Determine if we're in "edit selected annotation" mode
|
|
270
|
-
const selAnnotation = slice.activeSubTool === "select" ? slice.selectedAnnotationObj : null;
|
|
271
|
-
const selAnnotationType = selAnnotation ? selAnnotation.type : null;
|
|
272
|
-
const selEditableKeys = selAnnotation ? getEditableOptionsForAnnotation(selAnnotation) : null;
|
|
273
|
-
if (slice.activeSubTool === "select" && selAnnotation && selEditableKeys) {
|
|
274
|
-
// Editing a selected annotation — show property controls sourced from the annotation
|
|
275
|
-
editingAnnotation = true;
|
|
276
|
-
const opts = annotationToToolOptions(selAnnotation);
|
|
277
|
-
// Rebuild controls if sub-tool changed or annotation type changed
|
|
278
|
-
if (builtSubTool !== "select" || builtForAnnotationType !== selAnnotationType) {
|
|
279
|
-
closeAllPanels();
|
|
280
|
-
buildControlsForAnnotation(selEditableKeys, opts, store, i18n);
|
|
281
|
-
builtSubTool = "select";
|
|
282
|
-
builtForAnnotationType = selAnnotationType;
|
|
283
|
-
}
|
|
284
|
-
updateValues(opts, store, i18n);
|
|
285
|
-
if (deleteBtn)
|
|
286
|
-
deleteBtn.disabled = false;
|
|
287
|
-
}
|
|
288
|
-
else {
|
|
289
|
-
// Normal mode: drawing tool options or select with no/non-editable annotation
|
|
290
|
-
editingAnnotation = false;
|
|
291
|
-
const opts = slice.toolOptions[slice.activeSubTool] ?? { ...DEFAULT_TOOL_OPTIONS };
|
|
292
|
-
if (builtSubTool !== slice.activeSubTool || builtForAnnotationType !== null) {
|
|
293
|
-
closeAllPanels();
|
|
294
|
-
buildControls(slice.activeSubTool, opts, store, i18n);
|
|
295
|
-
builtSubTool = slice.activeSubTool;
|
|
296
|
-
builtForAnnotationType = null;
|
|
297
|
-
}
|
|
298
|
-
updateValues(opts, store, i18n);
|
|
299
|
-
if (deleteBtn) {
|
|
300
|
-
deleteBtn.disabled = !slice.selectedAnnotation;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
applyState(selectSlice(store.getState()));
|
|
305
|
-
unsubRender = subscribeSelector(store, selectSlice, applyState, { equality: sliceEqual });
|
|
306
|
-
}
|
|
307
|
-
// ====================================================================
|
|
308
|
-
// buildControls — called ONLY when active sub-tool changes
|
|
309
|
-
// ====================================================================
|
|
310
|
-
function buildControls(subTool, opts, store, i18n) {
|
|
311
|
-
optionsSection.innerHTML = "";
|
|
312
|
-
lineStyleTrigger = null;
|
|
313
|
-
arrowHeadTrigger = null;
|
|
314
|
-
deleteBtn = null;
|
|
315
|
-
// Select tool shows a delete button instead of drawing options
|
|
316
|
-
if (subTool === "select") {
|
|
317
|
-
deleteBtn = document.createElement("button");
|
|
318
|
-
deleteBtn.className = "udoc-subtoolbar__btn udoc-subtoolbar__btn--delete";
|
|
319
|
-
deleteBtn.innerHTML = ICON_DELETE;
|
|
320
|
-
deleteBtn.title = i18n.t("tools.deleteAnnotation");
|
|
321
|
-
deleteBtn.setAttribute("aria-label", i18n.t("tools.deleteAnnotation"));
|
|
322
|
-
deleteBtn.disabled = true;
|
|
323
|
-
deleteBtn.addEventListener("click", () => {
|
|
324
|
-
const sel = store.getState().selectedAnnotation;
|
|
325
|
-
if (sel) {
|
|
326
|
-
store.dispatch({
|
|
327
|
-
type: "REMOVE_ANNOTATION",
|
|
328
|
-
pageIndex: sel.pageIndex,
|
|
329
|
-
annotationIndex: sel.annotationIndex,
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
optionsSection.appendChild(deleteBtn);
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
const supported = TOOL_OPTIONS_CONFIG[subTool];
|
|
337
|
-
if (!supported || supported.length === 0)
|
|
338
|
-
return;
|
|
339
|
-
for (const optKey of supported) {
|
|
340
|
-
if (optKey === "strokeColor") {
|
|
341
|
-
if (!strokeColorSelect) {
|
|
342
|
-
strokeColorSelect = createColorSelect({
|
|
343
|
-
variant: "stroke",
|
|
344
|
-
label: i18n.t("tools.strokeColor"),
|
|
345
|
-
noneLabel: i18n.t("tools.noFill"),
|
|
346
|
-
onSelect: () => closeAllPanels(),
|
|
347
|
-
onChange: (color) => dispatchOpt(store, "strokeColor", color),
|
|
348
|
-
});
|
|
349
|
-
containerRef.appendChild(strokeColorSelect.panel);
|
|
350
|
-
strokeColorSelect.el.addEventListener("click", (e) => {
|
|
351
|
-
e.stopPropagation();
|
|
352
|
-
openPanelAt("strokeColor", strokeColorSelect.el);
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
optionsSection.appendChild(strokeColorSelect.el);
|
|
356
|
-
}
|
|
357
|
-
else if (optKey === "fillColor") {
|
|
358
|
-
if (!fillColorSelect) {
|
|
359
|
-
fillColorSelect = createColorSelect({
|
|
360
|
-
variant: "fill",
|
|
361
|
-
label: i18n.t("tools.fillColor"),
|
|
362
|
-
noneLabel: i18n.t("tools.noFill"),
|
|
363
|
-
onSelect: () => closeAllPanels(),
|
|
364
|
-
onChange: (color) => dispatchOpt(store, "fillColor", color),
|
|
365
|
-
});
|
|
366
|
-
containerRef.appendChild(fillColorSelect.panel);
|
|
367
|
-
fillColorSelect.el.addEventListener("click", (e) => {
|
|
368
|
-
e.stopPropagation();
|
|
369
|
-
openPanelAt("fillColor", fillColorSelect.el);
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
optionsSection.appendChild(fillColorSelect.el);
|
|
373
|
-
}
|
|
374
|
-
else if (optKey === "strokeWidth") {
|
|
375
|
-
if (!strokeWidthInput) {
|
|
376
|
-
strokeWidthInput = createNumberInput({
|
|
377
|
-
min: 0.5,
|
|
378
|
-
max: 12,
|
|
379
|
-
step: 0.5,
|
|
380
|
-
value: opts.strokeWidth,
|
|
381
|
-
icon: ICON_STROKE_WIDTH,
|
|
382
|
-
formatValue: (v) => `${v}pt`,
|
|
383
|
-
parseValue: (s) => {
|
|
384
|
-
const n = parseFloat(s.replace(/pt$/i, ""));
|
|
385
|
-
return isNaN(n) ? null : n;
|
|
386
|
-
},
|
|
387
|
-
label: i18n.t("tools.strokeWidth"),
|
|
388
|
-
onChange: (v) => dispatchOpt(store, "strokeWidth", v),
|
|
389
|
-
});
|
|
390
|
-
containerRef.appendChild(strokeWidthInput.panel);
|
|
391
|
-
strokeWidthInput.el.addEventListener("click", (e) => {
|
|
392
|
-
e.stopPropagation();
|
|
393
|
-
openPanelAt("strokeWidth", strokeWidthInput.el);
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
optionsSection.appendChild(strokeWidthInput.el);
|
|
397
|
-
}
|
|
398
|
-
else if (optKey === "opacity") {
|
|
399
|
-
if (!opacityInput) {
|
|
400
|
-
opacityInput = createNumberInput({
|
|
401
|
-
min: 10,
|
|
402
|
-
max: 100,
|
|
403
|
-
step: 10,
|
|
404
|
-
value: Math.round(opts.opacity * 100),
|
|
405
|
-
icon: ICON_OPACITY,
|
|
406
|
-
formatValue: (v) => `${Math.round(v)}%`,
|
|
407
|
-
parseValue: (s) => {
|
|
408
|
-
const n = parseFloat(s.replace(/%$/i, ""));
|
|
409
|
-
return isNaN(n) ? null : n;
|
|
410
|
-
},
|
|
411
|
-
label: i18n.t("tools.opacity"),
|
|
412
|
-
onChange: (v) => dispatchOpt(store, "opacity", v / 100),
|
|
413
|
-
});
|
|
414
|
-
containerRef.appendChild(opacityInput.panel);
|
|
415
|
-
opacityInput.el.addEventListener("click", (e) => {
|
|
416
|
-
e.stopPropagation();
|
|
417
|
-
openPanelAt("opacity", opacityInput.el);
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
optionsSection.appendChild(opacityInput.el);
|
|
421
|
-
}
|
|
422
|
-
else if (optKey === "fontSize") {
|
|
423
|
-
if (!fontSizeInput) {
|
|
424
|
-
fontSizeInput = createNumberInput({
|
|
425
|
-
min: 8,
|
|
426
|
-
max: 144,
|
|
427
|
-
step: 1,
|
|
428
|
-
value: opts.fontSize,
|
|
429
|
-
icon: ICON_FONT_SIZE,
|
|
430
|
-
formatValue: (v) => `${v}pt`,
|
|
431
|
-
parseValue: (s) => {
|
|
432
|
-
const n = parseFloat(s.replace(/pt$/i, ""));
|
|
433
|
-
return isNaN(n) ? null : n;
|
|
434
|
-
},
|
|
435
|
-
label: i18n.t("tools.fontSize"),
|
|
436
|
-
onChange: (v) => dispatchOpt(store, "fontSize", v),
|
|
437
|
-
});
|
|
438
|
-
containerRef.appendChild(fontSizeInput.panel);
|
|
439
|
-
fontSizeInput.el.addEventListener("click", (e) => {
|
|
440
|
-
e.stopPropagation();
|
|
441
|
-
openPanelAt("fontSize", fontSizeInput.el);
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
optionsSection.appendChild(fontSizeInput.el);
|
|
445
|
-
}
|
|
446
|
-
else if (optKey === "lineStyle") {
|
|
447
|
-
lineStyleTrigger = document.createElement("button");
|
|
448
|
-
lineStyleTrigger.className =
|
|
449
|
-
"udoc-subtoolbar__dropdown-trigger udoc-subtoolbar__dropdown-trigger--icon";
|
|
450
|
-
lineStyleTrigger.title = i18n.t("tools.lineStyle");
|
|
451
|
-
const arrow = document.createElement("span");
|
|
452
|
-
arrow.className = "udoc-subtoolbar__dropdown-arrow";
|
|
453
|
-
arrow.textContent = "\u25BE";
|
|
454
|
-
lineStyleTrigger.appendChild(arrow);
|
|
455
|
-
lineStyleTrigger.addEventListener("click", (e) => {
|
|
456
|
-
e.stopPropagation();
|
|
457
|
-
openPanelAt("lineStyle", lineStyleTrigger);
|
|
458
|
-
});
|
|
459
|
-
optionsSection.appendChild(lineStyleTrigger);
|
|
460
|
-
}
|
|
461
|
-
else if (optKey === "arrowHead") {
|
|
462
|
-
arrowHeadTrigger = document.createElement("button");
|
|
463
|
-
arrowHeadTrigger.className =
|
|
464
|
-
"udoc-subtoolbar__dropdown-trigger udoc-subtoolbar__dropdown-trigger--icon";
|
|
465
|
-
arrowHeadTrigger.title = i18n.t("tools.arrowHeadEnd");
|
|
466
|
-
const arrow = document.createElement("span");
|
|
467
|
-
arrow.className = "udoc-subtoolbar__dropdown-arrow";
|
|
468
|
-
arrow.textContent = "\u25BE";
|
|
469
|
-
arrowHeadTrigger.appendChild(arrow);
|
|
470
|
-
arrowHeadTrigger.addEventListener("click", (e) => {
|
|
471
|
-
e.stopPropagation();
|
|
472
|
-
openPanelAt("arrowHead", arrowHeadTrigger);
|
|
473
|
-
});
|
|
474
|
-
optionsSection.appendChild(arrowHeadTrigger);
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
// ====================================================================
|
|
479
|
-
// buildControlsForAnnotation — select mode with a selected annotation
|
|
480
|
-
// ====================================================================
|
|
481
|
-
function buildControlsForAnnotation(editableKeys, opts, store, i18n) {
|
|
482
|
-
optionsSection.innerHTML = "";
|
|
483
|
-
lineStyleTrigger = null;
|
|
484
|
-
arrowHeadTrigger = null;
|
|
485
|
-
deleteBtn = null;
|
|
486
|
-
// Build property controls based on the annotation's editable keys
|
|
487
|
-
for (const optKey of editableKeys) {
|
|
488
|
-
if (optKey === "strokeColor") {
|
|
489
|
-
if (!strokeColorSelect) {
|
|
490
|
-
strokeColorSelect = createColorSelect({
|
|
491
|
-
variant: "stroke",
|
|
492
|
-
label: i18n.t("tools.strokeColor"),
|
|
493
|
-
noneLabel: i18n.t("tools.noFill"),
|
|
494
|
-
onSelect: () => closeAllPanels(),
|
|
495
|
-
onChange: (color) => dispatchOpt(store, "strokeColor", color),
|
|
496
|
-
});
|
|
497
|
-
containerRef.appendChild(strokeColorSelect.panel);
|
|
498
|
-
strokeColorSelect.el.addEventListener("click", (e) => {
|
|
499
|
-
e.stopPropagation();
|
|
500
|
-
openPanelAt("strokeColor", strokeColorSelect.el);
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
optionsSection.appendChild(strokeColorSelect.el);
|
|
504
|
-
}
|
|
505
|
-
else if (optKey === "fillColor") {
|
|
506
|
-
if (!fillColorSelect) {
|
|
507
|
-
fillColorSelect = createColorSelect({
|
|
508
|
-
variant: "fill",
|
|
509
|
-
label: i18n.t("tools.fillColor"),
|
|
510
|
-
noneLabel: i18n.t("tools.noFill"),
|
|
511
|
-
onSelect: () => closeAllPanels(),
|
|
512
|
-
onChange: (color) => dispatchOpt(store, "fillColor", color),
|
|
513
|
-
});
|
|
514
|
-
containerRef.appendChild(fillColorSelect.panel);
|
|
515
|
-
fillColorSelect.el.addEventListener("click", (e) => {
|
|
516
|
-
e.stopPropagation();
|
|
517
|
-
openPanelAt("fillColor", fillColorSelect.el);
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
optionsSection.appendChild(fillColorSelect.el);
|
|
521
|
-
}
|
|
522
|
-
else if (optKey === "strokeWidth") {
|
|
523
|
-
if (!strokeWidthInput) {
|
|
524
|
-
strokeWidthInput = createNumberInput({
|
|
525
|
-
min: 0.5,
|
|
526
|
-
max: 12,
|
|
527
|
-
step: 0.5,
|
|
528
|
-
value: opts.strokeWidth,
|
|
529
|
-
icon: ICON_STROKE_WIDTH,
|
|
530
|
-
formatValue: (v) => `${v}pt`,
|
|
531
|
-
parseValue: (s) => {
|
|
532
|
-
const n = parseFloat(s.replace(/pt$/i, ""));
|
|
533
|
-
return isNaN(n) ? null : n;
|
|
534
|
-
},
|
|
535
|
-
label: i18n.t("tools.strokeWidth"),
|
|
536
|
-
onChange: (v) => dispatchOpt(store, "strokeWidth", v),
|
|
537
|
-
});
|
|
538
|
-
containerRef.appendChild(strokeWidthInput.panel);
|
|
539
|
-
strokeWidthInput.el.addEventListener("click", (e) => {
|
|
540
|
-
e.stopPropagation();
|
|
541
|
-
openPanelAt("strokeWidth", strokeWidthInput.el);
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
optionsSection.appendChild(strokeWidthInput.el);
|
|
545
|
-
}
|
|
546
|
-
else if (optKey === "opacity") {
|
|
547
|
-
if (!opacityInput) {
|
|
548
|
-
opacityInput = createNumberInput({
|
|
549
|
-
min: 10,
|
|
550
|
-
max: 100,
|
|
551
|
-
step: 10,
|
|
552
|
-
value: Math.round(opts.opacity * 100),
|
|
553
|
-
icon: ICON_OPACITY,
|
|
554
|
-
formatValue: (v) => `${Math.round(v)}%`,
|
|
555
|
-
parseValue: (s) => {
|
|
556
|
-
const n = parseFloat(s.replace(/%$/i, ""));
|
|
557
|
-
return isNaN(n) ? null : n;
|
|
558
|
-
},
|
|
559
|
-
label: i18n.t("tools.opacity"),
|
|
560
|
-
onChange: (v) => dispatchOpt(store, "opacity", v / 100),
|
|
561
|
-
});
|
|
562
|
-
containerRef.appendChild(opacityInput.panel);
|
|
563
|
-
opacityInput.el.addEventListener("click", (e) => {
|
|
564
|
-
e.stopPropagation();
|
|
565
|
-
openPanelAt("opacity", opacityInput.el);
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
optionsSection.appendChild(opacityInput.el);
|
|
569
|
-
}
|
|
570
|
-
else if (optKey === "lineStyle") {
|
|
571
|
-
lineStyleTrigger = document.createElement("button");
|
|
572
|
-
lineStyleTrigger.className =
|
|
573
|
-
"udoc-subtoolbar__dropdown-trigger udoc-subtoolbar__dropdown-trigger--icon";
|
|
574
|
-
lineStyleTrigger.title = i18n.t("tools.lineStyle");
|
|
575
|
-
const arrow = document.createElement("span");
|
|
576
|
-
arrow.className = "udoc-subtoolbar__dropdown-arrow";
|
|
577
|
-
arrow.textContent = "\u25BE";
|
|
578
|
-
lineStyleTrigger.appendChild(arrow);
|
|
579
|
-
lineStyleTrigger.addEventListener("click", (e) => {
|
|
580
|
-
e.stopPropagation();
|
|
581
|
-
openPanelAt("lineStyle", lineStyleTrigger);
|
|
582
|
-
});
|
|
583
|
-
optionsSection.appendChild(lineStyleTrigger);
|
|
584
|
-
}
|
|
585
|
-
else if (optKey === "arrowHead") {
|
|
586
|
-
arrowHeadTrigger = document.createElement("button");
|
|
587
|
-
arrowHeadTrigger.className =
|
|
588
|
-
"udoc-subtoolbar__dropdown-trigger udoc-subtoolbar__dropdown-trigger--icon";
|
|
589
|
-
arrowHeadTrigger.title = i18n.t("tools.arrowHeadEnd");
|
|
590
|
-
const arrow = document.createElement("span");
|
|
591
|
-
arrow.className = "udoc-subtoolbar__dropdown-arrow";
|
|
592
|
-
arrow.textContent = "\u25BE";
|
|
593
|
-
arrowHeadTrigger.appendChild(arrow);
|
|
594
|
-
arrowHeadTrigger.addEventListener("click", (e) => {
|
|
595
|
-
e.stopPropagation();
|
|
596
|
-
openPanelAt("arrowHead", arrowHeadTrigger);
|
|
597
|
-
});
|
|
598
|
-
optionsSection.appendChild(arrowHeadTrigger);
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
// Always add delete button at the end
|
|
602
|
-
deleteBtn = document.createElement("button");
|
|
603
|
-
deleteBtn.className = "udoc-subtoolbar__btn udoc-subtoolbar__btn--delete";
|
|
604
|
-
deleteBtn.innerHTML = ICON_DELETE;
|
|
605
|
-
deleteBtn.title = i18n.t("tools.deleteAnnotation");
|
|
606
|
-
deleteBtn.setAttribute("aria-label", i18n.t("tools.deleteAnnotation"));
|
|
607
|
-
deleteBtn.addEventListener("click", () => {
|
|
608
|
-
const sel = store.getState().selectedAnnotation;
|
|
609
|
-
if (sel) {
|
|
610
|
-
store.dispatch({
|
|
611
|
-
type: "REMOVE_ANNOTATION",
|
|
612
|
-
pageIndex: sel.pageIndex,
|
|
613
|
-
annotationIndex: sel.annotationIndex,
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
optionsSection.appendChild(deleteBtn);
|
|
618
|
-
}
|
|
619
|
-
// ====================================================================
|
|
620
|
-
// updateValues — called on EVERY state change, updates in-place
|
|
621
|
-
// ====================================================================
|
|
622
|
-
function updateValues(opts, store, i18n) {
|
|
623
|
-
// Color selects
|
|
624
|
-
strokeColorSelect?.update(opts.strokeColor);
|
|
625
|
-
fillColorSelect?.update(opts.fillColor);
|
|
626
|
-
// Number inputs
|
|
627
|
-
strokeWidthInput?.update(opts.strokeWidth);
|
|
628
|
-
opacityInput?.update(Math.round(opts.opacity * 100));
|
|
629
|
-
fontSizeInput?.update(opts.fontSize);
|
|
630
|
-
// Line style trigger + panel
|
|
631
|
-
if (lineStyleTrigger) {
|
|
632
|
-
const def = LINE_STYLE_DEFS.find((s) => s.id === opts.lineStyle) ?? LINE_STYLE_DEFS[0];
|
|
633
|
-
const arrowEl = lineStyleTrigger.lastElementChild;
|
|
634
|
-
lineStyleTrigger.innerHTML = def.icon;
|
|
635
|
-
if (arrowEl)
|
|
636
|
-
lineStyleTrigger.appendChild(arrowEl);
|
|
637
|
-
lineStyleTrigger.setAttribute("aria-label", `${i18n.t("tools.lineStyle")}: ${i18n.t(def.labelKey)}`);
|
|
638
|
-
}
|
|
639
|
-
rebuildLineStylePanel(opts.lineStyle, store, i18n);
|
|
640
|
-
// Arrow head trigger + panel
|
|
641
|
-
if (arrowHeadTrigger) {
|
|
642
|
-
const endDef = ARROW_HEAD_DEFS.find((a) => a.id === opts.arrowHeadEnd) ?? ARROW_HEAD_DEFS[0];
|
|
643
|
-
const arrowEl = arrowHeadTrigger.lastElementChild;
|
|
644
|
-
arrowHeadTrigger.innerHTML = endDef.icon;
|
|
645
|
-
if (arrowEl)
|
|
646
|
-
arrowHeadTrigger.appendChild(arrowEl);
|
|
647
|
-
}
|
|
648
|
-
rebuildArrowHeadPanel(opts.arrowHeadStart, opts.arrowHeadEnd, store, i18n);
|
|
649
|
-
}
|
|
650
|
-
// ---- Line style panel ----
|
|
651
|
-
function rebuildLineStylePanel(current, store, i18n) {
|
|
652
|
-
lineStylePanel.innerHTML = "";
|
|
653
|
-
for (const def of LINE_STYLE_DEFS) {
|
|
654
|
-
const item = document.createElement("button");
|
|
655
|
-
item.className = "udoc-linestyle-panel__item";
|
|
656
|
-
if (current === def.id)
|
|
657
|
-
item.classList.add("udoc-linestyle-panel__item--active");
|
|
658
|
-
const icon = document.createElement("span");
|
|
659
|
-
icon.className = "udoc-linestyle-panel__icon";
|
|
660
|
-
icon.innerHTML = def.icon;
|
|
661
|
-
const label = document.createElement("span");
|
|
662
|
-
label.className = "udoc-linestyle-panel__label";
|
|
663
|
-
label.textContent = i18n.t(def.labelKey);
|
|
664
|
-
item.append(icon, label);
|
|
665
|
-
item.title = i18n.t(def.labelKey);
|
|
666
|
-
item.addEventListener("click", (e) => {
|
|
667
|
-
e.stopPropagation();
|
|
668
|
-
closeAllPanels();
|
|
669
|
-
dispatchOpt(store, "lineStyle", def.id);
|
|
670
|
-
});
|
|
671
|
-
lineStylePanel.appendChild(item);
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
// ---- Arrow head panel ----
|
|
675
|
-
function rebuildArrowHeadPanel(startVal, endVal, store, i18n) {
|
|
676
|
-
arrowHeadPanel.innerHTML = "";
|
|
677
|
-
for (const [rowKey, rowLabel, currentVal] of [
|
|
678
|
-
["arrowHeadStart", i18n.t("tools.arrowHeadStart"), startVal],
|
|
679
|
-
["arrowHeadEnd", i18n.t("tools.arrowHeadEnd"), endVal],
|
|
680
|
-
]) {
|
|
681
|
-
const row = document.createElement("div");
|
|
682
|
-
row.className = "udoc-arrowhead-panel__row";
|
|
683
|
-
const lbl = document.createElement("span");
|
|
684
|
-
lbl.className = "udoc-arrowhead-panel__row-label";
|
|
685
|
-
lbl.textContent = rowLabel;
|
|
686
|
-
row.appendChild(lbl);
|
|
687
|
-
for (const def of ARROW_HEAD_DEFS) {
|
|
688
|
-
const btn = document.createElement("button");
|
|
689
|
-
btn.className = "udoc-arrowhead-panel__btn";
|
|
690
|
-
if (currentVal === def.id)
|
|
691
|
-
btn.classList.add("udoc-arrowhead-panel__btn--active");
|
|
692
|
-
btn.innerHTML = def.icon;
|
|
693
|
-
btn.title = i18n.t(def.labelKey);
|
|
694
|
-
if (rowKey === "arrowHeadStart")
|
|
695
|
-
btn.style.transform = "scaleX(-1)";
|
|
696
|
-
btn.addEventListener("click", (e) => {
|
|
697
|
-
e.stopPropagation();
|
|
698
|
-
dispatchOpt(store, rowKey, def.id);
|
|
699
|
-
});
|
|
700
|
-
row.appendChild(btn);
|
|
701
|
-
}
|
|
702
|
-
arrowHeadPanel.appendChild(row);
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
// ---- Destroy ----
|
|
706
|
-
function destroy() {
|
|
707
|
-
if (unsubRender)
|
|
708
|
-
unsubRender();
|
|
709
|
-
document.removeEventListener("click", onDocumentClick);
|
|
710
|
-
currentToolBtns.clear();
|
|
711
|
-
strokeColorSelect?.destroy();
|
|
712
|
-
fillColorSelect?.destroy();
|
|
713
|
-
strokeWidthInput?.destroy();
|
|
714
|
-
opacityInput?.destroy();
|
|
715
|
-
fontSizeInput?.destroy();
|
|
716
|
-
lineStylePanel.remove();
|
|
717
|
-
arrowHeadPanel.remove();
|
|
718
|
-
el.remove();
|
|
719
|
-
}
|
|
720
|
-
return { el, mount, destroy };
|
|
721
|
-
}
|
|
722
|
-
//# sourceMappingURL=SubToolbar.js.map
|