
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@bagaking/dma-frame
Advanced tools
Unified API for document mini-app frame control - elegant height management for document addons
Elegant, unified API for document mini-app frame control
A lightweight, type-safe library providing intelligent height management for document addons, specifically designed for Feishu/Lark platform integration.
npm install @bagaking/dma-frame
npm install @lark-opdev/block-docs-addon-api
import { createFeishuHeightController } from '@bagaking/dma-frame';
// Create controller (automatically handles peer dependency)
const controller = await createFeishuHeightController();
// Adjust height with intelligent timing strategies
await controller.adjustHeight({
targetHeight: 600,
onUIChange: () => {
// Called immediately for expanding, or before bridge call for shrinking
setHeight(600);
},
onUIComplete: async () => {
// Called after bridge call for expanding, or before bridge call for shrinking
await animateContent();
}
});
import {
createFeishuBridge,
CoreHeightController,
type HeightAdjustmentBehavior
} from '@bagaking/dma-frame';
// Create custom controller with debugging
const bridge = await createFeishuBridge({ debug: true });
const controller = new CoreHeightController(bridge, true);
// Multiple height adjustments are automatically queued and serialized
const behaviors: HeightAdjustmentBehavior[] = [
{ targetHeight: 400, onUIChange: () => setCompactMode(true) },
{ targetHeight: 800, onUIChange: () => setExpandedMode(true) }
];
await Promise.all(
behaviors.map(behavior => controller.adjustHeight(behavior))
);
import { useEffect, useRef, useCallback } from 'react';
import { createFeishuHeightController, type HeightController } from '@bagaking/dma-frame';
function useFrameController() {
const controllerRef = useRef<HeightController>();
useEffect(() => {
createFeishuHeightController({
debug: process.env.NODE_ENV === 'development'
})
.then(controller => {
controllerRef.current = controller;
})
.catch(error => {
console.error('Failed to create height controller:', error);
});
return () => controllerRef.current?.dispose();
}, []);
const adjustHeight = useCallback(async (targetHeight: number) => {
if (!controllerRef.current || controllerRef.current.isDisposed) return;
await controllerRef.current.adjustHeight({
targetHeight,
onUIChange: () => {
// React state updates happen here
setCurrentHeight(targetHeight);
}
});
}, []);
return { adjustHeight };
}
HeightControllerinterface HeightController {
adjustHeight(behavior: HeightAdjustmentBehavior): Promise<void>;
dispose(): void;
readonly isDisposed: boolean;
}
HeightAdjustmentBehaviorinterface HeightAdjustmentBehavior {
readonly targetHeight: number;
readonly onUIChange?: () => void | Promise<void>;
readonly onUIComplete?: () => void | Promise<void>;
}
createFeishuHeightController(options?)Creates a complete height controller for Feishu platform.
const controller = await createFeishuHeightController({
debug: true, // Enable debug logging
platformId: 'my-addon' // Custom platform identifier
});
createFeishuBridge(options?)Creates just the platform bridge for advanced use cases.
createMockHeightController(options?)Creates a mock controller for testing.
Full support via @lark-opdev/block-docs-addon-api integration.
Implement the PlatformBridge interface:
import { PlatformBridge, CoreHeightController } from '@bagaking/dma-frame';
class CustomPlatformBridge implements PlatformBridge {
async updateHeight(targetHeight: number): Promise<number> {
// Your platform-specific implementation
await yourPlatformAPI.setFrameHeight(targetHeight);
return targetHeight;
}
}
const controller = new CoreHeightController(new CustomPlatformBridge());
Built-in mock utilities make testing easy:
import { createMockHeightController } from '@bagaking/dma-frame';
describe('Height Controller', () => {
it('should adjust height correctly', async () => {
const controller = createMockHeightController({ debug: true });
let uiHeight = 0;
await controller.adjustHeight({
targetHeight: 500,
onUIChange: () => { uiHeight = 500; }
});
expect(uiHeight).toBe(500);
});
});
adjustHeight method handles all complexityPlatformBridge interface isolates platform specificsMIT © bagaking
Contributions are welcome! Please feel free to submit a Pull Request.
Built with ❤️ for better document addon experiences
FAQs
Unified API for document mini-app frame control - elegant height management for document addons
We found that @bagaking/dma-frame demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.