-
Notifications
You must be signed in to change notification settings - Fork 11
Feature/blocks-new-theming #33
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
Conversation
WalkthroughIn this update, multiple examples have been updated to the latest version of Changes
Poem
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (9)
examples/angular-uploader/package-lock.json
is excluded by!**/package-lock.json
examples/composition/package-lock.json
is excluded by!**/package-lock.json
examples/js-uploader/package-lock.json
is excluded by!**/package-lock.json
examples/next-uploader-adapter/package-lock.json
is excluded by!**/package-lock.json
examples/next-uploader/package-lock.json
is excluded by!**/package-lock.json
examples/react-uploader-adapter/package-lock.json
is excluded by!**/package-lock.json
examples/react-uploader/package-lock.json
is excluded by!**/package-lock.json
examples/svelte-uploader/package-lock.json
is excluded by!**/package-lock.json
examples/vue-uploader/package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (25)
- examples/angular-uploader/package.json (1 hunks)
- examples/angular-uploader/src/app/components/file-uploader/file-uploader.component.html (2 hunks)
- examples/angular-uploader/src/app/components/file-uploader/file-uploader.component.scss (1 hunks)
- examples/composition/package.json (1 hunks)
- examples/js-uploader/headless.html (2 hunks)
- examples/js-uploader/headless.js (1 hunks)
- examples/js-uploader/minimal.html (1 hunks)
- examples/js-uploader/minimal.js (1 hunks)
- examples/js-uploader/package.json (1 hunks)
- examples/js-uploader/regular.html (2 hunks)
- examples/js-uploader/regular.js (1 hunks)
- examples/js-uploader/styles.css (1 hunks)
- examples/next-uploader/package.json (1 hunks)
- examples/next-uploader/pages/minimal.js (1 hunks)
- examples/next-uploader/pages/regular.js (1 hunks)
- examples/react-uploader/package.json (1 hunks)
- examples/react-uploader/src/components/FileUploader/FileUploader.module.scss (1 hunks)
- examples/react-uploader/src/components/FileUploader/FileUploader.tsx (1 hunks)
- examples/react-uploader/src/views/FormView/FormView.module.scss (3 hunks)
- examples/svelte-uploader/package.json (1 hunks)
- examples/svelte-uploader/src/lib/FileUploader/FileUploader.svelte (8 hunks)
- examples/svelte-uploader/src/routes/form/+page.svelte (5 hunks)
- examples/vue-uploader/package.json (1 hunks)
- examples/vue-uploader/src/components/FileUploader/FileUploader.composition.vue (9 hunks)
- examples/vue-uploader/src/components/FileUploader/FileUploader.options.vue (9 hunks)
Files skipped from review due to trivial changes (13)
- examples/angular-uploader/package.json
- examples/angular-uploader/src/app/components/file-uploader/file-uploader.component.scss
- examples/composition/package.json
- examples/js-uploader/regular.html
- examples/js-uploader/styles.css
- examples/next-uploader/package.json
- examples/next-uploader/pages/minimal.js
- examples/next-uploader/pages/regular.js
- examples/react-uploader/package.json
- examples/react-uploader/src/components/FileUploader/FileUploader.module.scss
- examples/react-uploader/src/views/FormView/FormView.module.scss
- examples/svelte-uploader/src/routes/form/+page.svelte
- examples/vue-uploader/package.json
Additional comments not posted (34)
examples/js-uploader/package.json (3)
5-5
: The addition of"type": "module"
is appropriate for enabling ES Module support.
12-12
: Updated dependency@uploadcare/blocks
to0.44.0-alpha.20
aligns with the PR's objectives.
15-15
: Addition of"serve": "^14.2.3"
indevDependencies
is suitable for serving static files during development.examples/svelte-uploader/package.json (1)
13-13
: Updated dependency@uploadcare/blocks
to0.44.0-alpha.20
aligns with the PR's objectives.examples/js-uploader/headless.html (2)
10-10
: Correct use oftype="module"
for ES Module support in script tag.
21-21
: Addition ofclass="uc-light"
tolr-file-uploader-regular
correctly applies the intended theme.examples/js-uploader/minimal.html (2)
12-12
: Correct use oftype="module"
for ES Module support in script tag.
20-20
: Addition ofclass="uc-light"
tolr-file-uploader-minimal
correctly applies the intended theme.examples/angular-uploader/src/app/components/file-uploader/file-uploader.component.html (1)
28-29
: Correct implementation of dynamic theme switching using Angular's class bindings.examples/js-uploader/regular.js (3)
1-3
: Import statements are correctly placed and essential for uploader functionality.
16-16
: Proper use of event binding to handle changes in file uploader state.
24-51
: TherenderFiles
function is well-implemented, using modern JavaScript to dynamically create and manage DOM elements based on file data.examples/js-uploader/minimal.js (3)
1-3
: Import statements are correctly formatted and necessary for the functionality of the minimal uploader.
16-16
: Consistent and correct setup of event binding for handling file changes, ensuring functionality across different uploader configurations.
24-51
: TherenderFiles
function maintains consistency with the regular setup, effectively managing file display in a minimal interface.examples/js-uploader/headless.js (3)
18-19
: Effective use of the uploader's API to initiate the flow in headless mode via a custom button, enhancing user interaction flexibility.
27-27
: Consistent event handling across different uploader modes, ensuring reliable data capture from user interactions.
35-61
: Consistent implementation of therenderFiles
function across different uploader modes, ensuring a uniform user experience and efficient code reuse.examples/react-uploader/src/components/FileUploader/FileUploader.tsx (1)
142-142
: Ensure dynamic class assignment is correctly implemented for theming.This line correctly toggles the theme classes based on the
theme
prop. Good use of conditional class assignment.examples/svelte-uploader/src/lib/FileUploader/FileUploader.svelte (5)
26-27
: Ensure that thehandleRemoveClick
function correctly updates thefiles
array.This function correctly filters out the file with the specified UUID from the
files
array, which is reactive in Svelte.
32-32
: Check thatuploadedFiles
is updated correctly on file status change.This line ensures that only files with a status of "success" are kept in the
uploadedFiles
array.
52-53
: Verify correct event listener setup and cleanup for the file uploader.Listeners for 'change' and 'modal-close' events are correctly added and removed in the lifecycle of the component.
63-81
: Ensure localization keys are correctly overridden.The localization keys are appropriately set for various uploader states, ensuring the file uploader is properly localized.
121-122
: Ensure correct theming class bindings.Theming classes are correctly bound based on the
theme
prop, allowing dynamic theme switching.examples/vue-uploader/src/components/FileUploader/FileUploader.composition.vue (5)
23-24
: Ensure the theme prop validator works correctly.The validator function correctly ensures that only 'light' or 'dark' can be set as valid themes.
49-52
: Check that thehandleRemoveClick
method emits the correct update.This method correctly filters the files and emits the updated list, ensuring reactivity.
57-59
: Validate thatuploadedFiles
is correctly updated based on file status.This function updates
uploadedFiles
to include only files with a 'success' status, which is typical for handling file uploads.
79-97
: Review the localization settings for accuracy and completeness.The localization settings are comprehensive and correctly structured, covering various states and actions of the file uploader.
135-138
: Ensure dynamic class handling for theming works correctly.The class binding syntax is correct and will dynamically apply the appropriate theme classes based on the
theme
prop.examples/vue-uploader/src/components/FileUploader/FileUploader.options.vue (5)
23-24
: Ensure the theme prop validator is functional.The validator correctly restricts the theme values to 'light' or 'dark', which is essential for theming consistency.
51-54
: Verify that thehandleRemoveClick
method correctly updates the files array.This method appropriately emits the updated files array after filtering out the specified file by UUID.
58-60
: Check the update mechanism foruploadedFiles
on file status change.The method correctly updates the
uploadedFiles
array to include only files with a 'success' status, which is standard for file upload handling.
80-98
: Review the localization settings for their accuracy and completeness.The localization overrides are comprehensive and accurately reflect various states and actions within the file uploader.
136-140
: Ensure dynamic class handling for theming is correctly implemented.The class binding is correctly implemented to dynamically apply theme-based classes based on the
theme
prop.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (10)
examples/angular-uploader/package-lock.json
is excluded by!**/package-lock.json
examples/composition/package-lock.json
is excluded by!**/package-lock.json
examples/js-uploader/package-lock.json
is excluded by!**/package-lock.json
examples/next-uploader-adapter/package-lock.json
is excluded by!**/package-lock.json
examples/next-uploader/package-lock.json
is excluded by!**/package-lock.json
examples/react-uploader-adapter/package-lock.json
is excluded by!**/package-lock.json
examples/react-uploader/package-lock.json
is excluded by!**/package-lock.json
examples/svelte-uploader/package-lock.json
is excluded by!**/package-lock.json
examples/vue-uploader/package-lock.json
is excluded by!**/package-lock.json
package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (8)
- examples/angular-uploader/package.json (1 hunks)
- examples/composition/package.json (1 hunks)
- examples/js-uploader/package.json (1 hunks)
- examples/next-uploader/package.json (1 hunks)
- examples/react-uploader/package.json (1 hunks)
- examples/svelte-uploader/package.json (1 hunks)
- examples/vue-uploader/package.json (1 hunks)
- package.json (1 hunks)
Files skipped from review as they are similar to previous changes (7)
- examples/angular-uploader/package.json
- examples/composition/package.json
- examples/js-uploader/package.json
- examples/next-uploader/package.json
- examples/react-uploader/package.json
- examples/svelte-uploader/package.json
- examples/vue-uploader/package.json
Additional comments not posted (1)
package.json (1)
7-7
: New script addition is practical for managing dependencies in a monorepo style setup.The
install-deps
script automates the installation of dependencies for each directory under./examples/
. This should streamline the setup process for multiple contained projects, which is particularly useful in a development environment where multiple small projects share a common setup but might have different dependencies.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
examples/js-uploader/package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (2)
- examples/js-uploader/package.json (1 hunks)
- examples/js-uploader/vite.config.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- examples/js-uploader/package.json
Additional comments not posted (2)
examples/js-uploader/vite.config.js (2)
1-2
: Ensure appropriate imports for usage.The imports
fileURLToPath
fromurl
anddefineConfig
fromvite
are correctly used in the file. It's important to ensure that these modules are available in the project's dependencies.
4-15
: Review of the updated build configuration.The updated
build
configuration indefineConfig
usesrollupOptions
to specify different HTML input files for various build targets. This is a good approach for handling multiple entry points in a Vite project. However, ensure that the paths provided are correct and that the HTML files exist at these locations.Additionally, using
fileURLToPath
andnew URL
ensures that the paths are resolved correctly relative to the module, which is a robust way to handle path resolutions in ES modules.Verification successful
Verification successful: All specified HTML files exist.
- The files
index.html
,minimal.html
,regular.html
, andheadless.html
are present in theexamples/js-uploader
directory.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of specified HTML files. # Test: Check if the HTML files exist. files=("index.html" "minimal.html" "regular.html" "headless.html") for file in "${files[@]}"; do if [ ! -f "./examples/js-uploader/$file" ]; then echo "$file does not exist." exit 1 fi done echo "All files exist."Length of output: 434
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
examples/vue-uploader/package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (1)
- examples/vue-uploader/package.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- examples/vue-uploader/package.json
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.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
examples/js-custom-tab/package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (6)
- examples/js-custom-tab/index.html (1 hunks)
- examples/js-custom-tab/package.json (1 hunks)
- examples/js-custom-tab/src/CustomFileUploader.js (1 hunks)
- examples/js-custom-tab/src/UnsplashSource.js (6 hunks)
- examples/js-custom-tab/src/main.js (2 hunks)
- examples/js-custom-tab/src/unsplash-source.css (1 hunks)
Files skipped from review due to trivial changes (2)
- examples/js-custom-tab/index.html
- examples/js-custom-tab/package.json
Additional comments not posted (3)
examples/js-custom-tab/src/main.js (1)
16-16
: Good addition of environment variable check.Including a runtime check for
VITE_UNSPLASH_TOKEN
enhances the robustness of the application by ensuring necessary configurations are in place. This is a good practice, especially for features dependent on external services.examples/js-custom-tab/src/CustomFileUploader.js (1)
3-3
: Class definition is properly structured.The
CustomFileUploader
class is well-defined and correctly extendsFileUploaderRegular
, ensuring that it inherits all the necessary properties and methods from the parent class.examples/js-custom-tab/src/unsplash-source.css (1)
12-12
: CSS updates align well with theming improvements.The changes to
background-color
,width
,max-height
, andpadding
are consistent and enhance the UI's adaptability and appearance. Using CSS custom properties (--uc-background
,--uc-padding
) enhances maintainability and scalability.Also applies to: 18-19, 22-22, 29-29
<lr-url-source></lr-url-source> | ||
<lr-external-source></lr-external-source> | ||
<lr-cloud-image-editor-activity></lr-cloud-image-editor-activity> | ||
<lr-unsplash-source token="${import.meta.env.VITE_UNSPLASH_TOKEN}"></lr-unsplash-source> |
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.
Consider handling environment variables more cautiously in templates.
Direct usage of import.meta.env.VITE_UNSPLASH_TOKEN
in the template might cause issues if the environment variable is not set, as this might happen at build time. Consider adding checks or fallbacks.
@@ -17,7 +17,7 @@ const getRandomImages = async (token) => { | |||
|
|||
export class UnsplashSource extends UploaderBlock { | |||
activityType = "unsplash"; | |||
_currentItemId = null | |||
_currentItemId = null; |
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.
Well-implemented class with robust functionality.
The UnsplashSource
class is well-implemented with proper use of asynchronous operations and event handling. However, consider reviewing direct DOM manipulations in event handlers, as these might conflict with frameworks that use a virtual DOM.
Also applies to: 32-40, 58-61, 76-76, 99-111, 158-160
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
examples/vue-uploader/package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (2)
- examples/js-custom-tab/src/unsplash-source.css (1 hunks)
- examples/js-custom-tab/vite.config.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- examples/js-custom-tab/src/unsplash-source.css
Additional comments not posted (1)
examples/js-custom-tab/vite.config.js (1)
1-2
: Imports look good.The imports for
resolve
frompath
anddefineConfig
fromvite
are appropriate for the configuration setup.
Description
Checklist
Summary by CodeRabbit
New Features
Updates
@uploadcare/blocks
dependency to version0.44.0
in various examples.js-uploader
example by updating dependencies and including new build configurations.vue-router
to version4.3.2
in thevue-uploader
example.Enhancements
js-custom-tab
example, including custom attributes, event listeners, and CSS variables.Configuration
js-uploader
andjs-custom-tab
with custom rollup input options.