Skip to content
Open
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
5ab076d
feat: symbiote v2 update
nd0ut Nov 5, 2025
d7691fc
chore: fix symbiote state type warnings
nd0ut Nov 5, 2025
2fd35a6
fix: use `inert` instead of `aria-hidden` to supress focus catch
nd0ut Nov 5, 2025
7f3993c
feat(lit): add core Lit infrastructure and compatibility mixins
nd0ut Dec 4, 2025
6a08b82
feat(lit): add LitBlock, LitActivityBlock, and LitUploaderBlock base …
nd0ut Dec 4, 2025
3a1de48
chore: remove deprecated Block.ts and old processors
nd0ut Dec 4, 2025
02dd5f5
refactor(blocks): migrate core uploader blocks to Lit
nd0ut Dec 4, 2025
5dfb7b5
refactor(cloud-image-editor): migrate editor components to Lit
nd0ut Dec 4, 2025
f1e671f
refactor(cloud-image-editor): migrate CloudImageEditorActivity to Lit
nd0ut Dec 4, 2025
78a53ad
refactor(solutions): migrate file uploader solutions to Lit
nd0ut Dec 4, 2025
f8fda71
refactor(img): rewrite uc-img components to TypeScript
nd0ut Dec 4, 2025
5942e62
chore(locales): convert locale files from JS to TS
nd0ut Dec 4, 2025
fb9edc4
refactor(abstract): update managers and utilities for Lit compatibility
nd0ut Dec 4, 2025
f9c7b88
refactor: update exports and imports for Lit migration
nd0ut Dec 4, 2025
9ec4799
chore: update dependencies and build config for Lit
nd0ut Dec 4, 2025
53c6dc7
test: update test files for Lit migration
nd0ut Dec 4, 2025
74f1718
chore(demo): update demo files for Lit migration
nd0ut Dec 4, 2025
26edd3d
chore: fix missed dep while rebasing
nd0ut Dec 2, 2025
d1e95f6
chore: remove lit bundle
nd0ut Dec 3, 2025
78403ab
chore(modal): expose dialog ref to ancestors
nd0ut Dec 3, 2025
d80a42f
chore: fix text binding
nd0ut Dec 3, 2025
d6c7f56
chore: fix symbiote layer unsubscribes
nd0ut Dec 3, 2025
49a8377
chore: remove focus-visible polyfill
nd0ut Dec 3, 2025
f2a71ef
chore: fix file-item render pause on re-render
nd0ut Dec 3, 2025
fe605b1
chore: fix ai-found memory leaks
nd0ut Dec 3, 2025
62af6de
chore: fix camera shot not freezing issue
nd0ut Dec 3, 2025
7f3a67c
chore: remove unused waitForAttribute method
nd0ut Dec 3, 2025
faf9669
chore(demo): replace real public key with demopublickey
nd0ut Dec 4, 2025
3e0db58
chore: apply linting fixes and remove unused imports
nd0ut Dec 4, 2025
a463157
chore(demo): reorganize demo pages and add bundle demos
nd0ut Dec 4, 2025
cbc98e1
chore: reorganize exports in index.ts and update version
nd0ut Dec 5, 2025
58829eb
chore: update tsconfig.node.json types
nd0ut Dec 5, 2025
fcfb913
fix: use unsafeSVG instead of unsafeHTML for SVG sprite
nd0ut Dec 5, 2025
2ee2cce
chore: add linked legal comments and include txt files in package
nd0ut Dec 5, 2025
ce2b8f7
chore: enable minification for dist build
nd0ut Dec 5, 2025
78729ed
chore: add NODE_ENV=production for Lit production mode and bundle lit…
nd0ut Dec 5, 2025
6cd3146
chore: use esbuild-minify-templates for HTML template minification
nd0ut Dec 5, 2025
f70d366
fix: remove non-existent jsx.ts entry from build items
nd0ut Dec 5, 2025
3efb4a1
chore: update biome config and fix test
nd0ut Dec 5, 2025
01c0c1a
chore: upgrade biome to 2.3.8
nd0ut Dec 5, 2025
6633021
chore(biome): enable useConsistentMemberAccessibility rule
nd0ut Dec 5, 2025
c900d71
refactor: enforce TS access modifiers
nd0ut Dec 6, 2025
1962d9b
chore: reorganize root exports
nd0ut Dec 6, 2025
e01f3c9
refactor: prefix private members with underscore
nd0ut Dec 6, 2025
eaec0c8
fix(css): use CSS variable for progress bar opacity control
nd0ut Dec 6, 2025
a49cdfe
refactor: replace @symbiotejs/symbiote with nanostores-based PubSub
nd0ut Dec 6, 2025
34c9a48
refactor(types): cover shared state types
nd0ut Dec 6, 2025
cbc8cce
fix(symbiote-compat): create state on initialize
nd0ut Dec 7, 2025
1cee417
refactor(symbiote-compat): use listenKeys from nanostore to subscribe…
nd0ut Dec 7, 2025
848a89b
chore: enable props mangling to reduce bundle size
nd0ut Dec 7, 2025
a9e3a3c
chore: rebuild lockfile
nd0ut Dec 7, 2025
1b32217
style: refresh locales demo and inline uploader styles
nd0ut Dec 7, 2025
90f1ba6
style: apply lint fixes
nd0ut Dec 7, 2025
1869c34
test: fix types test
nd0ut Dec 7, 2025
7a39559
chore: normalize package exports API to be compatible with the origin…
nd0ut Dec 7, 2025
9b5b86e
chore: fix biome warnings
nd0ut Dec 7, 2025
f1012c4
chore: refactor jsx types
nd0ut Dec 7, 2025
5713a92
chore: fix npm tests
nd0ut Dec 7, 2025
beb61af
refactor: make centralized handling of shared context instances
nd0ut Dec 7, 2025
f56abff
Update config playground selects and inline preview sizing
nd0ut Dec 7, 2025
f27978b
fix: check for elemnt is being connected to the DOM inside async func…
nd0ut Dec 8, 2025
fc2814c
chore: fix vitest configuration
nd0ut Dec 8, 2025
23ce031
refactor(PubSub): move contexts to static field
nd0ut Dec 8, 2025
4c9acfd
build: reduce license in the bundles + add version and build time
nd0ut Dec 8, 2025
3edb9f0
refactor: remove unused method
nd0ut Dec 8, 2025
1d9e774
types: fix uc-img jsx types
nd0ut Dec 8, 2025
0418aa2
fix: adjust aspect ratio icon rendering
nd0ut Dec 8, 2025
2571cd0
fix: check if blocks registry still empty before destroy ctx
nd0ut Dec 8, 2025
82bcdc7
refactor: uploadTrigger usage
nd0ut Dec 8, 2025
18f73bd
fix(cloud-image-editor): network problems splash + image loading loop
nd0ut Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand All @@ -26,6 +26,10 @@
},
"style": {
"noInferrableTypes": "error"
},
"correctness": {
"noUnusedVariables": "error",
"noUnusedImports": "error"
}
}
},
Expand All @@ -38,8 +42,8 @@
"enabled": true,
"actions": {
"source": {
"organizeImports": "on",
"recommended": true
"recommended": true,
"organizeImports": "on"
}
}
},
Expand All @@ -55,5 +59,11 @@
}
}
}
]
],
"html": {
"experimentalFullSupportEnabled": true,
"formatter": {
"enabled": true
}
}
}
34 changes: 34 additions & 0 deletions demo/bundles/cloud-image-editor.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!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>
27 changes: 27 additions & 0 deletions demo/bundles/iife.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>
37 changes: 37 additions & 0 deletions demo/bundles/img.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>
33 changes: 33 additions & 0 deletions demo/bundles/inline.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>
25 changes: 25 additions & 0 deletions demo/bundles/minimal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!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>
26 changes: 26 additions & 0 deletions demo/bundles/regular.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>
29 changes: 0 additions & 29 deletions demo/cloud-image-editor.html

This file was deleted.

30 changes: 0 additions & 30 deletions demo/custom-icons.html

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Avoid null access when wiring secureDeliveryProxyUrlResolver

The script in <head> queries for uc-config before the body is parsed:

const config = document.querySelector('uc-config');
config.secureDeliveryProxyUrlResolver = (previewUrl) => { ... };

At that point config can be null, leading to a runtime error and a broken demo.

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 <uc-config> element and still keep a simple null check.

Also applies to: 17-19

🤖 Prompt for AI Agents
In demo/external-sources/preview-proxy/secure-delivery-proxy-url-resolver.html
around lines 4 to 13 (and similarly lines 17 to 19), the script queries
document.querySelector('uc-config') before the body is parsed which can return
null and cause a runtime error; fix it by ensuring the DOM is ready and guarding
against a missing element: either wrap the wiring code in a DOMContentLoaded
handler (or move the script to after the <uc-config> element) and check that
config is non-null before assigning secureDeliveryProxyUrlResolver, failing
gracefully or logging if absent.

</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>
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<!doctype html>

<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<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';
import '@/solutions/file-uploader/regular/index.css';
import * as UC from '@/index.js';

UC.defineComponents(UC);
UC.defineComponents(UC);
</script>
</head>

Expand All @@ -15,5 +14,8 @@
ctx-name="my-uploader"
pubkey="demopublickey"
secure-delivery-proxy="http://localhost:3000/preview?url={{previewUrl}}"
debug
quality-insights="false"
test-mode
></uc-config>
<uc-upload-ctx-provider ctx-name="my-uploader"></uc-upload-ctx-provider>
48 changes: 48 additions & 0 deletions demo/external-sources/secure-uploads.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!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 msToUnixTimestamp = (ms) => Math.floor(ms / 1000).toString();

const getSecureExpire = (options) => {
if ('expire' in options) {
return msToUnixTimestamp(new Date(options.expire).getTime());
}

return msToUnixTimestamp(Date.now() + options.lifetime);
};

export const generateSecureSignature = async (secret, options) => {
const encoder = new TextEncoder();
const data = encoder.encode(getSecureExpire(options));
const key = await window.crypto.subtle.importKey(
'raw',
encoder.encode(secret),
{ name: 'HMAC', hash: { name: 'SHA-256' } },
false,
['sign'],
);
const signature = await window.crypto.subtle.sign('HMAC', key, data);
const secureSignature = Array.from(new Uint8Array(signature))
.map((byte) => byte.toString(16).padStart(2, '0'))
.join('');
return { secureSignature, secureExpire: getSecureExpire(options) };
};

const config = document.querySelector('uc-config');
config.secureUploadsSignatureResolver = async () => {
const token = await generateSecureSignature('', { lifetime: 60 * 1000 });
console.log('Generating secure signature...', token);
return token;
};
</script>
</head>

<uc-file-uploader-regular ctx-name="my-uploader"></uc-file-uploader-regular>
<uc-config ctx-name="my-uploader" pubkey="" debug quality-insights="false" test-mode></uc-config>
<uc-upload-ctx-provider ctx-name="my-uploader"></uc-upload-ctx-provider>
Loading
Loading