@dcloudio/uni-cli-shared 3.0.0-alpha-5000720260416001 → 3.0.0-alpha-5000820260420001
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/constants.d.ts +1 -3
- package/dist/constants.js +2 -6
- package/dist/deps.d.ts +1 -0
- package/dist/deps.js +22 -13
- package/dist/dom2/fontFamily.d.ts +4 -0
- package/dist/dom2/fontFamily.js +21 -0
- package/dist/dom2/index.d.ts +2 -0
- package/dist/dom2/index.js +2 -0
- package/dist/dom2/sharedData.d.ts +4 -0
- package/dist/dom2/sharedData.js +38 -5
- package/dist/dom2/vue.d.ts +15 -0
- package/dist/dom2/vue.js +41 -0
- package/dist/easycom.js +13 -9
- package/dist/env/define.d.ts +0 -1
- package/dist/env/define.js +3 -11
- package/dist/hbx/alias.js +48 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/json/uni-x/manifest.d.ts +1 -1
- package/dist/json/uni-x/manifest.js +2 -1
- package/dist/json/utils.js +24 -0
- package/dist/messages/en.d.ts +2 -0
- package/dist/messages/en.js +2 -0
- package/dist/messages/index.d.ts +4 -0
- package/dist/messages/zh_CN.d.ts +2 -0
- package/dist/messages/zh_CN.js +2 -0
- package/dist/uni_modules.cloud.js +28 -13
- package/dist/uni_modules.js +3 -2
- package/dist/uts.js +4 -2
- package/dist/vite/autoImport.js +7 -4
- package/dist/vite/cloud.js +13 -6
- package/dist/vite/extApi.js +4 -1
- package/dist/vite/plugins/json.js +2 -69
- package/dist/vite/plugins/stats.js +2 -1
- package/dist/vite/plugins/uts/uni_modules.js +7 -2
- package/dist/vite/plugins/vitejs/plugins/css.js +6 -4
- package/dist/workers.js +2 -0
- package/dist/x.d.ts +10 -0
- package/dist/x.js +39 -0
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.cjs +0 -7
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.mjs +0 -7
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.js +1 -1
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.prod.js +1 -1
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.d.ts +1 -0
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.esm-bundler.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.prod.js +1 -1
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +348 -120
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +99 -56
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +70 -47
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.d.ts +127 -107
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +70 -48
- package/lib/dom2/app/@vue/compiler-vapor-dom2/dist/compiler-vapor-dom2.cjs.js +1 -1
- package/lib/dom2/app/@vue/shared/dist/shared.cjs.js +1 -1
- package/lib/dom2/app/@vue/shared/dist/shared.cjs.prod.js +1 -1
- package/lib/dom2/app/@vue/shared/dist/shared.esm-bundler.js +1 -1
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-vapor v3.6.0-beta.
|
|
2
|
+
* @vue/compiler-vapor v3.6.0-beta.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -18989,7 +18989,7 @@ function wrapTemplate(node, dirs) {
|
|
|
18989
18989
|
const reserved = [];
|
|
18990
18990
|
const pass = [];
|
|
18991
18991
|
node.props.forEach((prop) => {
|
|
18992
|
-
if (prop.type === 7 && dirs.includes(prop.name)) reserved.push(prop);
|
|
18992
|
+
if (prop.type === 7 && (dirs.includes(prop.name) || prop.name === "bind" && prop.arg && prop.arg.type === 4 && prop.arg.content === "key" && dirs.includes("key"))) reserved.push(prop);
|
|
18993
18993
|
else pass.push(prop);
|
|
18994
18994
|
});
|
|
18995
18995
|
return extend({}, node, {
|
|
@@ -19049,13 +19049,6 @@ function getLiteralExpressionValue(exp, excludeNumber) {
|
|
|
19049
19049
|
}
|
|
19050
19050
|
return exp.isStatic ? exp.content : null;
|
|
19051
19051
|
}
|
|
19052
|
-
function isInTransition(context) {
|
|
19053
|
-
const parentNode = context.parent && context.parent.node;
|
|
19054
|
-
return !!(parentNode && isTransitionNode(parentNode));
|
|
19055
|
-
}
|
|
19056
|
-
function isTransitionNode(node) {
|
|
19057
|
-
return node.type === 1 && isTransitionTag(node.tag);
|
|
19058
|
-
}
|
|
19059
19052
|
function isTransitionTag(tag) {
|
|
19060
19053
|
tag = tag.toLowerCase();
|
|
19061
19054
|
return tag === "transition" || tag === "vaportransition";
|
|
@@ -19523,12 +19516,14 @@ const IRNodeTypes = {
|
|
|
19523
19516
|
"14": "IF",
|
|
19524
19517
|
"FOR": 15,
|
|
19525
19518
|
"15": "FOR",
|
|
19526
|
-
"
|
|
19527
|
-
"16": "
|
|
19528
|
-
"
|
|
19529
|
-
"17": "
|
|
19530
|
-
"
|
|
19531
|
-
"18": "
|
|
19519
|
+
"KEY": 16,
|
|
19520
|
+
"16": "KEY",
|
|
19521
|
+
"GET_TEXT_CHILD": 17,
|
|
19522
|
+
"17": "GET_TEXT_CHILD",
|
|
19523
|
+
"GET_INSERTION_PARENT": 18,
|
|
19524
|
+
"18": "GET_INSERTION_PARENT",
|
|
19525
|
+
"SET_CHANGE_PROP": 19,
|
|
19526
|
+
"19": "SET_CHANGE_PROP"
|
|
19532
19527
|
};
|
|
19533
19528
|
const DynamicFlag = {
|
|
19534
19529
|
"NONE": 0,
|
|
@@ -19542,7 +19537,7 @@ const DynamicFlag = {
|
|
|
19542
19537
|
};
|
|
19543
19538
|
function isBlockOperation(op) {
|
|
19544
19539
|
const type = op.type;
|
|
19545
|
-
return type === 11 || type === 12 || type === 14 || type === 15;
|
|
19540
|
+
return type === 11 || type === 12 || type === 14 || type === 16 || type === 15;
|
|
19546
19541
|
}
|
|
19547
19542
|
|
|
19548
19543
|
//#endregion
|
|
@@ -20800,7 +20795,7 @@ function genSlotBlockWithProps(oper, context) {
|
|
|
20800
20795
|
let propsName;
|
|
20801
20796
|
let exitScope;
|
|
20802
20797
|
let depth;
|
|
20803
|
-
const { props,
|
|
20798
|
+
const { props, node } = oper;
|
|
20804
20799
|
const idToPathMap = props ? parseValueDestructure(props, context) : /* @__PURE__ */ new Map();
|
|
20805
20800
|
if (props) if (props.ast) {
|
|
20806
20801
|
[depth, exitScope] = context.enterScope();
|
|
@@ -20810,16 +20805,6 @@ function genSlotBlockWithProps(oper, context) {
|
|
|
20810
20805
|
if (propsName) idMap[propsName] = null;
|
|
20811
20806
|
let blockFn = context.withId(() => genBlock(oper, context, propsName ? [propsName] : []), idMap);
|
|
20812
20807
|
exitScope && exitScope();
|
|
20813
|
-
if (key) blockFn = [
|
|
20814
|
-
`() => {`,
|
|
20815
|
-
INDENT_START,
|
|
20816
|
-
NEWLINE,
|
|
20817
|
-
`return `,
|
|
20818
|
-
...genCall(context.helper("createKeyedFragment"), [`() => `, ...genExpression(key, context)], blockFn),
|
|
20819
|
-
INDENT_END,
|
|
20820
|
-
NEWLINE,
|
|
20821
|
-
`}`
|
|
20822
|
-
];
|
|
20823
20808
|
if (node.type === 1) {
|
|
20824
20809
|
if (needsVaporCtx(oper)) blockFn = [
|
|
20825
20810
|
`${context.helper("withVaporCtx")}(`,
|
|
@@ -20893,6 +20878,20 @@ function genSlotOutlet(oper, context) {
|
|
|
20893
20878
|
return frag;
|
|
20894
20879
|
}
|
|
20895
20880
|
|
|
20881
|
+
//#endregion
|
|
20882
|
+
//#region packages/compiler-vapor/src/generators/key.ts
|
|
20883
|
+
function genKey(oper, context) {
|
|
20884
|
+
const { id, value, block } = oper;
|
|
20885
|
+
const [frag, push] = buildCodeFragment();
|
|
20886
|
+
const blockFn = genBlock(block, context);
|
|
20887
|
+
push(NEWLINE, `const n${id} = `, ...genCall(context.helper("createKeyedFragment"), [
|
|
20888
|
+
`() => (`,
|
|
20889
|
+
...genExpression(value, context),
|
|
20890
|
+
")"
|
|
20891
|
+
], blockFn));
|
|
20892
|
+
return frag;
|
|
20893
|
+
}
|
|
20894
|
+
|
|
20896
20895
|
//#endregion
|
|
20897
20896
|
//#region packages/compiler-vapor/src/generators/operation.ts
|
|
20898
20897
|
function genOperations(opers, context) {
|
|
@@ -20919,12 +20918,13 @@ function genOperation(oper, context) {
|
|
|
20919
20918
|
case 10: return genPrependNode(oper, context);
|
|
20920
20919
|
case 14: return genIf(oper, context);
|
|
20921
20920
|
case 15: return genFor(oper, context);
|
|
20921
|
+
case 16: return genKey(oper, context);
|
|
20922
20922
|
case 11: return genCreateComponent(oper, context);
|
|
20923
20923
|
case 12: return genSlotOutlet(oper, context);
|
|
20924
20924
|
case 13: return genBuiltinDirective(oper, context);
|
|
20925
|
-
case
|
|
20926
|
-
case 17: return [];
|
|
20925
|
+
case 17: return genGetTextChild(oper, context);
|
|
20927
20926
|
case 18: return [];
|
|
20927
|
+
case 19: return [];
|
|
20928
20928
|
default:
|
|
20929
20929
|
const exhaustiveCheck = oper;
|
|
20930
20930
|
throw new Error(`Unhandled operation type in genOperation: ${exhaustiveCheck}`);
|
|
@@ -21412,11 +21412,13 @@ function transformNativeElement(node, propsResult, singleRoot, context, getEffec
|
|
|
21412
21412
|
let template = "";
|
|
21413
21413
|
template += `<${tag}`;
|
|
21414
21414
|
if (scopeId) template += ` ${scopeId}`;
|
|
21415
|
-
if (isDom2
|
|
21416
|
-
template += ` gen-
|
|
21417
|
-
|
|
21418
|
-
|
|
21419
|
-
|
|
21415
|
+
if (isDom2) {
|
|
21416
|
+
if (context.effectiveParent === context.root) template += ` gen-vue-id=""`;
|
|
21417
|
+
if (singleRoot) {
|
|
21418
|
+
template += ` gen-flag-flatten=""`;
|
|
21419
|
+
const rootElementTagName = context.options.rootElementTagName;
|
|
21420
|
+
if (rootElementTagName) template += ` custom-tag-name="${rootElementTagName}"`;
|
|
21421
|
+
}
|
|
21420
21422
|
}
|
|
21421
21423
|
const dynamicProps = [];
|
|
21422
21424
|
if (propsResult[0]) {
|
|
@@ -21462,7 +21464,7 @@ function transformNativeElement(node, propsResult, singleRoot, context, getEffec
|
|
|
21462
21464
|
dynamicProps.push(key.content);
|
|
21463
21465
|
values[0].isStatic = false;
|
|
21464
21466
|
context.registerEffect(values, {
|
|
21465
|
-
type:
|
|
21467
|
+
type: 19,
|
|
21466
21468
|
node,
|
|
21467
21469
|
prop
|
|
21468
21470
|
}, getEffectIndex);
|
|
@@ -21684,7 +21686,7 @@ const transformVText = (dir, node, context) => {
|
|
|
21684
21686
|
context.childrenTemplate = [context.options.platform ? TEXT_PLACEHOLDER : " "];
|
|
21685
21687
|
const isComponent = node.tagType === 1;
|
|
21686
21688
|
if (!isComponent) context.registerOperation({
|
|
21687
|
-
type:
|
|
21689
|
+
type: 17,
|
|
21688
21690
|
node,
|
|
21689
21691
|
parent: context.reference()
|
|
21690
21692
|
});
|
|
@@ -21919,7 +21921,7 @@ function processTextContainer(children, context) {
|
|
|
21919
21921
|
else {
|
|
21920
21922
|
context.childrenTemplate = [context.options.platform ? TEXT_PLACEHOLDER : " "];
|
|
21921
21923
|
context.registerOperation({
|
|
21922
|
-
type:
|
|
21924
|
+
type: 17,
|
|
21923
21925
|
node: context.node,
|
|
21924
21926
|
parent: context.reference()
|
|
21925
21927
|
});
|
|
@@ -22064,7 +22066,7 @@ function processIf(node, dir, context) {
|
|
|
22064
22066
|
id,
|
|
22065
22067
|
condition: dir.exp,
|
|
22066
22068
|
positive: branch,
|
|
22067
|
-
index:
|
|
22069
|
+
index: context.root.nextIfIndex(),
|
|
22068
22070
|
once: context.inVOnce || isStaticExpression(dir.exp, context.options.bindingMetadata)
|
|
22069
22071
|
};
|
|
22070
22072
|
};
|
|
@@ -22098,7 +22100,7 @@ function processIf(node, dir, context) {
|
|
|
22098
22100
|
id: -1,
|
|
22099
22101
|
condition: dir.exp,
|
|
22100
22102
|
positive: branch,
|
|
22101
|
-
index:
|
|
22103
|
+
index: context.root.nextIfIndex(),
|
|
22102
22104
|
once: context.inVOnce || isStaticExpression(dir.exp, context.options.bindingMetadata)
|
|
22103
22105
|
};
|
|
22104
22106
|
return () => onExit();
|
|
@@ -22135,7 +22137,7 @@ function processFor(node, dir, context) {
|
|
|
22135
22137
|
const typeProp = findProp(node, "type");
|
|
22136
22138
|
const typeProperty = typeProp && propToExpression(typeProp);
|
|
22137
22139
|
const isComponent = node.tagType === 1 || isTemplateWithSingleComponent(node);
|
|
22138
|
-
context.node = node = wrapTemplate(node, ["for"]);
|
|
22140
|
+
context.node = node = wrapTemplate(node, ["for", "key"]);
|
|
22139
22141
|
context.dynamic.flags |= 6;
|
|
22140
22142
|
const id = context.reference();
|
|
22141
22143
|
const render = newBlock(node);
|
|
@@ -22252,13 +22254,6 @@ function transformComponentSlot(node, dir, context) {
|
|
|
22252
22254
|
markNonTemplate(n, context);
|
|
22253
22255
|
});
|
|
22254
22256
|
const [block, onExit] = createSlotBlock(node, dir, context);
|
|
22255
|
-
if (isTransitionNode(node) && nonSlotTemplateChildren.length) {
|
|
22256
|
-
const nonCommentChild = nonSlotTemplateChildren.find((n) => !isCommentOrWhitespace(n));
|
|
22257
|
-
if (nonCommentChild) {
|
|
22258
|
-
const keyProp = findProp(nonCommentChild, "key");
|
|
22259
|
-
if (keyProp) block.key = keyProp.exp;
|
|
22260
|
-
}
|
|
22261
|
-
}
|
|
22262
22257
|
const { slots } = context;
|
|
22263
22258
|
return () => {
|
|
22264
22259
|
onExit();
|
|
@@ -22377,6 +22372,32 @@ function hasMultipleChildren(node) {
|
|
|
22377
22372
|
return children.length > 1;
|
|
22378
22373
|
}
|
|
22379
22374
|
|
|
22375
|
+
//#endregion
|
|
22376
|
+
//#region packages/compiler-vapor/src/transforms/transformKey.ts
|
|
22377
|
+
const transformKey = (node, context) => {
|
|
22378
|
+
if (node.type !== 1 || context.inVOnce || findDir(node, "for")) return;
|
|
22379
|
+
const dir = findProp(node, "key", true, true);
|
|
22380
|
+
if (!dir || dir.type === 6) return;
|
|
22381
|
+
let value;
|
|
22382
|
+
value = dir.exp || normalizeBindShorthand(dir.arg, context);
|
|
22383
|
+
if (isStaticExpression(value, context.options.bindingMetadata)) return;
|
|
22384
|
+
let id = context.reference();
|
|
22385
|
+
context.dynamic.flags |= 6;
|
|
22386
|
+
context.node = node = wrapTemplate(node, ["key"]);
|
|
22387
|
+
const block = newBlock(node);
|
|
22388
|
+
const exitBlock = context.enterBlock(block);
|
|
22389
|
+
return () => {
|
|
22390
|
+
exitBlock();
|
|
22391
|
+
context.dynamic.operation = {
|
|
22392
|
+
type: 16,
|
|
22393
|
+
node,
|
|
22394
|
+
id,
|
|
22395
|
+
value,
|
|
22396
|
+
block
|
|
22397
|
+
};
|
|
22398
|
+
};
|
|
22399
|
+
};
|
|
22400
|
+
|
|
22380
22401
|
//#endregion
|
|
22381
22402
|
//#region packages/compiler-vapor/src/compile.ts
|
|
22382
22403
|
function compile(source, options = {}) {
|
|
@@ -22401,6 +22422,7 @@ function getBaseTransformPreset() {
|
|
|
22401
22422
|
transformVOnce,
|
|
22402
22423
|
transformVIf,
|
|
22403
22424
|
transformVFor,
|
|
22425
|
+
transformKey,
|
|
22404
22426
|
transformSlotOutlet,
|
|
22405
22427
|
transformTemplateRef,
|
|
22406
22428
|
transformElement,
|
|
@@ -22435,4 +22457,4 @@ const VaporErrorMessages = {
|
|
|
22435
22457
|
};
|
|
22436
22458
|
|
|
22437
22459
|
//#endregion
|
|
22438
|
-
export { CodegenContext, DELIMITERS_ARRAY, DELIMITERS_ARRAY_NEWLINE, DELIMITERS_OBJECT, DELIMITERS_OBJECT_NEWLINE, DynamicFlag, IMPORT_EXPR_RE, IMPORT_EXP_END, IMPORT_EXP_START, INDENT_END, INDENT_START, IRDynamicPropsKind, IRNodeTypes, IRSlotType, LF, NEWLINE, TEXT_NODE_PLACEHOLDER, TEXT_PLACEHOLDER, VaporErrorCodes, VaporErrorMessages, analyzeExpressions, buildCodeFragment, buildDestructureIdMap, codeFragmentToString, compile, createStructuralDirectiveTransform, createVaporCompilerError, genCall, genMulti, generate, getBaseTransformPreset, getLiteralExpressionValue, isBlockOperation, isBuiltInComponent, isConstantExpression, isKeepAliveTag, isStaticExpression, isTeleportTag, isTransitionGroupTag, isTransitionTag, needsVaporCtx, parse, parseValueDestructure, propToExpression, transform, transformChildren, transformComment, transformElement, transformSlotOutlet, transformTemplateRef, transformText, transformVBind, transformVFor, transformVHtml, transformVIf, transformVModel, transformVOn, transformVOnce, transformVShow, transformVSlot, transformVText, wrapTemplate };
|
|
22460
|
+
export { CodegenContext, DELIMITERS_ARRAY, DELIMITERS_ARRAY_NEWLINE, DELIMITERS_OBJECT, DELIMITERS_OBJECT_NEWLINE, DynamicFlag, IMPORT_EXPR_RE, IMPORT_EXP_END, IMPORT_EXP_START, INDENT_END, INDENT_START, IRDynamicPropsKind, IRNodeTypes, IRSlotType, LF, NEWLINE, TEXT_NODE_PLACEHOLDER, TEXT_PLACEHOLDER, VaporErrorCodes, VaporErrorMessages, analyzeExpressions, buildCodeFragment, buildDestructureIdMap, codeFragmentToString, compile, createStructuralDirectiveTransform, createVaporCompilerError, genCall, genMulti, generate, getBaseTransformPreset, getLiteralExpressionValue, isBlockOperation, isBuiltInComponent, isConstantExpression, isKeepAliveTag, isStaticExpression, isTeleportTag, isTransitionGroupTag, isTransitionTag, needsVaporCtx, parse, parseValueDestructure, propToExpression, transform, transformChildren, transformComment, transformElement, transformKey, transformSlotOutlet, transformTemplateRef, transformText, transformVBind, transformVFor, transformVHtml, transformVIf, transformVModel, transformVOn, transformVOnce, transformVShow, transformVSlot, transformVText, wrapTemplate };
|