@snowcone-app/ui 0.10.14 → 0.10.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.15
4
+
5
+ ### Patch Changes
6
+
7
+ - [#5365](https://github.com/snowcone-app/snowcone-monorepo/pull/5365) [`fd949e6`](https://github.com/snowcone-app/snowcone-monorepo/commit/fd949e6cef3687fd676c866c407da5c37534c674) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Smaller first load for pages that show a canvas or a product.
8
+ - canvas: the print-export Web Worker's code (about 1 MB, 227K gzip) now loads with `import()` on the first export
9
+ instead of with the package, so a page that merely shows an editor or a product no longer downloads it up front.
10
+ Exports work as before; only the first one waits for the code.
11
+ - ui: `PersonalizationProvider` calls `canvasImport` only when the product has personalization fields, so a product
12
+ without them never loads the canvas.
13
+
3
14
  ## 0.10.14
4
15
 
5
16
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -16718,9 +16718,10 @@ function PersonalizationProvider({
16718
16718
  const [BridgeComponent, setBridgeComponent] = (0, import_react69.useState)(
16719
16719
  cachedBridgeComponent
16720
16720
  );
16721
+ const hasFields = fields.length > 0;
16721
16722
  (0, import_react69.useEffect)(() => {
16722
16723
  if (CanvasComponent && BridgeComponent) return;
16723
- if (!canvasImport) return;
16724
+ if (!canvasImport || !hasFields) return;
16724
16725
  if (!canvasLoadPromise) {
16725
16726
  canvasLoadPromise = canvasImport().then((mod) => {
16726
16727
  cachedCanvasComponent = mod.SnowconeCanvas || mod.default;
@@ -16735,7 +16736,7 @@ function PersonalizationProvider({
16735
16736
  setBridgeComponent(() => cachedBridgeComponent);
16736
16737
  }
16737
16738
  });
16738
- }, [CanvasComponent, BridgeComponent, canvasImport]);
16739
+ }, [CanvasComponent, BridgeComponent, canvasImport, hasFields]);
16739
16740
  const realtimeEnabledRef = (0, import_react69.useRef)(false);
16740
16741
  (0, import_react69.useEffect)(() => {
16741
16742
  return () => {