@occluze/umber 0.2.0 → 0.3.0

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.
Files changed (84) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +78 -48
  3. package/dist/chunks/badge.js +2 -0
  4. package/dist/chunks/basis.js +2 -0
  5. package/dist/chunks/basis_transcoder.js +2 -0
  6. package/dist/chunks/basis_transcoder.wasm +0 -0
  7. package/dist/chunks/capture.js +2 -2
  8. package/dist/chunks/covers.js +2 -2
  9. package/dist/chunks/curves.js +2 -0
  10. package/dist/chunks/flip.js +2 -2
  11. package/dist/chunks/fx.js +2 -102
  12. package/dist/chunks/gl.js +2 -180
  13. package/dist/chunks/glsl.js +2 -239
  14. package/dist/chunks/inspect.js +2 -6
  15. package/dist/chunks/instances.js +2 -93
  16. package/dist/chunks/layers.js +2 -21
  17. package/dist/chunks/licence.js +2 -2
  18. package/dist/chunks/morph.js +2 -2
  19. package/dist/chunks/patch.js +2 -0
  20. package/dist/chunks/prepared.js +2 -0
  21. package/dist/chunks/profiler.js +2 -0
  22. package/dist/chunks/restore.js +2 -2
  23. package/dist/chunks/shapes.js +2 -2
  24. package/dist/chunks/sim.js +2 -22
  25. package/dist/chunks/text.js +2 -52
  26. package/dist/chunks/video.js +2 -2
  27. package/dist/chunks/views.js +2 -2
  28. package/dist/chunks/vocabulary.js +2 -0
  29. package/dist/chunks/warm.js +2 -2
  30. package/dist/frameworks/astro.mjs +2 -0
  31. package/dist/frameworks/react.mjs +2 -0
  32. package/dist/frameworks/svelte.mjs +2 -0
  33. package/dist/frameworks/vue.mjs +2 -0
  34. package/dist/modules/debug.js +2 -36
  35. package/dist/modules/debug.mjs +2 -36
  36. package/dist/modules/handoff.js +2 -2
  37. package/dist/modules/handoff.mjs +2 -2
  38. package/dist/modules/input.js +2 -2
  39. package/dist/modules/input.mjs +2 -2
  40. package/dist/modules/router-swap.js +2 -13
  41. package/dist/modules/router.js +2 -2
  42. package/dist/modules/router.mjs +2 -2
  43. package/dist/modules/scroll-more.js +2 -0
  44. package/dist/modules/scroll-touch.js +2 -0
  45. package/dist/modules/scroll.js +2 -2
  46. package/dist/modules/scroll.mjs +2 -2
  47. package/dist/modules/scrollfx.js +2 -0
  48. package/dist/modules/scrollfx.mjs +2 -0
  49. package/dist/modules/scrub.js +2 -8
  50. package/dist/modules/scrub.mjs +2 -8
  51. package/dist/modules/three.js +2 -0
  52. package/dist/modules/three.mjs +2 -0
  53. package/dist/node/assets.mjs +9 -0
  54. package/dist/node/astro.mjs +47 -0
  55. package/dist/node/cli.mjs +109 -0
  56. package/dist/node/shared-3Q24RNIF.mjs +602 -0
  57. package/dist/node/shared-4FIU6DYP.mjs +200 -0
  58. package/dist/node/vite.mjs +10 -0
  59. package/dist/umber.css +2 -2
  60. package/dist/umber.js +2 -2
  61. package/dist/umber.mjs +2 -2
  62. package/docs/AI-quick.md +240 -0
  63. package/docs/AI.md +3130 -0
  64. package/docs/npm.md +37 -26
  65. package/package.json +183 -12
  66. package/types/assets.d.ts +87 -0
  67. package/types/astro.d.ts +43 -0
  68. package/types/debug.d.ts +17 -16
  69. package/types/esm.d.ts +12 -12
  70. package/types/global.d.ts +17 -0
  71. package/types/handoff.d.ts +26 -25
  72. package/types/input.d.ts +63 -55
  73. package/types/loop.d.ts +75 -0
  74. package/types/module.d.ts +108 -0
  75. package/types/react.d.ts +15 -0
  76. package/types/router.d.ts +87 -45
  77. package/types/scroll.d.ts +96 -38
  78. package/types/scrollfx.d.ts +80 -0
  79. package/types/scrub.d.ts +33 -32
  80. package/types/svelte.d.ts +16 -0
  81. package/types/three.d.ts +226 -0
  82. package/types/umber.d.ts +633 -357
  83. package/types/vite.d.ts +33 -0
  84. package/types/vue.d.ts +14 -0
@@ -0,0 +1,33 @@
1
+ /**
2
+ * `@occluze/umber/vite`: prepares the pictures Umber draws after `vite build` (see
3
+ * `@occluze/umber/assets`), and puts Umber's chunks in the built site, so they load from its own
4
+ * origin. `vite dev` is left alone.
5
+ *
6
+ * import umberAssets from "@occluze/umber/vite";
7
+ * export default { plugins: [umberAssets()] };
8
+ */
9
+
10
+ import type { SiteOptions } from "./assets";
11
+
12
+ /**
13
+ * prepareSite()'s options (the folder and base URL come from Vite's config), whether to minify the
14
+ * site's own shaders (true), and whether to put Umber's chunks in the site (true; `false` loads them
15
+ * from umber.occluze.com).
16
+ */
17
+ export type UmberAssetsOptions = Omit<SiteOptions, "dir" | "baseUrl" | "log"> & { shaders?: boolean; chunks?: boolean };
18
+
19
+ /** A Vite plugin (build only). */
20
+ export interface UmberVitePlugin {
21
+ name: string;
22
+ apply: "build";
23
+ }
24
+
25
+ /**
26
+ * The plugins: one prepares the pictures (and fonts) after the build, one minifies the GLSL
27
+ * of the site's effects (their `fragment` and `vertex` parts, and literals marked
28
+ * `/* glsl *\/`) while it bundles, and one writes Umber's chunks into the site
29
+ * (`<assets>/umber@<version>/chunks/`) and points the bundled engine at them, so the built site
30
+ * loads nothing from umber.occluze.com but the licence check. `shaders: false` leaves the second
31
+ * out, `chunks: false` the third. createUmber({ base }) and window.UmberConfig.base still win.
32
+ */
33
+ export default function umberAssets(options?: UmberAssetsOptions): UmberVitePlugin[];
package/types/vue.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Types for @occluze/umber/vue: useScroll(), Lenis's useLenis() for Umber's umber.scroll.
3
+ *
4
+ * import { useScroll } from "@occluze/umber/vue";
5
+ * const scroll = useScroll((s) => (progress.value = s.progress));
6
+ */
7
+
8
+ import type { ScrollApi } from "./scroll.js";
9
+
10
+ /** A ref (Vue's shallowRef) to umber.scroll (null until mounted, or without the scroll module); `callback` hears its "scroll" while mounted. The engine: the one on the page, or `gl`. */
11
+ export declare function useScroll(
12
+ callback?: (scroll: ScrollApi) => void,
13
+ gl?: { readonly scroll?: ScrollApi } | null,
14
+ ): { value: ScrollApi | null };