@vue-jsx-vapor/compiler 2.4.2 → 2.4.4
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/index.cjs +8 -8
- package/dist/index.d.cts +0 -19
- package/dist/index.d.ts +0 -19
- package/dist/index.js +8 -8
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
@@ -171,7 +171,7 @@ function resolveSimpleExpressionNode(exp) {
|
|
171
171
|
}
|
172
172
|
return exp;
|
173
173
|
}
|
174
|
-
const resolvedExpressions = new WeakSet();
|
174
|
+
const resolvedExpressions = /* @__PURE__ */ new WeakSet();
|
175
175
|
function resolveExpression(node, context, effect = false) {
|
176
176
|
if (!node) return (0, __vue_compiler_dom.createSimpleExpression)("", true);
|
177
177
|
node = (0, __vue_compiler_dom.unwrapTSNode)(node.type === "JSXExpressionContainer" ? node.expression : node);
|
@@ -442,8 +442,8 @@ function transform(node, options = {}) {
|
|
442
442
|
node,
|
443
443
|
source: node.source,
|
444
444
|
template: [],
|
445
|
-
component: new Set(),
|
446
|
-
directive: new Set(),
|
445
|
+
component: /* @__PURE__ */ new Set(),
|
446
|
+
directive: /* @__PURE__ */ new Set(),
|
447
447
|
block: newBlock(node),
|
448
448
|
hasTemplateRef: false
|
449
449
|
};
|
@@ -693,7 +693,7 @@ function transformProp(prop, node, context) {
|
|
693
693
|
}
|
694
694
|
}
|
695
695
|
function dedupeProperties(results) {
|
696
|
-
const knownProps = new Map();
|
696
|
+
const knownProps = /* @__PURE__ */ new Map();
|
697
697
|
const deduped = [];
|
698
698
|
for (const result of results) {
|
699
699
|
const prop = resolveDirectiveResult(result);
|
@@ -800,9 +800,9 @@ function processLogicalExpression(node, context) {
|
|
800
800
|
|
801
801
|
//#endregion
|
802
802
|
//#region src/transforms/transformText.ts
|
803
|
-
const seen = new WeakMap();
|
803
|
+
const seen = /* @__PURE__ */ new WeakMap();
|
804
804
|
const transformText = (node, context) => {
|
805
|
-
if (!seen.has(context.root)) seen.set(context.root, new WeakSet());
|
805
|
+
if (!seen.has(context.root)) seen.set(context.root, /* @__PURE__ */ new WeakSet());
|
806
806
|
if (seen.get(context.root).has(node)) {
|
807
807
|
context.dynamic.flags |= DynamicFlag.NON_TEMPLATE;
|
808
808
|
return;
|
@@ -842,7 +842,7 @@ function processInterpolation(context) {
|
|
842
842
|
return;
|
843
843
|
}
|
844
844
|
const id = context.reference();
|
845
|
-
if (isFragmentNode(parent)) context.registerOperation({
|
845
|
+
if (isFragmentNode(parent) || findProp(parent, "v-slot")) context.registerOperation({
|
846
846
|
type: IRNodeTypes.CREATE_NODES,
|
847
847
|
id,
|
848
848
|
values
|
@@ -990,7 +990,7 @@ const transformVIf = createStructuralDirectiveTransform([
|
|
990
990
|
"else",
|
991
991
|
"else-if"
|
992
992
|
], processIf);
|
993
|
-
const transformedIfNode = new WeakMap();
|
993
|
+
const transformedIfNode = /* @__PURE__ */ new WeakMap();
|
994
994
|
function processIf(node, attribute, context) {
|
995
995
|
const dir = resolveDirective(attribute, context);
|
996
996
|
if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
|
package/dist/index.d.cts
CHANGED
@@ -49,7 +49,6 @@ declare class TransformContext<T extends BlockIRNode['node'] = BlockIRNode['node
|
|
49
49
|
declare function transform(node: RootNode, options?: TransformOptions): RootIRNode;
|
50
50
|
declare function transformNode(context: TransformContext<BlockIRNode['node']>): void;
|
51
51
|
declare function createStructuralDirectiveTransform(name: string | string[], fn: StructuralDirectiveTransform): NodeTransform;
|
52
|
-
|
53
52
|
//#endregion
|
54
53
|
//#region src/ir/component.d.ts
|
55
54
|
interface IRProp extends Omit<DirectiveTransformResult, 'value'> {
|
@@ -107,7 +106,6 @@ interface IRSlotsExpression {
|
|
107
106
|
}
|
108
107
|
type IRSlotDynamic = IRSlotDynamicBasic | IRSlotDynamicLoop | IRSlotDynamicConditional;
|
109
108
|
type IRSlots = IRSlotsStatic | IRSlotDynamic | IRSlotsExpression;
|
110
|
-
|
111
109
|
//#endregion
|
112
110
|
//#region src/ir/index.d.ts
|
113
111
|
declare enum IRNodeTypes {
|
@@ -343,7 +341,6 @@ type VaporDirectiveNode = Overwrite<DirectiveNode, {
|
|
343
341
|
}>;
|
344
342
|
type InsertionStateTypes = IfIRNode | ForIRNode | SlotOutletIRNode | CreateComponentIRNode;
|
345
343
|
declare function isBlockOperation(op: OperationNode): op is InsertionStateTypes;
|
346
|
-
|
347
344
|
//#endregion
|
348
345
|
//#region src/compile.d.ts
|
349
346
|
interface VaporCodegenResult$1 extends Omit<VaporCodegenResult, 'ast'> {
|
@@ -355,66 +352,50 @@ type CompilerOptions = HackOptions<CompilerOptions$1> & {
|
|
355
352
|
source?: string;
|
356
353
|
};
|
357
354
|
type TransformPreset = [NodeTransform[], Record<string, DirectiveTransform>];
|
358
|
-
|
359
355
|
//#endregion
|
360
356
|
//#region src/transforms/transformText.d.ts
|
361
357
|
declare const transformText: NodeTransform;
|
362
|
-
|
363
358
|
//#endregion
|
364
359
|
//#region src/transforms/transformElement.d.ts
|
365
360
|
declare const transformElement: NodeTransform;
|
366
|
-
|
367
361
|
//#endregion
|
368
362
|
//#region src/transforms/transformChildren.d.ts
|
369
363
|
declare const transformChildren: NodeTransform;
|
370
|
-
|
371
364
|
//#endregion
|
372
365
|
//#region src/transforms/transformTemplateRef.d.ts
|
373
366
|
declare const transformTemplateRef: NodeTransform;
|
374
|
-
|
375
367
|
//#endregion
|
376
368
|
//#region src/transforms/vBind.d.ts
|
377
369
|
declare const transformVBind: DirectiveTransform;
|
378
|
-
|
379
370
|
//#endregion
|
380
371
|
//#region src/transforms/vOn.d.ts
|
381
372
|
declare const transformVOn: DirectiveTransform;
|
382
|
-
|
383
373
|
//#endregion
|
384
374
|
//#region src/transforms/vSlot.d.ts
|
385
375
|
declare const transformVSlot: NodeTransform;
|
386
|
-
|
387
376
|
//#endregion
|
388
377
|
//#region src/transforms/vSlots.d.ts
|
389
378
|
declare const transformVSlots: DirectiveTransform;
|
390
|
-
|
391
379
|
//#endregion
|
392
380
|
//#region src/transforms/vModel.d.ts
|
393
381
|
declare const transformVModel: DirectiveTransform;
|
394
|
-
|
395
382
|
//#endregion
|
396
383
|
//#region src/transforms/vShow.d.ts
|
397
384
|
declare const transformVShow: DirectiveTransform;
|
398
|
-
|
399
385
|
//#endregion
|
400
386
|
//#region src/transforms/vHtml.d.ts
|
401
387
|
declare const transformVHtml: DirectiveTransform;
|
402
|
-
|
403
388
|
//#endregion
|
404
389
|
//#region src/transforms/vFor.d.ts
|
405
390
|
declare const transformVFor: NodeTransform;
|
406
|
-
|
407
391
|
//#endregion
|
408
392
|
//#region src/transforms/vIf.d.ts
|
409
393
|
declare const transformVIf: NodeTransform;
|
410
|
-
|
411
394
|
//#endregion
|
412
395
|
//#region src/transforms/vOnce.d.ts
|
413
396
|
declare const transformVOnce: NodeTransform;
|
414
|
-
|
415
397
|
//#endregion
|
416
398
|
//#region src/transforms/vText.d.ts
|
417
399
|
declare const transformVText: DirectiveTransform;
|
418
|
-
|
419
400
|
//#endregion
|
420
401
|
export { BaseIRNode, BlockIRNode, CompilerOptions, CreateComponentIRNode, CreateNodesIRNode, DeclareOldRefIRNode, DirectiveIRNode, DirectiveTransform, DirectiveTransformResult, DynamicFlag, ForIRNode, GetTextChildIRNode, HackOptions, IRDynamicInfo, IRDynamicPropsKind, IREffect, IRFor, IRNode, IRNodeTypes, IRProp, IRProps, IRPropsDynamicAttribute, IRPropsDynamicExpression, IRPropsStatic, IRSlotDynamic, IRSlotDynamicBasic, IRSlotDynamicConditional, IRSlotDynamicLoop, IRSlotType, IRSlots, IRSlotsExpression, IRSlotsStatic, IfIRNode, InsertNodeIRNode, InsertionStateTypes, KeyOverride, NodeTransform, OperationNode, PrependNodeIRNode, RootIRNode, RootNode, SetDynamicEventsIRNode, SetDynamicPropsIRNode, SetEventIRNode, SetHtmlIRNode, SetNodesIRNode, SetPropIRNode, SetTemplateRefIRNode, SetTextIRNode, SlotBlockIRNode, SlotOutletIRNode, StructuralDirectiveTransform, TransformContext, TransformOptions, TransformPreset, VaporDirectiveNode, compile, createStructuralDirectiveTransform, generate, isBlockOperation, transform, transformChildren, transformElement, transformNode, transformTemplateRef, transformText, transformVBind, transformVFor, transformVHtml, transformVIf, transformVModel, transformVOn, transformVOnce, transformVShow, transformVSlot, transformVSlots, transformVText };
|
package/dist/index.d.ts
CHANGED
@@ -49,7 +49,6 @@ declare class TransformContext<T extends BlockIRNode['node'] = BlockIRNode['node
|
|
49
49
|
declare function transform(node: RootNode, options?: TransformOptions): RootIRNode;
|
50
50
|
declare function transformNode(context: TransformContext<BlockIRNode['node']>): void;
|
51
51
|
declare function createStructuralDirectiveTransform(name: string | string[], fn: StructuralDirectiveTransform): NodeTransform;
|
52
|
-
|
53
52
|
//#endregion
|
54
53
|
//#region src/ir/component.d.ts
|
55
54
|
interface IRProp extends Omit<DirectiveTransformResult, 'value'> {
|
@@ -107,7 +106,6 @@ interface IRSlotsExpression {
|
|
107
106
|
}
|
108
107
|
type IRSlotDynamic = IRSlotDynamicBasic | IRSlotDynamicLoop | IRSlotDynamicConditional;
|
109
108
|
type IRSlots = IRSlotsStatic | IRSlotDynamic | IRSlotsExpression;
|
110
|
-
|
111
109
|
//#endregion
|
112
110
|
//#region src/ir/index.d.ts
|
113
111
|
declare enum IRNodeTypes {
|
@@ -343,7 +341,6 @@ type VaporDirectiveNode = Overwrite<DirectiveNode, {
|
|
343
341
|
}>;
|
344
342
|
type InsertionStateTypes = IfIRNode | ForIRNode | SlotOutletIRNode | CreateComponentIRNode;
|
345
343
|
declare function isBlockOperation(op: OperationNode): op is InsertionStateTypes;
|
346
|
-
|
347
344
|
//#endregion
|
348
345
|
//#region src/compile.d.ts
|
349
346
|
interface VaporCodegenResult$1 extends Omit<VaporCodegenResult, 'ast'> {
|
@@ -355,66 +352,50 @@ type CompilerOptions = HackOptions<CompilerOptions$1> & {
|
|
355
352
|
source?: string;
|
356
353
|
};
|
357
354
|
type TransformPreset = [NodeTransform[], Record<string, DirectiveTransform>];
|
358
|
-
|
359
355
|
//#endregion
|
360
356
|
//#region src/transforms/transformText.d.ts
|
361
357
|
declare const transformText: NodeTransform;
|
362
|
-
|
363
358
|
//#endregion
|
364
359
|
//#region src/transforms/transformElement.d.ts
|
365
360
|
declare const transformElement: NodeTransform;
|
366
|
-
|
367
361
|
//#endregion
|
368
362
|
//#region src/transforms/transformChildren.d.ts
|
369
363
|
declare const transformChildren: NodeTransform;
|
370
|
-
|
371
364
|
//#endregion
|
372
365
|
//#region src/transforms/transformTemplateRef.d.ts
|
373
366
|
declare const transformTemplateRef: NodeTransform;
|
374
|
-
|
375
367
|
//#endregion
|
376
368
|
//#region src/transforms/vBind.d.ts
|
377
369
|
declare const transformVBind: DirectiveTransform;
|
378
|
-
|
379
370
|
//#endregion
|
380
371
|
//#region src/transforms/vOn.d.ts
|
381
372
|
declare const transformVOn: DirectiveTransform;
|
382
|
-
|
383
373
|
//#endregion
|
384
374
|
//#region src/transforms/vSlot.d.ts
|
385
375
|
declare const transformVSlot: NodeTransform;
|
386
|
-
|
387
376
|
//#endregion
|
388
377
|
//#region src/transforms/vSlots.d.ts
|
389
378
|
declare const transformVSlots: DirectiveTransform;
|
390
|
-
|
391
379
|
//#endregion
|
392
380
|
//#region src/transforms/vModel.d.ts
|
393
381
|
declare const transformVModel: DirectiveTransform;
|
394
|
-
|
395
382
|
//#endregion
|
396
383
|
//#region src/transforms/vShow.d.ts
|
397
384
|
declare const transformVShow: DirectiveTransform;
|
398
|
-
|
399
385
|
//#endregion
|
400
386
|
//#region src/transforms/vHtml.d.ts
|
401
387
|
declare const transformVHtml: DirectiveTransform;
|
402
|
-
|
403
388
|
//#endregion
|
404
389
|
//#region src/transforms/vFor.d.ts
|
405
390
|
declare const transformVFor: NodeTransform;
|
406
|
-
|
407
391
|
//#endregion
|
408
392
|
//#region src/transforms/vIf.d.ts
|
409
393
|
declare const transformVIf: NodeTransform;
|
410
|
-
|
411
394
|
//#endregion
|
412
395
|
//#region src/transforms/vOnce.d.ts
|
413
396
|
declare const transformVOnce: NodeTransform;
|
414
|
-
|
415
397
|
//#endregion
|
416
398
|
//#region src/transforms/vText.d.ts
|
417
399
|
declare const transformVText: DirectiveTransform;
|
418
|
-
|
419
400
|
//#endregion
|
420
401
|
export { BaseIRNode, BlockIRNode, CompilerOptions, CreateComponentIRNode, CreateNodesIRNode, DeclareOldRefIRNode, DirectiveIRNode, DirectiveTransform, DirectiveTransformResult, DynamicFlag, ForIRNode, GetTextChildIRNode, HackOptions, IRDynamicInfo, IRDynamicPropsKind, IREffect, IRFor, IRNode, IRNodeTypes, IRProp, IRProps, IRPropsDynamicAttribute, IRPropsDynamicExpression, IRPropsStatic, IRSlotDynamic, IRSlotDynamicBasic, IRSlotDynamicConditional, IRSlotDynamicLoop, IRSlotType, IRSlots, IRSlotsExpression, IRSlotsStatic, IfIRNode, InsertNodeIRNode, InsertionStateTypes, KeyOverride, NodeTransform, OperationNode, PrependNodeIRNode, RootIRNode, RootNode, SetDynamicEventsIRNode, SetDynamicPropsIRNode, SetEventIRNode, SetHtmlIRNode, SetNodesIRNode, SetPropIRNode, SetTemplateRefIRNode, SetTextIRNode, SlotBlockIRNode, SlotOutletIRNode, StructuralDirectiveTransform, TransformContext, TransformOptions, TransformPreset, VaporDirectiveNode, compile, createStructuralDirectiveTransform, generate, isBlockOperation, transform, transformChildren, transformElement, transformNode, transformTemplateRef, transformText, transformVBind, transformVFor, transformVHtml, transformVIf, transformVModel, transformVOn, transformVOnce, transformVShow, transformVSlot, transformVSlots, transformVText };
|
package/dist/index.js
CHANGED
@@ -148,7 +148,7 @@ function resolveSimpleExpressionNode(exp) {
|
|
148
148
|
}
|
149
149
|
return exp;
|
150
150
|
}
|
151
|
-
const resolvedExpressions = new WeakSet();
|
151
|
+
const resolvedExpressions = /* @__PURE__ */ new WeakSet();
|
152
152
|
function resolveExpression(node, context, effect = false) {
|
153
153
|
if (!node) return createSimpleExpression("", true);
|
154
154
|
node = unwrapTSNode(node.type === "JSXExpressionContainer" ? node.expression : node);
|
@@ -419,8 +419,8 @@ function transform(node, options = {}) {
|
|
419
419
|
node,
|
420
420
|
source: node.source,
|
421
421
|
template: [],
|
422
|
-
component: new Set(),
|
423
|
-
directive: new Set(),
|
422
|
+
component: /* @__PURE__ */ new Set(),
|
423
|
+
directive: /* @__PURE__ */ new Set(),
|
424
424
|
block: newBlock(node),
|
425
425
|
hasTemplateRef: false
|
426
426
|
};
|
@@ -670,7 +670,7 @@ function transformProp(prop, node, context) {
|
|
670
670
|
}
|
671
671
|
}
|
672
672
|
function dedupeProperties(results) {
|
673
|
-
const knownProps = new Map();
|
673
|
+
const knownProps = /* @__PURE__ */ new Map();
|
674
674
|
const deduped = [];
|
675
675
|
for (const result of results) {
|
676
676
|
const prop = resolveDirectiveResult(result);
|
@@ -777,9 +777,9 @@ function processLogicalExpression(node, context) {
|
|
777
777
|
|
778
778
|
//#endregion
|
779
779
|
//#region src/transforms/transformText.ts
|
780
|
-
const seen = new WeakMap();
|
780
|
+
const seen = /* @__PURE__ */ new WeakMap();
|
781
781
|
const transformText = (node, context) => {
|
782
|
-
if (!seen.has(context.root)) seen.set(context.root, new WeakSet());
|
782
|
+
if (!seen.has(context.root)) seen.set(context.root, /* @__PURE__ */ new WeakSet());
|
783
783
|
if (seen.get(context.root).has(node)) {
|
784
784
|
context.dynamic.flags |= DynamicFlag.NON_TEMPLATE;
|
785
785
|
return;
|
@@ -819,7 +819,7 @@ function processInterpolation(context) {
|
|
819
819
|
return;
|
820
820
|
}
|
821
821
|
const id = context.reference();
|
822
|
-
if (isFragmentNode(parent)) context.registerOperation({
|
822
|
+
if (isFragmentNode(parent) || findProp(parent, "v-slot")) context.registerOperation({
|
823
823
|
type: IRNodeTypes.CREATE_NODES,
|
824
824
|
id,
|
825
825
|
values
|
@@ -967,7 +967,7 @@ const transformVIf = createStructuralDirectiveTransform([
|
|
967
967
|
"else",
|
968
968
|
"else-if"
|
969
969
|
], processIf);
|
970
|
-
const transformedIfNode = new WeakMap();
|
970
|
+
const transformedIfNode = /* @__PURE__ */ new WeakMap();
|
971
971
|
function processIf(node, attribute, context) {
|
972
972
|
const dir = resolveDirective(attribute, context);
|
973
973
|
if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vue-jsx-vapor/compiler",
|
3
|
-
"version": "2.4.
|
3
|
+
"version": "2.4.4",
|
4
4
|
"description": "Vue JSX Vapor Compiler",
|
5
5
|
"type": "module",
|
6
6
|
"keywords": [
|
@@ -34,11 +34,11 @@
|
|
34
34
|
"./*": "./*"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@babel/parser": "^7.
|
38
|
-
"@babel/types": "^7.
|
39
|
-
"@vue/compiler-dom": "https://pkg.pr.new/@vue/compiler-dom@
|
40
|
-
"@vue/compiler-vapor": "https://pkg.pr.new/@vue/compiler-vapor@
|
41
|
-
"@vue/shared": "https://pkg.pr.new/@vue/shared@
|
37
|
+
"@babel/parser": "^7.27.3",
|
38
|
+
"@babel/types": "^7.27.3",
|
39
|
+
"@vue/compiler-dom": "https://pkg.pr.new/@vue/compiler-dom@280bc48",
|
40
|
+
"@vue/compiler-vapor": "https://pkg.pr.new/@vue/compiler-vapor@280bc48",
|
41
|
+
"@vue/shared": "https://pkg.pr.new/@vue/shared@280bc48"
|
42
42
|
},
|
43
43
|
"scripts": {
|
44
44
|
"build": "tsdown",
|