Skip to content

Commit

Permalink
build: 缩包
Browse files Browse the repository at this point in the history
  • Loading branch information
liningzhu committed Jan 8, 2024
1 parent 9e585d6 commit 426e5a0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 30 deletions.
28 changes: 2 additions & 26 deletions packages/buitar-editor/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
export function printElement(elementId: string) {
// // 隐藏除了指定 DOM 元素之外的内容
// const allElements: NodeListOf<HTMLElement> = document.querySelectorAll('body > *:not(#' + elementId + ')');
// allElements.forEach(function(element) {
// element.style.display = 'none';
// });

// // // 打印指定 DOM 元素
// const elementToPrint = document.getElementById(elementId);

// let tempEl = elementToPrint
// while (tempEl?.parentElement && tempEl?.parentElement !== document.body) {
// tempEl.style.display = 'block';
// console.log('lnz tempEl?.parentElement', tempEl?.parentElement);
// tempEl = tempEl?.parentElement
// }
// console.log('lnz elementToPrint', elementToPrint);

window.print();



// // 恢复显示所有内容
// allElements.forEach(function(element) {
// element.style.display = '';
// });
}
window.print()
}
4 changes: 2 additions & 2 deletions packages/buitar/src/components/svg-chord/vex-chord.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useIsMobile } from '@/utils/hooks/use-device'
import { Point } from '@buitar/to-guitar'
import { FC, memo, useEffect, useRef } from 'react'
import Vex, { Voice, StaveNote, Formatter } from 'vexflow'
const { Renderer, Stave } = Vex.Flow
import { Voice, StaveNote, Formatter, Flow } from 'vexflow/core'
import cx from 'classnames'
import styles from './vex-chord.module.scss'

const { Renderer, Stave } = Flow
export const VexChord: FC<{ taps: Point[]; className?: string }> = memo(({ taps, className }) => {
const divRef = useRef<HTMLDivElement>()
const isMobile = useIsMobile()
Expand Down
1 change: 0 additions & 1 deletion packages/buitar/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export default defineConfig({
tone: ['tone'],
vexflow: ['vexflow'],
'react-libs': ['react', 'react-dom', 'react-router-dom'],
// 'buitar-libs': ['@buitar/abc-editor', '@buitar/to-guitar', '@buitar/tone-player'],
'@buitar/abc-editor':['@buitar/abc-editor'],
'@buitar/to-guitar':['@buitar/to-guitar'],
'@buitar/tone-player':['@buitar/tone-player'],
Expand Down
2 changes: 1 addition & 1 deletion packages/tone-player/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@buitar/tone-player",
"version": "0.0.1",
"main": "dist/index.esm.js",
"main": "src/index.ts",
"types": "dist/index.d.ts",
"author": "[email protected]",
"license": "MIT",
Expand Down

0 comments on commit 426e5a0

Please sign in to comment.