-
Notifications
You must be signed in to change notification settings - Fork 18
Migration to Lit Element #886
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: rc
Are you sure you want to change the base?
Changes from all commits
c5a09f5
6195486
d60cc6b
73a910a
4c43cac
b474aa9
0d8c5f8
70d09b7
2b527b5
3570693
caecbc9
f978017
f54efa9
f5e95ce
5611261
c6360cc
7d67db6
5c3680a
021ae0a
e197425
0f9b486
f2934de
4bdc014
b999992
054bfa7
0416e02
0d4f248
8f3c816
5b0a13e
5e9a197
08e3c4d
0003461
7751173
4820e31
12f7fa5
af8c36e
9d8e093
9e46bfa
2156635
908a716
c3c8e38
dcdce78
51eb12b
a1dc1f2
29850c4
e0575d3
0535c68
ecd910e
7d0094b
95f1af5
d1c9433
8c660a8
4519777
a81068e
8f3d742
f52e0a2
9616d1f
6fe1278
06da2a0
fc66679
6f7ad64
cd4065e
23f8720
afe582e
632465e
6bc0dce
adb5c7e
13c8ad5
286cc7a
9457a2b
10a1abd
62d4d95
2554808
b07e65e
2d75e94
875a643
a03a904
3c420ba
495cf50
11c0a6b
21cc76d
019271c
0c1a33e
020d9e0
224d0b4
6d390a0
80638fd
ab7fc93
c9d11fa
28a56bf
d473f8e
a0f9c53
136fd90
8771062
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # yaml-language-server: $schema=https://www.coderabbit.ai/integrations/schema.v2.json | ||
|
|
||
| reviews: | ||
| # Exclude demo pages from CodeRabbit reviews. | ||
| # Patterns are glob-style; entries starting with '!' are ignored. | ||
| path_filters: | ||
| - "!demo/" | ||
| - "!demo/**" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| web | ||
| node_modules | ||
| dist | ||
| **/__coverage__/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <title>Cloud Image Editor - Bundle Demo</title> | ||
| <link rel="stylesheet" href="../../web/uc-cloud-image-editor.min.css"> | ||
| <style> | ||
| .uc-cloud-image-editor { | ||
| width: 100vw; | ||
| height: 100vh; | ||
| } | ||
| body { | ||
| height: 100vh; | ||
| margin: 0; | ||
| } | ||
| </style> | ||
| <script type="module"> | ||
| import * as UC from '../../web/uc-cloud-image-editor.min.js'; | ||
|
|
||
| UC.defineComponents(UC); | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <uc-config | ||
| ctx-name="my-editor" | ||
| pubkey="demopublickey" | ||
| debug | ||
| quality-insights="false" | ||
| test-mode | ||
| cdn-cname="https://ucarecdn.com/" | ||
| ></uc-config> | ||
| <uc-cloud-image-editor | ||
| uuid="f4dc9ebc-ed6d-4b4d-83d1-863bf1e4bb7f" | ||
| ctx-name="my-editor" | ||
| tabs="tuning,filters,crop" | ||
| crop-preset="1:1, 16:9, 4:3, 4:3, 3:4, 9:16" | ||
| class="uc-light" | ||
| ></uc-cloud-image-editor> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <title>File Uploader - IIFE Bundle Demo</title> | ||
| <link rel="stylesheet" href="../../web/uc-basic.min.css"> | ||
| <style> | ||
| @media (prefers-color-scheme: dark) { | ||
| body { | ||
| background-color: #121213; | ||
| } | ||
| } | ||
| </style> | ||
| <!-- IIFE bundle - no module required, UC is available globally --> | ||
| <script src="../../web/file-uploader.iife.min.js"></script> | ||
| <script> | ||
| // UC is available as a global variable | ||
| UC.defineComponents(UC); | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <uc-file-uploader-regular ctx-name="my-uploader"></uc-file-uploader-regular> | ||
| <uc-config ctx-name="my-uploader" pubkey="demopublickey" debug quality-insights="false" test-mode></uc-config> | ||
| <uc-upload-ctx-provider ctx-name="my-uploader"></uc-upload-ctx-provider> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <title>Adaptive Image - Bundle Demo</title> | ||
| <style> | ||
| uc-img { | ||
| --uc-img-pubkey: "demopublickey"; | ||
| --uc-img-breakpoints: "200, 500, 800"; | ||
| display: contents; | ||
| } | ||
|
|
||
| uc-img > img { | ||
| transition: 1s; | ||
| } | ||
|
|
||
| uc-img > img[unresolved] { | ||
| transform: scale(0.8); | ||
| opacity: 0; | ||
| transition: 1s; | ||
| } | ||
|
|
||
| @media (prefers-color-scheme: dark) { | ||
| body { | ||
| background-color: #121213; | ||
| } | ||
| } | ||
| </style> | ||
| <script type="module"> | ||
| import '../../web/uc-img.min.js'; | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <uc-img uuid="7124ae98-344c-42b2-ae2a-bd9aa79d76d8" width="500px"></uc-img> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <title>File Uploader Inline - Bundle Demo</title> | ||
| <link rel="stylesheet" href="../../web/uc-file-uploader-inline.min.css"> | ||
| <style> | ||
| @media (prefers-color-scheme: dark) { | ||
| body { | ||
| background-color: #121213; | ||
| } | ||
| } | ||
| </style> | ||
| <script type="module"> | ||
| import * as UC from '../../web/uc-file-uploader-inline.min.js'; | ||
|
|
||
| UC.defineComponents(UC); | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <uc-file-uploader-inline ctx-name="my-uploader"></uc-file-uploader-inline> | ||
| <uc-config | ||
| ctx-name="my-uploader" | ||
| pubkey="demopublickey" | ||
| crop-preset="1:1" | ||
| cloud-image-editor-tabs="crop" | ||
| debug | ||
| quality-insights="false" | ||
| test-mode | ||
| ></uc-config> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <title>File Uploader Minimal - Bundle Demo</title> | ||
| <link rel="stylesheet" href="../../web/uc-file-uploader-minimal.min.css"> | ||
| <style> | ||
| @media (prefers-color-scheme: dark) { | ||
| body { | ||
| background-color: #121213; | ||
| } | ||
| } | ||
| </style> | ||
| <script type="module"> | ||
| import * as UC from '../../web/uc-file-uploader-minimal.min.js'; | ||
|
|
||
| UC.defineComponents(UC); | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <uc-file-uploader-minimal ctx-name="my-uploader"></uc-file-uploader-minimal> | ||
| <uc-config | ||
| ctx-name="my-uploader" | ||
| pubkey="demopublickey" | ||
| img-only | ||
| group-output | ||
| debug | ||
| quality-insights="false" | ||
| test-mode | ||
| ></uc-config> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <title>File Uploader Regular - Bundle Demo</title> | ||
| <link rel="stylesheet" href="../../web/uc-file-uploader-regular.min.css"> | ||
| <style> | ||
| @media (prefers-color-scheme: dark) { | ||
| body { | ||
| background-color: #121213; | ||
| } | ||
| } | ||
| </style> | ||
| <script type="module"> | ||
| import * as UC from '../../web/uc-file-uploader-regular.min.js'; | ||
|
|
||
| UC.defineComponents(UC); | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <uc-file-uploader-regular ctx-name="my-uploader"></uc-file-uploader-regular> | ||
| <uc-config ctx-name="my-uploader" pubkey="demopublickey" debug quality-insights="false" test-mode></uc-config> | ||
| <uc-upload-ctx-provider ctx-name="my-uploader"></uc-upload-ctx-provider> | ||
| </body> | ||
| </html> |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <!doctype html> | ||
| <head> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <script type="module"> | ||
| import '@/solutions/file-uploader/regular/index.css'; | ||
| import * as UC from '@/index.js'; | ||
|
|
||
| UC.defineComponents(UC); | ||
|
|
||
| const config = document.querySelector('uc-config'); | ||
| config.secureDeliveryProxyUrlResolver = (previewUrl) => { | ||
| return `http://localhost:3000/preview?url=${encodeURIComponent(previewUrl)}`; | ||
| }; | ||
|
Comment on lines
+4
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid null access when wiring The script in const config = document.querySelector('uc-config');
config.secureDeliveryProxyUrlResolver = (previewUrl) => { ... };At that point A minimal, robust fix is to wait for DOM readiness and guard against a missing element: - const config = document.querySelector('uc-config');
- config.secureDeliveryProxyUrlResolver = (previewUrl) => {
- return `http://localhost:3000/preview?url=${encodeURIComponent(previewUrl)}`;
- };
+ window.addEventListener('DOMContentLoaded', () => {
+ const config = document.querySelector('uc-config');
+ if (!config) return;
+
+ config.secureDeliveryProxyUrlResolver = (previewUrl) => {
+ return `http://localhost:3000/preview?url=${encodeURIComponent(previewUrl)}`;
+ };
+ });Alternatively, you could move the script tag to after the Also applies to: 17-19 🤖 Prompt for AI Agents |
||
| </script> | ||
| </head> | ||
|
|
||
| <uc-file-uploader-regular ctx-name="my-uploader"></uc-file-uploader-regular> | ||
| <uc-config ctx-name="my-uploader" pubkey="demopublickey" debug quality-insights="false" test-mode></uc-config> | ||
| <uc-upload-ctx-provider ctx-name="my-uploader"></uc-upload-ctx-provider> | ||
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 the type safety implications of downgrading
noExplicitAny.The severity of
noExplicitAnyhas been downgraded from "warn" to "info". While this may reduce noise during the Lit Element migration, it weakens type safety by making explicitanyusage less visible. Consider whether this is a temporary measure or if there's a plan to address explicitanytypes after the migration.🤖 Prompt for AI Agents