{"_id":"@composy/stamp-vue","name":"@composy/stamp-vue","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@composy/stamp-vue","version":"0.0.1","description":"Vue 3 adapter for @composy/stamp-workspace","keywords":["stamp","seal","vue","vue3","svg","canvas","ldesign"],"author":{"name":"LDesign Team"},"license":"MIT","type":"module","sideEffects":false,"exports":{".":{"types":"./es/index.d.ts","import":"./es/index.js","require":"./lib/index.cjs","default":"./es/index.js"},"./composables/*":{"types":"./es/composables/*.d.ts","import":"./es/composables/*.js","require":"./lib/composables/*.cjs","default":"./es/composables/*.js"},"./plugins/*":{"types":"./es/plugins/*.d.ts","import":"./es/plugins/*.js","require":"./lib/plugins/*.cjs","default":"./es/plugins/*.js"},"./index.css":"./dist/index.css","./index.min.css":"./dist/index.min.css","./components/StampDesigner.vue.css":"./es/components/StampDesigner.vue.css","./components/StampEditor.vue.css":"./es/components/StampEditor.vue.css","./package.json":"./package.json"},"main":"./lib/index.cjs","module":"./es/index.js","types":"./es/index.d.ts","unpkg":"./dist/index.min.js","jsdelivr":"./dist/index.min.js","scripts":{"build":"ldesign-builder build","clean":"rimraf dist *.tsbuildinfo","dev":"vite","lint":"eslint . --cache","lint:check":"eslint . --cache --max-warnings 0","lint:fix":"eslint . --cache --fix","type-check":"vue-tsc --noEmit","test":"ltesting run:unit","test:run":"ltesting run:unit","test:watch":"ltesting run:unit --watch","test:coverage":"ltesting run:unit --coverage","test:changed":"ltesting run:unit --changed","test:failed":"ltesting run:unit --failed","test:ui":"ltesting dashboard"},"dependencies":{"@composy/stamp-core":"^0.0.1","lucide-vue-next":"^1.0.0"},"peerDependencies":{"vue":"^3.5.32"},"devDependencies":{"@antfu/eslint-config":"9.1.0","@composy/builder":"^0.0.1","@composy/testing":"^0.0.1","eslint":"10.7.0","rimraf":"^6.1.3","typescript":"5.9.3","vite":"^8.1.4","vue":"3.5.39","vue-tsc":"^3.3.7"},"typings":"./es/index.d.ts","browser":"./dist/index.js","_id":"@composy/stamp-vue@0.0.1","_nodeVersion":"23.11.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Dh0LPx4BfIcnBjloyXQHFEXhn+/cxASwjPz+ODDOajO5QkQZGoR3sh20mnpjwDdXd02EPa22dPY4DghNEhMnlA==","shasum":"aea37056e2841aeec1a42d3e77568e5c21dab1be","tarball":"https://registry.npmjs.org/@composy/stamp-vue/-/stamp-vue-0.0.1.tgz","fileCount":152,"unpackedSize":3048117,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDCZtfWJoS7xxtHVZ6m9FdnE1+d77xXCH4esSeuC07+OgIhALtcJi97Ool6dKhKzYwXl5iSWUSXw5tkcP1cYhB3fhRE"}]},"_npmUser":{"name":"swimly","email":"979741120@qq.com"},"directories":{},"maintainers":[{"name":"swimly","email":"979741120@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stamp-vue_0.0.1_1786949305237_0.56971876093345"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-17T06:48:25.042Z","0.0.1":"2026-08-17T06:48:25.382Z","modified":"2026-08-17T06:48:25.722Z"},"maintainers":[{"name":"swimly","email":"979741120@qq.com"}],"description":"Vue 3 adapter for @composy/stamp-workspace","keywords":["stamp","seal","vue","vue3","svg","canvas","ldesign"],"author":{"name":"LDesign Team"},"license":"MIT","readme":"# @composy/stamp-vue\n\n电子印章 Vue 3 适配层 — 组件、组合式 API、插件\n\n## 安装\n\n```bash\npnpm add @composy/stamp-vue\n```\n\n## 快速开始\n\n```vue\n<script setup>\nimport { StampEditor, useStampPresets } from '@composy/stamp-vue'\n</script>\n\n<template>\n  <StampEditor />\n</template>\n```\n\n## 组件\n\n### Stamp / LStamp\n\n纯渲染组件，将 `StampConfig` 渲染为 SVG 或 Canvas。\n\n```vue\n<script setup>\nimport { Stamp } from '@composy/stamp-vue'\nimport { createCompanySeal } from '@composy/stamp-core'\n\nconst config = createCompanySeal({ name: '某某公司' })\n</script>\n\n<template>\n  <Stamp :config=\"config\" mode=\"svg\" />\n</template>\n```\n\n### StampEditor / LStampEditor\n\n表单式简单编辑器。左右分栏布局：左侧控制面板 + 右侧实时预览。\n\n```vue\n<script setup>\nimport { StampEditor } from '@composy/stamp-vue'\n</script>\n\n<template>\n  <StampEditor />\n</template>\n```\n\n### StampDesigner / LStampDesigner\n\n交互式高级设计器。支持画布缩放/平移、元素拖拽、双击内联编辑、键盘快捷键。\n\n```vue\n<script setup>\nimport { StampDesigner } from '@composy/stamp-vue'\n</script>\n\n<template>\n  <StampDesigner />\n</template>\n```\n\n### StampPreview / LStampPreview\n\n轻量级预览组件，适用于列表展示、缩略图等场景。\n\n```vue\n<script setup>\nimport { StampPreview } from '@composy/stamp-vue'\nimport { createCompanySeal } from '@composy/stamp-core'\n\nconst config = createCompanySeal({ name: '某某公司' })\n</script>\n\n<template>\n  <StampPreview :config=\"config\" :width=\"120\" :height=\"120\" />\n</template>\n```\n\n### StampGallery / LStampGallery\n\n预设印章画廊/选择器组件，展示所有内置预设，支持分组浏览。\n\n```vue\n<script setup>\nimport { StampGallery } from '@composy/stamp-vue'\n\nfunction onSelect(key: string) {\n  console.log('选中预设：', key)\n}\n</script>\n\n<template>\n  <StampGallery grouped @select=\"onSelect\" />\n</template>\n```\n\n## 组合式 API\n\n### useStamp\n\n封装 `Stamp` 类的 Vue 响应式包装。\n\n```vue\n<script setup>\nimport { useStamp } from '@composy/stamp-vue'\n\nconst { stamp, svgString, size, download } = useStamp(() => config.value)\n</script>\n```\n\n### useStampEditor\n\n完整编辑器状态管理：预设应用、局部更新、JSON 导入导出、模板解析。\n\n```vue\n<script setup>\nimport { useStampEditor } from '@composy/stamp-vue'\n\nconst { config, applyPreset, exportJson, importJson } = useStampEditor()\napplyPreset('stateEnterprise')\n</script>\n```\n\n### useStampPresets\n\n按分组获取预设列表。\n\n```vue\n<script setup>\nimport { useStampPresets } from '@composy/stamp-vue'\n\nconst { groups, allPresets, getConfig, getLabel } = useStampPresets()\n</script>\n```\n\n### useStampExport\n\n封装多种导出格式的便捷方法。\n\n```vue\n<script setup>\nimport { useStampExport } from '@composy/stamp-vue'\n\nconst { exportAs, downloadAs, batchExport } = useStampExport()\n\n// 导出为 PNG Data URL\nconst dataUrl = exportAs(config, 'png')\n\n// 下载为 SVG 文件\ndownloadAs(config, 'svg', 'my-stamp')\n</script>\n```\n\n## 插件\n\n### createStampPlugin\n\n原生 Vue 3 插件，注册全局组件和 `$stamp` 属性。\n\n```typescript\nimport { createApp } from 'vue'\nimport { createStampPlugin } from '@composy/stamp-vue'\n\nconst app = createApp(App)\napp.use(createStampPlugin({ componentName: 'LStamp' }))\n```\n\n### createStampEnginePlugin\n\nEngine 适配器插件，集成到 `@composy/engine-vue`。\n\n## 样式系统\n\n所有 UI 组件使用 `@composy/color-core` 和 `@composy/size-core` 提供的 CSS 变量：\n\n- 颜色：`--ld-primary-*`、`--ld-danger-*`、`--ld-bg-*`、`--ld-text-*`、`--ld-border-*`\n- 尺寸：`--ld-font-*`、`--ld-spacing-*`、`--ld-radius-*`\n\n组件自动支持 light/dark 主题切换（通过 `data-theme` 属性）。\n\n## 依赖\n\n- `@composy/stamp-core` — 核心引擎\n- `vue` ^3.5.32 (peerDependency)\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-a1f1bf6bfde5aa483c157ee7ca1f7c08"}