@mbsks/rspfx-framework-vue 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/headless.d.ts +4 -0
- package/dist/headless.d.ts.map +1 -0
- package/dist/headless.js +30 -0
- package/dist/headless.js.map +1 -0
- package/dist/index.d.ts +17 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/webpart.d.ts +5 -6
- package/dist/webpart.d.ts.map +1 -1
- package/dist/webpart.js +6 -22
- package/dist/webpart.js.map +1 -1
- package/package.json +16 -10
- package/LICENSE +0 -21
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Component } from 'vue';
|
|
2
|
+
import type { HeadlessAdapter } from '@mbsks/rspfx-core/headless';
|
|
3
|
+
export declare function createVueAdapter<TProps extends Record<string, unknown>>(factory: (props: TProps) => Component): HeadlessAdapter<TProps>;
|
|
4
|
+
//# sourceMappingURL=headless.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headless.d.ts","sourceRoot":"","sources":["../src/headless.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,wBAAgB,gBAAgB,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,GACpC,eAAe,CAAC,MAAM,CAAC,CAyBzB"}
|
package/dist/headless.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createApp } from 'vue';
|
|
2
|
+
export function createVueAdapter(factory) {
|
|
3
|
+
const apps = new WeakMap();
|
|
4
|
+
return {
|
|
5
|
+
mount(root, props) {
|
|
6
|
+
const prev = apps.get(root);
|
|
7
|
+
if (prev)
|
|
8
|
+
prev.unmount();
|
|
9
|
+
const app = createApp(factory(props));
|
|
10
|
+
apps.set(root, app);
|
|
11
|
+
app.mount(root);
|
|
12
|
+
},
|
|
13
|
+
update(root, props) {
|
|
14
|
+
const prev = apps.get(root);
|
|
15
|
+
if (prev)
|
|
16
|
+
prev.unmount();
|
|
17
|
+
const app = createApp(factory(props));
|
|
18
|
+
apps.set(root, app);
|
|
19
|
+
app.mount(root);
|
|
20
|
+
},
|
|
21
|
+
unmount(root) {
|
|
22
|
+
const app = apps.get(root);
|
|
23
|
+
if (app) {
|
|
24
|
+
app.unmount();
|
|
25
|
+
apps.delete(root);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=headless.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headless.js","sourceRoot":"","sources":["../src/headless.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsC,MAAM,KAAK,CAAC;AAGpE,MAAM,UAAU,gBAAgB,CAC9B,OAAqC;IAErC,MAAM,IAAI,GAAG,IAAI,OAAO,EAAuB,CAAC;IAChD,OAAO;QACL,KAAK,CAAC,IAAI,EAAE,KAAK;YACf,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC5B,IAAI,IAAI;gBAAE,IAAI,CAAC,OAAO,EAAE,CAAC;YACzB,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;YACtC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACpB,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,CAAC,IAAI,EAAE,KAAK;YAChB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC5B,IAAI,IAAI;gBAAE,IAAI,CAAC,OAAO,EAAE,CAAC;YACzB,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;YACtC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACpB,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,IAAI;YACV,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC3B,IAAI,GAAG,EAAE,CAAC;gBACR,GAAG,CAAC,OAAO,EAAE,CAAC;gBACd,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const preset:
|
|
1
|
+
import type { RspackContribs, FrameworkRsbuildContributions, FrameworkViteContributions } from '@mbsks/rspfx-plugin-api';
|
|
2
|
+
export declare const preset: {
|
|
3
|
+
name: "vue";
|
|
4
|
+
rspack(_opts: {
|
|
5
|
+
fastRefresh: boolean;
|
|
6
|
+
}): RspackContribs;
|
|
7
|
+
vite(_opts: {
|
|
8
|
+
fastRefresh: boolean;
|
|
9
|
+
}): FrameworkViteContributions;
|
|
10
|
+
rsbuild(opts: {
|
|
11
|
+
fastRefresh: boolean;
|
|
12
|
+
}): FrameworkRsbuildContributions;
|
|
13
|
+
/** @deprecated use rspack() */
|
|
14
|
+
contributions(opts: {
|
|
15
|
+
fastRefresh: boolean;
|
|
16
|
+
}): RspackContribs;
|
|
17
|
+
};
|
|
3
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,cAAc,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAI1I,eAAO,MAAM,MAAM;;kBAEH;QAAE,WAAW,EAAE,OAAO,CAAA;KAAE,GAAG,cAAc;gBAO3C;QAAE,WAAW,EAAE,OAAO,CAAA;KAAE,GAAG,0BAA0B;kBAMnD;QAAE,WAAW,EAAE,OAAO,CAAA;KAAE,GAAG,6BAA6B;IAGtE,+BAA+B;wBACX;QAAE,WAAW,EAAE,OAAO,CAAA;KAAE,GAAG,cAAc;CAG7B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import vuePlugin from '@vitejs/plugin-vue';
|
|
|
2
2
|
import { VueLoaderPlugin } from 'vue-loader';
|
|
3
3
|
export const preset = {
|
|
4
4
|
name: 'vue',
|
|
5
|
-
|
|
5
|
+
rspack(_opts) {
|
|
6
6
|
return {
|
|
7
|
-
rules: [{ test: /\.vue$/, use: 'vue-loader' }],
|
|
7
|
+
rules: [{ test: /\.vue$/, use: 'vue-loader', exclude: /node_modules\/(?!my-lib)/ }],
|
|
8
8
|
plugins: [new VueLoaderPlugin()],
|
|
9
9
|
resolve: { extensions: ['.vue'] }
|
|
10
10
|
};
|
|
@@ -16,7 +16,11 @@ export const preset = {
|
|
|
16
16
|
};
|
|
17
17
|
},
|
|
18
18
|
rsbuild(opts) {
|
|
19
|
-
return this.
|
|
19
|
+
return this.rspack(opts);
|
|
20
|
+
},
|
|
21
|
+
/** @deprecated use rspack() */
|
|
22
|
+
contributions(opts) {
|
|
23
|
+
return this.rspack(opts);
|
|
20
24
|
}
|
|
21
25
|
};
|
|
22
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,CAAC,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,KAAc;IACpB,MAAM,CAAC,KAA+B;QACpC,OAAO;YACL,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;YACnF,OAAO,EAAE,CAAC,IAAI,eAAe,EAAE,CAAC;YAChC,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE;SAClC,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,KAA+B;QAClC,OAAO;YACL,OAAO,EAAE,CAAC,SAAS,EAAE,CAAC;YACtB,iBAAiB,EAAE,CAAC,MAAM,CAAC;SAC5B,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,IAA8B;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IACD,+BAA+B;IAC/B,aAAa,CAAC,IAA8B;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;CAC+B,CAAC"}
|
package/dist/webpart.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { HeadlessWebPart } from '@mbsks/rspfx-webpart-base';
|
|
2
|
+
import type { Component } from 'vue';
|
|
3
|
+
/** @deprecated use createVueAdapter from @mbsks/rspfx-framework-vue/headless + defineWebPart */
|
|
4
|
+
export declare abstract class VueWebPart<TProps extends Record<string, unknown> = Record<string, unknown>, TState = unknown> extends HeadlessWebPart<TProps> {
|
|
4
5
|
protected abstract renderComponent(props: TProps): Component;
|
|
5
|
-
protected
|
|
6
|
-
protected disposeFrom(root: HTMLElement): void;
|
|
7
|
-
protected getComponentProps(): TProps;
|
|
6
|
+
protected createAdapter(): import("packages/core/dist/headless.js").HeadlessAdapter<TProps>;
|
|
8
7
|
}
|
|
9
8
|
//# sourceMappingURL=webpart.d.ts.map
|
package/dist/webpart.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpart.d.ts","sourceRoot":"","sources":["../src/webpart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"webpart.d.ts","sourceRoot":"","sources":["../src/webpart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,gGAAgG;AAChG,8BAAsB,UAAU,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAE,SAAQ,eAAe,CAAC,MAAM,CAAC;IAClJ,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAE5D,SAAS,CAAC,aAAa;CAGxB"}
|
package/dist/webpart.js
CHANGED
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export class VueWebPart extends
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (previous) {
|
|
8
|
-
previous.unmount();
|
|
9
|
-
}
|
|
10
|
-
const app = createApp(this.renderComponent(this.getComponentProps()));
|
|
11
|
-
apps.set(root, app);
|
|
12
|
-
app.mount(root);
|
|
13
|
-
}
|
|
14
|
-
disposeFrom(root) {
|
|
15
|
-
const app = apps.get(root);
|
|
16
|
-
if (app) {
|
|
17
|
-
app.unmount();
|
|
18
|
-
apps.delete(root);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
getComponentProps() {
|
|
22
|
-
return this.properties;
|
|
1
|
+
import { HeadlessWebPart } from '@mbsks/rspfx-webpart-base';
|
|
2
|
+
import { createVueAdapter } from './headless.js';
|
|
3
|
+
/** @deprecated use createVueAdapter from @mbsks/rspfx-framework-vue/headless + defineWebPart */
|
|
4
|
+
export class VueWebPart extends HeadlessWebPart {
|
|
5
|
+
createAdapter() {
|
|
6
|
+
return createVueAdapter((p) => this.renderComponent(p));
|
|
23
7
|
}
|
|
24
8
|
}
|
|
25
9
|
//# sourceMappingURL=webpart.js.map
|
package/dist/webpart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpart.js","sourceRoot":"","sources":["../src/webpart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"webpart.js","sourceRoot":"","sources":["../src/webpart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGjD,gGAAgG;AAChG,MAAM,OAAgB,UAA+F,SAAQ,eAAuB;IAGxI,aAAa;QACrB,OAAO,gBAAgB,CAAS,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mbsks/rspfx-framework-vue",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,18 +15,29 @@
|
|
|
15
15
|
"types": "./dist/webpart.d.ts",
|
|
16
16
|
"import": "./dist/webpart.js",
|
|
17
17
|
"default": "./dist/webpart.js"
|
|
18
|
+
},
|
|
19
|
+
"./headless": {
|
|
20
|
+
"types": "./dist/headless.d.ts",
|
|
21
|
+
"import": "./dist/headless.js",
|
|
22
|
+
"default": "./dist/headless.js"
|
|
18
23
|
}
|
|
19
24
|
},
|
|
20
25
|
"files": [
|
|
21
26
|
"dist"
|
|
22
27
|
],
|
|
23
28
|
"license": "MIT",
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc -p tsconfig.build.json",
|
|
31
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
32
|
+
"test": "vitest run"
|
|
33
|
+
},
|
|
24
34
|
"dependencies": {
|
|
35
|
+
"@mbsks/rspfx-core": "0.0.14",
|
|
36
|
+
"@mbsks/rspfx-plugin-api": "0.0.14",
|
|
37
|
+
"@mbsks/rspfx-webpart-base": "0.0.14",
|
|
25
38
|
"@vitejs/plugin-vue": "^5.2.0",
|
|
26
39
|
"@vue/compiler-sfc": "^3.5.13",
|
|
27
|
-
"vue-loader": "^17.4.2"
|
|
28
|
-
"@mbsks/rspfx-core": "0.0.12",
|
|
29
|
-
"@mbsks/rspfx-plugin-api": "0.0.12"
|
|
40
|
+
"vue-loader": "^17.4.2"
|
|
30
41
|
},
|
|
31
42
|
"peerDependencies": {
|
|
32
43
|
"vue": "^3.5.0"
|
|
@@ -38,10 +49,5 @@
|
|
|
38
49
|
"repository": {
|
|
39
50
|
"type": "git",
|
|
40
51
|
"url": "git+https://github.com/master8848/rspfx.git"
|
|
41
|
-
},
|
|
42
|
-
"scripts": {
|
|
43
|
-
"build": "tsc -p tsconfig.build.json",
|
|
44
|
-
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
45
|
-
"test": "vitest run"
|
|
46
52
|
}
|
|
47
|
-
}
|
|
53
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 RSPFX contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|