feat:组件框架

This commit is contained in:
董海洋
2026-05-31 09:36:07 +08:00
parent 859acc7b71
commit b371a5341a
88 changed files with 23328 additions and 0 deletions
@@ -0,0 +1,35 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import type { nodeToGroup, nodeToSymbol, SketchFormat } from 'html2sketch';
import { ApplyPluginsType } from 'dumi';
import { getPluginManager } from '@@/core/plugin';
const html2sketch = typeof window !== 'undefined' ? window.html2sketch as {
nodeToGroup: typeof nodeToGroup;
nodeToSymbol: typeof nodeToSymbol;
} : null;
async function toSketchJSON(
node: HTMLElement,
opts: { type: 'group' | 'symbol' },
) {
return opts.type === 'group'
? (await html2sketch.nodeToGroup(node)).toSketchJSON()
: (await html2sketch.nodeToSymbol(node)).toSketchJSON();
}
function runtimeToSketchJSON(
target: HTMLElement | Document,
opts: Parameters<typeof toSketchJSON>[1],
): ReturnType<typeof toSketchJSON> | Promise<null> {
return getPluginManager().applyPlugins({
key: 'toSketchJSON',
type: ApplyPluginsType.modify,
initialValue: null,
args: { target, opts },
async: true,
});
}
export const getSketchJSON = null;