@alloy-js/core 0.22.0-dev.1 → 0.22.0-dev.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/src/components/Block.d.ts.map +1 -1
- package/dist/src/components/Block.js +24 -7
- package/dist/src/components/Block.js.map +1 -1
- package/dist/src/components/Indent.d.ts.map +1 -1
- package/dist/src/components/Indent.js +2 -1
- package/dist/src/components/Indent.js.map +1 -1
- package/dist/src/components/Prose.d.ts.map +1 -1
- package/dist/src/components/Prose.js +2 -1
- package/dist/src/components/Prose.js.map +1 -1
- package/dist/src/content-slot.d.ts +51 -0
- package/dist/src/content-slot.d.ts.map +1 -0
- package/dist/src/content-slot.js +69 -0
- package/dist/src/content-slot.js.map +1 -0
- package/dist/src/content-slot.test.d.ts +2 -0
- package/dist/src/content-slot.test.d.ts.map +1 -0
- package/dist/src/content-slot.test.js +57 -0
- package/dist/src/content-slot.test.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/reactivity.d.ts +15 -1
- package/dist/src/reactivity.d.ts.map +1 -1
- package/dist/src/reactivity.js +20 -8
- package/dist/src/reactivity.js.map +1 -1
- package/dist/src/render.d.ts +24 -0
- package/dist/src/render.d.ts.map +1 -1
- package/dist/src/render.js +98 -2
- package/dist/src/render.js.map +1 -1
- package/dist/src/symbols/decl.d.ts +8 -0
- package/dist/src/symbols/decl.d.ts.map +1 -0
- package/dist/src/symbols/decl.js +22 -0
- package/dist/src/symbols/decl.js.map +1 -0
- package/dist/src/symbols/index.d.ts +1 -0
- package/dist/src/symbols/index.d.ts.map +1 -1
- package/dist/src/symbols/index.js +1 -0
- package/dist/src/symbols/index.js.map +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +212 -15
- package/dist/src/utils.js.map +1 -1
- package/dist/test/components/block.test.d.ts.map +1 -1
- package/dist/test/components/block.test.js +18 -1
- package/dist/test/components/block.test.js.map +1 -1
- package/dist/test/components/list.test.d.ts.map +1 -1
- package/dist/test/components/list.test.js +80 -1
- package/dist/test/components/list.test.js.map +1 -1
- package/dist/test/control-flow/for.test.js +32 -2
- package/dist/test/control-flow/for.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/Block.tsx +18 -6
- package/src/components/Indent.tsx +4 -2
- package/src/components/Prose.tsx +2 -1
- package/src/content-slot.test.tsx +65 -0
- package/src/content-slot.tsx +91 -0
- package/src/index.ts +1 -0
- package/src/reactivity.ts +38 -5
- package/src/render.ts +112 -3
- package/src/symbols/decl.ts +25 -0
- package/src/symbols/index.ts +1 -0
- package/src/utils.tsx +240 -16
- package/temp/api.json +550 -4
- package/test/components/block.test.tsx +21 -1
- package/test/components/list.test.tsx +76 -1
- package/test/control-flow/for.test.tsx +43 -2
package/temp/api.json
CHANGED
|
@@ -3261,6 +3261,227 @@
|
|
|
3261
3261
|
}
|
|
3262
3262
|
]
|
|
3263
3263
|
},
|
|
3264
|
+
{
|
|
3265
|
+
"kind": "Interface",
|
|
3266
|
+
"canonicalReference": "@alloy-js/core!ContentSlot:interface",
|
|
3267
|
+
"docComment": "",
|
|
3268
|
+
"excerptTokens": [
|
|
3269
|
+
{
|
|
3270
|
+
"kind": "Content",
|
|
3271
|
+
"text": "export interface ContentSlot "
|
|
3272
|
+
}
|
|
3273
|
+
],
|
|
3274
|
+
"fileUrlPath": "src/content-slot.tsx",
|
|
3275
|
+
"releaseTag": "Public",
|
|
3276
|
+
"name": "ContentSlot",
|
|
3277
|
+
"preserveMemberOrder": false,
|
|
3278
|
+
"members": [
|
|
3279
|
+
{
|
|
3280
|
+
"kind": "CallSignature",
|
|
3281
|
+
"canonicalReference": "@alloy-js/core!ContentSlot:call(1)",
|
|
3282
|
+
"docComment": "",
|
|
3283
|
+
"excerptTokens": [
|
|
3284
|
+
{
|
|
3285
|
+
"kind": "Content",
|
|
3286
|
+
"text": "(props: "
|
|
3287
|
+
},
|
|
3288
|
+
{
|
|
3289
|
+
"kind": "Content",
|
|
3290
|
+
"text": "{\n children: "
|
|
3291
|
+
},
|
|
3292
|
+
{
|
|
3293
|
+
"kind": "Reference",
|
|
3294
|
+
"text": "Children",
|
|
3295
|
+
"canonicalReference": "@alloy-js/core!Children:type"
|
|
3296
|
+
},
|
|
3297
|
+
{
|
|
3298
|
+
"kind": "Content",
|
|
3299
|
+
"text": ";\n }"
|
|
3300
|
+
},
|
|
3301
|
+
{
|
|
3302
|
+
"kind": "Content",
|
|
3303
|
+
"text": "): "
|
|
3304
|
+
},
|
|
3305
|
+
{
|
|
3306
|
+
"kind": "Reference",
|
|
3307
|
+
"text": "Children",
|
|
3308
|
+
"canonicalReference": "@alloy-js/core!Children:type"
|
|
3309
|
+
},
|
|
3310
|
+
{
|
|
3311
|
+
"kind": "Content",
|
|
3312
|
+
"text": ";"
|
|
3313
|
+
}
|
|
3314
|
+
],
|
|
3315
|
+
"returnTypeTokenRange": {
|
|
3316
|
+
"startIndex": 5,
|
|
3317
|
+
"endIndex": 6
|
|
3318
|
+
},
|
|
3319
|
+
"releaseTag": "Public",
|
|
3320
|
+
"overloadIndex": 1,
|
|
3321
|
+
"parameters": [
|
|
3322
|
+
{
|
|
3323
|
+
"parameterName": "props",
|
|
3324
|
+
"parameterTypeTokenRange": {
|
|
3325
|
+
"startIndex": 1,
|
|
3326
|
+
"endIndex": 4
|
|
3327
|
+
},
|
|
3328
|
+
"isOptional": false
|
|
3329
|
+
}
|
|
3330
|
+
]
|
|
3331
|
+
},
|
|
3332
|
+
{
|
|
3333
|
+
"kind": "PropertySignature",
|
|
3334
|
+
"canonicalReference": "@alloy-js/core!ContentSlot#hasContent:member",
|
|
3335
|
+
"docComment": "/**\n * Whether the slot has any content.\n */\n",
|
|
3336
|
+
"excerptTokens": [
|
|
3337
|
+
{
|
|
3338
|
+
"kind": "Content",
|
|
3339
|
+
"text": "hasContent: "
|
|
3340
|
+
},
|
|
3341
|
+
{
|
|
3342
|
+
"kind": "Content",
|
|
3343
|
+
"text": "boolean"
|
|
3344
|
+
},
|
|
3345
|
+
{
|
|
3346
|
+
"kind": "Content",
|
|
3347
|
+
"text": ";"
|
|
3348
|
+
}
|
|
3349
|
+
],
|
|
3350
|
+
"isReadonly": false,
|
|
3351
|
+
"isOptional": false,
|
|
3352
|
+
"releaseTag": "Public",
|
|
3353
|
+
"name": "hasContent",
|
|
3354
|
+
"propertyTypeTokenRange": {
|
|
3355
|
+
"startIndex": 1,
|
|
3356
|
+
"endIndex": 2
|
|
3357
|
+
}
|
|
3358
|
+
},
|
|
3359
|
+
{
|
|
3360
|
+
"kind": "PropertySignature",
|
|
3361
|
+
"canonicalReference": "@alloy-js/core!ContentSlot#isEmpty:member",
|
|
3362
|
+
"docComment": "/**\n * Whether the slot is currently empty.\n */\n",
|
|
3363
|
+
"excerptTokens": [
|
|
3364
|
+
{
|
|
3365
|
+
"kind": "Content",
|
|
3366
|
+
"text": "isEmpty: "
|
|
3367
|
+
},
|
|
3368
|
+
{
|
|
3369
|
+
"kind": "Content",
|
|
3370
|
+
"text": "boolean"
|
|
3371
|
+
},
|
|
3372
|
+
{
|
|
3373
|
+
"kind": "Content",
|
|
3374
|
+
"text": ";"
|
|
3375
|
+
}
|
|
3376
|
+
],
|
|
3377
|
+
"isReadonly": false,
|
|
3378
|
+
"isOptional": false,
|
|
3379
|
+
"releaseTag": "Public",
|
|
3380
|
+
"name": "isEmpty",
|
|
3381
|
+
"propertyTypeTokenRange": {
|
|
3382
|
+
"startIndex": 1,
|
|
3383
|
+
"endIndex": 2
|
|
3384
|
+
}
|
|
3385
|
+
},
|
|
3386
|
+
{
|
|
3387
|
+
"kind": "PropertySignature",
|
|
3388
|
+
"canonicalReference": "@alloy-js/core!ContentSlot#ref:member",
|
|
3389
|
+
"docComment": "/**\n * A ref indicating whether the slot is currently empty.\n */\n",
|
|
3390
|
+
"excerptTokens": [
|
|
3391
|
+
{
|
|
3392
|
+
"kind": "Content",
|
|
3393
|
+
"text": "ref: "
|
|
3394
|
+
},
|
|
3395
|
+
{
|
|
3396
|
+
"kind": "Reference",
|
|
3397
|
+
"text": "Ref",
|
|
3398
|
+
"canonicalReference": "@vue/reactivity!Ref:interface"
|
|
3399
|
+
},
|
|
3400
|
+
{
|
|
3401
|
+
"kind": "Content",
|
|
3402
|
+
"text": "<boolean>"
|
|
3403
|
+
},
|
|
3404
|
+
{
|
|
3405
|
+
"kind": "Content",
|
|
3406
|
+
"text": ";"
|
|
3407
|
+
}
|
|
3408
|
+
],
|
|
3409
|
+
"isReadonly": false,
|
|
3410
|
+
"isOptional": false,
|
|
3411
|
+
"releaseTag": "Public",
|
|
3412
|
+
"name": "ref",
|
|
3413
|
+
"propertyTypeTokenRange": {
|
|
3414
|
+
"startIndex": 1,
|
|
3415
|
+
"endIndex": 3
|
|
3416
|
+
}
|
|
3417
|
+
},
|
|
3418
|
+
{
|
|
3419
|
+
"kind": "PropertySignature",
|
|
3420
|
+
"canonicalReference": "@alloy-js/core!ContentSlot#WhenEmpty:member",
|
|
3421
|
+
"docComment": "/**\n * A component that will render its contents when the content slot is empty.\n */\n",
|
|
3422
|
+
"excerptTokens": [
|
|
3423
|
+
{
|
|
3424
|
+
"kind": "Content",
|
|
3425
|
+
"text": "WhenEmpty: "
|
|
3426
|
+
},
|
|
3427
|
+
{
|
|
3428
|
+
"kind": "Reference",
|
|
3429
|
+
"text": "Component",
|
|
3430
|
+
"canonicalReference": "@alloy-js/core!Component:interface"
|
|
3431
|
+
},
|
|
3432
|
+
{
|
|
3433
|
+
"kind": "Content",
|
|
3434
|
+
"text": "<{}>"
|
|
3435
|
+
},
|
|
3436
|
+
{
|
|
3437
|
+
"kind": "Content",
|
|
3438
|
+
"text": ";"
|
|
3439
|
+
}
|
|
3440
|
+
],
|
|
3441
|
+
"isReadonly": false,
|
|
3442
|
+
"isOptional": false,
|
|
3443
|
+
"releaseTag": "Public",
|
|
3444
|
+
"name": "WhenEmpty",
|
|
3445
|
+
"propertyTypeTokenRange": {
|
|
3446
|
+
"startIndex": 1,
|
|
3447
|
+
"endIndex": 3
|
|
3448
|
+
}
|
|
3449
|
+
},
|
|
3450
|
+
{
|
|
3451
|
+
"kind": "PropertySignature",
|
|
3452
|
+
"canonicalReference": "@alloy-js/core!ContentSlot#WhenHasContent:member",
|
|
3453
|
+
"docComment": "/**\n * A component that will render its contents when the content slot has content.\n */\n",
|
|
3454
|
+
"excerptTokens": [
|
|
3455
|
+
{
|
|
3456
|
+
"kind": "Content",
|
|
3457
|
+
"text": "WhenHasContent: "
|
|
3458
|
+
},
|
|
3459
|
+
{
|
|
3460
|
+
"kind": "Reference",
|
|
3461
|
+
"text": "Component",
|
|
3462
|
+
"canonicalReference": "@alloy-js/core!Component:interface"
|
|
3463
|
+
},
|
|
3464
|
+
{
|
|
3465
|
+
"kind": "Content",
|
|
3466
|
+
"text": "<{}>"
|
|
3467
|
+
},
|
|
3468
|
+
{
|
|
3469
|
+
"kind": "Content",
|
|
3470
|
+
"text": ";"
|
|
3471
|
+
}
|
|
3472
|
+
],
|
|
3473
|
+
"isReadonly": false,
|
|
3474
|
+
"isOptional": false,
|
|
3475
|
+
"releaseTag": "Public",
|
|
3476
|
+
"name": "WhenHasContent",
|
|
3477
|
+
"propertyTypeTokenRange": {
|
|
3478
|
+
"startIndex": 1,
|
|
3479
|
+
"endIndex": 3
|
|
3480
|
+
}
|
|
3481
|
+
}
|
|
3482
|
+
],
|
|
3483
|
+
"extendsTokenRanges": []
|
|
3484
|
+
},
|
|
3264
3485
|
{
|
|
3265
3486
|
"kind": "Interface",
|
|
3266
3487
|
"canonicalReference": "@alloy-js/core!Context:interface",
|
|
@@ -3276,6 +3497,33 @@
|
|
|
3276
3497
|
"name": "Context",
|
|
3277
3498
|
"preserveMemberOrder": false,
|
|
3278
3499
|
"members": [
|
|
3500
|
+
{
|
|
3501
|
+
"kind": "PropertySignature",
|
|
3502
|
+
"canonicalReference": "@alloy-js/core!Context#childrenWithContent:member",
|
|
3503
|
+
"docComment": "/**\n * The number of child nodes that have content. When zero, this component is\n * semantically empty.\n */\n",
|
|
3504
|
+
"excerptTokens": [
|
|
3505
|
+
{
|
|
3506
|
+
"kind": "Content",
|
|
3507
|
+
"text": "childrenWithContent: "
|
|
3508
|
+
},
|
|
3509
|
+
{
|
|
3510
|
+
"kind": "Content",
|
|
3511
|
+
"text": "number"
|
|
3512
|
+
},
|
|
3513
|
+
{
|
|
3514
|
+
"kind": "Content",
|
|
3515
|
+
"text": ";"
|
|
3516
|
+
}
|
|
3517
|
+
],
|
|
3518
|
+
"isReadonly": false,
|
|
3519
|
+
"isOptional": false,
|
|
3520
|
+
"releaseTag": "Public",
|
|
3521
|
+
"name": "childrenWithContent",
|
|
3522
|
+
"propertyTypeTokenRange": {
|
|
3523
|
+
"startIndex": 1,
|
|
3524
|
+
"endIndex": 2
|
|
3525
|
+
}
|
|
3526
|
+
},
|
|
3279
3527
|
{
|
|
3280
3528
|
"kind": "PropertySignature",
|
|
3281
3529
|
"canonicalReference": "@alloy-js/core!Context#componentOwner:member",
|
|
@@ -3400,6 +3648,65 @@
|
|
|
3400
3648
|
"endIndex": 2
|
|
3401
3649
|
}
|
|
3402
3650
|
},
|
|
3651
|
+
{
|
|
3652
|
+
"kind": "PropertySignature",
|
|
3653
|
+
"canonicalReference": "@alloy-js/core!Context#isEmpty:member",
|
|
3654
|
+
"docComment": "/**\n * A ref that indicates whether the component is empty.\n */\n",
|
|
3655
|
+
"excerptTokens": [
|
|
3656
|
+
{
|
|
3657
|
+
"kind": "Content",
|
|
3658
|
+
"text": "isEmpty?: "
|
|
3659
|
+
},
|
|
3660
|
+
{
|
|
3661
|
+
"kind": "Reference",
|
|
3662
|
+
"text": "Ref",
|
|
3663
|
+
"canonicalReference": "@vue/reactivity!Ref:interface"
|
|
3664
|
+
},
|
|
3665
|
+
{
|
|
3666
|
+
"kind": "Content",
|
|
3667
|
+
"text": "<boolean>"
|
|
3668
|
+
},
|
|
3669
|
+
{
|
|
3670
|
+
"kind": "Content",
|
|
3671
|
+
"text": ";"
|
|
3672
|
+
}
|
|
3673
|
+
],
|
|
3674
|
+
"isReadonly": false,
|
|
3675
|
+
"isOptional": true,
|
|
3676
|
+
"releaseTag": "Public",
|
|
3677
|
+
"name": "isEmpty",
|
|
3678
|
+
"propertyTypeTokenRange": {
|
|
3679
|
+
"startIndex": 1,
|
|
3680
|
+
"endIndex": 3
|
|
3681
|
+
}
|
|
3682
|
+
},
|
|
3683
|
+
{
|
|
3684
|
+
"kind": "PropertySignature",
|
|
3685
|
+
"canonicalReference": "@alloy-js/core!Context#isRoot:member",
|
|
3686
|
+
"docComment": "/**\n * Whether this context is a root context\n */\n",
|
|
3687
|
+
"excerptTokens": [
|
|
3688
|
+
{
|
|
3689
|
+
"kind": "Content",
|
|
3690
|
+
"text": "isRoot: "
|
|
3691
|
+
},
|
|
3692
|
+
{
|
|
3693
|
+
"kind": "Content",
|
|
3694
|
+
"text": "boolean"
|
|
3695
|
+
},
|
|
3696
|
+
{
|
|
3697
|
+
"kind": "Content",
|
|
3698
|
+
"text": ";"
|
|
3699
|
+
}
|
|
3700
|
+
],
|
|
3701
|
+
"isReadonly": false,
|
|
3702
|
+
"isOptional": false,
|
|
3703
|
+
"releaseTag": "Public",
|
|
3704
|
+
"name": "isRoot",
|
|
3705
|
+
"propertyTypeTokenRange": {
|
|
3706
|
+
"startIndex": 1,
|
|
3707
|
+
"endIndex": 2
|
|
3708
|
+
}
|
|
3709
|
+
},
|
|
3403
3710
|
{
|
|
3404
3711
|
"kind": "PropertySignature",
|
|
3405
3712
|
"canonicalReference": "@alloy-js/core!Context#meta:member",
|
|
@@ -4073,6 +4380,35 @@
|
|
|
4073
4380
|
],
|
|
4074
4381
|
"name": "createComponent"
|
|
4075
4382
|
},
|
|
4383
|
+
{
|
|
4384
|
+
"kind": "Function",
|
|
4385
|
+
"canonicalReference": "@alloy-js/core!createContentSlot:function(1)",
|
|
4386
|
+
"docComment": "/**\n * Create a component which tracks whether any content is placed inside of it.\n * The component exposes a ref `isEmpty` which indicates whether the slot is\n * empty, as well as convenience accessors `isEmpty` and `hasContent`.\n * Additionally, it provides two sub-components, `WhenEmpty` and\n * `WhenHasContent`, which render their contents conditionally based on whether\n * the slot is empty.\n *\n * @example\n *\n *\n *\n * ```tsx\n * const ContentSlot = createContentSlot();\n *\n * <>\n * <ContentSlot.WhenEmpty>The slot is empty!</ContentSlot.WhenEmpty>\n * <ContentSlot.WhenHasContent>The slot has content!</ContentSlot.WhenHasContent>\n * <ContentSlot>\n * {someCondition && \"Here is some content!\"}\n * </ContentSlot>\n * </>\n * ```\n *\n */\n",
|
|
4387
|
+
"excerptTokens": [
|
|
4388
|
+
{
|
|
4389
|
+
"kind": "Content",
|
|
4390
|
+
"text": "export declare function createContentSlot(): "
|
|
4391
|
+
},
|
|
4392
|
+
{
|
|
4393
|
+
"kind": "Reference",
|
|
4394
|
+
"text": "ContentSlot",
|
|
4395
|
+
"canonicalReference": "@alloy-js/core!ContentSlot:interface"
|
|
4396
|
+
},
|
|
4397
|
+
{
|
|
4398
|
+
"kind": "Content",
|
|
4399
|
+
"text": ";"
|
|
4400
|
+
}
|
|
4401
|
+
],
|
|
4402
|
+
"fileUrlPath": "src/content-slot.tsx",
|
|
4403
|
+
"returnTypeTokenRange": {
|
|
4404
|
+
"startIndex": 1,
|
|
4405
|
+
"endIndex": 2
|
|
4406
|
+
},
|
|
4407
|
+
"releaseTag": "Public",
|
|
4408
|
+
"overloadIndex": 1,
|
|
4409
|
+
"parameters": [],
|
|
4410
|
+
"name": "createContentSlot"
|
|
4411
|
+
},
|
|
4076
4412
|
{
|
|
4077
4413
|
"kind": "Function",
|
|
4078
4414
|
"canonicalReference": "@alloy-js/core!createContext:function(1)",
|
|
@@ -5504,6 +5840,61 @@
|
|
|
5504
5840
|
"endIndex": 4
|
|
5505
5841
|
}
|
|
5506
5842
|
},
|
|
5843
|
+
{
|
|
5844
|
+
"kind": "Function",
|
|
5845
|
+
"canonicalReference": "@alloy-js/core!decl:function(1)",
|
|
5846
|
+
"docComment": "/**\n * Create a declaration in the current scope with the given namekey. Only works\n * with basic scopes. Import `decl` from a specific language library for\n * declaring language-specific symbols.\n */\n",
|
|
5847
|
+
"excerptTokens": [
|
|
5848
|
+
{
|
|
5849
|
+
"kind": "Content",
|
|
5850
|
+
"text": "export declare function decl(namekey: "
|
|
5851
|
+
},
|
|
5852
|
+
{
|
|
5853
|
+
"kind": "Reference",
|
|
5854
|
+
"text": "Namekey",
|
|
5855
|
+
"canonicalReference": "@alloy-js/core!Namekey:interface"
|
|
5856
|
+
},
|
|
5857
|
+
{
|
|
5858
|
+
"kind": "Content",
|
|
5859
|
+
"text": "): "
|
|
5860
|
+
},
|
|
5861
|
+
{
|
|
5862
|
+
"kind": "Content",
|
|
5863
|
+
"text": "import(\"../runtime/component.js\")."
|
|
5864
|
+
},
|
|
5865
|
+
{
|
|
5866
|
+
"kind": "Reference",
|
|
5867
|
+
"text": "ComponentCreator",
|
|
5868
|
+
"canonicalReference": "@alloy-js/core!ComponentCreator:interface"
|
|
5869
|
+
},
|
|
5870
|
+
{
|
|
5871
|
+
"kind": "Content",
|
|
5872
|
+
"text": "<{}>"
|
|
5873
|
+
},
|
|
5874
|
+
{
|
|
5875
|
+
"kind": "Content",
|
|
5876
|
+
"text": ";"
|
|
5877
|
+
}
|
|
5878
|
+
],
|
|
5879
|
+
"fileUrlPath": "src/symbols/decl.ts",
|
|
5880
|
+
"returnTypeTokenRange": {
|
|
5881
|
+
"startIndex": 3,
|
|
5882
|
+
"endIndex": 6
|
|
5883
|
+
},
|
|
5884
|
+
"releaseTag": "Public",
|
|
5885
|
+
"overloadIndex": 1,
|
|
5886
|
+
"parameters": [
|
|
5887
|
+
{
|
|
5888
|
+
"parameterName": "namekey",
|
|
5889
|
+
"parameterTypeTokenRange": {
|
|
5890
|
+
"startIndex": 1,
|
|
5891
|
+
"endIndex": 2
|
|
5892
|
+
},
|
|
5893
|
+
"isOptional": false
|
|
5894
|
+
}
|
|
5895
|
+
],
|
|
5896
|
+
"name": "decl"
|
|
5897
|
+
},
|
|
5507
5898
|
{
|
|
5508
5899
|
"kind": "Function",
|
|
5509
5900
|
"canonicalReference": "@alloy-js/core!Declaration:function(1)",
|
|
@@ -13107,6 +13498,34 @@
|
|
|
13107
13498
|
],
|
|
13108
13499
|
"extendsTokenRanges": []
|
|
13109
13500
|
},
|
|
13501
|
+
{
|
|
13502
|
+
"kind": "Function",
|
|
13503
|
+
"canonicalReference": "@alloy-js/core!notifyContentState:function(1)",
|
|
13504
|
+
"docComment": "",
|
|
13505
|
+
"excerptTokens": [
|
|
13506
|
+
{
|
|
13507
|
+
"kind": "Content",
|
|
13508
|
+
"text": "export declare function notifyContentState(): "
|
|
13509
|
+
},
|
|
13510
|
+
{
|
|
13511
|
+
"kind": "Content",
|
|
13512
|
+
"text": "void"
|
|
13513
|
+
},
|
|
13514
|
+
{
|
|
13515
|
+
"kind": "Content",
|
|
13516
|
+
"text": ";"
|
|
13517
|
+
}
|
|
13518
|
+
],
|
|
13519
|
+
"fileUrlPath": "src/render.ts",
|
|
13520
|
+
"returnTypeTokenRange": {
|
|
13521
|
+
"startIndex": 1,
|
|
13522
|
+
"endIndex": 2
|
|
13523
|
+
},
|
|
13524
|
+
"releaseTag": "Public",
|
|
13525
|
+
"overloadIndex": 1,
|
|
13526
|
+
"parameters": [],
|
|
13527
|
+
"name": "notifyContentState"
|
|
13528
|
+
},
|
|
13110
13529
|
{
|
|
13111
13530
|
"kind": "Function",
|
|
13112
13531
|
"canonicalReference": "@alloy-js/core!onCleanup:function(1)",
|
|
@@ -17004,7 +17423,7 @@
|
|
|
17004
17423
|
{
|
|
17005
17424
|
"kind": "Function",
|
|
17006
17425
|
"canonicalReference": "@alloy-js/core!printTree:function(1)",
|
|
17007
|
-
"docComment": "",
|
|
17426
|
+
"docComment": "/**\n * Convert a rendered text tree to a string. Will ensure that the scheduler is\n * empty before printing.\n */\n",
|
|
17008
17427
|
"excerptTokens": [
|
|
17009
17428
|
{
|
|
17010
17429
|
"kind": "Content",
|
|
@@ -18467,6 +18886,56 @@
|
|
|
18467
18886
|
],
|
|
18468
18887
|
"extendsTokenRanges": []
|
|
18469
18888
|
},
|
|
18889
|
+
{
|
|
18890
|
+
"kind": "Function",
|
|
18891
|
+
"canonicalReference": "@alloy-js/core!refId:function(1)",
|
|
18892
|
+
"docComment": "",
|
|
18893
|
+
"excerptTokens": [
|
|
18894
|
+
{
|
|
18895
|
+
"kind": "Content",
|
|
18896
|
+
"text": "export declare function refId(ref: "
|
|
18897
|
+
},
|
|
18898
|
+
{
|
|
18899
|
+
"kind": "Reference",
|
|
18900
|
+
"text": "Ref",
|
|
18901
|
+
"canonicalReference": "@vue/reactivity!Ref:interface"
|
|
18902
|
+
},
|
|
18903
|
+
{
|
|
18904
|
+
"kind": "Content",
|
|
18905
|
+
"text": "<unknown>"
|
|
18906
|
+
},
|
|
18907
|
+
{
|
|
18908
|
+
"kind": "Content",
|
|
18909
|
+
"text": "): "
|
|
18910
|
+
},
|
|
18911
|
+
{
|
|
18912
|
+
"kind": "Content",
|
|
18913
|
+
"text": "number"
|
|
18914
|
+
},
|
|
18915
|
+
{
|
|
18916
|
+
"kind": "Content",
|
|
18917
|
+
"text": ";"
|
|
18918
|
+
}
|
|
18919
|
+
],
|
|
18920
|
+
"fileUrlPath": "src/reactivity.ts",
|
|
18921
|
+
"returnTypeTokenRange": {
|
|
18922
|
+
"startIndex": 4,
|
|
18923
|
+
"endIndex": 5
|
|
18924
|
+
},
|
|
18925
|
+
"releaseTag": "Public",
|
|
18926
|
+
"overloadIndex": 1,
|
|
18927
|
+
"parameters": [
|
|
18928
|
+
{
|
|
18929
|
+
"parameterName": "ref",
|
|
18930
|
+
"parameterTypeTokenRange": {
|
|
18931
|
+
"startIndex": 1,
|
|
18932
|
+
"endIndex": 3
|
|
18933
|
+
},
|
|
18934
|
+
"isOptional": false
|
|
18935
|
+
}
|
|
18936
|
+
],
|
|
18937
|
+
"name": "refId"
|
|
18938
|
+
},
|
|
18470
18939
|
{
|
|
18471
18940
|
"kind": "Function",
|
|
18472
18941
|
"canonicalReference": "@alloy-js/core!refkey:function(1)",
|
|
@@ -18664,7 +19133,7 @@
|
|
|
18664
19133
|
{
|
|
18665
19134
|
"kind": "Function",
|
|
18666
19135
|
"canonicalReference": "@alloy-js/core!render:function(1)",
|
|
18667
|
-
"docComment": "",
|
|
19136
|
+
"docComment": "/**\n * Render a component tree to source directories and files. Will ensure that\n * all non-async scheduled jobs are completed before returning. If async jobs\n * are found, an error will be thrown. Use `renderAsync` when asynchronous\n * jobs are expected.\n */\n",
|
|
18668
19137
|
"excerptTokens": [
|
|
18669
19138
|
{
|
|
18670
19139
|
"kind": "Content",
|
|
@@ -18807,7 +19276,7 @@
|
|
|
18807
19276
|
{
|
|
18808
19277
|
"kind": "Function",
|
|
18809
19278
|
"canonicalReference": "@alloy-js/core!renderAsync:function(1)",
|
|
18810
|
-
"docComment": "",
|
|
19279
|
+
"docComment": "/**\n * Render a component tree to source directories and files. Will ensure that all\n * scheduled jobs are completed before returning.\n */\n",
|
|
18811
19280
|
"excerptTokens": [
|
|
18812
19281
|
{
|
|
18813
19282
|
"kind": "Content",
|
|
@@ -20958,7 +21427,7 @@
|
|
|
20958
21427
|
{
|
|
20959
21428
|
"kind": "Function",
|
|
20960
21429
|
"canonicalReference": "@alloy-js/core!sourceFilesForTree:function(1)",
|
|
20961
|
-
"docComment": "",
|
|
21430
|
+
"docComment": "/**\n * Convert a rendered text tree to source directories and files. Will ensure\n * that all scheduled jobs are completed before returning.\n */\n",
|
|
20962
21431
|
"excerptTokens": [
|
|
20963
21432
|
{
|
|
20964
21433
|
"kind": "Content",
|
|
@@ -21019,6 +21488,83 @@
|
|
|
21019
21488
|
],
|
|
21020
21489
|
"name": "sourceFilesForTree"
|
|
21021
21490
|
},
|
|
21491
|
+
{
|
|
21492
|
+
"kind": "Function",
|
|
21493
|
+
"canonicalReference": "@alloy-js/core!sourceFilesForTreeAsync:function(1)",
|
|
21494
|
+
"docComment": "/**\n * Convert a rendered text tree to source directories and files. Will ensure that\n * all scheduled jobs are completed, including async ones.\n */\n",
|
|
21495
|
+
"excerptTokens": [
|
|
21496
|
+
{
|
|
21497
|
+
"kind": "Content",
|
|
21498
|
+
"text": "export declare function sourceFilesForTreeAsync(tree: "
|
|
21499
|
+
},
|
|
21500
|
+
{
|
|
21501
|
+
"kind": "Reference",
|
|
21502
|
+
"text": "RenderedTextTree",
|
|
21503
|
+
"canonicalReference": "@alloy-js/core!RenderedTextTree:type"
|
|
21504
|
+
},
|
|
21505
|
+
{
|
|
21506
|
+
"kind": "Content",
|
|
21507
|
+
"text": ", options?: "
|
|
21508
|
+
},
|
|
21509
|
+
{
|
|
21510
|
+
"kind": "Reference",
|
|
21511
|
+
"text": "PrintTreeOptions",
|
|
21512
|
+
"canonicalReference": "@alloy-js/core!PrintTreeOptions:interface"
|
|
21513
|
+
},
|
|
21514
|
+
{
|
|
21515
|
+
"kind": "Content",
|
|
21516
|
+
"text": "): "
|
|
21517
|
+
},
|
|
21518
|
+
{
|
|
21519
|
+
"kind": "Reference",
|
|
21520
|
+
"text": "Promise",
|
|
21521
|
+
"canonicalReference": "!Promise:interface"
|
|
21522
|
+
},
|
|
21523
|
+
{
|
|
21524
|
+
"kind": "Content",
|
|
21525
|
+
"text": "<"
|
|
21526
|
+
},
|
|
21527
|
+
{
|
|
21528
|
+
"kind": "Reference",
|
|
21529
|
+
"text": "OutputDirectory",
|
|
21530
|
+
"canonicalReference": "@alloy-js/core!OutputDirectory:interface"
|
|
21531
|
+
},
|
|
21532
|
+
{
|
|
21533
|
+
"kind": "Content",
|
|
21534
|
+
"text": ">"
|
|
21535
|
+
},
|
|
21536
|
+
{
|
|
21537
|
+
"kind": "Content",
|
|
21538
|
+
"text": ";"
|
|
21539
|
+
}
|
|
21540
|
+
],
|
|
21541
|
+
"fileUrlPath": "src/render.ts",
|
|
21542
|
+
"returnTypeTokenRange": {
|
|
21543
|
+
"startIndex": 5,
|
|
21544
|
+
"endIndex": 9
|
|
21545
|
+
},
|
|
21546
|
+
"releaseTag": "Public",
|
|
21547
|
+
"overloadIndex": 1,
|
|
21548
|
+
"parameters": [
|
|
21549
|
+
{
|
|
21550
|
+
"parameterName": "tree",
|
|
21551
|
+
"parameterTypeTokenRange": {
|
|
21552
|
+
"startIndex": 1,
|
|
21553
|
+
"endIndex": 2
|
|
21554
|
+
},
|
|
21555
|
+
"isOptional": false
|
|
21556
|
+
},
|
|
21557
|
+
{
|
|
21558
|
+
"parameterName": "options",
|
|
21559
|
+
"parameterTypeTokenRange": {
|
|
21560
|
+
"startIndex": 3,
|
|
21561
|
+
"endIndex": 4
|
|
21562
|
+
},
|
|
21563
|
+
"isOptional": true
|
|
21564
|
+
}
|
|
21565
|
+
],
|
|
21566
|
+
"name": "sourceFilesForTreeAsync"
|
|
21567
|
+
},
|
|
21022
21568
|
{
|
|
21023
21569
|
"kind": "Function",
|
|
21024
21570
|
"canonicalReference": "@alloy-js/core!splitProps:function(1)",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { ref } from "@vue/reactivity";
|
|
1
2
|
import { expect, it } from "vitest";
|
|
2
3
|
import { Block } from "../../src/components/Block.jsx";
|
|
4
|
+
import { printTree, renderTree } from "../../src/render.js";
|
|
3
5
|
import "../../testing/extend-expect.js";
|
|
4
6
|
it("renders properly with no children", () => {
|
|
5
7
|
const template = (
|
|
@@ -33,7 +35,7 @@ it("renders properly with newline and no children", () => {
|
|
|
33
35
|
`);
|
|
34
36
|
});
|
|
35
37
|
|
|
36
|
-
it("renders properly with newline and
|
|
38
|
+
it("renders properly with newline and children", () => {
|
|
37
39
|
const template = (
|
|
38
40
|
<>
|
|
39
41
|
class<Block newline>contents!!</Block>
|
|
@@ -46,3 +48,21 @@ it("renders properly with newline and no children", () => {
|
|
|
46
48
|
}
|
|
47
49
|
`);
|
|
48
50
|
});
|
|
51
|
+
|
|
52
|
+
it("renders properly when content is added reactively", () => {
|
|
53
|
+
const contents = ref("");
|
|
54
|
+
const tree = renderTree(
|
|
55
|
+
<>
|
|
56
|
+
class Foo <Block>{contents}</Block>
|
|
57
|
+
</>,
|
|
58
|
+
);
|
|
59
|
+
expect(printTree(tree)).toRenderTo(`
|
|
60
|
+
class Foo {}
|
|
61
|
+
`);
|
|
62
|
+
contents.value = "x = 12;";
|
|
63
|
+
expect(printTree(tree)).toRenderTo(`
|
|
64
|
+
class Foo {
|
|
65
|
+
x = 12;
|
|
66
|
+
}
|
|
67
|
+
`);
|
|
68
|
+
});
|