Since the Copy/Paste functionality has not been implemented for
ContentLibraries yet, the "Copy to Clipboard" button should not appear
in both the ContentLibrary page.
The text plugin for requirejs is used to load text assets such as .underscore files.
To avoid CORS issues when loading such assets from a different domain, such as a when
a CDN is in use, this plugin loads such assets as .js files by adding a script tag.
What this means in practice is that if you configure the platform to serve static
assets from a CDN, it will try to load `file.underscore.js` instead of
`file.underscore`. We can override this behaviour by providing a `useXhr` function
for the text plugin configuration. The plugin will use this function to determine
whether to use XHR or the script tag approach.
In this change we are asking it to always use XHR since the concerns about CORS
raised by the plugins documentation don't apply here.
ref: 3f9d4c19b3/README.md (xhr-restrictions)
Uses the updated styles for the notification based on the new designs.
Includes a button to open view the files directly in the notification.
This also fix a bug where the notification was not appearing when paste
a whole Unit.
In ~Palm and earlier, all built-in XBlock Sass was included into CMS
(and LMS) styles before being compiled. So, if a site theme was meant to
affect built-in XBlock styling, those changes would be manifested
directly in the base CMS CSS that is included into every single Studio
page. When the user provided the `?site_theme` querystring parameter,
which is intended to allow devs & admins to view Studio through a given
theme, CMS would look up the given theme and serve the corresponding
base CMS CSS, which would affect the built-in XBlocks views (as
expected).
After ~Palm, built-in XBlocks styles are handled more similarly to to
pure XBlock styles, in that they are only requested when CMS tries to
render the block. In Studio, blocks are not rendered by the original
request, but by a subsequent AJAX request to the `/container_preview`
enpoint. Thus, passing the `?site_theme` query parameter to the original
request will apply the given theme to Studio's chrome, but the theme
will _not_ apply to built-in XBlock views, whose CSS is now loaded via
async request.
To fix this, we simply pass Studio's querystring parameters (including
`?site_theme`) along to the `/container_view` AJAX request. This will
cause CMS to correctly serve the built-in XBlock CSS from the theme
specified by `?site_theme`, rather than whatever the current theme is.
Part of: https://github.com/openedx/edx-platform/issues/32292
* refactor: improve typing of StaticFile named tuple
* feat: copy static asset files into the clipboard
* feat: paste static assets
* feat: show notification in studio about pasted assets
* fix: HTML XBlocks would lose the editor="raw" setting when copy-pasted.
* feat: copy python_lib.zip to the clipboard when it seems to be in use
This basically changes how the xmodule static files are
generated and consumed in order to separate the Xblock
styles from general style files. Includes:
* build: decople XModule style assets by using a custom webpack loader
* build: move scss imports to its specific file
* build: fix: add system dirs to theme lookup paths. (fixes attempt 1)
* build: fix: use bootstrap variables instead of lms variables (fixes attempt 2)
This is an amendment to #32188,
which itself was an amendment to #32018.
Addressing the issue https://github.com/openedx/edx-platform/issues/31624
This basically changes how the xmodule static files are
generated and consumed in order to separate the Xblock
styles from general style files. Includes:
* build: decople XModule style assets by using a custom webpack loader
* build: move scss imports to its specific file
* build: fix: add system dirs to theme lookup paths.
This is an amendment to #32018
Addressing the issue #31624
This basically changes how the xmodule static files are
generated and consumed in order to separate the Xblock
styles from general style files. Includes:
* build: decople XModule style assets by using a custom webpack loader
* build: move scss imports to its specific file
Addressing the issue https://github.com/openedx/edx-platform/issues/31624