-
-
Notifications
You must be signed in to change notification settings - Fork 287
Plugins #2400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…in conditinal experimental profile flag, add plugin django models
The preview deployment is ready. 🟢 Last updated at: 2025-04-03 18:27:28 CET |
const scrollToRef = (sref) => { | ||
if (sref) { | ||
const query = `div[data-ref="${sref}"]`; | ||
const element = document.querySelectorAll(query)[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would scroll on the first (and only first) matching text pane on the page, right? Not just the one immediately to the "left" of the plugin? That doesn't sound like the expected behavior...
Better to figure out how to pass an event that will query and scroll the appropriate React pane.
if (sref) { | ||
const query = `div[data-ref="${sref}"]`; | ||
const element = document.querySelectorAll(query)[0]; | ||
if (element) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have scrollToRef
return a boolean so the plugin can know if the element was not in scope to scroll
|
||
const scrollToRef = (sref) => { | ||
if (sref) { | ||
const query = `div[data-ref="${sref}"]`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this match a reference like Genesis 2
, or just Genesis 2.1
?
This pull request introduces several significant changes, primarily focusing on the integration of a plugin management system, enhancements to the user profile settings, and updates to various views and components to support the new functionalities.
Plugin Management System:
fields/file_fields.py
: AddedGCSImageFieldFile
andGCSImageField
classes to handle image storage on Google Cloud Storage.plugins/models.py
: Created aPlugin
model to store plugin information, including name, description, URL, and image.plugins/admin.py
: Registered thePlugin
model with the Django admin interface usingPluginAdmin
.plugins/views.py
: Added views to render the development version of a plugin and retrieve all plugins.sefaria/urls.py
: Updated URL patterns to include routes for the plugin API.User Profile Enhancements:
sefaria/model/user_profile.py
: Added anexperiments
field to the user profile settings.reader/views.py
: Included theexperiments
field in the base properties for user profiles. [1] [2]Frontend Integration:
static/js/ConnectionsPanel.jsx
: Added a new button for plugins in the connections panel, conditionally rendered based on theexperiments
field. [1] [2]static/js/components/plugins/PluginList.jsx
: Created a component to list and load plugins.static/js/components/plugins/PluginsComponent.jsx
: Developed a component to toggle between plugin list and plugin creation views.static/js/components/plugins/WebComponentLoader.jsx
: Implemented a component to dynamically load and display plugins.static/js/sefaria/sefaria.js
: Added methods to fetch plugins and unpack theexperiments
property from base props. [1] [2]Miscellaneous Updates:
sefaria/settings.py
: Registered thePluginsAppConfig
in the Django settings.These changes collectively introduce a robust plugin management system, enhance user profile capabilities, and integrate new frontend components to support plugin interactions.