@instructure/canvas-rce 5.11.1 → 5.12.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/CHANGELOG.md +24 -0
- package/es/canvasFileBrowser/FileBrowser.js +6 -1
- package/es/common/fileUrl.js +3 -4
- package/es/defaultTinymceConfig.js +1 -1
- package/es/elementDenylist.js +19 -0
- package/es/getThemeVars.js +4 -3
- package/es/getTranslations.js +77 -1
- package/es/rce/RCEWrapper.js +2 -6
- package/es/rce/StatusBar.js +8 -2
- package/es/rce/contentInsertion.js +5 -2
- package/es/rce/plugins/instructure_documents/components/DocumentsPanel.js +3 -9
- package/es/rce/plugins/instructure_html_view/plugin.js +2 -2
- package/es/rce/plugins/instructure_icon_maker/components/SavedIconMakerList.js +3 -2
- package/es/rce/plugins/instructure_image/ImageList/Image.js +2 -2
- package/es/rce/plugins/instructure_image/Images/index.js +3 -10
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +3 -0
- package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +3 -1
- package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +26 -1
- package/es/rce/plugins/instructure_record/AudioOptionsTray/index.js +9 -3
- package/es/rce/plugins/instructure_record/MediaPanel/index.js +3 -9
- package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +27 -2
- package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +35 -6
- package/es/rce/plugins/shared/fileShape.js +81 -9
- package/es/rce/plugins/shared/fileTypeUtils.js +6 -0
- package/es/rcs/api.js +6 -4
- package/es/sidebar/store/configureStore.js +2 -2
- package/es/translations/locales/ab.js +26 -0
- package/es/translations/locales/cs.js +27 -0
- package/es/translations/locales/cs_CZ.js +27 -0
- package/es/translations/locales/da_DK.js +27 -0
- package/es/translations/locales/en_NZ.js +26 -0
- package/es/translations/locales/en_SE.js +26 -0
- package/es/translations/locales/en_US.js +26 -0
- package/es/translations/locales/hu_HU.js +27 -0
- package/es/translations/locales/id.js +2426 -0
- package/es/{types/inst-ui.d.js → translations/locales/id_ID.js} +9 -1
- package/es/translations/locales/ko_KR.js +27 -0
- package/es/translations/locales/lt.js +26 -0
- package/es/translations/locales/lt_LT.js +26 -0
- package/es/translations/locales/mn_MN.js +26 -0
- package/es/translations/locales/nl_NL.js +27 -0
- package/es/translations/locales/ro.js +27 -0
- package/es/translations/locales/ru.js +2375 -32
- package/es/translations/locales/sv.js +2379 -30
- package/es/translations/locales/th.js +2401 -1
- package/es/translations/locales/tl_PH.js +26 -0
- package/es/translations/locales/tr.js +3 -0
- package/es/translations/locales/vi.js +2396 -8
- package/es/translations/locales/zh_TW.Big5.js +27 -0
- package/es/translations/locales/zh_TW.js +27 -0
- package/lib/canvasFileBrowser/FileBrowser.js +6 -1
- package/lib/common/fileUrl.js +3 -4
- package/lib/defaultTinymceConfig.js +1 -1
- package/lib/elementDenylist.js +19 -0
- package/lib/getThemeVars.js +4 -3
- package/lib/getTranslations.js +77 -1
- package/lib/rce/RCEWrapper.js +2 -6
- package/lib/rce/StatusBar.js +8 -2
- package/lib/rce/contentInsertion.js +5 -2
- package/lib/rce/plugins/instructure_documents/components/DocumentsPanel.js +3 -9
- package/lib/rce/plugins/instructure_html_view/plugin.js +2 -2
- package/lib/rce/plugins/instructure_icon_maker/components/SavedIconMakerList.js +3 -2
- package/lib/rce/plugins/instructure_image/ImageList/Image.js +2 -2
- package/lib/rce/plugins/instructure_image/Images/index.js +3 -10
- package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +3 -0
- package/lib/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +3 -1
- package/lib/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +26 -1
- package/lib/rce/plugins/instructure_record/AudioOptionsTray/index.js +9 -3
- package/lib/rce/plugins/instructure_record/MediaPanel/index.js +3 -9
- package/lib/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +27 -2
- package/lib/rce/plugins/instructure_record/VideoOptionsTray/index.js +35 -6
- package/lib/rce/plugins/shared/fileShape.js +81 -9
- package/lib/rce/plugins/shared/fileTypeUtils.js +6 -0
- package/lib/rcs/api.js +6 -4
- package/lib/sidebar/store/configureStore.js +2 -2
- package/lib/translations/locales/ab.js +26 -0
- package/lib/translations/locales/cs.js +27 -0
- package/lib/translations/locales/cs_CZ.js +27 -0
- package/lib/translations/locales/da_DK.js +27 -0
- package/lib/translations/locales/en_NZ.js +26 -0
- package/lib/translations/locales/en_SE.js +26 -0
- package/lib/translations/locales/en_US.js +26 -0
- package/lib/translations/locales/hu_HU.js +27 -0
- package/lib/translations/locales/id.js +2426 -0
- package/lib/{types/inst-ui.d.js → translations/locales/id_ID.js} +9 -1
- package/lib/translations/locales/ko_KR.js +27 -0
- package/lib/translations/locales/lt.js +26 -0
- package/lib/translations/locales/lt_LT.js +26 -0
- package/lib/translations/locales/mn_MN.js +26 -0
- package/lib/translations/locales/nl_NL.js +27 -0
- package/lib/translations/locales/ro.js +27 -0
- package/lib/translations/locales/ru.js +2375 -32
- package/lib/translations/locales/sv.js +2379 -30
- package/lib/translations/locales/th.js +2401 -1
- package/lib/translations/locales/tl_PH.js +26 -0
- package/lib/translations/locales/tr.js +3 -0
- package/lib/translations/locales/vi.js +2396 -8
- package/lib/translations/locales/zh_TW.Big5.js +27 -0
- package/lib/translations/locales/zh_TW.js +27 -0
- package/package.json +11 -9
- package/scripts/publish_to_npm.sh +26 -0
- package/canvas/README.md +0 -84
- package/canvas/locales/en.json +0 -934
- package/canvas/package.json +0 -189
- package/es/common/scroll.js +0 -45
- package/es/types/ts-migration.js +0 -1
- package/lib/common/scroll.js +0 -45
- package/lib/types/ts-migration.js +0 -1
package/canvas/package.json
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@instructure/canvas-rce",
|
|
3
|
-
"version": "5.1.1",
|
|
4
|
-
"description": "A component wrapping canvas's common tinymce usage",
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"module": "es/index.js",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"i18n:extract": "format-message extract \"src*/**/*.js\" -g underscored_crc32 -o locales/en.json",
|
|
9
|
-
"integration-test": "nightwatch --env integration",
|
|
10
|
-
"lint": "eslint \"src/**/*.js\" \"test/**/*.js\"",
|
|
11
|
-
"lint:fix": "eslint --fix \"src/**/*.js\" \"test/**/*.js\"",
|
|
12
|
-
"_test": "Test cafe will be added back to test as part of CORE-2995",
|
|
13
|
-
"test": "yarn test:mocha && yarn test:jest",
|
|
14
|
-
"test:mocha": "BABEL_ENV=test-node mocha 'test/**/*.test.js' --require @instructure/canvas-theme --require jsdom-global/register --require ./babel-register.js --timeout 5000 --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.js",
|
|
15
|
-
"test:mocha:one": "BABEL_ENV=test-node mocha --require @instructure/canvas-theme --require jsdom-global/register --require ./babel-register.js --timeout 5000 --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.js",
|
|
16
|
-
"test:mocha:debug": "BABEL_ENV=test-node mocha --inspect-brk --require @instructure/canvas-theme --require jsdom-global/register --require ./babel-register.js --timeout 5000 --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.js",
|
|
17
|
-
"test:jest": "jest --color --runInBand",
|
|
18
|
-
"test:cafe": "yarn build:cafe && yarn test:cafe:only",
|
|
19
|
-
"test:cafe:only": "testcafe chrome testcafe/**/*.test.js",
|
|
20
|
-
"test:cafe:one": "testcafe chrome testcafe/**/*.test.js --test ",
|
|
21
|
-
"test:cafe:all": "yarn build:cafe && testcafe chrome,firefox,safari testcafe/**/*.test.js",
|
|
22
|
-
"test:cafe:debug": "testcafe --inspect-brk chrome testcafe/**/*.test.js",
|
|
23
|
-
"test:watch": "BABEL_ENV=test-node mocha 'test/**/*.test.js' --require @instructure/canvas-theme --require ./babel-register.js --watch",
|
|
24
|
-
"test:coverage": "cross-env BABEL_ENV=test-node nyc -r html -r json node_modules/.bin/mocha -r jsdom-global/register 'test/**/*.test.js'",
|
|
25
|
-
"test:jest:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
|
|
26
|
-
"debug": "BABEL_ENV=test-node inspect _mocha --no-timeouts --debug-brk 'test/**/*.test.js' --require @instructure/canvas-theme --require ./babel-register.js",
|
|
27
|
-
"demo": "scripts/demo.sh",
|
|
28
|
-
"demo:clean": "rm -f github-pages/dist/*",
|
|
29
|
-
"demo:build": "webpack -c ./webpack.demo.config.js",
|
|
30
|
-
"demo:dev": "yarn demo:clean && mkdir -p ./github-pages/dist && cp ./github-pages/index.html ./github-pages/dist && webpack -c ./webpack.dev.config.js",
|
|
31
|
-
"installTranslations": "scripts/installTranslations.js",
|
|
32
|
-
"build:all": "scripts/build.js",
|
|
33
|
-
"build:canvas": "scripts/build-canvas",
|
|
34
|
-
"build:watch": "rm -rf es && ./node_modules/.bin/babel --out-dir es src --watch",
|
|
35
|
-
"build:cafe": "webpack --config webpack.testcafe.config.js",
|
|
36
|
-
"prepublishOnly": "yarn build:all && yarn test",
|
|
37
|
-
"fmt:check": "prettier -l '**/*.js'",
|
|
38
|
-
"fmt:fix": "prettier --write '**/*.js'",
|
|
39
|
-
"clean": "rm -rf lib && rm -rf es && rm -rf coverage && yarn demo:clean"
|
|
40
|
-
},
|
|
41
|
-
"author": "Instructure, Inc",
|
|
42
|
-
"license": "AGPL-3.0",
|
|
43
|
-
"browserslist": [
|
|
44
|
-
"extends @instructure/browserslist-config-canvas-lms"
|
|
45
|
-
],
|
|
46
|
-
"nyc": {
|
|
47
|
-
"include": [
|
|
48
|
-
"shared/**/*.js",
|
|
49
|
-
"src/**/*.js"
|
|
50
|
-
],
|
|
51
|
-
"exclude": [],
|
|
52
|
-
"require": [
|
|
53
|
-
"@babel/register",
|
|
54
|
-
"@instructure/canvas-theme"
|
|
55
|
-
],
|
|
56
|
-
"sourceMap": false,
|
|
57
|
-
"instrument": false
|
|
58
|
-
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"@instructure/canvas-media": ">=1.0.0",
|
|
61
|
-
"@instructure/canvas-theme": "7",
|
|
62
|
-
"@instructure/k5uploader": ">=1",
|
|
63
|
-
"@instructure/media-capture": "~8.0.1-rc.11",
|
|
64
|
-
"@instructure/ui-a11y-content": "7",
|
|
65
|
-
"@instructure/ui-alerts": "7",
|
|
66
|
-
"@instructure/ui-avatar": "7",
|
|
67
|
-
"@instructure/ui-badge": "7",
|
|
68
|
-
"@instructure/ui-billboard": "7",
|
|
69
|
-
"@instructure/ui-buttons": "7",
|
|
70
|
-
"@instructure/ui-checkbox": "7",
|
|
71
|
-
"@instructure/ui-code-editor": "7.3.0",
|
|
72
|
-
"@instructure/ui-color-utils": "7",
|
|
73
|
-
"@instructure/ui-file-drop": "7",
|
|
74
|
-
"@instructure/ui-flex": "7",
|
|
75
|
-
"@instructure/ui-focusable": "7",
|
|
76
|
-
"@instructure/ui-form-field": "7",
|
|
77
|
-
"@instructure/ui-heading": "7",
|
|
78
|
-
"@instructure/ui-icons": "7",
|
|
79
|
-
"@instructure/ui-img": "7",
|
|
80
|
-
"@instructure/ui-link": "7",
|
|
81
|
-
"@instructure/ui-list": "7",
|
|
82
|
-
"@instructure/ui-media-player": "7",
|
|
83
|
-
"@instructure/ui-modal": "7",
|
|
84
|
-
"@instructure/ui-motion": "7",
|
|
85
|
-
"@instructure/ui-overlays": "7",
|
|
86
|
-
"@instructure/ui-pagination": "7",
|
|
87
|
-
"@instructure/ui-popover": "7",
|
|
88
|
-
"@instructure/ui-radio-input": "7",
|
|
89
|
-
"@instructure/ui-react-utils": "7",
|
|
90
|
-
"@instructure/ui-simple-select": "7",
|
|
91
|
-
"@instructure/ui-spinner": "7",
|
|
92
|
-
"@instructure/ui-svg-images": "7",
|
|
93
|
-
"@instructure/ui-tabs": "7",
|
|
94
|
-
"@instructure/ui-text": "7",
|
|
95
|
-
"@instructure/ui-text-area": "7",
|
|
96
|
-
"@instructure/ui-text-input": "7",
|
|
97
|
-
"@instructure/ui-themeable": "7",
|
|
98
|
-
"@instructure/ui-themes": "7",
|
|
99
|
-
"@instructure/ui-toggle-details": "7",
|
|
100
|
-
"@instructure/ui-tooltip": "7",
|
|
101
|
-
"@instructure/ui-tray": "7",
|
|
102
|
-
"@instructure/ui-tree-browser": "7",
|
|
103
|
-
"@instructure/ui-truncate-text": "7",
|
|
104
|
-
"@instructure/ui-utils": "7",
|
|
105
|
-
"@instructure/ui-view": "7",
|
|
106
|
-
"@instructure/uid": "7",
|
|
107
|
-
"@sheerun/mutationobserver-shim": "^0.3.2",
|
|
108
|
-
"@tinymce/tinymce-react": "~3.8.4",
|
|
109
|
-
"aphrodite": "^2",
|
|
110
|
-
"axios": "^0.21.1",
|
|
111
|
-
"bloody-offset": "0.0.0",
|
|
112
|
-
"classnames": "^2.2.5",
|
|
113
|
-
"format-message": "^6",
|
|
114
|
-
"format-message-generate-id": "^6",
|
|
115
|
-
"get-cookie": "1",
|
|
116
|
-
"i18n-js": "^3",
|
|
117
|
-
"i18nliner": "~0.2.0",
|
|
118
|
-
"isomorphic-fetch": "2.2.1",
|
|
119
|
-
"jquery": "https://github.com/instructure/jquery.git#1.7.2-with-AMD-and-CommonJS",
|
|
120
|
-
"js-beautify": "1",
|
|
121
|
-
"keycode": "^2",
|
|
122
|
-
"lodash": "^4",
|
|
123
|
-
"minimatch": "~3.0.4",
|
|
124
|
-
"prop-types": "^15",
|
|
125
|
-
"react": "^0.14.8 || ^15.0.0 || ^16",
|
|
126
|
-
"react-dom": "^0.14.8 || ^15.0.0 || ^16",
|
|
127
|
-
"react-draggable": "^3.3.0",
|
|
128
|
-
"react-redux": "^5",
|
|
129
|
-
"react-transition-group": "^1",
|
|
130
|
-
"redux": "^4",
|
|
131
|
-
"redux-batch-middleware": "^0.2.0",
|
|
132
|
-
"redux-thunk": "^2",
|
|
133
|
-
"scroll-into-view": "https://github.com/bkirkby/scroll-into-view.git#588b0ced98eeecf84e6fb2074aa076e80b7cffab",
|
|
134
|
-
"tinymce": "^5",
|
|
135
|
-
"tinymce-a11y-checker": "^3.0.0"
|
|
136
|
-
},
|
|
137
|
-
"devDependencies": {
|
|
138
|
-
"@babel/cli": "^7",
|
|
139
|
-
"@babel/core": "^7",
|
|
140
|
-
"@babel/register": "7",
|
|
141
|
-
"@instructure/browserslist-config-canvas-lms": ">=2",
|
|
142
|
-
"@instructure/translations": ">=1",
|
|
143
|
-
"@instructure/ui-babel-preset": "7",
|
|
144
|
-
"@testing-library/dom": "^7",
|
|
145
|
-
"@testing-library/jest-dom": "^5",
|
|
146
|
-
"@testing-library/react": "^11",
|
|
147
|
-
"@testing-library/user-event": "^12",
|
|
148
|
-
"axe-testcafe": "^3",
|
|
149
|
-
"babel-loader": "^8.0.0",
|
|
150
|
-
"babel-plugin-dynamic-import-node": "^2.2.0",
|
|
151
|
-
"babel-plugin-inline-json-import": "^0.2.0",
|
|
152
|
-
"babel-plugin-minify-constant-folding": "^0.5.0",
|
|
153
|
-
"babel-plugin-minify-dead-code-elimination": "^0.5.0",
|
|
154
|
-
"babel-plugin-minify-guarded-expressions": "^0.4.3",
|
|
155
|
-
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
|
|
156
|
-
"cross-env": "^5.0.0",
|
|
157
|
-
"eslint-plugin-mocha": "^6",
|
|
158
|
-
"eslint-plugin-testcafe": "^0.2.1",
|
|
159
|
-
"fetch-mock": "^6",
|
|
160
|
-
"format-message-cli": "^6",
|
|
161
|
-
"format-message-parse": "^6",
|
|
162
|
-
"jest": "^24",
|
|
163
|
-
"jest-canvas-mock": "^2",
|
|
164
|
-
"jest-environment-jsdom-fourteen": "^0.1.0",
|
|
165
|
-
"jest-junit": "^7",
|
|
166
|
-
"jsdom": "^13.0.0",
|
|
167
|
-
"jsdom-global": "^3.0.2",
|
|
168
|
-
"jsdomify": "^3",
|
|
169
|
-
"mocha": "^6",
|
|
170
|
-
"mocha-junit-reporter": "^1.18.0",
|
|
171
|
-
"mocha-multi-reporters": "^1.1.7",
|
|
172
|
-
"moxios": "^0.4",
|
|
173
|
-
"nyc": "^13",
|
|
174
|
-
"prettier": "^2.2.1",
|
|
175
|
-
"proxyquire": "1.7.4",
|
|
176
|
-
"shelljs": "^0.8.3",
|
|
177
|
-
"sinon": "^7",
|
|
178
|
-
"skin-deep": "^1",
|
|
179
|
-
"testcafe": "^1.9.0",
|
|
180
|
-
"testcafe-react-selectors": "^3.3.0",
|
|
181
|
-
"webpack": "^4",
|
|
182
|
-
"webpack-merge": "^5",
|
|
183
|
-
"webpack-nano": "^1",
|
|
184
|
-
"webpack-plugin-serve": "^1"
|
|
185
|
-
},
|
|
186
|
-
"resolutions": {
|
|
187
|
-
"format-message-estree-util": "../packages/format-message-estree-util"
|
|
188
|
-
}
|
|
189
|
-
}
|
package/es/common/scroll.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2018 - present Instructure, Inc.
|
|
3
|
-
*
|
|
4
|
-
* This file is part of Canvas.
|
|
5
|
-
*
|
|
6
|
-
* Canvas is free software: you can redistribute it and/or modify it under
|
|
7
|
-
* the terms of the GNU Affero General Public License as published by the Free
|
|
8
|
-
* Software Foundation, version 3 of the License.
|
|
9
|
-
*
|
|
10
|
-
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
11
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
12
|
-
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
13
|
-
* details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License along
|
|
16
|
-
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
*/
|
|
18
|
-
import scrollIntoView from 'scroll-into-view';
|
|
19
|
-
export default {
|
|
20
|
-
// scrolling in react is kinda messed up. it would
|
|
21
|
-
// make sense to scroll after getting "componentDidUpdate'
|
|
22
|
-
// after exposing new DOM objects, but "componentDidUpdate"
|
|
23
|
-
// get's called after the virtual DOM flushes it's updates
|
|
24
|
-
// to the real DOM. it doesn't get called after the real
|
|
25
|
-
// DOM has actually updated the page, so getting accurate
|
|
26
|
-
// scroll and window size information in "componenetDidUpdate"
|
|
27
|
-
// is not reliable, so we need a delay.
|
|
28
|
-
// there also is no uniform event in javascript yet that will
|
|
29
|
-
// notify of scoll window changes. firefox has "overflow",
|
|
30
|
-
// chrome has "overflowchanged", and ie has nothing.
|
|
31
|
-
// so i need to introduce a delay to give the DOM time to render.
|
|
32
|
-
// the underlying scrollIntoView module will also perform a
|
|
33
|
-
// requestAnimationFrame() (through module raf), but that delay
|
|
34
|
-
// wasn't enough for what we needed here.
|
|
35
|
-
// see the below stackoverflow for more info
|
|
36
|
-
// http://stackoverflow.com/questions/26556436/react-after-render-code
|
|
37
|
-
INTERIM_DELAY: 100,
|
|
38
|
-
|
|
39
|
-
scrollIntoViewWDelay(target, config) {
|
|
40
|
-
setTimeout(() => {
|
|
41
|
-
scrollIntoView.scrollIntoView(target, config);
|
|
42
|
-
}, this.INTERIM_DELAY);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
};
|
package/es/types/ts-migration.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/common/scroll.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2018 - present Instructure, Inc.
|
|
3
|
-
*
|
|
4
|
-
* This file is part of Canvas.
|
|
5
|
-
*
|
|
6
|
-
* Canvas is free software: you can redistribute it and/or modify it under
|
|
7
|
-
* the terms of the GNU Affero General Public License as published by the Free
|
|
8
|
-
* Software Foundation, version 3 of the License.
|
|
9
|
-
*
|
|
10
|
-
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
11
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
12
|
-
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
13
|
-
* details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License along
|
|
16
|
-
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
*/
|
|
18
|
-
import scrollIntoView from 'scroll-into-view';
|
|
19
|
-
export default {
|
|
20
|
-
// scrolling in react is kinda messed up. it would
|
|
21
|
-
// make sense to scroll after getting "componentDidUpdate'
|
|
22
|
-
// after exposing new DOM objects, but "componentDidUpdate"
|
|
23
|
-
// get's called after the virtual DOM flushes it's updates
|
|
24
|
-
// to the real DOM. it doesn't get called after the real
|
|
25
|
-
// DOM has actually updated the page, so getting accurate
|
|
26
|
-
// scroll and window size information in "componenetDidUpdate"
|
|
27
|
-
// is not reliable, so we need a delay.
|
|
28
|
-
// there also is no uniform event in javascript yet that will
|
|
29
|
-
// notify of scoll window changes. firefox has "overflow",
|
|
30
|
-
// chrome has "overflowchanged", and ie has nothing.
|
|
31
|
-
// so i need to introduce a delay to give the DOM time to render.
|
|
32
|
-
// the underlying scrollIntoView module will also perform a
|
|
33
|
-
// requestAnimationFrame() (through module raf), but that delay
|
|
34
|
-
// wasn't enough for what we needed here.
|
|
35
|
-
// see the below stackoverflow for more info
|
|
36
|
-
// http://stackoverflow.com/questions/26556436/react-after-render-code
|
|
37
|
-
INTERIM_DELAY: 100,
|
|
38
|
-
|
|
39
|
-
scrollIntoViewWDelay(target, config) {
|
|
40
|
-
setTimeout(() => {
|
|
41
|
-
scrollIntoView.scrollIntoView(target, config);
|
|
42
|
-
}, this.INTERIM_DELAY);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|