use-scroll-animate 9.3.0 → 9.5.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.
- package/CHANGELOG.md +28 -0
- package/dist/components/fx-safe.cjs +155 -0
- package/dist/components/fx-safe.cjs.map +1 -0
- package/dist/components/fx-safe.d.cts +85 -0
- package/dist/components/fx-safe.d.ts +85 -0
- package/dist/components/fx-safe.js +145 -0
- package/dist/components/fx-safe.js.map +1 -0
- package/dist/components/fx-video.cjs +111 -0
- package/dist/components/fx-video.cjs.map +1 -0
- package/dist/components/fx-video.d.cts +80 -0
- package/dist/components/fx-video.d.ts +80 -0
- package/dist/components/fx-video.js +105 -0
- package/dist/components/fx-video.js.map +1 -0
- package/dist/components/fx2.cjs +20 -0
- package/dist/components/fx2.cjs.map +1 -1
- package/dist/components/fx2.d.cts +76 -1
- package/dist/components/fx2.d.ts +76 -1
- package/dist/components/fx2.js +9 -1
- package/dist/components/fx2.js.map +1 -1
- package/dist/components/marketplace.cjs +2 -0
- package/dist/components/marketplace.cjs.map +1 -1
- package/dist/components/marketplace.js +2 -0
- package/dist/components/marketplace.js.map +1 -1
- package/dist/components/widgets.cjs +483 -181
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +94 -2
- package/dist/components/widgets.d.ts +94 -2
- package/dist/components/widgets.js +480 -182
- package/dist/components/widgets.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +2 -2
- package/docs/components.md +35 -0
- package/package.json +42 -2
package/dist/components/fx2.d.ts
CHANGED
|
@@ -872,6 +872,81 @@ declare const GENART_FX: EffectDefinition[];
|
|
|
872
872
|
/** Register halftone-in, mesh-drift, kaleido and grain-flicker (9.3). */
|
|
873
873
|
declare function registerGenArtPack(): void;
|
|
874
874
|
|
|
875
|
+
/**
|
|
876
|
+
* 9.4 — Video motion (`motionary/fx/video`, also `motionary/components/fx-video`):
|
|
877
|
+
*
|
|
878
|
+
* - `scrubVideo(video, trigger?)` — scroll-driven video: `currentTime`
|
|
879
|
+
* follows the scroll progress of `trigger` (default the video) through the
|
|
880
|
+
* viewport, eased. Returns a stop function.
|
|
881
|
+
* - `frameSequence(canvas, { count, src | draw }, trigger?)` — an Apple-style
|
|
882
|
+
* image sequence scrubbed by scroll: frame `i` is the image `src(i)`
|
|
883
|
+
* (preloaded) or whatever `draw(ctx, i, w, h)` paints. Returns a stop.
|
|
884
|
+
* - `scrollProgress(el)` — 0 when `el` enters at the bottom, 1 when it leaves
|
|
885
|
+
* at the top.
|
|
886
|
+
*
|
|
887
|
+
* Effects: `film-burn` (enter) — a warm light leak burns across as the
|
|
888
|
+
* element appears; `jump-cut` (attention) — two hard cuts (zoom / reframe)
|
|
889
|
+
* and back, like an edit. Reduced motion: scrubbing shows the first frame,
|
|
890
|
+
* film-burn fades, jump-cut does nothing.
|
|
891
|
+
*/
|
|
892
|
+
|
|
893
|
+
/** Scroll progress of `el` through the viewport: 0 entering at the bottom → 1 leaving at the top (9.4). */
|
|
894
|
+
declare function scrollProgress(el: Element): number;
|
|
895
|
+
/** Scroll-driven video: `video.currentTime` follows the scroll progress of `trigger` (9.4). */
|
|
896
|
+
declare function scrubVideo(video: HTMLVideoElement, trigger?: Element, opts?: {
|
|
897
|
+
ease?: number;
|
|
898
|
+
}): () => void;
|
|
899
|
+
interface FrameSequenceSource {
|
|
900
|
+
count: number;
|
|
901
|
+
src?: (i: number) => string;
|
|
902
|
+
draw?: (ctx: CanvasRenderingContext2D, i: number, w: number, h: number) => void;
|
|
903
|
+
}
|
|
904
|
+
/** Image-sequence scrubbing on a canvas (preloads `src(i)`, or paints with `draw`) (9.4). */
|
|
905
|
+
declare function frameSequence(canvas: HTMLCanvasElement, seq: FrameSequenceSource, trigger?: Element): () => void;
|
|
906
|
+
declare const VIDEO_FX: EffectDefinition[];
|
|
907
|
+
/** Register film-burn and jump-cut (9.4). */
|
|
908
|
+
declare function registerVideoPack(): void;
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* 9.5 — Accessible motion 2.0 (`motionary/fx/safe`, also `motionary/components/fx-safe`):
|
|
912
|
+
*
|
|
913
|
+
* - `vestibularSafe(keyframes)` — strips movement (translate / scale /
|
|
914
|
+
* rotate / skew / perspective, clip and blur) from keyframes, keeping
|
|
915
|
+
* opacity and colour, so any animation can get a vestibular-safe twin.
|
|
916
|
+
* - `flashCount(keyframes, duration)` / `isFlashSafe(...)` — counts large
|
|
917
|
+
* opacity / brightness swings and checks WCAG 2.3.1's three-flashes-per-
|
|
918
|
+
* second limit.
|
|
919
|
+
* - `applyMotionPreferences(prefs)` / `loadMotionPreferences()` — the
|
|
920
|
+
* settings behind `<usa-motion-prefs>`: sensitivity level, speed (shared
|
|
921
|
+
* clock rate), pause autoplay, no parallax; persisted in localStorage and
|
|
922
|
+
* exposed as `data-usa-*` attributes on `<html>` for your CSS.
|
|
923
|
+
*
|
|
924
|
+
* Effects that never move anything: `safe-fade` (enter), `focus-glow`
|
|
925
|
+
* (attention), `color-pulse` (attention), `underline-sweep` (hover).
|
|
926
|
+
*/
|
|
927
|
+
|
|
928
|
+
/** Keyframes with all movement removed (opacity / colour / shadow kept; blur removed from filters) (9.5). */
|
|
929
|
+
declare function vestibularSafe(frames: Keyframe[]): Keyframe[];
|
|
930
|
+
/** Number of flashes (a ≥ 0.3 luminance swing that comes back) in one run of `frames` (9.5). */
|
|
931
|
+
declare function flashCount(frames: Keyframe[]): number;
|
|
932
|
+
/** WCAG 2.3.1: no more than three flashes in any one second (9.5). */
|
|
933
|
+
declare function isFlashSafe(frames: Keyframe[], duration: number, iterations?: number): boolean;
|
|
934
|
+
interface MotionPreferences {
|
|
935
|
+
sensitivity: MotionSensitivity;
|
|
936
|
+
speed: number;
|
|
937
|
+
pauseAutoplay: boolean;
|
|
938
|
+
noParallax: boolean;
|
|
939
|
+
}
|
|
940
|
+
declare const MOTION_PREFS_KEY = "usa-motion-prefs";
|
|
941
|
+
declare const DEFAULT_MOTION_PREFS: MotionPreferences;
|
|
942
|
+
/** Apply (and persist) motion preferences: sensitivity, shared clock speed, `data-usa-*` flags on `<html>` (9.5). */
|
|
943
|
+
declare function applyMotionPreferences(p: Partial<MotionPreferences>, persist?: boolean): MotionPreferences;
|
|
944
|
+
/** Saved preferences (or the defaults) (9.5). */
|
|
945
|
+
declare function loadMotionPreferences(): MotionPreferences;
|
|
946
|
+
declare const SAFE_FX: EffectDefinition[];
|
|
947
|
+
/** Register safe-fade, focus-glow, color-pulse and underline-sweep (9.5). */
|
|
948
|
+
declare function registerSafePack(): void;
|
|
949
|
+
|
|
875
950
|
/**
|
|
876
951
|
* 5.5 — generative backgrounds on Canvas 2D, registered through
|
|
877
952
|
* `registerEffect()` (kind `background`): `flow-field`, `voronoi`,
|
|
@@ -981,5 +1056,5 @@ declare const EFFECT_PACKS: Record<string, EffectDefinition[]>;
|
|
|
981
1056
|
/** Register every 6.x effect pack (idempotent). */
|
|
982
1057
|
declare function registerEffectPacks(): void;
|
|
983
1058
|
|
|
984
|
-
export { AI_FX, CAMERA_MOVES, CHART_FX, CINEMA_FX, CYBER_FX, DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FESTIVAL_FX, FOCUS_FX, FORM_FX, GAME_FX, GENART_FX, GEO_FX, GESTURE3_FX, GLSL_HEAD, GPU_FX, LIGHT_FX, LOTTIE_FX, MORPH2_FX, MUSIC_FX, ORGANIC_FX, PALETTES, PAPER_FX, PHYSICS2_FX, RETRO_FX, SHOP_FX, SOCIAL_FX, SPATIAL_FX, SURFACE_FX, SURFACE_THEMES, TEXT3_FX, TRANSITIONS2_FX, VerletWorld, WEATHER_FX, WGSL_HEAD, applySurfaceTheme, arcPath, blobRadius, cameraFrame, crossDocumentTransitions, decodeFrame, fanAngles, fieldFallback, glslToWgsl, loadEffectPack, lottieToKeyframes, lottieToSvg, meshGradient, musicSample, orientationToTilt, packManifest, pageTransition, paperRandom, parseFigure, pinchAngle, pinchScale, pixelSteps, pointsToPath, register3dPack, registerAiPack, registerChartPack, registerCinemaPack, registerCyberPack, registerEffectPacks, registerFestivalPack, registerFocusPack, registerFormPack, registerGamePack, registerGenArtPack, registerGeoPack, registerGesture3Pack, registerGpuPack, registerLightPack, registerLottiePack, registerMorphPack, registerMusicPack, registerOrganicPack, registerPaperPack, registerPhysicsPack, registerRetroPack, registerShopPack, registerSocialPack, registerSpatialPack, registerSurfacePack, registerTextPack, registerTransitionsPack, registerWeatherPack, riveInputs, roughLine, routeLength, samplePath, seededRandom, shaderBackground, shakeFrames, skyAt, sparkVectors, splitChars, splitWords, supportsWebGL2, supportsWebGPU, syntheticSample, throwPath, trackPointer, validateManifest, webgpuBackground, wgslModule, xrSupport, yawToOffset };
|
|
1059
|
+
export { AI_FX, CAMERA_MOVES, CHART_FX, CINEMA_FX, CYBER_FX, DEFAULT_MOTION_PREFS, DEPTH3_FX, EFFECT_PACKS, EFFECT_PACK_FORMAT, FESTIVAL_FX, FOCUS_FX, FORM_FX, GAME_FX, GENART_FX, GEO_FX, GESTURE3_FX, GLSL_HEAD, GPU_FX, LIGHT_FX, LOTTIE_FX, MORPH2_FX, MOTION_PREFS_KEY, MUSIC_FX, ORGANIC_FX, PALETTES, PAPER_FX, PHYSICS2_FX, RETRO_FX, SAFE_FX, SHOP_FX, SOCIAL_FX, SPATIAL_FX, SURFACE_FX, SURFACE_THEMES, TEXT3_FX, TRANSITIONS2_FX, VIDEO_FX, VerletWorld, WEATHER_FX, WGSL_HEAD, applyMotionPreferences, applySurfaceTheme, arcPath, blobRadius, cameraFrame, crossDocumentTransitions, decodeFrame, fanAngles, fieldFallback, flashCount, frameSequence, glslToWgsl, isFlashSafe, loadEffectPack, loadMotionPreferences, lottieToKeyframes, lottieToSvg, meshGradient, musicSample, orientationToTilt, packManifest, pageTransition, paperRandom, parseFigure, pinchAngle, pinchScale, pixelSteps, pointsToPath, register3dPack, registerAiPack, registerChartPack, registerCinemaPack, registerCyberPack, registerEffectPacks, registerFestivalPack, registerFocusPack, registerFormPack, registerGamePack, registerGenArtPack, registerGeoPack, registerGesture3Pack, registerGpuPack, registerLightPack, registerLottiePack, registerMorphPack, registerMusicPack, registerOrganicPack, registerPaperPack, registerPhysicsPack, registerRetroPack, registerSafePack, registerShopPack, registerSocialPack, registerSpatialPack, registerSurfacePack, registerTextPack, registerTransitionsPack, registerVideoPack, registerWeatherPack, riveInputs, roughLine, routeLength, samplePath, scrollProgress, scrubVideo, seededRandom, shaderBackground, shakeFrames, skyAt, sparkVectors, splitChars, splitWords, supportsWebGL2, supportsWebGPU, syntheticSample, throwPath, trackPointer, validateManifest, vestibularSafe, webgpuBackground, wgslModule, xrSupport, yawToOffset };
|
|
985
1060
|
export type { EffectPackManifest, ShaderSpec };
|
package/dist/components/fx2.js
CHANGED
|
@@ -53,6 +53,10 @@ import { LOTTIE_FX, registerLottiePack } from './fx-lottie.js';
|
|
|
53
53
|
export { lottieToKeyframes, lottieToSvg, riveInputs } from './fx-lottie.js';
|
|
54
54
|
import { GENART_FX, registerGenArtPack } from './fx-genart.js';
|
|
55
55
|
export { PALETTES, meshGradient, seededRandom } from './fx-genart.js';
|
|
56
|
+
import { VIDEO_FX, registerVideoPack } from './fx-video.js';
|
|
57
|
+
export { frameSequence, scrollProgress, scrubVideo } from './fx-video.js';
|
|
58
|
+
import { SAFE_FX, registerSafePack } from './fx-safe.js';
|
|
59
|
+
export { DEFAULT_MOTION_PREFS, MOTION_PREFS_KEY, applyMotionPreferences, flashCount, isFlashSafe, loadMotionPreferences, vestibularSafe } from './fx-safe.js';
|
|
56
60
|
import '../chunks/registry-CnO7ZVPK.js';
|
|
57
61
|
import '../chunks/base-CLuqlLfG.js';
|
|
58
62
|
import '../chunks/generative-2LhxG5BJ.js';
|
|
@@ -89,6 +93,8 @@ const EFFECT_PACKS = {
|
|
|
89
93
|
cinema: CINEMA_FX,
|
|
90
94
|
lottie: LOTTIE_FX,
|
|
91
95
|
genart: GENART_FX,
|
|
96
|
+
video: VIDEO_FX,
|
|
97
|
+
safe: SAFE_FX,
|
|
92
98
|
};
|
|
93
99
|
/** Register every 6.x effect pack (idempotent). */
|
|
94
100
|
function registerEffectPacks() {
|
|
@@ -120,7 +126,9 @@ function registerEffectPacks() {
|
|
|
120
126
|
registerCinemaPack();
|
|
121
127
|
registerLottiePack();
|
|
122
128
|
registerGenArtPack();
|
|
129
|
+
registerVideoPack();
|
|
130
|
+
registerSafePack();
|
|
123
131
|
}
|
|
124
132
|
|
|
125
|
-
export { AI_FX, CHART_FX, CINEMA_FX, CYBER_FX, DEPTH3_FX, EFFECT_PACKS, FESTIVAL_FX, FOCUS_FX, FORM_FX, GAME_FX, GENART_FX, GEO_FX, GESTURE3_FX, GPU_FX, LIGHT_FX, LOTTIE_FX, MORPH2_FX, MUSIC_FX, ORGANIC_FX, PAPER_FX, PHYSICS2_FX, RETRO_FX, SHOP_FX, SOCIAL_FX, SPATIAL_FX, SURFACE_FX, TEXT3_FX, TRANSITIONS2_FX, WEATHER_FX, register3dPack, registerAiPack, registerChartPack, registerCinemaPack, registerCyberPack, registerEffectPacks, registerFestivalPack, registerFocusPack, registerFormPack, registerGamePack, registerGenArtPack, registerGeoPack, registerGesture3Pack, registerGpuPack, registerLightPack, registerLottiePack, registerMorphPack, registerMusicPack, registerOrganicPack, registerPaperPack, registerPhysicsPack, registerRetroPack, registerShopPack, registerSocialPack, registerSpatialPack, registerSurfacePack, registerTextPack, registerTransitionsPack, registerWeatherPack };
|
|
133
|
+
export { AI_FX, CHART_FX, CINEMA_FX, CYBER_FX, DEPTH3_FX, EFFECT_PACKS, FESTIVAL_FX, FOCUS_FX, FORM_FX, GAME_FX, GENART_FX, GEO_FX, GESTURE3_FX, GPU_FX, LIGHT_FX, LOTTIE_FX, MORPH2_FX, MUSIC_FX, ORGANIC_FX, PAPER_FX, PHYSICS2_FX, RETRO_FX, SAFE_FX, SHOP_FX, SOCIAL_FX, SPATIAL_FX, SURFACE_FX, TEXT3_FX, TRANSITIONS2_FX, VIDEO_FX, WEATHER_FX, register3dPack, registerAiPack, registerChartPack, registerCinemaPack, registerCyberPack, registerEffectPacks, registerFestivalPack, registerFocusPack, registerFormPack, registerGamePack, registerGenArtPack, registerGeoPack, registerGesture3Pack, registerGpuPack, registerLightPack, registerLottiePack, registerMorphPack, registerMusicPack, registerOrganicPack, registerPaperPack, registerPhysicsPack, registerRetroPack, registerSafePack, registerShopPack, registerSocialPack, registerSpatialPack, registerSurfacePack, registerTextPack, registerTransitionsPack, registerVideoPack, registerWeatherPack };
|
|
126
134
|
//# sourceMappingURL=fx2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fx2.js","sources":["../../src/components/fx2/index.ts"],"sourcesContent":["/**\n * The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so\n * their size budgets stay separate. This module (`registerFx2()`) registers\n * them all — used by dist/widgets.umd.js and the showcase.\n */\nimport type { EffectDefinition } from '../fx/registry';\nexport { EFFECT_PACK_FORMAT, packManifest, validateManifest, loadEffectPack } from './manifest';\nexport type { EffectPackManifest } from './manifest';\nimport { GPU_FX, registerGpuPack } from './gpu';\nimport { TEXT3_FX, registerTextPack, splitChars } from './text3';\nimport { LIGHT_FX, registerLightPack, trackPointer } from './light';\nimport { DEPTH3_FX, register3dPack } from './depth3';\nimport { MORPH2_FX, registerMorphPack, samplePath, pointsToPath } from './morph2';\nimport { TRANSITIONS2_FX, registerTransitionsPack, pageTransition, crossDocumentTransitions } from './transitions2';\nimport { WEATHER_FX, registerWeatherPack, skyAt } from './weather';\nimport { PHYSICS2_FX, registerPhysicsPack, VerletWorld } from './physics2';\nimport { FOCUS_FX, registerFocusPack } from './focus';\nimport { MUSIC_FX, registerMusicPack, syntheticSample, musicSample } from './music';\nimport { CHART_FX, registerChartPack, parseFigure } from './chart';\nimport { SHOP_FX, registerShopPack, arcPath } from './shop';\nimport { SOCIAL_FX, registerSocialPack, fanAngles } from './social';\nimport { GAME_FX, registerGamePack, throwPath } from './game';\nimport { GEO_FX, registerGeoPack, routeLength } from './geo';\nimport { FORM_FX, registerFormPack, shakeFrames } from './form';\nimport { AI_FX, registerAiPack, splitWords } from './ai';\nimport { FESTIVAL_FX, registerFestivalPack, sparkVectors } from './festival';\nimport { RETRO_FX, registerRetroPack, pixelSteps } from './retro2';\nimport { ORGANIC_FX, registerOrganicPack, blobRadius } from './organic';\nimport { CYBER_FX, registerCyberPack, decodeFrame } from './cyber';\nimport { PAPER_FX, registerPaperPack, roughLine, paperRandom } from './paper';\nimport { SURFACE_FX, registerSurfacePack, SURFACE_THEMES, applySurfaceTheme } from './themefx';\nimport { GESTURE3_FX, registerGesture3Pack, pinchScale, pinchAngle, orientationToTilt } from './gesture3';\nimport { SPATIAL_FX, registerSpatialPack, yawToOffset, xrSupport } from './spatial';\nimport { CINEMA_FX, registerCinemaPack, cameraFrame, CAMERA_MOVES } from './cinema';\nimport { LOTTIE_FX, registerLottiePack, lottieToKeyframes, lottieToSvg, riveInputs } from './lottie';\nimport { GENART_FX, registerGenArtPack, PALETTES, seededRandom, meshGradient } from './genart';\n\nexport { GPU_FX, registerGpuPack, TEXT3_FX, registerTextPack, splitChars };\nexport { shaderBackground, supportsWebGL2, fieldFallback, GLSL_HEAD } from './gl';\nexport { supportsWebGPU, glslToWgsl, wgslModule, webgpuBackground, WGSL_HEAD } from './webgpu';\nexport type { ShaderSpec } from './gl';\n\nexport { LIGHT_FX, registerLightPack, trackPointer };\n\nexport { DEPTH3_FX, register3dPack };\n\nexport { MORPH2_FX, registerMorphPack, samplePath, pointsToPath };\n\nexport { TRANSITIONS2_FX, registerTransitionsPack, pageTransition, crossDocumentTransitions };\n\nexport { WEATHER_FX, registerWeatherPack, skyAt };\n\nexport { PHYSICS2_FX, registerPhysicsPack, VerletWorld };\n\nexport { FOCUS_FX, registerFocusPack };\n\nexport { MUSIC_FX, registerMusicPack, syntheticSample, musicSample };\n\nexport { CHART_FX, registerChartPack, parseFigure };\n\nexport { SHOP_FX, registerShopPack, arcPath };\n\nexport { SOCIAL_FX, registerSocialPack, fanAngles };\n\nexport { GAME_FX, registerGamePack, throwPath };\n\nexport { GEO_FX, registerGeoPack, routeLength };\n\nexport { FORM_FX, registerFormPack, shakeFrames };\n\nexport { AI_FX, registerAiPack, splitWords };\n\nexport { FESTIVAL_FX, registerFestivalPack, sparkVectors };\n\nexport { RETRO_FX, registerRetroPack, pixelSteps };\n\nexport { ORGANIC_FX, registerOrganicPack, blobRadius };\n\nexport { CYBER_FX, registerCyberPack, decodeFrame };\n\nexport { PAPER_FX, registerPaperPack, roughLine, paperRandom };\n\nexport { SURFACE_FX, registerSurfacePack, SURFACE_THEMES, applySurfaceTheme };\n\nexport { GESTURE3_FX, registerGesture3Pack, pinchScale, pinchAngle, orientationToTilt };\n\nexport { SPATIAL_FX, registerSpatialPack, yawToOffset, xrSupport };\n\nexport { CINEMA_FX, registerCinemaPack, cameraFrame, CAMERA_MOVES };\n\nexport { LOTTIE_FX, registerLottiePack, lottieToKeyframes, lottieToSvg, riveInputs };\n\nexport { GENART_FX, registerGenArtPack, PALETTES, seededRandom, meshGradient };\n\n/** The 6.x effect packs by name. */\nexport const EFFECT_PACKS: Record<string, EffectDefinition[]> = {\n gpu: GPU_FX,\n text: TEXT3_FX,\n light: LIGHT_FX,\n depth: DEPTH3_FX,\n morph: MORPH2_FX,\n transitions: TRANSITIONS2_FX,\n weather: WEATHER_FX,\n physics: PHYSICS2_FX,\n focus: FOCUS_FX,\n music: MUSIC_FX,\n chart: CHART_FX,\n shop: SHOP_FX,\n social: SOCIAL_FX,\n game: GAME_FX,\n geo: GEO_FX,\n form: FORM_FX,\n ai: AI_FX,\n festival: FESTIVAL_FX,\n retro: RETRO_FX,\n organic: ORGANIC_FX,\n cyber: CYBER_FX,\n paper: PAPER_FX,\n surface: SURFACE_FX,\n gesture3: GESTURE3_FX,\n spatial: SPATIAL_FX,\n cinema: CINEMA_FX,\n lottie: LOTTIE_FX,\n genart: GENART_FX,\n};\n\n/** Register every 6.x effect pack (idempotent). */\nexport function registerEffectPacks(): void {\n registerGpuPack();\n registerTextPack();\n registerLightPack();\n register3dPack();\n registerMorphPack();\n registerTransitionsPack();\n registerWeatherPack();\n registerPhysicsPack();\n registerFocusPack();\n registerMusicPack();\n registerChartPack();\n registerShopPack();\n registerSocialPack();\n registerGamePack();\n registerGeoPack();\n registerFormPack();\n registerAiPack();\n registerFestivalPack();\n registerRetroPack();\n registerOrganicPack();\n registerCyberPack();\n registerPaperPack();\n registerSurfacePack();\n registerGesture3Pack();\n registerSpatialPack();\n registerCinemaPack();\n registerLottiePack();\n registerGenArtPack();\n}\n\n\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fx2.js","sources":["../../src/components/fx2/index.ts"],"sourcesContent":["/**\n * The 6.x effect packs, one entry each (`motionary/components/fx-gpu`, …) so\n * their size budgets stay separate. This module (`registerFx2()`) registers\n * them all — used by dist/widgets.umd.js and the showcase.\n */\nimport type { EffectDefinition } from '../fx/registry';\nexport { EFFECT_PACK_FORMAT, packManifest, validateManifest, loadEffectPack } from './manifest';\nexport type { EffectPackManifest } from './manifest';\nimport { GPU_FX, registerGpuPack } from './gpu';\nimport { TEXT3_FX, registerTextPack, splitChars } from './text3';\nimport { LIGHT_FX, registerLightPack, trackPointer } from './light';\nimport { DEPTH3_FX, register3dPack } from './depth3';\nimport { MORPH2_FX, registerMorphPack, samplePath, pointsToPath } from './morph2';\nimport { TRANSITIONS2_FX, registerTransitionsPack, pageTransition, crossDocumentTransitions } from './transitions2';\nimport { WEATHER_FX, registerWeatherPack, skyAt } from './weather';\nimport { PHYSICS2_FX, registerPhysicsPack, VerletWorld } from './physics2';\nimport { FOCUS_FX, registerFocusPack } from './focus';\nimport { MUSIC_FX, registerMusicPack, syntheticSample, musicSample } from './music';\nimport { CHART_FX, registerChartPack, parseFigure } from './chart';\nimport { SHOP_FX, registerShopPack, arcPath } from './shop';\nimport { SOCIAL_FX, registerSocialPack, fanAngles } from './social';\nimport { GAME_FX, registerGamePack, throwPath } from './game';\nimport { GEO_FX, registerGeoPack, routeLength } from './geo';\nimport { FORM_FX, registerFormPack, shakeFrames } from './form';\nimport { AI_FX, registerAiPack, splitWords } from './ai';\nimport { FESTIVAL_FX, registerFestivalPack, sparkVectors } from './festival';\nimport { RETRO_FX, registerRetroPack, pixelSteps } from './retro2';\nimport { ORGANIC_FX, registerOrganicPack, blobRadius } from './organic';\nimport { CYBER_FX, registerCyberPack, decodeFrame } from './cyber';\nimport { PAPER_FX, registerPaperPack, roughLine, paperRandom } from './paper';\nimport { SURFACE_FX, registerSurfacePack, SURFACE_THEMES, applySurfaceTheme } from './themefx';\nimport { GESTURE3_FX, registerGesture3Pack, pinchScale, pinchAngle, orientationToTilt } from './gesture3';\nimport { SPATIAL_FX, registerSpatialPack, yawToOffset, xrSupport } from './spatial';\nimport { CINEMA_FX, registerCinemaPack, cameraFrame, CAMERA_MOVES } from './cinema';\nimport { LOTTIE_FX, registerLottiePack, lottieToKeyframes, lottieToSvg, riveInputs } from './lottie';\nimport { GENART_FX, registerGenArtPack, PALETTES, seededRandom, meshGradient } from './genart';\nimport { VIDEO_FX, registerVideoPack, scrollProgress, scrubVideo, frameSequence } from './video';\nimport { SAFE_FX, registerSafePack, vestibularSafe, flashCount, isFlashSafe, applyMotionPreferences, loadMotionPreferences, MOTION_PREFS_KEY, DEFAULT_MOTION_PREFS } from './safemotion';\n\nexport { GPU_FX, registerGpuPack, TEXT3_FX, registerTextPack, splitChars };\nexport { shaderBackground, supportsWebGL2, fieldFallback, GLSL_HEAD } from './gl';\nexport { supportsWebGPU, glslToWgsl, wgslModule, webgpuBackground, WGSL_HEAD } from './webgpu';\nexport type { ShaderSpec } from './gl';\n\nexport { LIGHT_FX, registerLightPack, trackPointer };\n\nexport { DEPTH3_FX, register3dPack };\n\nexport { MORPH2_FX, registerMorphPack, samplePath, pointsToPath };\n\nexport { TRANSITIONS2_FX, registerTransitionsPack, pageTransition, crossDocumentTransitions };\n\nexport { WEATHER_FX, registerWeatherPack, skyAt };\n\nexport { PHYSICS2_FX, registerPhysicsPack, VerletWorld };\n\nexport { FOCUS_FX, registerFocusPack };\n\nexport { MUSIC_FX, registerMusicPack, syntheticSample, musicSample };\n\nexport { CHART_FX, registerChartPack, parseFigure };\n\nexport { SHOP_FX, registerShopPack, arcPath };\n\nexport { SOCIAL_FX, registerSocialPack, fanAngles };\n\nexport { GAME_FX, registerGamePack, throwPath };\n\nexport { GEO_FX, registerGeoPack, routeLength };\n\nexport { FORM_FX, registerFormPack, shakeFrames };\n\nexport { AI_FX, registerAiPack, splitWords };\n\nexport { FESTIVAL_FX, registerFestivalPack, sparkVectors };\n\nexport { RETRO_FX, registerRetroPack, pixelSteps };\n\nexport { ORGANIC_FX, registerOrganicPack, blobRadius };\n\nexport { CYBER_FX, registerCyberPack, decodeFrame };\n\nexport { PAPER_FX, registerPaperPack, roughLine, paperRandom };\n\nexport { SURFACE_FX, registerSurfacePack, SURFACE_THEMES, applySurfaceTheme };\n\nexport { GESTURE3_FX, registerGesture3Pack, pinchScale, pinchAngle, orientationToTilt };\n\nexport { SPATIAL_FX, registerSpatialPack, yawToOffset, xrSupport };\n\nexport { CINEMA_FX, registerCinemaPack, cameraFrame, CAMERA_MOVES };\n\nexport { LOTTIE_FX, registerLottiePack, lottieToKeyframes, lottieToSvg, riveInputs };\n\nexport { GENART_FX, registerGenArtPack, PALETTES, seededRandom, meshGradient };\n\nexport { VIDEO_FX, registerVideoPack, scrollProgress, scrubVideo, frameSequence };\n\nexport { SAFE_FX, registerSafePack, vestibularSafe, flashCount, isFlashSafe, applyMotionPreferences, loadMotionPreferences, MOTION_PREFS_KEY, DEFAULT_MOTION_PREFS };\n\n/** The 6.x effect packs by name. */\nexport const EFFECT_PACKS: Record<string, EffectDefinition[]> = {\n gpu: GPU_FX,\n text: TEXT3_FX,\n light: LIGHT_FX,\n depth: DEPTH3_FX,\n morph: MORPH2_FX,\n transitions: TRANSITIONS2_FX,\n weather: WEATHER_FX,\n physics: PHYSICS2_FX,\n focus: FOCUS_FX,\n music: MUSIC_FX,\n chart: CHART_FX,\n shop: SHOP_FX,\n social: SOCIAL_FX,\n game: GAME_FX,\n geo: GEO_FX,\n form: FORM_FX,\n ai: AI_FX,\n festival: FESTIVAL_FX,\n retro: RETRO_FX,\n organic: ORGANIC_FX,\n cyber: CYBER_FX,\n paper: PAPER_FX,\n surface: SURFACE_FX,\n gesture3: GESTURE3_FX,\n spatial: SPATIAL_FX,\n cinema: CINEMA_FX,\n lottie: LOTTIE_FX,\n genart: GENART_FX,\n video: VIDEO_FX,\n safe: SAFE_FX,\n};\n\n/** Register every 6.x effect pack (idempotent). */\nexport function registerEffectPacks(): void {\n registerGpuPack();\n registerTextPack();\n registerLightPack();\n register3dPack();\n registerMorphPack();\n registerTransitionsPack();\n registerWeatherPack();\n registerPhysicsPack();\n registerFocusPack();\n registerMusicPack();\n registerChartPack();\n registerShopPack();\n registerSocialPack();\n registerGamePack();\n registerGeoPack();\n registerFormPack();\n registerAiPack();\n registerFestivalPack();\n registerRetroPack();\n registerOrganicPack();\n registerCyberPack();\n registerPaperPack();\n registerSurfacePack();\n registerGesture3Pack();\n registerSpatialPack();\n registerCinemaPack();\n registerLottiePack();\n registerGenArtPack();\n registerVideoPack();\n registerSafePack();\n}\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoGA;AACO,MAAM,YAAY,GAAuC;AAC9D,IAAA,GAAG,EAAE,MAAM;AACX,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,WAAW,EAAE,eAAe;AAC5B,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,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,EAAE;AACtB,IAAA,mBAAmB,EAAE;AACrB,IAAA,kBAAkB,EAAE;AACpB,IAAA,kBAAkB,EAAE;AACpB,IAAA,kBAAkB,EAAE;AACpB,IAAA,iBAAiB,EAAE;AACnB,IAAA,gBAAgB,EAAE;AACpB;;;;"}
|
|
@@ -19,6 +19,8 @@ const MARKETPLACE = [
|
|
|
19
19
|
L('motionary/fx/cinema', 'Cinematic', 'Dolly-in, pan reveal, letterbox and rack focus.', 'motionary/fx/cinema', 'registerCinemaPack', 'dolly-in pan-reveal letterbox rack-focus', 'film camera story', '9.1'),
|
|
20
20
|
L('motionary/fx/lottie', 'Lottie & Rive', 'Lottie import (keyframes + SVG), Rive state-machine inputs, icon pop.', 'motionary/fx/lottie', 'registerLottiePack', 'lottie-play icon-pop', 'lottie rive after-effects icons', '9.2'),
|
|
21
21
|
L('motionary/fx/genart', 'Generative art 2.0', 'Halftone print-in, drifting mesh gradients, kaleidoscope and film grain.', 'motionary/fx/genart', 'registerGenArtPack', 'halftone-in mesh-drift kaleido grain-flicker', 'generative gradient grain art', '9.3'),
|
|
22
|
+
L('motionary/fx/video', 'Video motion', 'Scroll-driven video and frame sequences, film burn, jump cut.', 'motionary/fx/video', 'registerVideoPack', 'film-burn jump-cut', 'video scroll film', '9.4'),
|
|
23
|
+
L('motionary/fx/safe', 'Accessible motion 2.0', 'Motion that never moves: safe fade, focus glow, colour pulse, underline sweep.', 'motionary/fx/safe', 'registerSafePack', 'safe-fade focus-glow color-pulse underline-sweep', 'a11y accessibility vestibular reduced-motion', '9.5'),
|
|
22
24
|
];
|
|
23
25
|
/** Ranked search over listings (name / title / tags / effects / description) (9.0). */
|
|
24
26
|
function searchPlugins(query, list = MARKETPLACE) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketplace.cjs","sources":["../../src/components/marketplace/index.ts"],"sourcesContent":["/**\n * `motionary/marketplace` (= `motionary/components/marketplace`, 9.0 GA) —\n * the plugin marketplace. Builds on the 6.9 effect-pack manifest\n * (`packManifest`, `validateManifest`, `loadEffectPack`) with:\n *\n * - **`MARKETPLACE`** — the first-party catalogue: every Motionary effect\n * pack as a marketplace listing (name, entry, effects, tags, since).\n * - **`searchPlugins(query, list?)`** — ranked search over names,\n * descriptions, tags and effect names.\n * - **`installPlugin(listing | url, { load })`** — imports a pack (your\n * `load` can map entries to bundler imports), validates it and registers\n * its effects; remembered by `installedPlugins()`.\n * - **`fetchMarketplace(url)`** — read a third-party index\n * (`{ \"format\": \"motionary/marketplace\", \"version\": 1, \"plugins\": [...] }`).\n */\nimport type { EffectDefinition } from '../fx/registry';\nimport { loadEffectPack } from '../fx2/manifest';\n\nexport { EFFECT_PACK_FORMAT, packManifest, validateManifest, loadEffectPack } from '../fx2/manifest';\nexport type { EffectPackManifest } from '../fx2/manifest';\n\nexport const MARKETPLACE_FORMAT = 'motionary/marketplace';\nexport interface PluginListing {\n name: string;\n title: string;\n description: string;\n entry: string;\n register: string;\n effects: string[];\n tags: string[];\n since: string;\n author?: string;\n official?: boolean;\n}\n\nconst L = (name: string, title: string, description: string, entry: string, register: string, effects: string, tags: string, since: string): PluginListing => ({ name, title, description, entry, register, effects: effects.split(' '), tags: tags.split(' '), since, author: 'Motionary', official: true });\n\n/** The first-party catalogue (9.0). */\nexport const MARKETPLACE: PluginListing[] = [\n L('motionary/fx/festival', 'Festival', 'Fireworks, lanterns, Christmas snow and spooky floats.', 'motionary/fx/festival', 'registerFestivalPack', 'firework-burst lantern-rise xmas-snow spooky-float', 'holiday celebration seasonal', '8.1'),\n L('motionary/fx/retro', 'Retro', 'Pixel, CRT, VHS and Y2K looks.', 'motionary/fx/retro', 'registerRetroPack', 'pixelate-in crt-power vhs-glitch y2k-shine', 'pixel 8-bit vintage', '8.2'),\n L('motionary/fx/organic', 'Organic', 'Vines, blooms, water drops and breathing blobs.', 'motionary/fx/organic', 'registerOrganicPack', 'vine-grow bloom water-drop breathe', 'nature blob liquid', '8.3'),\n L('motionary/fx/cyber', 'Cyber', 'HUD lock-on, scanlines, holograms and data decode.', 'motionary/fx/cyber', 'registerCyberPack', 'hud-frame scanline-sweep hologram data-decode', 'sci-fi hud glitch', '8.4'),\n L('motionary/fx/paper', 'Paper & hand-drawn', 'Paper unfold, pencil sketch, watercolor and crumple.', 'motionary/fx/paper', 'registerPaperPack', 'paper-unfold pencil-sketch watercolor crumple', 'sketch paper drawing', '8.5'),\n L('motionary/fx/surface', 'Surface themes', 'Neon ignite and pulse, glass frost, neumorphic press.', 'motionary/fx/surface', 'registerSurfacePack', 'neon-ignite neon-pulse glass-frost neu-press', 'neon glassmorphism neumorphism theme', '8.6'),\n L('motionary/fx/gesture', 'Gestures 3.0', 'Swipe and pinch hints, tilt wobble, depth-in.', 'motionary/fx/gesture', 'registerGesture3Pack', 'swipe-hint pinch-hint tilt-wobble depth-in', 'touch onboarding 3d', '8.7'),\n L('motionary/fx/spatial', 'XR / spatial', 'Portal open, orbit-in, spatial float and depth pop.', 'motionary/fx/spatial', 'registerSpatialPack', 'portal-open orbit-in spatial-float depth-pop', 'xr vr visionos 3d', '8.8'),\n L('motionary/fx/cinema', 'Cinematic', 'Dolly-in, pan reveal, letterbox and rack focus.', 'motionary/fx/cinema', 'registerCinemaPack', 'dolly-in pan-reveal letterbox rack-focus', 'film camera story', '9.1'),\n L('motionary/fx/lottie', 'Lottie & Rive', 'Lottie import (keyframes + SVG), Rive state-machine inputs, icon pop.', 'motionary/fx/lottie', 'registerLottiePack', 'lottie-play icon-pop', 'lottie rive after-effects icons', '9.2'),\n L('motionary/fx/genart', 'Generative art 2.0', 'Halftone print-in, drifting mesh gradients, kaleidoscope and film grain.', 'motionary/fx/genart', 'registerGenArtPack', 'halftone-in mesh-drift kaleido grain-flicker', 'generative gradient grain art', '9.3'),\n];\n\n/** Ranked search over listings (name / title / tags / effects / description) (9.0). */\nexport function searchPlugins(query: string, list: PluginListing[] = MARKETPLACE): PluginListing[] {\n const q = query.toLowerCase().trim().split(/\\s+/).filter(Boolean);\n if (!q.length) return list.slice();\n const score = (p: PluginListing) =>\n q.reduce((s, w) => {\n let n = 0;\n if (p.title.toLowerCase().includes(w)) n += 5;\n if (p.tags.some((t) => t.includes(w))) n += 4;\n if (p.effects.some((e) => e.includes(w))) n += 3;\n if (p.name.toLowerCase().includes(w)) n += 2;\n if (p.description.toLowerCase().includes(w)) n += 1;\n return n ? s + n : -1e9;\n }, 0);\n return list\n .map((p) => [p, score(p)] as const)\n .filter(([, s]) => s > 0)\n .sort((a, b) => b[1] - a[1])\n .map(([p]) => p);\n}\n\nconst installed = new Map<string, string[]>();\n/** Names of installed plugins → their registered effects (9.0). */\nexport function installedPlugins(): Record<string, string[]> {\n return Object.fromEntries(installed);\n}\n\n/**\n * Install a plugin: `load(entry)` imports the module (default: dynamic `import()`), then its\n * `register*` function runs (first-party listing) or its `effects` are validated and registered\n * through `loadEffectPack` (third-party pack). Returns the registered effect names (9.0).\n */\nexport async function installPlugin(p: PluginListing | string, opts: { load?: (entry: string) => Promise<any>; override?: boolean } = {}): Promise<string[]> {\n const listing = typeof p === 'string' ? null : p;\n const entry = listing ? listing.entry : (p as string);\n const key = listing ? listing.name : entry;\n if (installed.has(key)) return installed.get(key) as string[];\n const load = opts.load || ((u: string) => import(/* @vite-ignore */ u));\n const mod = await load(entry);\n let names: string[];\n if (listing && typeof mod?.[listing.register] === 'function') {\n mod[listing.register]();\n names = listing.effects.slice();\n } else names = await loadEffectPack(mod as { effects?: EffectDefinition[]; default?: EffectDefinition[] }, { override: opts.override, manifest: mod?.manifest });\n installed.set(key, names);\n return names;\n}\n\n/** Read a marketplace index (`{ format: \"motionary/marketplace\", version: 1, plugins }`) (9.0). */\nexport async function fetchMarketplace(url: string, fetcher: typeof fetch = fetch): Promise<PluginListing[]> {\n const r = await fetcher(url);\n const j = await r.json();\n if (j?.format !== MARKETPLACE_FORMAT || j?.version !== 1 || !Array.isArray(j.plugins)) throw new Error(`[motionary] ${url} is not a ${MARKETPLACE_FORMAT} v1 index`);\n return j.plugins.filter((p: any) => p && typeof p.name === 'string' && typeof p.entry === 'string').map((p: any) => ({ title: p.name, description: '', register: '', effects: [], tags: [], since: '', ...p }));\n}\n"],"names":["loadEffectPack"],"mappings":";;;;;;AAqBO,MAAM,kBAAkB,GAAG;AAclC,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,WAAmB,EAAE,KAAa,EAAE,QAAgB,EAAE,OAAe,EAAE,IAAY,EAAE,KAAa,MAAqB,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAE7S;AACO,MAAM,WAAW,GAAoB;AAC1C,IAAA,CAAC,CAAC,uBAAuB,EAAE,UAAU,EAAE,wDAAwD,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,oDAAoD,EAAE,8BAA8B,EAAE,KAAK,CAAC;AAC9O,IAAA,CAAC,CAAC,oBAAoB,EAAE,OAAO,EAAE,gCAAgC,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,4CAA4C,EAAE,qBAAqB,EAAE,KAAK,CAAC;AACzL,IAAA,CAAC,CAAC,sBAAsB,EAAE,SAAS,EAAE,iDAAiD,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,oCAAoC,EAAE,oBAAoB,EAAE,KAAK,CAAC;AACzM,IAAA,CAAC,CAAC,oBAAoB,EAAE,OAAO,EAAE,oDAAoD,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,+CAA+C,EAAE,mBAAmB,EAAE,KAAK,CAAC;AAC9M,IAAA,CAAC,CAAC,oBAAoB,EAAE,oBAAoB,EAAE,sDAAsD,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,+CAA+C,EAAE,sBAAsB,EAAE,KAAK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C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,CAAA,YAAA,EAAe,GAAG,CAAA,UAAA,EAAa,kBAAkB,CAAA,SAAA,CAAW,CAAC;AACpK,IAAA,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAM,KAAK,CAAC,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AACjN;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"marketplace.cjs","sources":["../../src/components/marketplace/index.ts"],"sourcesContent":["/**\n * `motionary/marketplace` (= `motionary/components/marketplace`, 9.0 GA) —\n * the plugin marketplace. Builds on the 6.9 effect-pack manifest\n * (`packManifest`, `validateManifest`, `loadEffectPack`) with:\n *\n * - **`MARKETPLACE`** — the first-party catalogue: every Motionary effect\n * pack as a marketplace listing (name, entry, effects, tags, since).\n * - **`searchPlugins(query, list?)`** — ranked search over names,\n * descriptions, tags and effect names.\n * - **`installPlugin(listing | url, { load })`** — imports a pack (your\n * `load` can map entries to bundler imports), validates it and registers\n * its effects; remembered by `installedPlugins()`.\n * - **`fetchMarketplace(url)`** — read a third-party index\n * (`{ \"format\": \"motionary/marketplace\", \"version\": 1, \"plugins\": [...] }`).\n */\nimport type { EffectDefinition } from '../fx/registry';\nimport { loadEffectPack } from '../fx2/manifest';\n\nexport { EFFECT_PACK_FORMAT, packManifest, validateManifest, loadEffectPack } from '../fx2/manifest';\nexport type { EffectPackManifest } from '../fx2/manifest';\n\nexport const MARKETPLACE_FORMAT = 'motionary/marketplace';\nexport interface PluginListing {\n name: string;\n title: string;\n description: string;\n entry: string;\n register: string;\n effects: string[];\n tags: string[];\n since: string;\n author?: string;\n official?: boolean;\n}\n\nconst L = (name: string, title: string, description: string, entry: string, register: string, effects: string, tags: string, since: string): PluginListing => ({ name, title, description, entry, register, effects: effects.split(' '), tags: tags.split(' '), since, author: 'Motionary', official: true });\n\n/** The first-party catalogue (9.0). */\nexport const MARKETPLACE: PluginListing[] = [\n L('motionary/fx/festival', 'Festival', 'Fireworks, lanterns, Christmas snow and spooky floats.', 'motionary/fx/festival', 'registerFestivalPack', 'firework-burst lantern-rise xmas-snow spooky-float', 'holiday celebration seasonal', '8.1'),\n L('motionary/fx/retro', 'Retro', 'Pixel, CRT, VHS and Y2K looks.', 'motionary/fx/retro', 'registerRetroPack', 'pixelate-in crt-power vhs-glitch y2k-shine', 'pixel 8-bit vintage', '8.2'),\n L('motionary/fx/organic', 'Organic', 'Vines, blooms, water drops and breathing blobs.', 'motionary/fx/organic', 'registerOrganicPack', 'vine-grow bloom water-drop breathe', 'nature blob liquid', '8.3'),\n L('motionary/fx/cyber', 'Cyber', 'HUD lock-on, scanlines, holograms and data decode.', 'motionary/fx/cyber', 'registerCyberPack', 'hud-frame scanline-sweep hologram data-decode', 'sci-fi hud glitch', '8.4'),\n L('motionary/fx/paper', 'Paper & hand-drawn', 'Paper unfold, pencil sketch, watercolor and crumple.', 'motionary/fx/paper', 'registerPaperPack', 'paper-unfold pencil-sketch watercolor crumple', 'sketch paper drawing', '8.5'),\n L('motionary/fx/surface', 'Surface themes', 'Neon ignite and pulse, glass frost, neumorphic press.', 'motionary/fx/surface', 'registerSurfacePack', 'neon-ignite neon-pulse glass-frost neu-press', 'neon glassmorphism neumorphism theme', '8.6'),\n L('motionary/fx/gesture', 'Gestures 3.0', 'Swipe and pinch hints, tilt wobble, depth-in.', 'motionary/fx/gesture', 'registerGesture3Pack', 'swipe-hint pinch-hint tilt-wobble depth-in', 'touch onboarding 3d', '8.7'),\n L('motionary/fx/spatial', 'XR / spatial', 'Portal open, orbit-in, spatial float and depth pop.', 'motionary/fx/spatial', 'registerSpatialPack', 'portal-open orbit-in spatial-float depth-pop', 'xr vr visionos 3d', '8.8'),\n L('motionary/fx/cinema', 'Cinematic', 'Dolly-in, pan reveal, letterbox and rack focus.', 'motionary/fx/cinema', 'registerCinemaPack', 'dolly-in pan-reveal letterbox rack-focus', 'film camera story', '9.1'),\n L('motionary/fx/lottie', 'Lottie & Rive', 'Lottie import (keyframes + SVG), Rive state-machine inputs, icon pop.', 'motionary/fx/lottie', 'registerLottiePack', 'lottie-play icon-pop', 'lottie rive after-effects icons', '9.2'),\n L('motionary/fx/genart', 'Generative art 2.0', 'Halftone print-in, drifting mesh gradients, kaleidoscope and film grain.', 'motionary/fx/genart', 'registerGenArtPack', 'halftone-in mesh-drift kaleido grain-flicker', 'generative gradient grain art', '9.3'),\n L('motionary/fx/video', 'Video motion', 'Scroll-driven video and frame sequences, film burn, jump cut.', 'motionary/fx/video', 'registerVideoPack', 'film-burn jump-cut', 'video scroll film', '9.4'),\n L('motionary/fx/safe', 'Accessible motion 2.0', 'Motion that never moves: safe fade, focus glow, colour pulse, underline sweep.', 'motionary/fx/safe', 'registerSafePack', 'safe-fade focus-glow color-pulse underline-sweep', 'a11y accessibility vestibular reduced-motion', '9.5'),\n];\n\n/** Ranked search over listings (name / title / tags / effects / description) (9.0). */\nexport function searchPlugins(query: string, list: PluginListing[] = MARKETPLACE): PluginListing[] {\n const q = query.toLowerCase().trim().split(/\\s+/).filter(Boolean);\n if (!q.length) return list.slice();\n const score = (p: PluginListing) =>\n q.reduce((s, w) => {\n let n = 0;\n if (p.title.toLowerCase().includes(w)) n += 5;\n if (p.tags.some((t) => t.includes(w))) n += 4;\n if (p.effects.some((e) => e.includes(w))) n += 3;\n if (p.name.toLowerCase().includes(w)) n += 2;\n if (p.description.toLowerCase().includes(w)) n += 1;\n return n ? s + n : -1e9;\n }, 0);\n return list\n .map((p) => [p, score(p)] as const)\n .filter(([, s]) => s > 0)\n .sort((a, b) => b[1] - a[1])\n .map(([p]) => p);\n}\n\nconst installed = new Map<string, string[]>();\n/** Names of installed plugins → their registered effects (9.0). */\nexport function installedPlugins(): Record<string, string[]> {\n return Object.fromEntries(installed);\n}\n\n/**\n * Install a plugin: `load(entry)` imports the module (default: dynamic `import()`), then its\n * `register*` function runs (first-party listing) or its `effects` are validated and registered\n * through `loadEffectPack` (third-party pack). Returns the registered effect names (9.0).\n */\nexport async function installPlugin(p: PluginListing | string, opts: { load?: (entry: string) => Promise<any>; override?: boolean } = {}): Promise<string[]> {\n const listing = typeof p === 'string' ? null : p;\n const entry = listing ? listing.entry : (p as string);\n const key = listing ? listing.name : entry;\n if (installed.has(key)) return installed.get(key) as string[];\n const load = opts.load || ((u: string) => import(/* @vite-ignore */ u));\n const mod = await load(entry);\n let names: string[];\n if (listing && typeof mod?.[listing.register] === 'function') {\n mod[listing.register]();\n names = listing.effects.slice();\n } else names = await loadEffectPack(mod as { effects?: EffectDefinition[]; default?: EffectDefinition[] }, { override: opts.override, manifest: mod?.manifest });\n installed.set(key, names);\n return names;\n}\n\n/** Read a marketplace index (`{ format: \"motionary/marketplace\", version: 1, plugins }`) (9.0). */\nexport async function fetchMarketplace(url: string, fetcher: typeof fetch = fetch): Promise<PluginListing[]> {\n const r = await fetcher(url);\n const j = await r.json();\n if (j?.format !== MARKETPLACE_FORMAT || j?.version !== 1 || !Array.isArray(j.plugins)) throw new Error(`[motionary] ${url} is not a ${MARKETPLACE_FORMAT} v1 index`);\n return j.plugins.filter((p: any) => p && typeof p.name === 'string' && typeof p.entry === 'string').map((p: any) => ({ title: p.name, description: '', register: '', effects: [], tags: [], since: '', ...p }));\n}\n"],"names":["loadEffectPack"],"mappings":";;;;;;AAqBO,MAAM,kBAAkB,GAAG;AAclC,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,WAAmB,EAAE,K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KAAK,kBAAkB,IAAI,CAAC,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,CAAA,YAAA,EAAe,GAAG,CAAA,UAAA,EAAa,kBAAkB,CAAA,SAAA,CAAW,CAAC;AACpK,IAAA,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAM,KAAK,CAAC,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AACjN;;;;;;;;;;;;;"}
|
|
@@ -18,6 +18,8 @@ const MARKETPLACE = [
|
|
|
18
18
|
L('motionary/fx/cinema', 'Cinematic', 'Dolly-in, pan reveal, letterbox and rack focus.', 'motionary/fx/cinema', 'registerCinemaPack', 'dolly-in pan-reveal letterbox rack-focus', 'film camera story', '9.1'),
|
|
19
19
|
L('motionary/fx/lottie', 'Lottie & Rive', 'Lottie import (keyframes + SVG), Rive state-machine inputs, icon pop.', 'motionary/fx/lottie', 'registerLottiePack', 'lottie-play icon-pop', 'lottie rive after-effects icons', '9.2'),
|
|
20
20
|
L('motionary/fx/genart', 'Generative art 2.0', 'Halftone print-in, drifting mesh gradients, kaleidoscope and film grain.', 'motionary/fx/genart', 'registerGenArtPack', 'halftone-in mesh-drift kaleido grain-flicker', 'generative gradient grain art', '9.3'),
|
|
21
|
+
L('motionary/fx/video', 'Video motion', 'Scroll-driven video and frame sequences, film burn, jump cut.', 'motionary/fx/video', 'registerVideoPack', 'film-burn jump-cut', 'video scroll film', '9.4'),
|
|
22
|
+
L('motionary/fx/safe', 'Accessible motion 2.0', 'Motion that never moves: safe fade, focus glow, colour pulse, underline sweep.', 'motionary/fx/safe', 'registerSafePack', 'safe-fade focus-glow color-pulse underline-sweep', 'a11y accessibility vestibular reduced-motion', '9.5'),
|
|
21
23
|
];
|
|
22
24
|
/** Ranked search over listings (name / title / tags / effects / description) (9.0). */
|
|
23
25
|
function searchPlugins(query, list = MARKETPLACE) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketplace.js","sources":["../../src/components/marketplace/index.ts"],"sourcesContent":["/**\n * `motionary/marketplace` (= `motionary/components/marketplace`, 9.0 GA) —\n * the plugin marketplace. Builds on the 6.9 effect-pack manifest\n * (`packManifest`, `validateManifest`, `loadEffectPack`) with:\n *\n * - **`MARKETPLACE`** — the first-party catalogue: every Motionary effect\n * pack as a marketplace listing (name, entry, effects, tags, since).\n * - **`searchPlugins(query, list?)`** — ranked search over names,\n * descriptions, tags and effect names.\n * - **`installPlugin(listing | url, { load })`** — imports a pack (your\n * `load` can map entries to bundler imports), validates it and registers\n * its effects; remembered by `installedPlugins()`.\n * - **`fetchMarketplace(url)`** — read a third-party index\n * (`{ \"format\": \"motionary/marketplace\", \"version\": 1, \"plugins\": [...] }`).\n */\nimport type { EffectDefinition } from '../fx/registry';\nimport { loadEffectPack } from '../fx2/manifest';\n\nexport { EFFECT_PACK_FORMAT, packManifest, validateManifest, loadEffectPack } from '../fx2/manifest';\nexport type { EffectPackManifest } from '../fx2/manifest';\n\nexport const MARKETPLACE_FORMAT = 'motionary/marketplace';\nexport interface PluginListing {\n name: string;\n title: string;\n description: string;\n entry: string;\n register: string;\n effects: string[];\n tags: string[];\n since: string;\n author?: string;\n official?: boolean;\n}\n\nconst L = (name: string, title: string, description: string, entry: string, register: string, effects: string, tags: string, since: string): PluginListing => ({ name, title, description, entry, register, effects: effects.split(' '), tags: tags.split(' '), since, author: 'Motionary', official: true });\n\n/** The first-party catalogue (9.0). */\nexport const MARKETPLACE: PluginListing[] = [\n L('motionary/fx/festival', 'Festival', 'Fireworks, lanterns, Christmas snow and spooky floats.', 'motionary/fx/festival', 'registerFestivalPack', 'firework-burst lantern-rise xmas-snow spooky-float', 'holiday celebration seasonal', '8.1'),\n L('motionary/fx/retro', 'Retro', 'Pixel, CRT, VHS and Y2K looks.', 'motionary/fx/retro', 'registerRetroPack', 'pixelate-in crt-power vhs-glitch y2k-shine', 'pixel 8-bit vintage', '8.2'),\n L('motionary/fx/organic', 'Organic', 'Vines, blooms, water drops and breathing blobs.', 'motionary/fx/organic', 'registerOrganicPack', 'vine-grow bloom water-drop breathe', 'nature blob liquid', '8.3'),\n L('motionary/fx/cyber', 'Cyber', 'HUD lock-on, scanlines, holograms and data decode.', 'motionary/fx/cyber', 'registerCyberPack', 'hud-frame scanline-sweep hologram data-decode', 'sci-fi hud glitch', '8.4'),\n L('motionary/fx/paper', 'Paper & hand-drawn', 'Paper unfold, pencil sketch, watercolor and crumple.', 'motionary/fx/paper', 'registerPaperPack', 'paper-unfold pencil-sketch watercolor crumple', 'sketch paper drawing', '8.5'),\n L('motionary/fx/surface', 'Surface themes', 'Neon ignite and pulse, glass frost, neumorphic press.', 'motionary/fx/surface', 'registerSurfacePack', 'neon-ignite neon-pulse glass-frost neu-press', 'neon glassmorphism neumorphism theme', '8.6'),\n L('motionary/fx/gesture', 'Gestures 3.0', 'Swipe and pinch hints, tilt wobble, depth-in.', 'motionary/fx/gesture', 'registerGesture3Pack', 'swipe-hint pinch-hint tilt-wobble depth-in', 'touch onboarding 3d', '8.7'),\n L('motionary/fx/spatial', 'XR / spatial', 'Portal open, orbit-in, spatial float and depth pop.', 'motionary/fx/spatial', 'registerSpatialPack', 'portal-open orbit-in spatial-float depth-pop', 'xr vr visionos 3d', '8.8'),\n L('motionary/fx/cinema', 'Cinematic', 'Dolly-in, pan reveal, letterbox and rack focus.', 'motionary/fx/cinema', 'registerCinemaPack', 'dolly-in pan-reveal letterbox rack-focus', 'film camera story', '9.1'),\n L('motionary/fx/lottie', 'Lottie & Rive', 'Lottie import (keyframes + SVG), Rive state-machine inputs, icon pop.', 'motionary/fx/lottie', 'registerLottiePack', 'lottie-play icon-pop', 'lottie rive after-effects icons', '9.2'),\n L('motionary/fx/genart', 'Generative art 2.0', 'Halftone print-in, drifting mesh gradients, kaleidoscope and film grain.', 'motionary/fx/genart', 'registerGenArtPack', 'halftone-in mesh-drift kaleido grain-flicker', 'generative gradient grain art', '9.3'),\n];\n\n/** Ranked search over listings (name / title / tags / effects / description) (9.0). */\nexport function searchPlugins(query: string, list: PluginListing[] = MARKETPLACE): PluginListing[] {\n const q = query.toLowerCase().trim().split(/\\s+/).filter(Boolean);\n if (!q.length) return list.slice();\n const score = (p: PluginListing) =>\n q.reduce((s, w) => {\n let n = 0;\n if (p.title.toLowerCase().includes(w)) n += 5;\n if (p.tags.some((t) => t.includes(w))) n += 4;\n if (p.effects.some((e) => e.includes(w))) n += 3;\n if (p.name.toLowerCase().includes(w)) n += 2;\n if (p.description.toLowerCase().includes(w)) n += 1;\n return n ? s + n : -1e9;\n }, 0);\n return list\n .map((p) => [p, score(p)] as const)\n .filter(([, s]) => s > 0)\n .sort((a, b) => b[1] - a[1])\n .map(([p]) => p);\n}\n\nconst installed = new Map<string, string[]>();\n/** Names of installed plugins → their registered effects (9.0). */\nexport function installedPlugins(): Record<string, string[]> {\n return Object.fromEntries(installed);\n}\n\n/**\n * Install a plugin: `load(entry)` imports the module (default: dynamic `import()`), then its\n * `register*` function runs (first-party listing) or its `effects` are validated and registered\n * through `loadEffectPack` (third-party pack). Returns the registered effect names (9.0).\n */\nexport async function installPlugin(p: PluginListing | string, opts: { load?: (entry: string) => Promise<any>; override?: boolean } = {}): Promise<string[]> {\n const listing = typeof p === 'string' ? null : p;\n const entry = listing ? listing.entry : (p as string);\n const key = listing ? listing.name : entry;\n if (installed.has(key)) return installed.get(key) as string[];\n const load = opts.load || ((u: string) => import(/* @vite-ignore */ u));\n const mod = await load(entry);\n let names: string[];\n if (listing && typeof mod?.[listing.register] === 'function') {\n mod[listing.register]();\n names = listing.effects.slice();\n } else names = await loadEffectPack(mod as { effects?: EffectDefinition[]; default?: EffectDefinition[] }, { override: opts.override, manifest: mod?.manifest });\n installed.set(key, names);\n return names;\n}\n\n/** Read a marketplace index (`{ format: \"motionary/marketplace\", version: 1, plugins }`) (9.0). */\nexport async function fetchMarketplace(url: string, fetcher: typeof fetch = fetch): Promise<PluginListing[]> {\n const r = await fetcher(url);\n const j = await r.json();\n if (j?.format !== MARKETPLACE_FORMAT || j?.version !== 1 || !Array.isArray(j.plugins)) throw new Error(`[motionary] ${url} is not a ${MARKETPLACE_FORMAT} v1 index`);\n return j.plugins.filter((p: any) => p && typeof p.name === 'string' && typeof p.entry === 'string').map((p: any) => ({ title: p.name, description: '', register: '', effects: [], tags: [], since: '', ...p }));\n}\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,kBAAkB,GAAG;AAclC,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,WAAmB,EAAE,KAAa,EAAE,QAAgB,EAAE,OAAe,EAAE,IAAY,EAAE,KAAa,MAAqB,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAE7S;AACO,MAAM,WAAW,GAAoB;AAC1C,IAAA,CAAC,CAAC,uBAAuB,EAAE,UAAU,EAAE,wDAAwD,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,oDAAoD,EAAE,8BAA8B,EAAE,KAAK,CAAC;AAC9O,IAAA,CAAC,CAAC,oBAAoB,EAAE,OAAO,EAAE,gCAAgC,EAAE,oBAAoB,EAAE,mBAAmB,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AE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAChK,IAAA,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;AACzB,IAAA,OAAO,KAAK;AACd;AAEA;AACO,eAAe,gBAAgB,CAAC,GAAW,EAAE,UAAwB,KAAK,EAAA;AAC/E,IAAA,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;AAC5B,IAAA,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE;IACxB,IAAI,CAAC,EAAE,MAAM,KAAK,kBAAkB,IAAI,CAAC,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,CAAA,YAAA,EAAe,GAAG,CAAA,UAAA,EAAa,kBAAkB,CAAA,SAAA,CAAW,CAAC;AACpK,IAAA,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAM,KAAK,CAAC,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AACjN;;;;"}
|
|
1
|
+
{"version":3,"file":"marketplace.js","sources":["../../src/components/marketplace/index.ts"],"sourcesContent":["/**\n * `motionary/marketplace` (= `motionary/components/marketplace`, 9.0 GA) —\n * the plugin marketplace. Builds on the 6.9 effect-pack manifest\n * (`packManifest`, `validateManifest`, `loadEffectPack`) with:\n *\n * - **`MARKETPLACE`** — the first-party catalogue: every Motionary effect\n * pack as a marketplace listing (name, entry, effects, tags, since).\n * - **`searchPlugins(query, list?)`** — ranked search over names,\n * descriptions, tags and effect names.\n * - **`installPlugin(listing | url, { load })`** — imports a pack (your\n * `load` can map entries to bundler imports), validates it and registers\n * its effects; remembered by `installedPlugins()`.\n * - **`fetchMarketplace(url)`** — read a third-party index\n * (`{ \"format\": \"motionary/marketplace\", \"version\": 1, \"plugins\": [...] }`).\n */\nimport type { EffectDefinition } from '../fx/registry';\nimport { loadEffectPack } from '../fx2/manifest';\n\nexport { EFFECT_PACK_FORMAT, packManifest, validateManifest, loadEffectPack } from '../fx2/manifest';\nexport type { EffectPackManifest } from '../fx2/manifest';\n\nexport const MARKETPLACE_FORMAT = 'motionary/marketplace';\nexport interface PluginListing {\n name: string;\n title: string;\n description: string;\n entry: string;\n register: string;\n effects: string[];\n tags: string[];\n since: string;\n author?: string;\n official?: boolean;\n}\n\nconst L = (name: string, title: string, description: string, entry: string, register: string, effects: string, tags: string, since: string): PluginListing => ({ name, title, description, entry, register, effects: effects.split(' '), tags: tags.split(' '), since, author: 'Motionary', official: true });\n\n/** The first-party catalogue (9.0). */\nexport const MARKETPLACE: PluginListing[] = [\n L('motionary/fx/festival', 'Festival', 'Fireworks, lanterns, Christmas snow and spooky floats.', 'motionary/fx/festival', 'registerFestivalPack', 'firework-burst lantern-rise xmas-snow spooky-float', 'holiday celebration seasonal', '8.1'),\n L('motionary/fx/retro', 'Retro', 'Pixel, CRT, VHS and Y2K looks.', 'motionary/fx/retro', 'registerRetroPack', 'pixelate-in crt-power vhs-glitch y2k-shine', 'pixel 8-bit vintage', '8.2'),\n L('motionary/fx/organic', 'Organic', 'Vines, blooms, water drops and breathing blobs.', 'motionary/fx/organic', 'registerOrganicPack', 'vine-grow bloom water-drop breathe', 'nature blob liquid', '8.3'),\n L('motionary/fx/cyber', 'Cyber', 'HUD lock-on, scanlines, holograms and data decode.', 'motionary/fx/cyber', 'registerCyberPack', 'hud-frame scanline-sweep hologram data-decode', 'sci-fi hud glitch', '8.4'),\n L('motionary/fx/paper', 'Paper & hand-drawn', 'Paper unfold, pencil sketch, watercolor and crumple.', 'motionary/fx/paper', 'registerPaperPack', 'paper-unfold pencil-sketch watercolor crumple', 'sketch paper drawing', '8.5'),\n L('motionary/fx/surface', 'Surface themes', 'Neon ignite and pulse, glass frost, neumorphic press.', 'motionary/fx/surface', 'registerSurfacePack', 'neon-ignite neon-pulse glass-frost neu-press', 'neon glassmorphism neumorphism theme', '8.6'),\n L('motionary/fx/gesture', 'Gestures 3.0', 'Swipe and pinch hints, tilt wobble, depth-in.', 'motionary/fx/gesture', 'registerGesture3Pack', 'swipe-hint pinch-hint tilt-wobble depth-in', 'touch onboarding 3d', '8.7'),\n L('motionary/fx/spatial', 'XR / spatial', 'Portal open, orbit-in, spatial float and depth pop.', 'motionary/fx/spatial', 'registerSpatialPack', 'portal-open orbit-in spatial-float depth-pop', 'xr vr visionos 3d', '8.8'),\n L('motionary/fx/cinema', 'Cinematic', 'Dolly-in, pan reveal, letterbox and rack focus.', 'motionary/fx/cinema', 'registerCinemaPack', 'dolly-in pan-reveal letterbox rack-focus', 'film camera story', '9.1'),\n L('motionary/fx/lottie', 'Lottie & Rive', 'Lottie import (keyframes + SVG), Rive state-machine inputs, icon pop.', 'motionary/fx/lottie', 'registerLottiePack', 'lottie-play icon-pop', 'lottie rive after-effects icons', '9.2'),\n L('motionary/fx/genart', 'Generative art 2.0', 'Halftone print-in, drifting mesh gradients, kaleidoscope and film grain.', 'motionary/fx/genart', 'registerGenArtPack', 'halftone-in mesh-drift kaleido grain-flicker', 'generative gradient grain art', '9.3'),\n L('motionary/fx/video', 'Video motion', 'Scroll-driven video and frame sequences, film burn, jump cut.', 'motionary/fx/video', 'registerVideoPack', 'film-burn jump-cut', 'video scroll film', '9.4'),\n L('motionary/fx/safe', 'Accessible motion 2.0', 'Motion that never moves: safe fade, focus glow, colour pulse, underline sweep.', 'motionary/fx/safe', 'registerSafePack', 'safe-fade focus-glow color-pulse underline-sweep', 'a11y accessibility vestibular reduced-motion', '9.5'),\n];\n\n/** Ranked search over listings (name / title / tags / effects / description) (9.0). */\nexport function searchPlugins(query: string, list: PluginListing[] = MARKETPLACE): PluginListing[] {\n const q = query.toLowerCase().trim().split(/\\s+/).filter(Boolean);\n if (!q.length) return list.slice();\n const score = (p: PluginListing) =>\n q.reduce((s, w) => {\n let n = 0;\n if (p.title.toLowerCase().includes(w)) n += 5;\n if (p.tags.some((t) => t.includes(w))) n += 4;\n if (p.effects.some((e) => e.includes(w))) n += 3;\n if (p.name.toLowerCase().includes(w)) n += 2;\n if (p.description.toLowerCase().includes(w)) n += 1;\n return n ? s + n : -1e9;\n }, 0);\n return list\n .map((p) => [p, score(p)] as const)\n .filter(([, s]) => s > 0)\n .sort((a, b) => b[1] - a[1])\n .map(([p]) => p);\n}\n\nconst installed = new Map<string, string[]>();\n/** Names of installed plugins → their registered effects (9.0). */\nexport function installedPlugins(): Record<string, string[]> {\n return Object.fromEntries(installed);\n}\n\n/**\n * Install a plugin: `load(entry)` imports the module (default: dynamic `import()`), then its\n * `register*` function runs (first-party listing) or its `effects` are validated and registered\n * through `loadEffectPack` (third-party pack). Returns the registered effect names (9.0).\n */\nexport async function installPlugin(p: PluginListing | string, opts: { load?: (entry: string) => Promise<any>; override?: boolean } = {}): Promise<string[]> {\n const listing = typeof p === 'string' ? null : p;\n const entry = listing ? listing.entry : (p as string);\n const key = listing ? listing.name : entry;\n if (installed.has(key)) return installed.get(key) as string[];\n const load = opts.load || ((u: string) => import(/* @vite-ignore */ u));\n const mod = await load(entry);\n let names: string[];\n if (listing && typeof mod?.[listing.register] === 'function') {\n mod[listing.register]();\n names = listing.effects.slice();\n } else names = await loadEffectPack(mod as { effects?: EffectDefinition[]; default?: EffectDefinition[] }, { override: opts.override, manifest: mod?.manifest });\n installed.set(key, names);\n return names;\n}\n\n/** Read a marketplace index (`{ format: \"motionary/marketplace\", version: 1, plugins }`) (9.0). */\nexport async function fetchMarketplace(url: string, fetcher: typeof fetch = fetch): Promise<PluginListing[]> {\n const r = await fetcher(url);\n const j = await r.json();\n if (j?.format !== MARKETPLACE_FORMAT || j?.version !== 1 || !Array.isArray(j.plugins)) throw new Error(`[motionary] ${url} is not a ${MARKETPLACE_FORMAT} v1 index`);\n return j.plugins.filter((p: any) => p && typeof p.name === 'string' && typeof p.entry === 'string').map((p: any) => ({ title: p.name, description: '', register: '', effects: [], tags: [], since: '', ...p }));\n}\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,kBAAkB,GAAG;AAclC,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,WAAmB,EAAE,KAAa,EAAE,QAAgB,EAAE,OAAe,EAAE,IAAY,EAAE,KAAa,MAAqB,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAE7S;AACO,MAAM,WAAW,GAAoB;AAC1C,IAAA,CAAC,CAAC,uBAAuB,EAAE,UAAU,EAAE,wDAAwD,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,oDAAoD,EAAE,8BAA8B,EAAE,KAAK,CAAC;AAC9O,IAAA,CAAC,CAAC,oBAAoB,EAAE,OAAO,EAAE,gCAAgC,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,4CAA4C,EAAE,qBAAqB,EAAE,KAAK,CAAC;AACzL,IAAA,CAAC,CAAC,sBAAsB,EAAE,SAAS,EAAE,iDAAiD,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,oCAAoC,EAAE,oBAAoB,EAAE,KAAK,CAAC;AACzM,IAAA,CAAC,CAAC,oBAAoB,EAAE,OAAO,EAAE,oDAAoD,EAAE,oBA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