Skip to content

Commit fb6c7b8

Browse files
authored
0.1.2 (#44)
* Live demo (#42) * feat: add progress in vue playground * feat: add 600 delay * Attached (#43) * feat: add progress in vue playground * feat: add 600 delay * feat: check attached and isMounted * chore: playground ci package update * chore: playground try 0.1.2-beta vue-skia * version: 0.1.2
1 parent a53a28f commit fb6c7b8

File tree

10 files changed

+30
-10
lines changed

10 files changed

+30
-10
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "monorepo",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"private": "true",
55
"scripts": {},
66
"packageManager": "[email protected]"

soft-skia-wasm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "soft-skia-wasm"
3-
version = "0.11.0"
3+
version = "0.12.0"
44
authors = ["meloalright <[email protected]>"]
55
edition = "2018"
66

soft-skia/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "soft_skia"
3-
version = "0.11.0"
3+
version = "0.12.0"
44
edition = "2021"
55
description="software rasterization skia binding"
66
license = "MIT"

vue-playground/package-ci.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-playground",
3-
"version": "0.11.0",
3+
"version": "0.12.0",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve",
@@ -14,7 +14,8 @@
1414
"prismjs": "^1.29.0",
1515
"vue": "^3.2.13",
1616
"vue-live": "^2.5.4",
17-
"vue-skia": "0.1.1"
17+
"vue3-progress": "0.0.1-beta4",
18+
"vue-skia": "0.1.2"
1819
},
1920
"devDependencies": {
2021
"@types/node": "^20.5.0",

vue-playground/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-playground",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve",
@@ -14,6 +14,7 @@
1414
"prismjs": "^1.29.0",
1515
"vue": "^3.2.13",
1616
"vue-live": "^2.5.4",
17+
"vue3-progress": "0.0.1-beta4",
1718
"vue-skia": "workspace:*"
1819
},
1920
"devDependencies": {

vue-playground/src/App.vue

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<template>
2+
<vue3-progress />
23
<main v-if="!loading" style="text-align: center">
34
<template v-if="true">
45
<h1>Vue Skia</h1>
@@ -19,6 +20,7 @@
1920
</div>
2021
<VueLive
2122
:editorProps="{ lineNumbers: true }"
23+
:delay="600"
2224
:code="!loading && !debug ? code : LoadingCode"
2325
:layout="CustomLayout"
2426
:components="{
@@ -113,6 +115,7 @@ import code from "./code";
113115
import LoadingCode from "./loading-code";
114116
import "vue-live/style.css";
115117
import "prism-themes/themes/prism-night-owl.css";
118+
116119
export default defineComponent({
117120
name: "App",
118121
components: {
@@ -159,11 +162,15 @@ export default defineComponent({
159162
}
160163
161164
this.loading = false;
165+
(this as unknown as { $progress: { start: () => void; finish: () => void } }).$progress.finish();
162166
});
163167
},
168+
created() {
169+
(this as unknown as { $progress: { start: () => void; finish: () => void } }).$progress.start();
170+
},
164171
methods: {
165172
input(event: any) {
166-
this.code = event.target._value;
173+
// this.code = event.target._value;
167174
},
168175
copy() {
169176
try {

vue-playground/src/main.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import { createApp } from "vue";
22
import App from "./App.vue";
33
import { VueSkia } from 'vue-skia'
4+
import Vue3Progress from "vue3-progress";
45

56
const app = createApp(App);
67
app.use(VueSkia);
8+
app.use(Vue3Progress, {
9+
position: "fixed",
10+
color: "rgb(0, 161, 132)",
11+
})
712
app.mount("#app");

vue-skia-framework/package-publish.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-skia",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"files": [
55
"lib",
66
"type.d.ts",
@@ -13,6 +13,6 @@
1313
"main": "./main.js",
1414
"module": "./main.js",
1515
"dependencies": {
16-
"soft-skia-wasm": "0.11.0"
16+
"soft-skia-wasm": "0.12.0"
1717
}
1818
}

vue-skia-framework/plugin/index.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const VSKNode = (name: string) => {
6464
instance._ssw_id = (
6565
parent as ComponentInternalInstanceWithSoftSkiaWASM
6666
)._ssw_id;
67+
instance._ssw_attached = true;
6768

6869
instance._ssw_grouped = (child) => {
6970
core.setAttrBySerde(instance._ssw_id, {
@@ -103,6 +104,7 @@ const VSKNode = (name: string) => {
103104
}
104105
const core = root.ssw;
105106
instance._ssw_id = SelfIncreaseCount.count;
107+
instance._ssw_attached = true;
106108
var parent = instance.parent;
107109
while (!('_ssw_id' in parent)) {
108110
parent = parent.parent;
@@ -208,7 +210,10 @@ const VSKNode = (name: string) => {
208210
while (!('_ssw_id' in parent)) {
209211
parent = parent.parent;
210212
}
211-
core.removeChildFromContainer(child_id, (parent as ComponentInternalInstanceWithSoftSkiaWASM)._ssw_id)
213+
instance._ssw_attached = false;
214+
if ((parent as ComponentInternalInstanceWithSoftSkiaWASM)._ssw_attached && parent.isMounted) {
215+
core.removeChildFromContainer(child_id, (parent as ComponentInternalInstanceWithSoftSkiaWASM)._ssw_id)
216+
}
212217
});
213218

214219
return () => h(name, {}, slots.default?.())

vue-skia-framework/type.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { SoftSkiaWASM } from '../soft-skia-wasm/pkg/';
66
export type ComponentInternalInstanceWithSoftSkiaWASM = ComponentInternalInstance & {
77
ssw: SoftSkiaWASM;
88
_ssw_id: number;
9+
_ssw_attached: boolean;
910
_ssw_grouped?: (instance: ComponentInternalInstanceWithSoftSkiaWASM) => void;
1011
_ssw_batchDraw?: () => void;
1112
}

0 commit comments

Comments
 (0)