@instructure/canvas-rce
Advanced tools
Comparing version 5.14.0 to 5.14.1
@@ -7,3 +7,8 @@ # Changelog | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
## 5.14.1 - 2024-10-28 | ||
### Changed | ||
- Forward along access token and inst_ui parameters from file URLs. | ||
## 5.14.0 - 2024-10-18 | ||
@@ -23,2 +28,8 @@ | ||
## 5.13.7 - 2024-10-28 | ||
### Changed | ||
- Forward along access token and inst_ui parameters from file URLs. | ||
## 5.13.6 - 2024-09-25 | ||
@@ -41,2 +52,19 @@ | ||
## 5.13.5 - 2024-09-25 | ||
### Fixed | ||
- File links with data-canvas-previewable='false' will no longer try to preview | ||
- Change backgroundless buttons to "primary" theme color to be more visible | ||
- Fix LTI tool scrolling issue on small iOS devices | ||
- Adding missing translation strings | ||
- Fixed some types of non-Canvas files from trying to preview like Canvas files | ||
### Changed | ||
- Allow links with data-old-link to replace the existing src or href with the contents | ||
of the data-old-link attribute | ||
- Added IDs to multiple objects missing IDs | ||
- Add loading spinners to image uploads | ||
## 5.13.5 - 2024-08-12 | ||
@@ -43,0 +71,0 @@ |
@@ -105,12 +105,21 @@ /* | ||
const verifier = url === null || url === void 0 ? void 0 : url.searchParams.get('verifier'); | ||
const file_id = matches[1]; // TODO: | ||
// 1. what window should be be using | ||
const access_token = url === null || url === void 0 ? void 0 : url.searchParams.get('access_token'); | ||
const instfs_id = url === null || url === void 0 ? void 0 : url.searchParams.get('instfs_id'); | ||
const file_id = matches[1]; | ||
const params = { | ||
subject: 'preview_file', | ||
file_id | ||
}; | ||
if (verifier) params.verifier = verifier; | ||
if (access_token && instfs_id) { | ||
params.access_token = access_token; | ||
params.instfs_id = instfs_id; | ||
} // TODO: | ||
// 1. what window should we be using | ||
// 2. is that the right origin? | ||
// 3. this is temporary until we can decouple the file previewer from canvas | ||
window.top.postMessage({ | ||
subject: 'preview_file', | ||
file_id, | ||
verifier | ||
}, canvasOrigin); | ||
window.top.postMessage(params, canvasOrigin); | ||
} | ||
@@ -117,0 +126,0 @@ } |
@@ -91,3 +91,3 @@ /* | ||
const scrollingAreaRef = useRef(null); | ||
const closeButtonRef = useRef(null); | ||
const [closeButtonRef, setCloseButtonRef] = useState(null); | ||
const [filterSettings, setFilterSettings] = useFilterSettings(); | ||
@@ -115,8 +115,13 @@ const [isEditTray, setIsEditTray] = useState(false); | ||
setIsOpen(false); | ||
}, [bridge, onTrayClosing]); | ||
}, [bridge, onTrayClosing]); // this shouldn't be necessary, but INSTUI isn't focusing the close button | ||
// like it should. | ||
useEffect(() => { | ||
if (isOpen && closeButtonRef) { | ||
closeButtonRef.focus(); | ||
} | ||
}, [closeButtonRef, isOpen]); | ||
useEffect(() => { | ||
const controller = { | ||
showTrayForPlugin(plugin) { | ||
var _closeButtonRef$curre; | ||
// increment a counter that's used as the key when rendering | ||
@@ -149,4 +154,2 @@ // this gets us a new instance everytime, which is necessary | ||
} | ||
(_closeButtonRef$curre = closeButtonRef.current) === null || _closeButtonRef$curre === void 0 ? void 0 : _closeButtonRef$curre.focus(); | ||
}, | ||
@@ -296,2 +299,13 @@ | ||
function renderLinkDisplay() { | ||
return isEditTray && /*#__PURE__*/React.createElement(LinkDisplay, { | ||
linkText: linkText, | ||
placeholderText: (link === null || link === void 0 ? void 0 : link.title) || placeholderText, | ||
linkFileName: (link === null || link === void 0 ? void 0 : link.title) || '', | ||
published: (link === null || link === void 0 ? void 0 : link.published) || false, | ||
handleTextChange: setLinkText, | ||
linkType: link === null || link === void 0 ? void 0 : link.type | ||
}); | ||
} | ||
return /*#__PURE__*/React.createElement(Tray, { | ||
@@ -313,3 +327,3 @@ "data-mce-component": true, | ||
contentRef: el => trayRef.current = el | ||
}, isOpen && hasOpened ? /*#__PURE__*/React.createElement(Flex, { | ||
}, /*#__PURE__*/React.createElement(Flex, { | ||
direction: "column", | ||
@@ -335,11 +349,4 @@ as: "div", | ||
screenReaderLabel: formatMessage('Close'), | ||
elementRef: el => closeButtonRef.current = el | ||
})), isEditTray && /*#__PURE__*/React.createElement(LinkDisplay, { | ||
linkText: linkText, | ||
placeholderText: (link === null || link === void 0 ? void 0 : link.title) || placeholderText, | ||
linkFileName: (link === null || link === void 0 ? void 0 : link.title) || '', | ||
published: (link === null || link === void 0 ? void 0 : link.published) || false, | ||
handleTextChange: setLinkText, | ||
linkType: link === null || link === void 0 ? void 0 : link.type | ||
}), /*#__PURE__*/React.createElement(Filter, Object.assign({}, filterSettings, { | ||
elementRef: el => setCloseButtonRef(el) | ||
})), renderLinkDisplay(), /*#__PURE__*/React.createElement(Filter, Object.assign({}, filterSettings, { | ||
mountNode: props.mountNode, | ||
@@ -353,3 +360,3 @@ userContextType: props.contextType, | ||
use_rce_icon_maker: props.use_rce_icon_maker | ||
}))), /*#__PURE__*/React.createElement(Flex.Item, { | ||
}))), isOpen && hasOpened ? /*#__PURE__*/React.createElement(Flex.Item, { | ||
shouldGrow: true, | ||
@@ -382,3 +389,3 @@ shouldShrink: true, | ||
selectedLink: link | ||
}, storeProps)))), isEditTray && renderFooter()))) : null); | ||
}, storeProps)))), isEditTray && renderFooter())) : null)); | ||
} | ||
@@ -385,0 +392,0 @@ CanvasContentTray.globalOpenCount = 0; |
{ | ||
"name": "@instructure/canvas-rce", | ||
"version": "5.14.0", | ||
"version": "5.14.1", | ||
"description": "A component wrapping Canvas's usage of Tinymce", | ||
@@ -35,3 +35,3 @@ "main": "es/index.js", | ||
"demo:build": "wp -c ./webpack.demo.config.js", | ||
"demo:dev": "yarn demo:clean && mkdir -p ./github-pages/dist && cp ./github-pages/index.html ./github-pages/dist && wp -c ./webpack.dev.config.js", | ||
"demo:dev": "yarn demo:clean && mkdir -p ./github-pages/dist && cp ./github-pages/index.html ./github-pages/dist && wp -c ./webpack.dev.config.js", | ||
"installTranslations": "scripts/installTranslations.js", | ||
@@ -38,0 +38,0 @@ "commitTranslations": "scripts/commitTranslations.sh", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
529
6651073
179251