Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc308b0c

Browse files
author
knight.chen
committed
misc: upgrade deps version
1 parent838f956 commitc308b0c

File tree

11 files changed

+1996
-1561
lines changed

11 files changed

+1996
-1561
lines changed

‎package.json‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
88
"lint":"pnpm run lint:code && pnpm run lint:type",
99
"lint:code":"eslint ./packages/**/*.ts && stylelint ./packages/**/*.less",
1010
"lint:type":"pnpm -r lint:type",
11-
"prepare":"husky install && pnpm build"
11+
"prepare":"husky install"
1212
},
1313
"devDependencies": {
1414
"@rushstack/eslint-patch":"^1.2.0",
15-
"@types/node":"^18.15.3",
16-
"@typescript-eslint/eslint-plugin":"^5.55.0",
17-
"@typescript-eslint/parser":"^5.55.0",
15+
"@types/node":"^18.16.9",
16+
"@typescript-eslint/eslint-plugin":"^5.59.5",
17+
"@typescript-eslint/parser":"^5.59.5",
1818
"@vue/eslint-config-prettier":"^7.1.0",
19-
"@vue/eslint-config-typescript":"^11.0.2",
20-
"eslint":"^8.36.0",
21-
"eslint-config-prettier":"^8.7.0",
19+
"@vue/eslint-config-typescript":"^11.0.3",
20+
"eslint":"^8.40.0",
21+
"eslint-config-prettier":"^8.8.0",
2222
"eslint-plugin-prettier":"^4.2.1",
23-
"eslint-plugin-vue":"^9.9.0",
23+
"eslint-plugin-vue":"^9.12.0",
2424
"husky":"^8.0.3",
25-
"lint-staged":"^13.2.0",
25+
"lint-staged":"^13.2.2",
2626
"postcss":"8.4.14",
2727
"postcss-html":"^1.5.0",
2828
"postcss-less":"^6.0.0",
29-
"prettier":"^2.8.4",
30-
"stylelint":"^15.2.0",
29+
"prettier":"^2.8.8",
30+
"stylelint":"^15.6.1",
3131
"stylelint-config-prettier":"^9.0.5",
3232
"stylelint-config-rational-order":"^0.1.2",
3333
"stylelint-config-recommended-less":"^1.0.4",

‎packages/hooks/package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
},
2020
"dependencies": {},
2121
"devDependencies": {
22-
"@alilc/lowcode-designer":"^1.1.3",
23-
"@alilc/lowcode-types":"^1.1.3",
24-
"vite":"^4.1.4",
22+
"@alilc/lowcode-designer":"^1.1.6",
23+
"@alilc/lowcode-types":"^1.1.6",
24+
"vite":"^4.3.5",
2525
"vite-plugin-lib-types":"^0.1.2",
26-
"vue":"^3.2.47"
26+
"vue":"~3.2.47"
2727
},
2828
"peerDependencies": {
2929
"@alilc/lowcode-designer":">= 1.1.x < 2",

‎packages/hooks/src/renderer-context.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { inject, getCurrentInstance } from 'vue';
66
exporttypeDesignMode='live'|'design';
77

88
exportinterfaceRendererContext{
9-
readonlycomponents:Record<string,Component>;
9+
readonlycomponents:Record<string,Component<any,any,any>>;
1010
readonlydesignMode:DesignMode;
1111
readonlythisRequiredInJSE:boolean;
1212
getNode(id:string):Node|null;

‎packages/utils/package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
},
2020
"dependencies": {},
2121
"devDependencies": {
22-
"@alilc/lowcode-designer":"^1.1.3",
23-
"@alilc/lowcode-types":"^1.1.3",
24-
"vite":"^4.1.4",
22+
"@alilc/lowcode-designer":"^1.1.6",
23+
"@alilc/lowcode-types":"^1.1.6",
24+
"vite":"^4.3.5",
2525
"vite-plugin-lib-types":"^0.1.2",
26-
"vue":"^3.2.47"
26+
"vue":"~3.2.47"
2727
},
2828
"peerDependencies": {
2929
"@alilc/lowcode-designer":">= 1.1.x < 2",

‎packages/vue-renderer/package.json‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@
2222
"dependencies": {
2323
"@knxcloud/lowcode-hooks":"workspace:*",
2424
"@knxcloud/lowcode-utils":"workspace:*",
25-
"intl-messageformat":"^10.3.1"
25+
"intl-messageformat":"^10.3.5"
2626
},
2727
"devDependencies": {
28-
"@alilc/lowcode-designer":"^1.1.3",
29-
"@alilc/lowcode-types":"^1.1.3",
30-
"@vitejs/plugin-vue":"^4.0.0",
31-
"@vitejs/plugin-vue-jsx":"^3.0.0",
32-
"deepmerge":"^4.3.0",
33-
"vite":"^4.1.4",
28+
"@alilc/lowcode-designer":"^1.1.6",
29+
"@alilc/lowcode-types":"^1.1.6",
30+
"@vitejs/plugin-vue":"^4.2.1",
31+
"@vitejs/plugin-vue-jsx":"^3.0.1",
32+
"vite":"^4.3.5",
3433
"vite-plugin-lib-types":"^0.1.2",
35-
"vue":"^3.2.47",
36-
"vue-router":"^4.1.6"
34+
"vue":"~3.2.47",
35+
"vue-router":"~4.1.6"
3736
},
3837
"peerDependencies": {
3938
"@alilc/lowcode-designer":">= 1.1.x < 2",
Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,18 @@
1-
import{defineComponent,Fragment,h,mergeProps}from'vue';
1+
import{defineComponent,h,mergeProps,renderSlot}from'vue';
22
import{isFragment,splitLeafProps}from'./use';
33
import{leafProps}from'./base';
4-
import{useRendererContext}from'@knxcloud/lowcode-hooks';
54

65
exportconstLive=defineComponent({
76
inheritAttrs:false,
87
props:leafProps,
98
setup:(props,{ attrs, slots})=>{
10-
const{ triggerCompGetCtx}=useRendererContext();
11-
129
return()=>{
13-
const{__comp:comp,__vnodeProps:vnodeProps,__schema:schema}=props;
10+
const{__comp:comp,__vnodeProps:vnodeProps}=props;
1411
constcompProps=splitLeafProps(attrs)[1];
1512
if(isFragment(comp)){
16-
returnh(Fragment,slots.default?.());
13+
returnrenderSlot(slots,'default',attrs);
1714
}
18-
returncomp
19-
?h(
20-
comp,
21-
mergeProps(compProps,vnodeProps,{
22-
onVnodeMounted(vnode){
23-
constinstance=vnode.component?.proxy;
24-
instance&&triggerCompGetCtx(schema,instance);
25-
},
26-
}),
27-
slots
28-
)
29-
:null;
15+
returncomp ?h(comp,mergeProps(compProps,vnodeProps),slots) :null;
3016
};
3117
},
3218
});

‎packages/vue-renderer/src/core/use.ts‎

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434
onRenderTriggered,
3535
onServerPrefetch,
3636
}from'vue';
37-
importtype{Node,Prop}from'@alilc/lowcode-designer';
37+
importtype{Node}from'@alilc/lowcode-designer';
3838
importtype{
3939
IPublicTypeNodeDataasNodeData,
4040
IPublicTypeSlotSchemaasSlotSchema,
@@ -435,8 +435,10 @@ export function useLeaf(
435435
schema:unknown,
436436
scope:RuntimeScope,
437437
blockScope?:BlockScope|null,
438-
prop?:Prop|null
438+
path?:string|null,
439+
node?:Node|null
439440
):any=>{
441+
constprop=path ?node?.getProp(path,false) :null;
440442
if(isJSExpression(schema)||isJSFunction(schema)){
441443
// 处理表达式和函数
442444
returnparser.parseExpression(schema,scope);
@@ -469,16 +471,15 @@ export function useLeaf(
469471
}elseif(isArray(schema)){
470472
// 属性值为 array,递归处理属性的每一项
471473
returnschema.map((item,idx)=>
472-
buildNormalProp(item,scope,blockScope,prop?.get(idx))
474+
buildNormalProp(item,scope,blockScope,`${path}[${idx}]`,node)
473475
);
474476
}elseif(schema&&isObject(schema)){
475477
// 属性值为 object,递归处理属性的每一项
476478
constres:Record<string,unknown>={};
477479
Object.keys(schema).forEach((key)=>{
478480
if(key.startsWith('__'))return;
479481
constval=schema[key];
480-
constchildProp=prop?.get(key);
481-
res[key]=buildNormalProp(val,scope,blockScope,childProp);
482+
res[key]=buildNormalProp(val,scope,blockScope,`${path}.${key}`,node);
482483
});
483484
returnres;
484485
}
@@ -497,7 +498,8 @@ export function useLeaf(
497498
schema:unknown,
498499
scope:RuntimeScope,
499500
blockScope?:BlockScope|null,
500-
prop?:Prop|null
501+
path?:string|null,
502+
node?:Node|null
501503
):any=>{
502504
if(isString(schema)){
503505
constfield=schema;
@@ -537,9 +539,9 @@ export function useLeaf(
537539
lastInst=inst;
538540
};
539541
}else{
540-
constpropValue=buildNormalProp(schema,scope,blockScope,prop);
542+
constpropValue=buildNormalProp(schema,scope,blockScope,path,node);
541543
returnisString(propValue)
542-
?buildRefProp(propValue,scope,blockScope,prop)
544+
?buildRefProp(propValue,scope,blockScope,path,node)
543545
:propValue;
544546
}
545547
};
@@ -570,13 +572,8 @@ export function useLeaf(
570572
constschema=processed[propName];
571573
parsedProps[propName]=
572574
propName==='ref'
573-
?buildRefProp(schema,mergedScope,blockScope,node?.getProp(propName)asProp)
574-
:buildNormalProp(
575-
schema,
576-
mergedScope,
577-
blockScope,
578-
node?.getProp(propName)asProp
579-
);
575+
?buildRefProp(schema,mergedScope,blockScope,propName,node)
576+
:buildNormalProp(schema,mergedScope,blockScope,propName,node);
580577
});
581578

582579
// 应用运行时附加的属性值

‎packages/vue-simulator-renderer/package.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@
2626
"@knxcloud/lowcode-vue-renderer":"workspace:*"
2727
},
2828
"devDependencies": {
29-
"@alilc/lowcode-designer":"^1.1.3",
30-
"@alilc/lowcode-types":"^1.1.3",
31-
"@vitejs/plugin-vue":"^4.0.0",
32-
"@vitejs/plugin-vue-jsx":"^3.0.0",
29+
"@alilc/lowcode-designer":"^1.1.6",
30+
"@alilc/lowcode-types":"^1.1.6",
31+
"@vitejs/plugin-vue":"^4.2.1",
32+
"@vitejs/plugin-vue-jsx":"^3.0.1",
3333
"@vue/cli-plugin-babel":"^5.0.8",
3434
"@vue/cli-plugin-eslint":"^5.0.8",
3535
"@vue/cli-plugin-typescript":"^5.0.8",
3636
"@vue/cli-service":"^5.0.8",
3737
"less":"^4.1.3",
3838
"less-loader":"^11.1.0",
39-
"vite":"^4.1.4",
39+
"vite":"^4.3.5",
4040
"vite-plugin-lib-types":"^0.1.2",
41-
"vue":"^3.2.47",
42-
"vue-router":"^4.1.6"
41+
"vue":"~3.2.47",
42+
"vue-router":"~4.1.6"
4343
},
4444
"peerDependencies": {
4545
"@alilc/lowcode-designer":">= 1.1.x < 2",

‎packages/vue-simulator-renderer/src/interface.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import type {
66
AssetList,
77
IPublicTypeNpmInfoasNpmInfo,
88
IPublicTypeRootSchemaasRootSchema,
9-
IPublicTypeContainerSchemaasContainerSchema,
109
IPublicTypeComponentSchemaasComponentSchema,
1110
IPublicTypeNodeInstance,
1211
}from'@alilc/lowcode-types';
@@ -73,7 +72,6 @@ export interface VueSimulatorRenderer extends BuiltinSimulatorRenderer {
7372
rerender():void;
7473
getCurrentDocument():DocumentInstance|null;
7574
rerender:()=>void;
76-
createComponent(schema:ContainerSchema):Component|null;
7775
getComponent(componentName:string):Component;
7876
getClosestNodeInstance(
7977
from:ComponentRecord|Element,

‎packages/vue-simulator-renderer/src/simulator.ts‎

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import type { IPublicTypeContainerSchema } from '@alilc/lowcode-types';
33
import{
44
typeRef,
55
typeComponent,
6-
defineComponent,
7-
h,
86
createApp,
97
ref,
108
shallowRef,
@@ -22,7 +20,7 @@ import type {
2220
SimulatorViewLayout,
2321
VueSimulatorRenderer,
2422
}from'./interface';
25-
importVueRenderer,{
23+
import{
2624
config,
2725
LOWCODE_ROUTE_META,
2826
SchemaParser,
@@ -52,7 +50,6 @@ import {
5250
setNativeSelection,
5351
createComponentRecord,
5452
parseFileNameToPath,
55-
parseFileNameToCompName,
5653
isVNodeHTMLElement,
5754
CompRootHTMLElement,
5855
}from'./utils';
@@ -259,11 +256,7 @@ function createSimulatorRenderer() {
259256
function_buildComponents(){
260257
components.value={
261258
...builtinComponents,
262-
...buildComponents(
263-
libraryMap.value,
264-
componentsMap.value,
265-
simulator.createComponent
266-
),
259+
...buildComponents(libraryMap.value,componentsMap.value),
267260
};
268261
}
269262

@@ -329,44 +322,6 @@ function createSimulatorRenderer() {
329322
};
330323
simulator.getComponent=(componentName)=>components.value[componentName];
331324

332-
letcreatedCount=0;
333-
simulator.createComponent=({ css, ...schema})=>{
334-
constcompId=`Component-${schema.id||createdCount++}`;
335-
constCreatedComponent=defineComponent({
336-
props:VueRenderer.props,
337-
setup:(props,{ slots})=>{
338-
letstyleEl=document.getElementById(compId);
339-
if(css&&!styleEl){
340-
constdoc=window.document;
341-
styleEl=doc.createElement('style');
342-
styleEl.setAttribute('type','text/css');
343-
styleEl.setAttribute('id',compId);
344-
styleEl.appendChild(doc.createTextNode(css));
345-
doc.head.appendChild(styleEl);
346-
}
347-
return()=>{
348-
returnh(
349-
VueRenderer,
350-
{
351-
schema,
352-
locale:simulator.locale,
353-
device:simulator.device,
354-
passProps:props,
355-
components:components.value,
356-
},
357-
slots
358-
);
359-
};
360-
},
361-
});
362-
if(schema.fileName){
363-
CreatedComponent.name=parseFileNameToCompName(schema.fileName);
364-
}
365-
if(schema.props){
366-
CreatedComponent.props=Object.keys(schema.props);
367-
}
368-
returnCreatedComponent;
369-
};
370325
simulator.getClientRects=(element)=>getClientRects(element);
371326
simulator.setNativeSelection=(enable)=>setNativeSelection(enable);
372327
simulator.setDraggingState=(state)=>cursor.setDragging(state);
@@ -402,17 +357,20 @@ function createSimulatorRenderer() {
402357
document.documentElement.classList.add('engine-page');
403358
document.body.classList.add('engine-document');
404359
simulator.app.use(simulator.router).mount(container);
360+
//@ts-expect-error
405361
host.project.setRendererReady(simulator);
406362
};
407363

408364
disposeFunctions.push(
409365
host.connect(simulator,()=>{
410-
constconfig=host.project.get('config');
366+
constconfig=host.project.get('config')||{};
411367

412368
// sync layout config
413369
layout.value=config.layout??{};
414370
// sync disableCompMock
415-
disableCompMock.value=config.disableCompMock??false;
371+
disableCompMock.value=isArray(config.disableCompMock)
372+
?config.disableCompMock
373+
:Boolean(config.disableCompMock);
416374

417375
// todo: split with others, not all should recompute
418376
if(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp