-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
215 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
package-lock.json | ||
.DS_Store | ||
dist | ||
dist-ssr | ||
coverage | ||
*.local | ||
|
||
# Editor directories and files | ||
.idea | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Fabric Vue.js Sandbox | ||
|
||
A [`vue`](https://vuejs.org/) app for reproducing `fabric` issues and creating examples. | ||
|
||
## Reproducing | ||
|
||
Creating a clear, easy to use reproduction is very **IMPORTANT**. | ||
Keep it simple and concise. | ||
Don't add stuff that is out of scope. | ||
|
||
Make sure you are reproducing with the correct version of fabric. | ||
|
||
Provide a **detailed description** including steps to reproduce in the [`REPRODUCE.md`](./REPRODUCE.md) file. | ||
|
||
Navigate to [`src/App.vue`](./src/App.vue) and start editing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Reproducing | ||
|
||
## Steps | ||
|
||
1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="vite/client" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite App</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "vue", | ||
"version": "0.0.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "run-p type-check \"build-only {@}\" --", | ||
"preview": "vite preview", | ||
"build-only": "vite build", | ||
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false" | ||
}, | ||
"dependencies": { | ||
"fabric": "file:../../..", | ||
"vue": "^3.3.4" | ||
}, | ||
"devDependencies": { | ||
"@tsconfig/node18": "^18.2.2", | ||
"@types/node": "^18.18.5", | ||
"@vitejs/plugin-vue": "^4.4.0", | ||
"@vitejs/plugin-vue-jsx": "^3.0.2", | ||
"@vue/tsconfig": "^0.4.0", | ||
"npm-run-all2": "^6.1.1", | ||
"typescript": "~5.2.0", | ||
"vite": "^4.4.11", | ||
"vue-tsc": "^1.8.19" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"template": "vue-cli" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<canvas ref="canvas"></canvas> | ||
</template> | ||
|
||
<script> | ||
import * as fabric from 'fabric'; | ||
export default { | ||
name: 'Canvas', | ||
mounted() { | ||
// Do we need to use https://vuejs.org/api/reactivity-advanced.html#markraw? | ||
const canvas = new fabric.Canvas(this.$refs.canvas, { | ||
width: 500, | ||
height: 500, | ||
}); | ||
const textValue = 'fabric.js sandbox'; | ||
const text = new fabric.Textbox(textValue, { | ||
originX: 'center', | ||
splitByGrapheme: true, | ||
width: 200, | ||
top: 20, | ||
styles: fabric.util.stylesFromArray( | ||
[ | ||
{ | ||
style: { | ||
fontWeight: 'bold', | ||
fontSize: 64, | ||
}, | ||
start: 0, | ||
end: 9, | ||
}, | ||
], | ||
textValue | ||
), | ||
}); | ||
canvas.add(text); | ||
canvas.centerObjectH(text); | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { createApp } from 'vue'; | ||
import App from './App.vue'; | ||
|
||
createApp(App).mount('#app'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"extends": "@vue/tsconfig/tsconfig.dom.json", | ||
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"], | ||
"exclude": ["src/**/__tests__/*"], | ||
"compilerOptions": { | ||
"composite": true, | ||
"baseUrl": ".", | ||
"paths": { | ||
"@/*": ["./src/*"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"files": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.node.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.app.json" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"extends": "@tsconfig/node18/tsconfig.json", | ||
"include": [ | ||
"vite.config.*", | ||
"vitest.config.*", | ||
"cypress.config.*", | ||
"nightwatch.conf.*", | ||
"playwright.config.*" | ||
], | ||
"compilerOptions": { | ||
"composite": true, | ||
"module": "ESNext", | ||
"moduleResolution": "Bundler", | ||
"types": ["node"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { fileURLToPath, URL } from 'node:url'; | ||
|
||
import { defineConfig } from 'vite'; | ||
import vue from '@vitejs/plugin-vue'; | ||
import vueJsx from '@vitejs/plugin-vue-jsx'; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [vue(), vueJsx()], | ||
resolve: { | ||
alias: { | ||
'@': fileURLToPath(new URL('./src', import.meta.url)), | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ before_commit | |
**/dist/ | ||
/lib/ | ||
/test/ | ||
/website/ | ||
.next/ | ||
.parcel-cache/ | ||
/docs/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters