@torpor/view 0.0.2 → 0.0.3
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/CHANGELOG.md +11 -0
- package/dist/{Component-Dpu-AVgs.d.cts → Component-CysAnHpO.d.cts} +1 -1
- package/dist/{Component-Dpu-AVgs.d.ts → Component-CysAnHpO.d.ts} +1 -1
- package/dist/{ServerSlotRender-BJ4LZmv6.d.cts → ServerSlotRender-AWF3bD5B.d.cts} +1 -1
- package/dist/{ServerSlotRender-BJ4LZmv6.d.ts → ServerSlotRender-AWF3bD5B.d.ts} +1 -1
- package/dist/chunk-EGRHWZRV.js +1 -0
- package/dist/chunk-EGRHWZRV.js.map +1 -0
- package/dist/compile.cjs +119 -89
- package/dist/compile.cjs.map +1 -1
- package/dist/compile.d.cts +37 -30
- package/dist/compile.d.ts +37 -30
- package/dist/compile.js +121 -89
- package/dist/compile.js.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/ssr.cjs +2 -2
- package/dist/ssr.cjs.map +1 -1
- package/dist/ssr.d.cts +4 -4
- package/dist/ssr.d.ts +4 -4
- package/dist/ssr.js +2 -2
- package/dist/ssr.js.map +1 -1
- package/package.json +12 -12
- package/scripts/buildTestOutput.ts +7 -8
- package/scripts/copyToRepl.ts +5 -3
- package/src/ambient.d.ts +23 -0
- package/src/compile/build/client/BuildStatus.ts +6 -4
- package/src/compile/build/client/buildAddFragment.ts +5 -5
- package/src/compile/build/client/buildAwaitNode.ts +3 -9
- package/src/compile/build/client/buildCode.ts +16 -12
- package/src/compile/build/client/buildComponentNode.ts +11 -9
- package/src/compile/build/client/buildControlNode.ts +10 -15
- package/src/compile/build/client/buildElementNode.ts +12 -15
- package/src/compile/build/client/buildForNode.ts +3 -10
- package/src/compile/build/client/buildFragment.ts +20 -8
- package/src/compile/build/client/buildFragmentText.ts +7 -7
- package/src/compile/build/client/buildHeadNode.ts +2 -2
- package/src/compile/build/client/buildHtmlNode.ts +3 -9
- package/src/compile/build/client/buildIfNode.ts +3 -9
- package/src/compile/build/client/buildMount.ts +1 -1
- package/src/compile/build/client/buildNode.ts +11 -11
- package/src/compile/build/client/buildReplaceNode.ts +3 -9
- package/src/compile/build/client/buildRootNode.ts +2 -2
- package/src/compile/build/client/buildRun.ts +2 -2
- package/src/compile/build/client/buildScriptNode.ts +1 -1
- package/src/compile/build/client/buildSlotNode.ts +10 -12
- package/src/compile/build/client/buildSpecialNode.ts +5 -6
- package/src/compile/build/client/buildStyles.ts +3 -4
- package/src/compile/build/client/buildSwitchNode.ts +3 -9
- package/src/compile/build/client/buildTextNode.ts +3 -9
- package/src/compile/build/server/BuildServerStatus.ts +3 -3
- package/src/compile/build/server/buildServerAwaitNode.ts +2 -2
- package/src/compile/build/server/buildServerCode.ts +11 -14
- package/src/compile/build/server/buildServerComponentNode.ts +15 -7
- package/src/compile/build/server/buildServerControlNode.ts +4 -3
- package/src/compile/build/server/buildServerElementNode.ts +4 -4
- package/src/compile/build/server/buildServerForNode.ts +2 -2
- package/src/compile/build/server/buildServerHtmlNode.ts +3 -9
- package/src/compile/build/server/buildServerIfNode.ts +2 -2
- package/src/compile/build/server/buildServerNode.ts +7 -7
- package/src/compile/build/server/buildServerReplaceNode.ts +2 -2
- package/src/compile/build/server/buildServerRootNode.ts +2 -2
- package/src/compile/build/server/buildServerScriptNode.ts +1 -1
- package/src/compile/build/server/buildServerSlotNode.ts +3 -3
- package/src/compile/build/server/buildServerSpecialNode.ts +2 -2
- package/src/compile/build/server/buildServerSwitchNode.ts +3 -3
- package/src/compile/build/server/buildServerTextNode.ts +3 -4
- package/src/compile/build/utils/isReactiveAttribute.ts +6 -7
- package/src/compile/build/utils/nextVarName.ts +2 -2
- package/src/compile/build.ts +3 -3
- package/src/compile/buildType.ts +4 -8
- package/src/compile/parse/ParseStatus.ts +13 -6
- package/src/compile/parse/addSpaceElement.ts +4 -4
- package/src/compile/parse/parseCode.ts +6 -5
- package/src/compile/parse/parseControl.ts +4 -4
- package/src/compile/parse/parseElement.ts +10 -8
- package/src/compile/parse/parseImports.ts +1 -1
- package/src/compile/parse/parseInlineScript.ts +3 -3
- package/src/compile/parse/parseMarkup.ts +1 -1
- package/src/compile/parse/parseStyles.ts +3 -4
- package/src/compile/parse/parseTag.ts +3 -3
- package/src/compile/parse/scopeStyles.ts +3 -3
- package/src/compile/parse/slottifyChildNodes.ts +2 -2
- package/src/compile/parse/utils/accept.ts +1 -1
- package/src/compile/parse/utils/addError.ts +1 -1
- package/src/compile/parse/utils/consumeAlphaNumeric.ts +1 -1
- package/src/compile/parse/utils/consumeNonSpace.ts +1 -1
- package/src/compile/parse/utils/consumeSpace.ts +1 -1
- package/src/compile/parse/utils/consumeUntil.ts +1 -1
- package/src/compile/parse/utils/expect.ts +1 -1
- package/src/compile/parse.ts +1 -1
- package/src/compile/types/BuildResult.ts +2 -2
- package/src/compile/types/CompileError.ts +2 -2
- package/src/compile/types/Import.ts +2 -2
- package/src/compile/types/ParseResult.ts +4 -4
- package/src/compile/types/nodes/Attribute.ts +2 -2
- package/src/compile/types/nodes/ControlNode.ts +6 -6
- package/src/compile/types/nodes/ElementNode.ts +6 -6
- package/src/compile/types/nodes/Fragment.ts +2 -2
- package/src/compile/types/nodes/NodeType.ts +1 -3
- package/src/compile/types/nodes/OperationType.ts +1 -3
- package/src/compile/types/nodes/ParentNode.ts +4 -4
- package/src/compile/types/nodes/RootNode.ts +5 -5
- package/src/compile/types/nodes/TemplateNode.ts +3 -3
- package/src/compile/types/nodes/TextNode.ts +3 -3
- package/src/compile/types/nodes/isControlNode.ts +2 -2
- package/src/compile/types/nodes/isElementNode.ts +2 -2
- package/src/compile/types/nodes/isParentNode.ts +2 -2
- package/src/compile/types/nodes/isSpaceNode.ts +2 -2
- package/src/compile/types/nodes/isSpecialNode.ts +2 -2
- package/src/compile/types/nodes/isTextNode.ts +2 -2
- package/src/compile/types/styles/Attribute.ts +2 -2
- package/src/compile/types/styles/Style.ts +3 -3
- package/src/compile/types/styles/StyleBlock.ts +3 -3
- package/src/compile/utils/Builder.ts +0 -1
- package/src/compile.ts +2 -2
- package/src/debug/printNode.ts +2 -2
- package/src/index.ts +5 -5
- package/src/render/$mount.ts +1 -1
- package/src/render/$run.ts +2 -2
- package/src/render/$serverMount.ts +2 -2
- package/src/render/$serverRun.ts +2 -2
- package/src/render/$watch.ts +2 -2
- package/src/render/addAnimation.ts +1 -1
- package/src/render/addFragment.ts +1 -1
- package/src/render/applyProps.ts +1 -1
- package/src/render/clearRange.ts +1 -1
- package/src/render/context.ts +5 -5
- package/src/render/flushMountEffects.ts +1 -1
- package/src/render/getFragment.ts +0 -2
- package/src/render/hydrate.ts +2 -2
- package/src/render/hydrateRoot.ts +2 -2
- package/src/render/mount.ts +2 -2
- package/src/render/moveRange.ts +1 -1
- package/src/render/newListItem.ts +1 -1
- package/src/render/newRange.ts +1 -1
- package/src/render/popRange.ts +1 -1
- package/src/render/pushRange.ts +1 -1
- package/src/render/runControl.ts +2 -2
- package/src/render/runControlBranch.ts +1 -1
- package/src/render/runList.ts +3 -3
- package/src/render/runListItems.ts +3 -4
- package/src/ssr.ts +1 -1
- package/src/types/Animation.ts +1 -1
- package/src/types/BuildOptions.ts +2 -2
- package/src/types/Cleanup.ts +1 -3
- package/src/types/Component.ts +2 -4
- package/src/types/Effect.ts +4 -4
- package/src/types/ListItem.ts +3 -3
- package/src/types/ProxyData.ts +3 -3
- package/src/types/ProxyPropData.ts +3 -3
- package/src/types/Range.ts +3 -3
- package/src/types/ServerComponent.ts +2 -4
- package/src/types/ServerSlotRender.ts +4 -3
- package/src/types/SlotRender.ts +3 -5
- package/src/types/Template.ts +4 -4
- package/src/types/TemplateComponent.ts +11 -4
- package/src/types/WatchOptions.ts +2 -2
- package/src/watch/proxyGet.ts +1 -1
- package/src/watch/proxySet.ts +1 -1
- package/src/watch/removeEffect.ts +1 -1
- package/src/watch/runEffect.ts +1 -1
- package/src/watch/trackEffect.ts +1 -1
- package/src/watch/transferEffects.ts +1 -1
- package/src/watch/triggerEffects.ts +1 -1
- package/test/attributes/attributes.test.ts +1 -1
- package/test/attributes/components/Attributes.d.ts +1 -1
- package/test/attributes/components/output/Attributes-client.ts +8 -3
- package/test/attributes/components/output/Attributes-server.ts +4 -3
- package/test/attributes/components/temp/{Attributes-client-6a45dee9b3b1a2cce54feceb78dd18c6dcf9ea71.ts → Attributes-client-c4812cb9307eac6ff44f90f3358a1811b52c7390.ts} +8 -3
- package/test/attributes/components/temp/{Attributes-server-81340ff9f0a53bdd3b568cb371e5c7648adbee4f.ts → Attributes-server-a7ebed503f2169f7c900d4613531082f1023b086.ts} +4 -3
- package/test/attributes/parse.test.ts +2 -2
- package/test/await/components/Await.d.ts +1 -1
- package/test/await/components/output/Await-client.ts +16 -5
- package/test/await/components/output/Await-server.ts +4 -1
- package/test/await/components/temp/{Await-client-fbc4a91efad261d702579b56b5d52ef4ed3684ba.ts → Await-client-6ce3ac610ce79ae3b474c81964b715e6f3d966da.ts} +16 -5
- package/test/await/components/temp/{Await-server-7906b4a37d8918108ba74466a48f67c4791aadc4.ts → Await-server-06cd2a3d8c7eb5bef026ffe2fb11793becf547c2.ts} +4 -1
- package/test/bench/bench.bench.ts +1 -1
- package/test/bench/components/Bench.d.ts +1 -17
- package/test/bench/components/output/Bench-client.ts +87 -9
- package/test/bench/components/output/Bench-server.ts +18 -21
- package/test/bind/components/BindText.d.ts +1 -1
- package/test/bind/components/output/BindText-client.ts +7 -2
- package/test/bind/components/output/BindText-server.ts +4 -1
- package/test/bind/components/temp/{BindText-client-6963638e95f6555cdf292aa921fdc866fa8ae1de.ts → BindText-client-d8b5da0867d612966fa091da7aa20baa77190d64.ts} +7 -2
- package/test/bind/components/temp/{BindText-server-6f62805628866f32e39045cd45e0f9da64c94837.ts → BindText-server-20ad98151d8e9dd7d347968051c4602d6b35124c.ts} +4 -1
- package/test/build-server/build-server-element-node.test.ts +1 -1
- package/test/build-server/build-server.test.ts +7 -4
- package/test/build-server/components/IfNested.d.ts +1 -1
- package/test/build-server/components/output/IfNested-client.ts +8 -7
- package/test/build-server/components/output/IfNested-server.ts +3 -2
- package/test/buildHtml.ts +10 -8
- package/test/buildOutputFiles.ts +7 -8
- package/test/child-component/components/ParentChild.d.ts +1 -1
- package/test/child-component/components/output/ParentChild-client.ts +13 -4
- package/test/child-component/components/output/ParentChild-server.ts +7 -3
- package/test/child-component/components/temp/{ParentChild-client-e2c85a44f6480588f7ff993be1b4d2c42f8e3cd3.ts → ParentChild-client-8f00a3a31a7f666990765fc4755b62a39c855226.ts} +13 -4
- package/test/child-component/components/temp/{ParentChild-server-17b1277850eee5321527307cd7b647be2485ea70.ts → ParentChild-server-9c791bdfa521c3f6549857a34a6cd414fa3c9e80.ts} +7 -3
- package/test/class/components/Class.d.ts +1 -1
- package/test/class/components/output/Class-client.ts +7 -3
- package/test/class/components/output/Class-server.ts +4 -3
- package/test/class/components/temp/{Class-client-8c6c84b3d23af8694670343c15cd5ca964c7da72.ts → Class-client-600bf865c14f1052d24e1c79242f837aaf5ae5e8.ts} +7 -3
- package/test/class/components/temp/{Class-server-5885a4a2dd951a6f311ae3e12cb59c08ce00c51c.ts → Class-server-082505b03612c762384ffff329472db3f55b8097.ts} +4 -3
- package/test/comments/html-comments.test.ts +2 -2
- package/test/comments/js-block-comments.test.ts +2 -2
- package/test/comments/js-line-comments.test.ts +2 -2
- package/test/component/components/Component.d.ts +1 -1
- package/test/component/components/Header.d.ts +1 -1
- package/test/component/components/output/Component-client.ts +7 -3
- package/test/component/components/output/Component-server.ts +5 -2
- package/test/component/components/output/Header-client.ts +8 -3
- package/test/component/components/output/Header-server.ts +4 -3
- package/test/component/components/temp/{Component-client-b419d2d8209ab069408eeaa294ec4c5a37bc310d.ts → Component-client-32cd481f03e25d10b8e93947a2ff8773135b4975.ts} +7 -3
- package/test/component/components/temp/{Component-server-8990933d40416aca88488988f30dfc3364dc456c.ts → Component-server-11542f55405218c0b471172cac1d6a1a4edb5c09.ts} +5 -2
- package/test/console/components/Console.d.ts +1 -1
- package/test/console/components/output/Console-client.ts +8 -2
- package/test/console/components/output/Console-server.ts +4 -1
- package/test/console/components/temp/{Console-client-3532f7492c0c06ab37cbce1c2472806396330dc5.ts → Console-client-2f206752ce59e59fba9bb91263b4102fd515951e.ts} +8 -2
- package/test/const/components/Const.d.ts +1 -1
- package/test/const/components/output/Const-client.ts +7 -2
- package/test/const/components/output/Const-server.ts +4 -1
- package/test/const/components/temp/{Const-client-5ba2f9f95af7840cbe1790a706596b0e97da2737.ts → Const-client-536e8fdf18d6f4f7f23b2789de2330ecf62d7865.ts} +7 -2
- package/test/const/components/temp/{Const-server-4914c3d9a707e19c852f31c40b4e8e16ed1b4b6b.ts → Const-server-8f84096c03a19296425aee5d243af0734b70ca61.ts} +4 -1
- package/test/effects/components/For.d.ts +1 -1
- package/test/effects/components/If.d.ts +1 -1
- package/test/effects/components/NestedIf.d.ts +1 -1
- package/test/effects/components/output/For-client.ts +10 -4
- package/test/effects/components/output/For-server.ts +3 -2
- package/test/effects/components/output/If-client.ts +12 -4
- package/test/effects/components/output/If-server.ts +3 -2
- package/test/effects/components/output/NestedIf-client.ts +15 -5
- package/test/effects/components/output/NestedIf-server.ts +3 -2
- package/test/effects/components/temp/{For-client-adc406645b9dd71d03bd2aafc56b642c2d21c2ae.ts → For-client-887b1758cf5c80f64708a47369e0e6ce44ffa20f.ts} +10 -4
- package/test/effects/components/temp/{For-server-8cc4e9e3fa2ae038e519460c85e558d9947b6fa5.ts → For-server-8e1c7393b102c870167dd086cbee45c47e614dfa.ts} +3 -2
- package/test/effects/components/temp/{If-client-cee3b0d8ea35c90cc1a0506fd121ad6ad7afde2d.ts → If-client-bfc548ef699b91f33e604f066211ce6269cc9506.ts} +12 -4
- package/test/effects/components/temp/{If-server-62a737eb85f6f9931bc5ce6f9121561c3474e5e3.ts → If-server-8c213b1a82cd0a5c2bccfeb90ba8bf01fa4672d2.ts} +3 -2
- package/test/effects/components/temp/{NestedIf-client-0df3cf11db8413f1af92857fbebdc05128eb7525.ts → NestedIf-client-9e9155398f240345af392194063adc6e42dda80c.ts} +15 -5
- package/test/effects/components/temp/{NestedIf-server-37e3b835c2ba3e0a280fa7589fd2a2861b7a8d0f.ts → NestedIf-server-5f11d075c2ff224ee5feb7f61aa41aea8af44313.ts} +3 -2
- package/test/effects/for-effect.test.ts +2 -2
- package/test/effects/if-effect.test.ts +1 -1
- package/test/effects/nested-if-effect.test.ts +1 -1
- package/test/events/components/Increment.d.ts +1 -1
- package/test/events/components/output/Increment-client.ts +7 -2
- package/test/events/components/output/Increment-server.ts +4 -1
- package/test/events/components/temp/{Increment-client-44da5864e44c53bed1fa35069403559fe3ec33b3.ts → Increment-client-35c275d15e94e4aa7625af12c45210521995ead5.ts} +7 -2
- package/test/events/components/temp/{Increment-server-bd1216d8417b709a52131417405be76909885775.ts → Increment-server-bbf5ac93c4f73382c4262ae42f4cc836bcb8ac1b.ts} +4 -1
- package/test/events/events.test.ts +1 -1
- package/test/for/components/For.d.ts +1 -1
- package/test/for/components/ForEscape.d.ts +18 -0
- package/test/for/components/ForEscape.torp +13 -0
- package/test/for/components/ForIn.d.ts +1 -1
- package/test/for/components/ForOf.d.ts +1 -1
- package/test/for/components/output/For-client.ts +11 -4
- package/test/for/components/output/For-server.ts +4 -1
- package/test/for/components/output/ForEscape-client.ts +96 -0
- package/test/for/components/output/ForEscape-server.ts +24 -0
- package/test/for/components/output/ForIn-client.ts +11 -5
- package/test/for/components/output/ForIn-server.ts +4 -3
- package/test/for/components/output/ForOf-client.ts +11 -5
- package/test/for/components/output/ForOf-server.ts +4 -3
- package/test/for/components/temp/{For-client-c28b3b4ffaff54e225968666bb89a9801aa4be38.ts → For-client-1f6e475347f0474375f12a7c24b0b293e3942aa7.ts} +11 -4
- package/test/for/components/temp/{For-server-f8858496076f65ca1abefa4cc8e3f5d8abb8939d.ts → For-server-8490f15d02ae76b218feb7fa266415f44b2a4ab9.ts} +4 -1
- package/test/for/components/temp/ForEscape-client-2c881b16a6382edf074e1f151a209d60ca9b2b66.ts +96 -0
- package/test/for/components/temp/ForEscape-server-94a1bceabed006e15326a7f635724d88c3daa8fe.ts +24 -0
- package/test/for/components/temp/{ForIn-client-9f9383ab12774da311700aa5215c3cd00710b4fa.ts → ForIn-client-c8a1ec4473d05475e11928d06d081ab671fd9f28.ts} +11 -5
- package/test/for/components/temp/{ForIn-server-dd6f6da286061c14a1871ce86b29d4cc1b3851f6.ts → ForIn-server-d92cf8d3c3e300b562308607caca2c9cab3cb30b.ts} +4 -3
- package/test/for/components/temp/{ForOf-client-6a1c4b8b20f4e20ec413902c8fa4f47dcc564895.ts → ForOf-client-069881d4d9e52bc091e7213154924f3e1626174a.ts} +11 -5
- package/test/for/components/temp/{ForOf-server-4101449127dfcf735eb1bfe9e571f7fa53b4182d.ts → ForOf-server-3bfbb33bd589890d272bbcbea53d9598f53bfd70.ts} +4 -3
- package/test/for/for-escape.test.ts +41 -0
- package/test/for/for-with-key.test.ts +2 -2
- package/test/function/components/Function.d.ts +1 -1
- package/test/function/components/Function.torp +1 -0
- package/test/function/components/output/Function-client.ts +8 -2
- package/test/function/components/output/Function-server.ts +5 -1
- package/test/function/components/temp/{Function-client-97c3afdfd0ed80a74a9bfd41136927045699114c.ts → Function-client-b8931e51769f3f1e84d1491c6474f8551acf9f8d.ts} +8 -2
- package/test/function/components/temp/{Function-server-648cf7cb39698cd436479079551d43be1460ca05.ts → Function-server-2d32fbe35260c0948a135f287f131c5520e8bce7.ts} +5 -1
- package/test/function/function.test.ts +1 -1
- package/test/helpers.ts +8 -8
- package/test/html/components/Html.d.ts +1 -1
- package/test/html/components/output/Html-client.ts +7 -3
- package/test/html/components/output/Html-server.ts +4 -3
- package/test/html/components/temp/{Html-client-83841e19c73a4c003a0a89a268d17120c093f4d1.ts → Html-client-5fc745d9980a42a70dcb3473b0fd976e69882c9e.ts} +7 -3
- package/test/html/components/temp/{Html-server-fe700ee95c04e6418f7df23e98353fc9f196bb30.ts → Html-server-437ea390e58947213ede74755a012cdacceeebe7.ts} +4 -3
- package/test/hydrateComponent.ts +2 -2
- package/test/if/components/IfAfterIf.d.ts +1 -1
- package/test/if/components/IfElse.d.ts +1 -1
- package/test/if/components/IfElseIf.d.ts +1 -1
- package/test/if/components/IfNested.d.ts +1 -1
- package/test/if/components/output/IfAfterIf-client.ts +12 -4
- package/test/if/components/output/IfAfterIf-server.ts +3 -2
- package/test/if/components/output/IfElse-client.ts +12 -4
- package/test/if/components/output/IfElse-server.ts +3 -2
- package/test/if/components/output/IfElseIf-client.ts +15 -5
- package/test/if/components/output/IfElseIf-server.ts +3 -2
- package/test/if/components/output/IfNested-client.ts +18 -6
- package/test/if/components/output/IfNested-server.ts +3 -2
- package/test/if/components/temp/{IfAfterIf-client-f6bb64b0dda769d8e7a2e81a8bc37dc3c3113e4d.ts → IfAfterIf-client-a489daa5b961ed9da71418fdbb1665b6ba39f1b7.ts} +12 -4
- package/test/if/components/temp/{IfAfterIf-server-76bbc2178815e296b81865693aefe8de20f6dac9.ts → IfAfterIf-server-243736e666e7d77d3f8553a1682734555f5ffd22.ts} +3 -2
- package/test/if/components/temp/{IfElse-client-46690dea26d700b1cde101f33c12cc404671ac12.ts → IfElse-client-4c71642f412d5dd2f45729eafb7e974781dbe011.ts} +12 -4
- package/test/if/components/temp/{IfElse-server-70dfdfc697531324af41de11c3c0e3c8cd1fd89e.ts → IfElse-server-64c055182b327504ee71d1f1d44cfccf48be350d.ts} +3 -2
- package/test/if/components/temp/{IfElseIf-client-24b71b4710bc0a155f46d44656f14d4cc134d217.ts → IfElseIf-client-98d50d6f40c2385c4ef4fc02329f9d2e182c76c4.ts} +15 -5
- package/test/if/components/temp/{IfElseIf-server-dfaf8f0a0afea900b547d000a068328bb3755133.ts → IfElseIf-server-79788b13af905175f50bfa8658f2ff2af73db232.ts} +3 -2
- package/test/if/components/temp/{IfNested-client-42d93aa332e02a638e0adcb82b37d64c30df0b7d.ts → IfNested-client-979db97eea5b4595550b9b46f297f3fbc31796d2.ts} +18 -6
- package/test/if/components/temp/{IfNested-server-8ad247311e91f4b0b5b37df501191b654dfb6739.ts → IfNested-server-3c4e4b6f2162c0906cef685830219b9ea9ee985c.ts} +3 -2
- package/test/importComponent.ts +1 -1
- package/test/imports/commented-imports.ts +2 -2
- package/test/imports/imports.ts +2 -2
- package/test/imports/multiple-imports.ts +2 -2
- package/test/mount/components/Mount.d.ts +1 -1
- package/test/mount/components/output/Mount-client.ts +8 -2
- package/test/mount/components/output/Mount-server.ts +4 -1
- package/test/mount/components/temp/{Mount-client-2a25acbe52ac71618466dbc5bdd8b0a21fcb1c69.ts → Mount-client-49d8d6475336b5749fe8a17be847fd2b6cda5ccc.ts} +8 -2
- package/test/mount/components/temp/{Mount-server-23552a7d89c61823077d26086bff3949ee19bdbe.ts → Mount-server-e3d689cf52a4477da9aa00e2c7604110710db991.ts} +4 -1
- package/test/mount/mount.test.ts +0 -2
- package/test/mountComponent.ts +1 -1
- package/test/on-mount/components/OnMount.d.ts +1 -1
- package/test/on-mount/components/output/OnMount-client.ts +8 -2
- package/test/on-mount/components/output/OnMount-server.ts +4 -1
- package/test/on-mount/components/temp/{OnMount-client-faa4dd0b96fd60a897ab0bc41a046a3fe000a7c2.ts → OnMount-client-b2dfd41a0aaeafb3b7af14793a03e0fc3bc43aaa.ts} +8 -2
- package/test/on-mount/components/temp/{OnMount-server-049b2392d0c75bf829507043e2670c98953f4759.ts → OnMount-server-1758fe2b16972fca7d4b9bb49d9256fce99780eb.ts} +4 -1
- package/test/party/10-on-mount.test.ts +1 -1
- package/test/party/12-props.test.ts +1 -1
- package/test/party/14-slot.test.ts +1 -1
- package/test/party/15-slot-fallback.test.ts +1 -1
- package/test/party/16-context.test.ts +1 -1
- package/test/party/17-input-text.test.ts +1 -1
- package/test/party/18-input-checkbox.test.ts +1 -1
- package/test/party/19-input-radio.test.ts +1 -1
- package/test/party/20-input-select.test.ts +1 -1
- package/test/party/5-styling.test.ts +1 -1
- package/test/party/6-loop.test.ts +1 -1
- package/test/party/7-event-click.test.ts +1 -1
- package/test/party/8-dom-ref.test.ts +0 -2
- package/test/party/components/AnswerButton.d.ts +1 -1
- package/test/party/components/AnswerButtonApp.d.ts +1 -1
- package/test/party/components/ColorSelect.d.ts +1 -1
- package/test/party/components/Colors.d.ts +1 -1
- package/test/party/components/Counter.d.ts +1 -1
- package/test/party/components/CssStyle.d.ts +1 -1
- package/test/party/components/DoubleCount.d.ts +1 -1
- package/test/party/components/FunnyButton.d.ts +1 -1
- package/test/party/components/FunnyButtonApp.d.ts +1 -1
- package/test/party/components/HelloWorld.d.ts +1 -1
- package/test/party/components/InputFocused.d.ts +1 -1
- package/test/party/components/InputHello.d.ts +1 -1
- package/test/party/components/IsAvailable.d.ts +1 -1
- package/test/party/components/Name.d.ts +1 -1
- package/test/party/components/NameUpdate.d.ts +1 -1
- package/test/party/components/PageTitle.d.ts +1 -1
- package/test/party/components/PickPill.d.ts +1 -1
- package/test/party/components/Time.d.ts +1 -1
- package/test/party/components/TrafficLight.d.ts +1 -1
- package/test/party/components/UserProfile.d.ts +1 -1
- package/test/party/components/UserProfileApp.d.ts +1 -1
- package/test/party/components/UserProfileContext.d.ts +1 -1
- package/test/party/components/UserProfileContextApp.d.ts +1 -1
- package/test/party/components/output/AnswerButton-client.ts +6 -2
- package/test/party/components/output/AnswerButton-server.ts +3 -2
- package/test/party/components/output/AnswerButtonApp-client.ts +8 -3
- package/test/party/components/output/AnswerButtonApp-server.ts +5 -2
- package/test/party/components/output/ColorSelect-client.ts +11 -4
- package/test/party/components/output/ColorSelect-server.ts +4 -1
- package/test/party/components/output/Colors-client.ts +11 -4
- package/test/party/components/output/Colors-server.ts +4 -1
- package/test/party/components/output/Counter-client.ts +7 -2
- package/test/party/components/output/Counter-server.ts +4 -1
- package/test/party/components/output/CssStyle-client.ts +11 -8
- package/test/party/components/output/CssStyle-server.ts +6 -2
- package/test/party/components/output/DoubleCount-client.ts +8 -2
- package/test/party/components/output/DoubleCount-server.ts +4 -1
- package/test/party/components/output/FunnyButton-client.ts +10 -4
- package/test/party/components/output/FunnyButton-server.ts +3 -1
- package/test/party/components/output/FunnyButtonApp-client.ts +19 -5
- package/test/party/components/output/FunnyButtonApp-server.ts +11 -3
- package/test/party/components/output/HelloWorld-client.ts +8 -2
- package/test/party/components/output/HelloWorld-server.ts +4 -1
- package/test/party/components/output/InputFocused-client.ts +8 -2
- package/test/party/components/output/InputFocused-server.ts +4 -1
- package/test/party/components/output/InputHello-client.ts +7 -2
- package/test/party/components/output/InputHello-server.ts +4 -1
- package/test/party/components/output/IsAvailable-client.ts +7 -2
- package/test/party/components/output/IsAvailable-server.ts +4 -1
- package/test/party/components/output/Name-client.ts +8 -2
- package/test/party/components/output/Name-server.ts +4 -1
- package/test/party/components/output/NameUpdate-client.ts +8 -2
- package/test/party/components/output/NameUpdate-server.ts +4 -1
- package/test/party/components/output/PageTitle-client.ts +8 -2
- package/test/party/components/output/PageTitle-server.ts +4 -1
- package/test/party/components/output/PickPill-client.ts +7 -2
- package/test/party/components/output/PickPill-server.ts +4 -1
- package/test/party/components/output/Time-client.ts +8 -2
- package/test/party/components/output/Time-server.ts +4 -1
- package/test/party/components/output/TrafficLight-client.ts +16 -5
- package/test/party/components/output/TrafficLight-server.ts +4 -1
- package/test/party/components/output/UserProfile-client.ts +6 -2
- package/test/party/components/output/UserProfile-server.ts +3 -2
- package/test/party/components/output/UserProfileApp-client.ts +7 -3
- package/test/party/components/output/UserProfileApp-server.ts +5 -2
- package/test/party/components/output/UserProfileContext-client.ts +6 -2
- package/test/party/components/output/UserProfileContext-server.ts +3 -1
- package/test/party/components/output/UserProfileContextApp-client.ts +6 -2
- package/test/party/components/output/UserProfileContextApp-server.ts +3 -1
- package/test/party/components/temp/{AnswerButtonApp-client-3e03cd1d6f95f5f9300028e5f1cdd260b5e61bcc.ts → AnswerButtonApp-client-34311c2e7412807867fb6267af31a341f092bf31.ts} +8 -3
- package/test/party/components/temp/{AnswerButtonApp-server-5d3914c7c62fb67c51f73d78e256ee1bd7302c2d.ts → AnswerButtonApp-server-3f5071775abea24ee8830830072c6fe465fc4e56.ts} +5 -2
- package/test/party/components/temp/{ColorSelect-client-1897c35dcd9fd8268ae214265d0257f3f9600a84.ts → ColorSelect-client-f9fb9fa09f4729da3226d5aaf30e84cd3cd705b5.ts} +11 -4
- package/test/party/components/temp/{ColorSelect-server-38cf44a5b4ba0ed79dcc8395c708bda5a69d2792.ts → ColorSelect-server-3ed19eff17bf10b31d03ec507974ff913932c97a.ts} +4 -1
- package/test/party/components/temp/{Colors-client-03ff835fd17118c9da283df7403cd96dc3033ed2.ts → Colors-client-f124162d1dd8f0c3d37bf96c8e5f18599ae3a682.ts} +11 -4
- package/test/party/components/temp/{Colors-server-4a5fb2264c0a19c2b6fc270af1316042e1420444.ts → Colors-server-f9b3037a5f25979f71b5f8f3e658140be7c27920.ts} +4 -1
- package/test/party/components/temp/{Counter-client-f8d52c7077575f4319bd2e79bba2a6bdc1abd101.ts → Counter-client-c349710110b4afbf9593f20cfc40c162ed836079.ts} +7 -2
- package/test/party/components/temp/{Counter-server-11f44d1f3437878c41c0845899f0c79c7e4f7d31.ts → Counter-server-36d1137c519691f5b86a18a5c27b7cf615b7e37c.ts} +4 -1
- package/test/party/components/temp/{CssStyle-client-cfc3fd2cf399a204de8b5f5523b3c7fb71dff889.ts → CssStyle-client-59c0f261f67bc04f2829a0371f655d146101cec6.ts} +8 -2
- package/test/party/components/temp/CssStyle-server-3e58d7e2f5c381a251f593245d3d8bf4b50925ae.ts +17 -0
- package/test/party/components/temp/{DoubleCount-client-2dd560a563301bd6da2fdfe2219249b34d12aa51.ts → DoubleCount-client-0426f128507a8d4516ef7501cd180662112b6d1d.ts} +8 -2
- package/test/party/components/temp/{DoubleCount-server-30aa97d18a7bcc0b24facc3ec4f30d1c2b4ff499.ts → DoubleCount-server-40fc88156e52281b80fd6b12dd73d2469201fa29.ts} +4 -1
- package/test/party/components/temp/{FunnyButtonApp-client-86fbab3b909222d7fc79abd53cf782b0cf94c9ef.ts → FunnyButtonApp-client-4ed0ebf5be13ddb62d9942bac7f4b8a885ec6c50.ts} +19 -5
- package/test/party/components/temp/{FunnyButtonApp-server-3d4f5946eed07e638d2a423ffffb966dfa4f4258.ts → FunnyButtonApp-server-9748c9096848e643c91237c46ea09d23f1b3fa7c.ts} +11 -3
- package/test/party/components/temp/{HelloWorld-client-5a32a86f768cc125d5ef0ed526c73b26919433df.ts → HelloWorld-client-791e8b9a0bd4b01e87fbe70f2b28d4ac356e3624.ts} +8 -2
- package/test/party/components/temp/{HelloWorld-server-cbcefb2b79dbba49c8699fa0417326662a23d2d3.ts → HelloWorld-server-3c4b9a995a78d652d9220a20124c9e0d18fc7101.ts} +4 -1
- package/test/party/components/temp/{InputFocused-client-bdde50cb9c6bc70d4306cacda193b3ff92351ebf.ts → InputFocused-client-a543f82c8db205fb3e33c62de699cff43c668a68.ts} +8 -2
- package/test/party/components/temp/{InputFocused-server-a863dd8dfbe87c47de1d6d415ee7e3ea75a32a9f.ts → InputFocused-server-222f2fa7029d1cd6941a3777293a9b2d37b7295e.ts} +4 -1
- package/test/party/components/temp/{InputHello-client-4aaeab79a049de079052e03d619f516d3a9c0993.ts → InputHello-client-9953499de5778bb1d8aac7691129210a6098db07.ts} +7 -2
- package/test/party/components/temp/{InputHello-server-37755f5410442a879097449df910faf0b6288878.ts → InputHello-server-6c982438e58d3649ee3890efec636ca4590a5cdb.ts} +4 -1
- package/test/party/components/temp/{IsAvailable-client-e5912560c2333f37b0033188ed00c1789203b40e.ts → IsAvailable-client-929ed6c872e72b6c5243b882c6a9a0d13f6a7c47.ts} +7 -2
- package/test/party/components/temp/{IsAvailable-server-601e1c621e40760f8354392061ec951d1ba4f64c.ts → IsAvailable-server-a35b7ec5f111472c76aa1b67c857b169fe363594.ts} +4 -1
- package/test/party/components/temp/{Name-client-f314881fb1fbc4c927e8620a44e508c4acae1cf6.ts → Name-client-cb8bef7cfca1306386b65410a0bd7a8acfaed359.ts} +8 -2
- package/test/party/components/temp/{Name-server-2f1400f7b8f889aef984f5f4f64f51f435528e21.ts → Name-server-9da0823f748e9751e017078f39717298be232636.ts} +4 -1
- package/test/party/components/temp/{NameUpdate-client-abc797f7c1e00e380ef170b454f38347a5ad17d5.ts → NameUpdate-client-ebef69b0da12d640994099592ce06c7e4b5089d4.ts} +8 -2
- package/test/party/components/temp/{NameUpdate-server-d9915a163ea8d9fcdea76630095f5a1c38f3298f.ts → NameUpdate-server-1856bdb5e010f7d7e5e67f2a0d87ac3f92f4e0ee.ts} +4 -1
- package/test/party/components/temp/{PageTitle-client-89c844f5140e569cc190836da5f64d90d94daed5.ts → PageTitle-client-403645e918294e5cdeea8cb3f602e0a2642b2650.ts} +8 -2
- package/test/party/components/temp/{PageTitle-server-91f02c92e1a3aef3441aa0529e8e71af245fd02d.ts → PageTitle-server-4d959183b7029b6817372abd1d60a7e996baeb15.ts} +4 -1
- package/test/party/components/temp/{PickPill-client-ad6c2a265ed708f49cab7347b29398f83af3387f.ts → PickPill-client-f9a50a75ce63ec2ee3ac34e378e20602b93629f7.ts} +7 -2
- package/test/party/components/temp/{PickPill-server-30a8311db60f7e3cd8929a54ec7ab9ff4fa45281.ts → PickPill-server-49e033c5f97dd2f98e1498327e16eb9c8c9d2f66.ts} +4 -1
- package/test/party/components/temp/{TrafficLight-client-6a0bbdc4eb55b3189de6feecbcd775485c6f5e4e.ts → TrafficLight-client-81dd9bd9f3332533e01f6c9b271c15e5f76e1fdb.ts} +16 -5
- package/test/party/components/temp/{TrafficLight-server-5196e9a6a350b53e08caf0127eeed585805bc192.ts → TrafficLight-server-ed2a8640fd82cf381eee8f4fb83bb09d174a4557.ts} +4 -1
- package/test/party/components/temp/{UserProfileApp-client-377b64d798df3cdb22cd25c1fdb9e7c7e45c9307.ts → UserProfileApp-client-af27173415d65647cab0f30a9a4967cef0307e25.ts} +7 -3
- package/test/party/components/temp/{UserProfileApp-server-c98cb680c86d52e8de1ebe7ecf8a9c83c4b58d05.ts → UserProfileApp-server-6a7dbe68ee8041785cef50fb15a9e5ba475e120f.ts} +5 -2
- package/test/party/components/temp/{UserProfileContextApp-client-fb3c86949640d30bb5abce8cc54be3f193b88942.ts → UserProfileContextApp-client-7ea7d90a35894408757aef3e935d3a8badf93aea.ts} +6 -2
- package/test/party/components/temp/{UserProfileContextApp-server-816f3848764aee3cb9edda5b4e1babe11a3f8958.ts → UserProfileContextApp-server-90290c770529d7211eabf29e7d0fe868aa856b52.ts} +3 -1
- package/test/props/props.test.ts +1 -1
- package/test/replace/components/Replace.d.ts +1 -1
- package/test/replace/components/output/Replace-client.ts +9 -3
- package/test/replace/components/output/Replace-server.ts +3 -2
- package/test/replace/components/temp/{Replace-client-a41872410e8a44ab1a1ae7efb26657519580b892.ts → Replace-client-ea4ddc73c71181fb6ef3c6f5bf61b0b9e017f00a.ts} +9 -3
- package/test/replace/components/temp/{Replace-server-c3a2e0c6304ca4cc5bf77b24426b5996e68d0142.ts → Replace-server-30eb1ad796516fa4d310798a9c8a6811ec13cbd9.ts} +3 -2
- package/test/run/watch-defined-property.test.ts +1 -1
- package/test/run/watch-effect.test.ts +1 -1
- package/test/run/watch-function.test.ts +1 -1
- package/test/run/watch-getter.test.ts +1 -1
- package/test/run/watch-set-same-value.test.ts +1 -1
- package/test/script/script-with-comments.test.ts +2 -2
- package/test/script/script-with-strings.test.ts +2 -2
- package/test/script/script.test.ts +2 -2
- package/test/slots/components/Article.d.ts +1 -1
- package/test/slots/components/Basic.d.ts +1 -1
- package/test/slots/components/Header.d.ts +1 -1
- package/test/slots/components/Let.d.ts +1 -1
- package/test/slots/components/List.d.ts +1 -1
- package/test/slots/components/Named.d.ts +1 -1
- package/test/slots/components/Unused.d.ts +1 -1
- package/test/slots/components/output/Article-client.ts +9 -5
- package/test/slots/components/output/Article-server.ts +3 -1
- package/test/slots/components/output/Basic-client.ts +19 -5
- package/test/slots/components/output/Basic-server.ts +11 -3
- package/test/slots/components/output/Header-client.ts +10 -4
- package/test/slots/components/output/Header-server.ts +3 -1
- package/test/slots/components/output/Let-client.ts +19 -6
- package/test/slots/components/output/Let-server.ts +11 -5
- package/test/slots/components/output/List-client.ts +11 -6
- package/test/slots/components/output/List-server.ts +4 -4
- package/test/slots/components/output/Named-client.ts +29 -7
- package/test/slots/components/output/Named-server.ts +17 -4
- package/test/slots/components/output/Unused-client.ts +6 -2
- package/test/slots/components/output/Unused-server.ts +4 -1
- package/test/slots/components/temp/{Basic-client-7c3d966d05bf02f2efb4d2defd01106c4a875f0e.ts → Basic-client-c82bc3c5e10f2f2c1869347435262c8f3039e32f.ts} +19 -5
- package/test/slots/components/temp/{Basic-server-10598ecc3722031c5b179112ebb78e573ddb995a.ts → Basic-server-21fb4f8caa3bbcae219aaef388af8c26c46fa5ce.ts} +11 -3
- package/test/slots/components/temp/{Let-client-f3705ad315d7a5a39b4b69d6bfd098e8306bf4b6.ts → Let-client-c54696fd1b5b859a693744722957fa960f72fad6.ts} +19 -6
- package/test/slots/components/temp/{Let-server-ebcf5b8bbdc8393fd6a713a40ffedcafec5de3ef.ts → Let-server-4d78ffc8741fa737f2cd915b36c0e6ec88a9146f.ts} +11 -5
- package/test/slots/components/temp/{Named-client-90b44efe110f9fc0d044af93f303826d2d8a92cb.ts → Named-client-0626b2f0911f77f5edcfda82f9751bcbc37b7641.ts} +29 -7
- package/test/slots/components/temp/{Named-server-9be98d66310a50762580d958c4f8839bd72904ef.ts → Named-server-e802f901223d697c7fd0a1a234ce1930af1b4b3f.ts} +17 -4
- package/test/slots/components/temp/{Unused-client-0c90dd59b1bccb280d7fa66635b14017aace5e7c.ts → Unused-client-aa05465731e0d00e18189498f49c94f991e76f10.ts} +6 -2
- package/test/slots/components/temp/{Unused-server-76e858fffa1ff9ca6657b1820105fa5cb03c8cdb.ts → Unused-server-00b92d14665a565f0042b1f56231f28bc38a1252.ts} +4 -1
- package/test/special-component/components/BigTitle.d.ts +1 -1
- package/test/special-component/components/Component.d.ts +1 -1
- package/test/special-component/components/SmallTitle.d.ts +1 -1
- package/test/special-component/components/output/BigTitle-client.ts +7 -3
- package/test/special-component/components/output/BigTitle-server.ts +3 -1
- package/test/special-component/components/output/Component-client.ts +20 -7
- package/test/special-component/components/output/Component-server.ts +12 -5
- package/test/special-component/components/output/SmallTitle-client.ts +7 -3
- package/test/special-component/components/output/SmallTitle-server.ts +3 -1
- package/test/special-component/components/temp/{Component-client-7c6efd9a0218c7ee02265c741321b30507d7d65e.ts → Component-client-3cc84b23def8830b8ef441bde0f03b3e9718196a.ts} +20 -7
- package/test/special-component/components/temp/{Component-server-8be4db515d02637a9c3ae367ecd9a308c1aefacb.ts → Component-server-5dc597784ea1fe45ac2cfb21305cf2187a3868e8.ts} +12 -5
- package/test/special-element/components/Element.d.ts +1 -1
- package/test/special-element/components/output/Element-client.ts +10 -4
- package/test/special-element/components/output/Element-server.ts +4 -3
- package/test/special-element/components/temp/{Element-client-6b3502e6ef5e1d2a804e527d3eb697c070e8bb21.ts → Element-client-0ab8992a8e914c7e190cddac790585fef9be1c9f.ts} +10 -4
- package/test/special-element/components/temp/{Element-server-f195e538a133b7a4af228a1eaa03e02f0bd7d67d.ts → Element-server-ddb0170df4a3f369577ca7e9768e5fe799f14dfb.ts} +4 -3
- package/test/special-head/components/Head.d.ts +1 -1
- package/test/special-head/components/output/Head-client.ts +8 -2
- package/test/special-head/components/output/Head-server.ts +4 -1
- package/test/special-head/components/temp/{Head-client-81055df0cf65a3cfe54b1e6043e28acc046891d1.ts → Head-client-07e8af6386d767a52667a4fdc978a335ec388302.ts} +8 -2
- package/test/special-head/components/temp/{Head-server-f3a4b72bef3716f3e02ebf71b8022f3d5c2af1d2.ts → Head-server-d80a0f1ee10e9942d9a631df35a24cb1cfb15555.ts} +4 -1
- package/test/special-head/special-head.test.ts +1 -2
- package/test/special-self/components/Self.d.ts +1 -1
- package/test/special-self/components/output/Self-client.ts +10 -4
- package/test/special-self/components/output/Self-server.ts +4 -3
- package/test/special-self/components/temp/{Self-client-7ab817163886fba5c8604dc54111335d4af52d0b.ts → Self-client-3982f174954034643c4d17cfc66d7f10bf1d4df6.ts} +10 -4
- package/test/special-self/components/temp/{Self-server-d605191b8649ba5bc515a92d37f97f872ab327c3.ts → Self-server-97ffbdaae47f4463034e1d318a8073d078ff138f.ts} +4 -3
- package/test/special-self/special-self.test.ts +1 -1
- package/test/style/components/Style.d.ts +1 -1
- package/test/style/components/output/Style-client.ts +9 -4
- package/test/style/components/output/Style-server.ts +4 -3
- package/test/style/components/temp/{Style-client-038dddfc74f14e95d17936a3fd6732584d85fcaa.ts → Style-client-085517e82bdd015c86f4c2577447c6a2791cf656.ts} +9 -4
- package/test/style/components/temp/{Style-server-7529b8cdc2f761b80747f66533163551cae1214d.ts → Style-server-b2615163fbafdcb2a5d4155120edf2f66ef3bba6.ts} +4 -3
- package/test/style/parse.test.ts +2 -2
- package/test/switch/components/Switch.d.ts +1 -1
- package/test/switch/components/output/Switch-client.ts +15 -5
- package/test/switch/components/output/Switch-server.ts +3 -2
- package/test/switch/components/temp/{Switch-client-4136875ddb11497e2d95caf2359abee086aaa75c.ts → Switch-client-4c4adac7308795807517e66bc268a38f87df6bda.ts} +15 -5
- package/test/switch/components/temp/{Switch-server-9b74d83bdb27f06d3fcf7e6a6ce82036aa47f874.ts → Switch-server-21fcac2b02c6071136bb0dc394babd27e454d2c9.ts} +3 -2
- package/test/template/basic-file.test.ts +2 -2
- package/test/template/empty-file.test.ts +2 -2
- package/test/template/errors.test.ts +1 -1
- package/test/watch/watch-nested-object.test.ts +3 -1
- package/test/watch/watch-null-object.test.ts +1 -1
- package/test/watch/watch-null-property.test.ts +1 -1
- package/test/watch/watch-simple-object.test.ts +2 -1
- package/test/watch/watch-undefined-object.test.ts +1 -1
- package/test/watch/watch-undefined-property.test.ts +1 -1
- package/test/watch-array/ArrayState.ts +2 -2
- package/test/watch-array/array-all-functions-unkeyed.test.ts +1 -2
- package/test/watch-array/array-all-functions.test.ts +1 -2
- package/test/watch-array/array-empty.test.ts +3 -5
- package/test/watch-array/array-entries.test.ts +1 -2
- package/test/watch-array/array-indexes.test.ts +1 -2
- package/test/watch-array/array-pop.test.ts +1 -2
- package/test/watch-array/array-push.test.ts +1 -2
- package/test/watch-array/array-reassign.test.ts +1 -1
- package/test/watch-array/array-reverse.test.ts +1 -2
- package/test/watch-array/array-set-object.test.ts +1 -2
- package/test/watch-array/array-set-property.test.ts +1 -2
- package/test/watch-array/array-shift.test.ts +1 -2
- package/test/watch-array/array-sort.test.ts +1 -2
- package/test/watch-array/array-splice-add.test.ts +1 -2
- package/test/watch-array/array-splice-delete-all.test.ts +1 -2
- package/test/watch-array/array-splice-delete-and-add.test.ts +1 -1
- package/test/watch-array/array-splice-delete-end.test.ts +1 -2
- package/test/watch-array/array-splice-delete.test.ts +1 -1
- package/test/watch-array/array-swap.test.ts +1 -2
- package/test/watch-array/array-unshift.test.ts +1 -2
- package/test/watch-array/array-update-assignment.test.ts +1 -2
- package/test/watch-array/components/Array.d.ts +1 -1
- package/test/watch-array/components/ArrayEntries.d.ts +1 -1
- package/test/watch-array/components/ArrayIndexes.d.ts +1 -1
- package/test/watch-array/components/ArrayUnkeyed.d.ts +1 -1
- package/test/watch-array/components/output/Array-client.ts +11 -5
- package/test/watch-array/components/output/Array-server.ts +4 -3
- package/test/watch-array/components/output/ArrayEntries-client.ts +11 -5
- package/test/watch-array/components/output/ArrayEntries-server.ts +4 -3
- package/test/watch-array/components/output/ArrayIndexes-client.ts +11 -5
- package/test/watch-array/components/output/ArrayIndexes-server.ts +4 -3
- package/test/watch-array/components/output/ArrayUnkeyed-client.ts +11 -5
- package/test/watch-array/components/output/ArrayUnkeyed-server.ts +4 -3
- package/test/watch-array/components/temp/{Array-client-7b40de2b50a8603f24654d0db984ff3b555e4104.ts → Array-client-b29a42f88c2a2f37b3a86bdb9535e20a487887e1.ts} +11 -5
- package/test/watch-array/components/temp/{Array-server-02515e92b822f1198b350264d81fe1f2a0564824.ts → Array-server-ced54fc7e63196f9c24c2e55b27bfe6cf7821dcb.ts} +4 -3
- package/test/watch-array/components/temp/{ArrayEntries-client-ec475fe4e32bce404c26d32ec676020f801b9cc2.ts → ArrayEntries-client-6289890758b1f6b462a74417e0b9e2e46d946ccd.ts} +11 -5
- package/test/watch-array/components/temp/{ArrayEntries-server-0ad3ea5e862952524f136e97a93646ee0cac1c26.ts → ArrayEntries-server-0429a18ffbe39afe87612889a3010c3fcaa601dc.ts} +4 -3
- package/test/watch-array/components/temp/{ArrayIndexes-client-50b5e551cd07fab2e3e2f01edfd101dd45b01063.ts → ArrayIndexes-client-fe4b1c49f442b3e5411f331c52ae6c5ab38f2b2d.ts} +11 -5
- package/test/watch-array/components/temp/{ArrayIndexes-server-692be8d9d103af14233ab4818e5b4c79b5c38f18.ts → ArrayIndexes-server-20c01f10832f035b007f85a423778934d51a703a.ts} +4 -3
- package/test/watch-array/components/temp/{ArrayUnkeyed-client-f62a5b1af81b12bf106a58a98ac392e0daee9501.ts → ArrayUnkeyed-client-3fffe2ce749ee84e0730130bfd730d432e3c4e12.ts} +11 -5
- package/test/watch-array/components/temp/{ArrayUnkeyed-server-e909a5b553fc692bb4b8a794382c0961ae13f4e6.ts → ArrayUnkeyed-server-0ab804a5e7bf5b47594d85adab79735e89a3939d.ts} +4 -3
- package/test/watch-object/components/Watched.d.ts +1 -1
- package/test/watch-object/components/output/Watched-client.ts +6 -2
- package/test/watch-object/components/output/Watched-server.ts +3 -2
- package/test/watch-object/components/temp/{Watched-client-7330a12b5cac7537b2b39ead6dad4eb3595cd099.ts → Watched-client-cb293038cd0a39043d05639c624a17d512419c25.ts} +6 -2
- package/test/watch-object/components/temp/{Watched-server-9db79c195516fc2c69c1170c8e5b40d6186cca0b.ts → Watched-server-4884585cf4f50493a70631909f2230153531208e.ts} +3 -2
- package/test/watch-object/watch-object.test.ts +0 -1
- package/tsconfig.json +2 -2
- package/test/on-mount/components/temp/OnMount-server-a9748dbc5bb7cadcacb94b4cabe8009d7b116989.ts +0 -7
- package/test/party/components/temp/CssStyle-server-a07cf02faad80642252776e2a7ad774376343de3.ts +0 -14
- package/test/special-element/components/temp/Element-server-c22cdebcbd076d32bb27f26e698054f36718b8de.ts +0 -9
- package/test/special-head/components/temp/Head-server-279cfa547d7ba593f57c0a3a9c3edca92ebb5118.ts +0 -11
- package/tsconfig-check.json +0 -5
package/dist/ssr.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ssr.ts","../src/render/$serverMount.ts","../src/render/$serverRun.ts","../src/render/$serverUnwrap.ts","../src/render/$serverWatch.ts","../src/render/formatAttributeText.ts","../src/render/formatText.ts","../src/render/getClasses.ts","../src/render/getStyles.ts"],"sourcesContent":["import $mount from \"./render/$serverMount\";\nimport $run from \"./render/$serverRun\";\nimport $unwrap from \"./render/$serverUnwrap\";\nimport $watch from \"./render/$serverWatch\";\nimport t_attr from \"./render/formatAttributeText\";\nimport t_fmt from \"./render/formatText\";\nimport t_class from \"./render/getClasses\";\nimport t_style from \"./render/getStyles\";\nimport type ServerSlotRender from \"./types/ServerSlotRender\";\n\nexport { $watch, $unwrap, $run, $mount, t_fmt, t_attr, t_class, t_style };\n\nexport type { ServerSlotRender };\n","import type Cleanup from \"../types/Cleanup\";\n\nexport default function $serverMount(
|
|
1
|
+
{"version":3,"sources":["../src/ssr.ts","../src/render/$serverMount.ts","../src/render/$serverRun.ts","../src/render/$serverUnwrap.ts","../src/render/$serverWatch.ts","../src/render/formatAttributeText.ts","../src/render/formatText.ts","../src/render/getClasses.ts","../src/render/getStyles.ts"],"sourcesContent":["import $mount from \"./render/$serverMount\";\nimport $run from \"./render/$serverRun\";\nimport $unwrap from \"./render/$serverUnwrap\";\nimport $watch from \"./render/$serverWatch\";\nimport t_attr from \"./render/formatAttributeText\";\nimport t_fmt from \"./render/formatText\";\nimport t_class from \"./render/getClasses\";\nimport t_style from \"./render/getStyles\";\nimport { type ServerSlotRender } from \"./types/ServerSlotRender\";\n\nexport { $watch, $unwrap, $run, $mount, t_fmt, t_attr, t_class, t_style };\n\nexport type { ServerSlotRender };\n","import { type Cleanup } from \"../types/Cleanup\";\n\nexport default function $serverMount(_: () => Cleanup | void) {}\n","import { type Cleanup } from \"../types/Cleanup\";\n\nexport default function $serverRun(_: () => Cleanup | void) {}\n","export default function $serverUnwrap<T extends Record<PropertyKey, any>>(object: T): T {\n\treturn object;\n}\n","export default function $serverWatch<T extends Record<PropertyKey, any>>(object: T): T {\n\treturn object;\n}\n","export default function formatAttributeText(value: any): string {\n\treturn (value ?? \"\").toString().replaceAll('\"', \""\");\n}\n","export default function formatText(value: any): string {\n\treturn value ?? \"\";\n}\n","export default function getClasses(value: unknown): string {\n\tlet classes: string[] = [];\n\tgatherNames(\"\", value, classes);\n\treturn classes.join(\" \");\n}\n\nfunction gatherNames(name: unknown, value: unknown, classes: string[]) {\n\tif (value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (let v of value) {\n\t\t\t\tgatherNames(v, v, classes);\n\t\t\t}\n\t\t} else if (typeof value === \"object\") {\n\t\t\tfor (let [n, v] of Object.entries(value)) {\n\t\t\t\tgatherNames(n, v, classes);\n\t\t\t}\n\t\t} else {\n\t\t\tclasses.push(name as string);\n\t\t}\n\t}\n}\n","export default function getStyles(value: Record<string, any>): string {\n\tlet styles: string[] = [];\n\tfor (let [n, v] of Object.entries(value)) {\n\t\tstyles.push(`${n}: ${v}`);\n\t}\n\treturn styles.join(\"; \");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEe,SAAR,aAA8B,GAAyB;AAAC;;;ACAhD,SAAR,WAA4B,GAAyB;AAAC;;;ACF9C,SAAR,cAAmE,QAAc;AACvF,SAAO;AACR;;;ACFe,SAAR,aAAkE,QAAc;AACtF,SAAO;AACR;;;ACFe,SAAR,oBAAqC,OAAoB;AAC/D,UAAQ,SAAS,IAAI,SAAS,EAAE,WAAW,KAAK,QAAQ;AACzD;;;ACFe,SAAR,WAA4B,OAAoB;AACtD,SAAO,SAAS;AACjB;;;ACFe,SAAR,WAA4B,OAAwB;AAC1D,MAAI,UAAoB,CAAC;AACzB,cAAY,IAAI,OAAO,OAAO;AAC9B,SAAO,QAAQ,KAAK,GAAG;AACxB;AAEA,SAAS,YAAY,MAAe,OAAgB,SAAmB;AACtE,MAAI,OAAO;AACV,QAAI,MAAM,QAAQ,KAAK,GAAG;AACzB,eAAS,KAAK,OAAO;AACpB,oBAAY,GAAG,GAAG,OAAO;AAAA,MAC1B;AAAA,IACD,WAAW,OAAO,UAAU,UAAU;AACrC,eAAS,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,KAAK,GAAG;AACzC,oBAAY,GAAG,GAAG,OAAO;AAAA,MAC1B;AAAA,IACD,OAAO;AACN,cAAQ,KAAK,IAAc;AAAA,IAC5B;AAAA,EACD;AACD;;;ACpBe,SAAR,UAA2B,OAAoC;AACrE,MAAI,SAAmB,CAAC;AACxB,WAAS,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,KAAK,GAAG;AACzC,WAAO,KAAK,GAAG,CAAC,KAAK,CAAC,EAAE;AAAA,EACzB;AACA,SAAO,OAAO,KAAK,IAAI;AACxB;","names":[]}
|
package/dist/ssr.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as Cleanup } from './ServerSlotRender-
|
|
2
|
-
export { S as ServerSlotRender, g as t_class, f as t_fmt, a as t_style } from './ServerSlotRender-
|
|
1
|
+
import { C as Cleanup } from './ServerSlotRender-AWF3bD5B.cjs';
|
|
2
|
+
export { S as ServerSlotRender, g as t_class, f as t_fmt, a as t_style } from './ServerSlotRender-AWF3bD5B.cjs';
|
|
3
3
|
|
|
4
|
-
declare function $serverMount(
|
|
4
|
+
declare function $serverMount(_: () => Cleanup | void): void;
|
|
5
5
|
|
|
6
|
-
declare function $serverRun(
|
|
6
|
+
declare function $serverRun(_: () => Cleanup | void): void;
|
|
7
7
|
|
|
8
8
|
declare function $serverUnwrap<T extends Record<PropertyKey, any>>(object: T): T;
|
|
9
9
|
|
package/dist/ssr.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as Cleanup } from './ServerSlotRender-
|
|
2
|
-
export { S as ServerSlotRender, g as t_class, f as t_fmt, a as t_style } from './ServerSlotRender-
|
|
1
|
+
import { C as Cleanup } from './ServerSlotRender-AWF3bD5B.js';
|
|
2
|
+
export { S as ServerSlotRender, g as t_class, f as t_fmt, a as t_style } from './ServerSlotRender-AWF3bD5B.js';
|
|
3
3
|
|
|
4
|
-
declare function $serverMount(
|
|
4
|
+
declare function $serverMount(_: () => Cleanup | void): void;
|
|
5
5
|
|
|
6
|
-
declare function $serverRun(
|
|
6
|
+
declare function $serverRun(_: () => Cleanup | void): void;
|
|
7
7
|
|
|
8
8
|
declare function $serverUnwrap<T extends Record<PropertyKey, any>>(object: T): T;
|
|
9
9
|
|
package/dist/ssr.js
CHANGED
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
} from "./chunk-GO2L324Q.js";
|
|
6
6
|
|
|
7
7
|
// src/render/$serverMount.ts
|
|
8
|
-
function $serverMount(
|
|
8
|
+
function $serverMount(_) {
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
// src/render/$serverRun.ts
|
|
12
|
-
function $serverRun(
|
|
12
|
+
function $serverRun(_) {
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// src/render/$serverUnwrap.ts
|
package/dist/ssr.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/$serverMount.ts","../src/render/$serverRun.ts","../src/render/$serverUnwrap.ts","../src/render/$serverWatch.ts","../src/render/formatAttributeText.ts"],"sourcesContent":["import type Cleanup from \"../types/Cleanup\";\n\nexport default function $serverMount(
|
|
1
|
+
{"version":3,"sources":["../src/render/$serverMount.ts","../src/render/$serverRun.ts","../src/render/$serverUnwrap.ts","../src/render/$serverWatch.ts","../src/render/formatAttributeText.ts"],"sourcesContent":["import { type Cleanup } from \"../types/Cleanup\";\n\nexport default function $serverMount(_: () => Cleanup | void) {}\n","import { type Cleanup } from \"../types/Cleanup\";\n\nexport default function $serverRun(_: () => Cleanup | void) {}\n","export default function $serverUnwrap<T extends Record<PropertyKey, any>>(object: T): T {\n\treturn object;\n}\n","export default function $serverWatch<T extends Record<PropertyKey, any>>(object: T): T {\n\treturn object;\n}\n","export default function formatAttributeText(value: any): string {\n\treturn (value ?? \"\").toString().replaceAll('\"', \""\");\n}\n"],"mappings":";;;;;;;AAEe,SAAR,aAA8B,GAAyB;AAAC;;;ACAhD,SAAR,WAA4B,GAAyB;AAAC;;;ACF9C,SAAR,cAAmE,QAAc;AACvF,SAAO;AACR;;;ACFe,SAAR,aAAkE,QAAc;AACtF,SAAO;AACR;;;ACFe,SAAR,oBAAqC,OAAoB;AAC/D,UAAQ,SAAS,IAAI,SAAS,EAAE,WAAW,KAAK,QAAQ;AACzD;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@torpor/view",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Torpor's view library, for writing and mounting components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -32,23 +32,23 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@testing-library/dom": "^10.4.0",
|
|
34
34
|
"@testing-library/jest-dom": "^6.6.3",
|
|
35
|
-
"@testing-library/user-event": "^14.
|
|
36
|
-
"@trivago/prettier-plugin-sort-imports": "^5.2.
|
|
35
|
+
"@testing-library/user-event": "^14.6.1",
|
|
36
|
+
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|
|
37
37
|
"@types/jsdom": "^21.1.7",
|
|
38
|
-
"@types/node": "^22.
|
|
39
|
-
"fast-glob": "^3.3.
|
|
40
|
-
"jsdom": "^
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"tsup": "^8.3.
|
|
38
|
+
"@types/node": "^22.13.4",
|
|
39
|
+
"fast-glob": "^3.3.3",
|
|
40
|
+
"jsdom": "^26.0.0",
|
|
41
|
+
"sucrase": "^3.35.0",
|
|
42
|
+
"tinybench": "^3.1.1",
|
|
43
|
+
"tsup": "^8.3.6",
|
|
44
44
|
"tsx": "^4.19.2",
|
|
45
|
-
"typescript": "^5.7.
|
|
46
|
-
"vitest": "^
|
|
45
|
+
"typescript": "^5.7.3",
|
|
46
|
+
"vitest": "^3.0.5"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsup && tsx ./scripts/copyToRepl.ts",
|
|
50
50
|
"build:watch": "tsup --watch",
|
|
51
|
-
"check": "tsc -p tsconfig
|
|
51
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
52
52
|
"test": "vitest",
|
|
53
53
|
"test:build": "tsx ./scripts/buildTestOutput.ts",
|
|
54
54
|
"bench": "tsx ./bench/bench.ts",
|
|
@@ -18,14 +18,13 @@ async function run() {
|
|
|
18
18
|
async function buildOutputFiles(file: string) {
|
|
19
19
|
//console.log(`Building files for ${file.substring(path.resolve("./test").length)}`);
|
|
20
20
|
|
|
21
|
-
const name = path.basename(file, ".torp");
|
|
22
21
|
const source = await fs.readFile(file, "utf8");
|
|
23
22
|
const parsed = parse(source);
|
|
24
23
|
if (parsed.ok && parsed.template) {
|
|
25
24
|
let serverCode = formatCode(build(parsed.template, { server: true }).code, "server");
|
|
26
25
|
let clientCode = formatCode(build(parsed.template).code, "client");
|
|
27
26
|
|
|
28
|
-
let typesCode = buildType(
|
|
27
|
+
let typesCode = buildType(parsed.template);
|
|
29
28
|
await fs.writeFile(file.replace(".torp", ".d.ts"), typesCode);
|
|
30
29
|
|
|
31
30
|
let outputFile = file.replace("/components/", "/components/output/");
|
|
@@ -111,10 +110,10 @@ const importsMap: Record<string, string> = {
|
|
|
111
110
|
'import { t_txt } from "@torpor/view";': 'import t_txt from "../../../../src/render/createText";',
|
|
112
111
|
'import { t_cmt } from "@torpor/view";':
|
|
113
112
|
'import t_cmt from "../../../../src/render/createComment";',
|
|
114
|
-
'import type
|
|
115
|
-
'import type ListItem from "../../../../src/types/ListItem";',
|
|
116
|
-
'import type
|
|
117
|
-
'import type SlotRender from "../../../../src/types/SlotRender";',
|
|
113
|
+
'import { type ListItem } from "@torpor/view";':
|
|
114
|
+
'import { type ListItem } from "../../../../src/types/ListItem";',
|
|
115
|
+
'import { type SlotRender } from "@torpor/view";':
|
|
116
|
+
'import { type SlotRender } from "../../../../src/types/SlotRender";',
|
|
118
117
|
'import { $watch } from "@torpor/view/ssr";':
|
|
119
118
|
'import $watch from "../../../../src/render/$watch";',
|
|
120
119
|
'import { $unwrap } from "@torpor/view/ssr";':
|
|
@@ -130,6 +129,6 @@ const importsMap: Record<string, string> = {
|
|
|
130
129
|
'import t_class from "../../../../src/render/getClasses";',
|
|
131
130
|
'import { t_style } from "@torpor/view/ssr";':
|
|
132
131
|
'import t_style from "../../../../src/render/getStyles";',
|
|
133
|
-
'import type
|
|
134
|
-
'import type ServerSlotRender from "../../../../src/types/ServerSlotRender";',
|
|
132
|
+
'import { type ServerSlotRender } from "@torpor/view/ssr";':
|
|
133
|
+
'import { type ServerSlotRender } from "../../../../src/types/ServerSlotRender";',
|
|
135
134
|
};
|
package/scripts/copyToRepl.ts
CHANGED
|
@@ -19,13 +19,15 @@ async function run() {
|
|
|
19
19
|
);
|
|
20
20
|
})
|
|
21
21
|
// HACK: Why are these imported?
|
|
22
|
-
.
|
|
22
|
+
.replaceAll(/^import \{.+} from ".\/chunk-(.+?).js";/gms, (_, capture) => {
|
|
23
23
|
const chunkFile = `./dist/chunk-${capture}.js`;
|
|
24
24
|
let chunkSource = readFileSync(chunkFile, "utf8");
|
|
25
25
|
return chunkSource.replace(/^export \{(.+)\};/gms, "");
|
|
26
|
-
})
|
|
26
|
+
})
|
|
27
|
+
.replaceAll(/^import ".\/chunk-(.+?).js";/gms, "")
|
|
28
|
+
.replaceAll(/\/\/# sourceMappingURL=(.+?).js.map/g, "");
|
|
27
29
|
|
|
28
|
-
const destFile = "
|
|
30
|
+
const destFile = "../../site/src/components/repl/view.txt";
|
|
29
31
|
await fs.writeFile(destFile, source);
|
|
30
32
|
}
|
|
31
33
|
|
package/src/ambient.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
declare module "*.torp" {
|
|
3
|
+
// HACK:
|
|
4
|
+
//import { Component } from "./types/Component";
|
|
5
|
+
type Component = (
|
|
6
|
+
$parent: ParentNode,
|
|
7
|
+
$anchor: Node | null,
|
|
8
|
+
$props?: Record<PropertyKey, any>,
|
|
9
|
+
$context?: Record<PropertyKey, any>,
|
|
10
|
+
$slots?: Record<
|
|
11
|
+
string,
|
|
12
|
+
(
|
|
13
|
+
parent: ParentNode,
|
|
14
|
+
anchor: Node | null,
|
|
15
|
+
$props?: Record<PropertyKey, any>,
|
|
16
|
+
$context?: Record<PropertyKey, any>,
|
|
17
|
+
) => void
|
|
18
|
+
>,
|
|
19
|
+
) => void;
|
|
20
|
+
export const C: Component;
|
|
21
|
+
//export default C;
|
|
22
|
+
}
|
|
23
|
+
*/
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type BuildOptions from "../../../types/BuildOptions";
|
|
2
|
-
import type Fragment from "../../types/nodes/Fragment";
|
|
1
|
+
import { type BuildOptions } from "../../../types/BuildOptions";
|
|
2
|
+
import { type Fragment } from "../../types/nodes/Fragment";
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export type BuildStatus = {
|
|
5
5
|
imports: Set<string>;
|
|
6
6
|
props: string[];
|
|
7
|
+
contextProps: string[];
|
|
8
|
+
slotProps: string[];
|
|
7
9
|
styleHash: string;
|
|
8
10
|
varNames: Record<string, number>;
|
|
9
11
|
fragmentStack: {
|
|
@@ -14,4 +16,4 @@ export default interface BuildStatus {
|
|
|
14
16
|
preserveWhitespace: boolean;
|
|
15
17
|
inHead?: boolean;
|
|
16
18
|
options?: BuildOptions;
|
|
17
|
-
}
|
|
19
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type ControlNode from "../../types/nodes/ControlNode";
|
|
2
|
-
import type ElementNode from "../../types/nodes/ElementNode";
|
|
3
|
-
import type RootNode from "../../types/nodes/RootNode";
|
|
1
|
+
import { type ControlNode } from "../../types/nodes/ControlNode";
|
|
2
|
+
import { type ElementNode } from "../../types/nodes/ElementNode";
|
|
3
|
+
import { type RootNode } from "../../types/nodes/RootNode";
|
|
4
4
|
import Builder from "../../utils/Builder";
|
|
5
|
-
import type BuildStatus from "./BuildStatus";
|
|
5
|
+
import { type BuildStatus } from "./BuildStatus";
|
|
6
6
|
|
|
7
7
|
export default function buildAddFragment(
|
|
8
8
|
node: RootNode | ControlNode | ElementNode,
|
|
@@ -17,7 +17,7 @@ export default function buildAddFragment(
|
|
|
17
17
|
status.imports.add("t_add_fragment");
|
|
18
18
|
b.append(`t_add_fragment(${fragmentName}, ${parentName}, ${anchorName});`);
|
|
19
19
|
// TODO: Don't need to do this if the last thing we hydrated was the end node
|
|
20
|
-
if (fragment.endVarName
|
|
20
|
+
if (fragment.endVarName) {
|
|
21
21
|
status.imports.add("t_next");
|
|
22
22
|
b.append(`t_next(${fragment.endVarName});`);
|
|
23
23
|
}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import type ControlNode from "../../types/nodes/ControlNode";
|
|
1
|
+
import { type ControlNode } from "../../types/nodes/ControlNode";
|
|
2
2
|
import isControlNode from "../../types/nodes/isControlNode";
|
|
3
3
|
import Builder from "../../utils/Builder";
|
|
4
4
|
import trimMatched from "../../utils/trimMatched";
|
|
5
5
|
import nextVarName from "../utils/nextVarName";
|
|
6
|
-
import type BuildStatus from "./BuildStatus";
|
|
6
|
+
import { type BuildStatus } from "./BuildStatus";
|
|
7
7
|
import buildAddFragment from "./buildAddFragment";
|
|
8
8
|
import buildFragment from "./buildFragment";
|
|
9
9
|
import buildNode from "./buildNode";
|
|
10
10
|
|
|
11
|
-
export default function buildAwaitNode(
|
|
12
|
-
node: ControlNode,
|
|
13
|
-
status: BuildStatus,
|
|
14
|
-
b: Builder,
|
|
15
|
-
parentName: string,
|
|
16
|
-
anchorName: string,
|
|
17
|
-
) {
|
|
11
|
+
export default function buildAwaitNode(node: ControlNode, status: BuildStatus, b: Builder) {
|
|
18
12
|
const awaitParentName = node.parentName!;
|
|
19
13
|
const awaitAnchorName = node.varName!;
|
|
20
14
|
const awaitRangeName = nextVarName("await_range", status);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type BuildOptions from "../../../types/BuildOptions";
|
|
2
|
-
import type Template from "../../../types/Template";
|
|
1
|
+
import { type BuildOptions } from "../../../types/BuildOptions";
|
|
2
|
+
import { type Template } from "../../../types/Template";
|
|
3
3
|
import Builder from "../../utils/Builder";
|
|
4
|
-
import type BuildStatus from "./BuildStatus";
|
|
4
|
+
import { type BuildStatus } from "./BuildStatus";
|
|
5
5
|
import buildFragmentText from "./buildFragmentText";
|
|
6
6
|
import buildNode from "./buildNode";
|
|
7
7
|
|
|
@@ -36,8 +36,8 @@ const importsMap: Record<string, string> = {
|
|
|
36
36
|
t_elm: 'import { t_elm } from "${folder}";',
|
|
37
37
|
t_txt: 'import { t_txt } from "${folder}";',
|
|
38
38
|
t_cmt: 'import { t_cmt } from "${folder}";',
|
|
39
|
-
ListItem: 'import type
|
|
40
|
-
SlotRender: 'import type
|
|
39
|
+
ListItem: 'import { type ListItem } from "${folder}";',
|
|
40
|
+
SlotRender: 'import { type SlotRender } from "${folder}";',
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
export default function buildCode(template: Template, options?: BuildOptions): string {
|
|
@@ -80,13 +80,15 @@ function buildTemplate(template: Template, imports: Set<string>, b: Builder) {
|
|
|
80
80
|
b.append(script.substring(marker, i));
|
|
81
81
|
|
|
82
82
|
// TODO: Support other params, like the user setting $context
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
$anchor: Node | null,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
$
|
|
89
|
-
|
|
83
|
+
let params = [
|
|
84
|
+
"$parent: ParentNode",
|
|
85
|
+
"$anchor: Node | null",
|
|
86
|
+
current.params ??
|
|
87
|
+
`${current.props?.length ? "$props" : "// @ts-ignore\n$props?"}: Record<PropertyKey, any>`,
|
|
88
|
+
`${current.contextProps?.length ? "" : "// @ts-ignore\n"}$context?: Record<PropertyKey, any>`,
|
|
89
|
+
`${current.slotProps?.length ? "" : "// @ts-ignore\n"}$slots?: Record<string, SlotRender>`,
|
|
90
|
+
];
|
|
91
|
+
b.append(params.join(",\n"));
|
|
90
92
|
|
|
91
93
|
marker = i + "/* @params */".length;
|
|
92
94
|
} else if (script.substring(i, i + "/* @start */".length) === "/* @start */") {
|
|
@@ -112,6 +114,8 @@ function buildTemplate(template: Template, imports: Set<string>, b: Builder) {
|
|
|
112
114
|
const status: BuildStatus = {
|
|
113
115
|
imports,
|
|
114
116
|
props: current.props || [],
|
|
117
|
+
contextProps: current.contextProps || [],
|
|
118
|
+
slotProps: current.slotProps || [],
|
|
115
119
|
styleHash: current.style?.hash || "",
|
|
116
120
|
varNames: {},
|
|
117
121
|
fragmentStack: [],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type ElementNode from "../../types/nodes/ElementNode";
|
|
1
|
+
import { type ElementNode } from "../../types/nodes/ElementNode";
|
|
2
2
|
import isSpecialNode from "../../types/nodes/isSpecialNode";
|
|
3
3
|
import Builder from "../../utils/Builder";
|
|
4
4
|
import trimMatched from "../../utils/trimMatched";
|
|
@@ -6,7 +6,7 @@ import trimQuotes from "../../utils/trimQuotes";
|
|
|
6
6
|
import isFullyReactive from "../utils/isFullyReactive";
|
|
7
7
|
import isReactive from "../utils/isReactive";
|
|
8
8
|
import nextVarName from "../utils/nextVarName";
|
|
9
|
-
import type BuildStatus from "./BuildStatus";
|
|
9
|
+
import { type BuildStatus } from "./BuildStatus";
|
|
10
10
|
import buildAddFragment from "./buildAddFragment";
|
|
11
11
|
import buildFragment from "./buildFragment";
|
|
12
12
|
import buildNode from "./buildNode";
|
|
@@ -16,8 +16,6 @@ export default function buildComponentNode(
|
|
|
16
16
|
node: ElementNode,
|
|
17
17
|
status: BuildStatus,
|
|
18
18
|
b: Builder,
|
|
19
|
-
parentName: string,
|
|
20
|
-
anchorName: string,
|
|
21
19
|
root = false,
|
|
22
20
|
) {
|
|
23
21
|
b.append("");
|
|
@@ -30,7 +28,7 @@ export default function buildComponentNode(
|
|
|
30
28
|
// TODO: defaults etc props
|
|
31
29
|
//status.imports.add("$watch");
|
|
32
30
|
//b.append(`const ${propsName} = $watch({});`);
|
|
33
|
-
b.append(`const ${propsName} = {};`);
|
|
31
|
+
b.append(`const ${propsName}: any = {};`);
|
|
34
32
|
for (let { name, value } of node.attributes) {
|
|
35
33
|
if (name === "self" && node.tagName === ":component") {
|
|
36
34
|
// Ignore this special attribute
|
|
@@ -80,14 +78,18 @@ export default function buildComponentNode(
|
|
|
80
78
|
const componentHasSlots = node.children.length;
|
|
81
79
|
const slotsName = componentHasSlots ? nextVarName("slots", status) : "undefined";
|
|
82
80
|
if (componentHasSlots) {
|
|
83
|
-
b.append(`const ${slotsName} = {};`);
|
|
81
|
+
b.append(`const ${slotsName}: Record<string, SlotRender> = {};`);
|
|
84
82
|
for (let slot of node.children) {
|
|
85
83
|
if (isSpecialNode(slot)) {
|
|
86
84
|
const nameAttribute = slot.attributes.find((a) => a.name === "name");
|
|
87
85
|
const slotName = nameAttribute?.value ? trimQuotes(nameAttribute.value) : "_";
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
const slotParams = [
|
|
87
|
+
"$sparent: ParentNode",
|
|
88
|
+
"$sanchor: Node | null",
|
|
89
|
+
"//@ts-ignore\n$sprops?: Record<PropertyKey, any>",
|
|
90
|
+
"//@ts-ignore\n$context?: Record<PropertyKey, any>",
|
|
91
|
+
];
|
|
92
|
+
b.append(`${slotsName}["${slotName}"] = (\n${slotParams.join(",\n")}\n) => {`);
|
|
91
93
|
|
|
92
94
|
buildFragment(slot, status, b, "$sparent", "$sanchor");
|
|
93
95
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type ControlNode from "../../types/nodes/ControlNode";
|
|
1
|
+
import { type ControlNode } from "../../types/nodes/ControlNode";
|
|
2
2
|
import Builder from "../../utils/Builder";
|
|
3
|
-
import type BuildStatus from "./BuildStatus";
|
|
3
|
+
import { type BuildStatus } from "./BuildStatus";
|
|
4
4
|
import buildAwaitNode from "./buildAwaitNode";
|
|
5
5
|
import buildForNode from "./buildForNode";
|
|
6
6
|
import buildHtmlNode from "./buildHtmlNode";
|
|
@@ -9,16 +9,10 @@ import buildReplaceNode from "./buildReplaceNode";
|
|
|
9
9
|
import buildScriptNode from "./buildScriptNode";
|
|
10
10
|
import buildSwitchNode from "./buildSwitchNode";
|
|
11
11
|
|
|
12
|
-
export default function buildControlNode(
|
|
13
|
-
node: ControlNode,
|
|
14
|
-
status: BuildStatus,
|
|
15
|
-
b: Builder,
|
|
16
|
-
parentName: string,
|
|
17
|
-
anchorName: string,
|
|
18
|
-
) {
|
|
12
|
+
export default function buildControlNode(node: ControlNode, status: BuildStatus, b: Builder) {
|
|
19
13
|
switch (node.operation) {
|
|
20
14
|
case "@if group": {
|
|
21
|
-
buildIfNode(node, status, b
|
|
15
|
+
buildIfNode(node, status, b);
|
|
22
16
|
break;
|
|
23
17
|
}
|
|
24
18
|
case "@if":
|
|
@@ -28,7 +22,8 @@ export default function buildControlNode(
|
|
|
28
22
|
break;
|
|
29
23
|
}
|
|
30
24
|
case "@switch group": {
|
|
31
|
-
buildSwitchNode(node, status, b
|
|
25
|
+
buildSwitchNode(node, status, b);
|
|
26
|
+
break;
|
|
32
27
|
}
|
|
33
28
|
case "@case":
|
|
34
29
|
case "@default": {
|
|
@@ -36,7 +31,7 @@ export default function buildControlNode(
|
|
|
36
31
|
break;
|
|
37
32
|
}
|
|
38
33
|
case "@for group": {
|
|
39
|
-
buildForNode(node, status, b
|
|
34
|
+
buildForNode(node, status, b);
|
|
40
35
|
break;
|
|
41
36
|
}
|
|
42
37
|
case "@for":
|
|
@@ -45,7 +40,7 @@ export default function buildControlNode(
|
|
|
45
40
|
break;
|
|
46
41
|
}
|
|
47
42
|
case "@await group": {
|
|
48
|
-
buildAwaitNode(node, status, b
|
|
43
|
+
buildAwaitNode(node, status, b);
|
|
49
44
|
break;
|
|
50
45
|
}
|
|
51
46
|
case "@await":
|
|
@@ -55,7 +50,7 @@ export default function buildControlNode(
|
|
|
55
50
|
break;
|
|
56
51
|
}
|
|
57
52
|
case "@replace group": {
|
|
58
|
-
buildReplaceNode(node, status, b
|
|
53
|
+
buildReplaceNode(node, status, b);
|
|
59
54
|
break;
|
|
60
55
|
}
|
|
61
56
|
case "@replace": {
|
|
@@ -63,7 +58,7 @@ export default function buildControlNode(
|
|
|
63
58
|
break;
|
|
64
59
|
}
|
|
65
60
|
case "@html group": {
|
|
66
|
-
buildHtmlNode(node, status, b
|
|
61
|
+
buildHtmlNode(node, status, b);
|
|
67
62
|
break;
|
|
68
63
|
}
|
|
69
64
|
case "@html": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type ElementNode from "../../types/nodes/ElementNode";
|
|
2
|
-
import type TextNode from "../../types/nodes/TextNode";
|
|
1
|
+
import { type ElementNode } from "../../types/nodes/ElementNode";
|
|
2
|
+
import { type TextNode } from "../../types/nodes/TextNode";
|
|
3
3
|
import Builder from "../../utils/Builder";
|
|
4
4
|
import trimEnd from "../../utils/trimEnd";
|
|
5
5
|
import trimMatched from "../../utils/trimMatched";
|
|
@@ -7,7 +7,7 @@ import trimQuotes from "../../utils/trimQuotes";
|
|
|
7
7
|
import isFullyReactive from "../utils/isFullyReactive";
|
|
8
8
|
import isReactive from "../utils/isReactive";
|
|
9
9
|
import nextVarName from "../utils/nextVarName";
|
|
10
|
-
import type BuildStatus from "./BuildStatus";
|
|
10
|
+
import { type BuildStatus } from "./BuildStatus";
|
|
11
11
|
import buildAddFragment from "./buildAddFragment";
|
|
12
12
|
import buildFragment from "./buildFragment";
|
|
13
13
|
import buildMount from "./buildMount";
|
|
@@ -19,7 +19,6 @@ export default function buildElementNode(
|
|
|
19
19
|
status: BuildStatus,
|
|
20
20
|
b: Builder,
|
|
21
21
|
parentName: string,
|
|
22
|
-
anchorName: string,
|
|
23
22
|
root = false,
|
|
24
23
|
) {
|
|
25
24
|
if (status.inHead) {
|
|
@@ -189,7 +188,7 @@ function buildElementAttributes(
|
|
|
189
188
|
// Bind the DOM element to a user-defined variable
|
|
190
189
|
b.append(`${value} = ${varName};`);
|
|
191
190
|
} else if (name === ":group") {
|
|
192
|
-
buildBindGroupAttribute(node, varName,
|
|
191
|
+
buildBindGroupAttribute(node, varName, value, status, b);
|
|
193
192
|
} else if (name === ":value" || name === ":checked") {
|
|
194
193
|
buildBindAttribute(node, varName, name, value, status, b);
|
|
195
194
|
} else if (name === ":onmount") {
|
|
@@ -198,7 +197,7 @@ function buildElementAttributes(
|
|
|
198
197
|
// cleanup function
|
|
199
198
|
buildMount("elMount", `return (${trimEnd(value.trim(), ";")})(${varName});`, status, b);
|
|
200
199
|
} else if (name.startsWith("on")) {
|
|
201
|
-
buildEventAttribute(
|
|
200
|
+
buildEventAttribute(varName, name, value, status, b);
|
|
202
201
|
} else if (name.startsWith(":transition")) {
|
|
203
202
|
buildTransitionAttribute(node, varName, name, value, status, b);
|
|
204
203
|
} else if (name === "class") {
|
|
@@ -208,7 +207,7 @@ function buildElementAttributes(
|
|
|
208
207
|
buildRun("setClasses", `${varName}.className = t_class(${value});`, status, b);
|
|
209
208
|
} else if (name === ":style") {
|
|
210
209
|
status.imports.add("t_style");
|
|
211
|
-
buildRun("setStyles", `${varName}.style
|
|
210
|
+
buildRun("setStyles", `${varName}.setAttribute("style", t_style(${value}));`, status, b);
|
|
212
211
|
} else if (name.includes("-")) {
|
|
213
212
|
// Handle data-, aria- etc
|
|
214
213
|
status.imports.add("t_attribute");
|
|
@@ -227,7 +226,6 @@ function buildElementAttributes(
|
|
|
227
226
|
function buildBindGroupAttribute(
|
|
228
227
|
node: ElementNode,
|
|
229
228
|
varName: string,
|
|
230
|
-
name: string,
|
|
231
229
|
value: string,
|
|
232
230
|
status: BuildStatus,
|
|
233
231
|
b: Builder,
|
|
@@ -294,7 +292,6 @@ function buildBindAttribute(
|
|
|
294
292
|
}
|
|
295
293
|
|
|
296
294
|
function buildEventAttribute(
|
|
297
|
-
node: ElementNode,
|
|
298
295
|
varName: string,
|
|
299
296
|
name: string,
|
|
300
297
|
value: string,
|
|
@@ -333,18 +330,18 @@ function buildTransitionAttribute(
|
|
|
333
330
|
let exitVarName = nextVarName("trans_out", status);
|
|
334
331
|
|
|
335
332
|
if (name === ":transition") {
|
|
336
|
-
b.append(`const ${entryVarName} = ${getAnimationDetails(value
|
|
333
|
+
b.append(`const ${entryVarName} = ${getAnimationDetails(value)};`);
|
|
337
334
|
b.append(`const ${exitVarName} = ${entryVarName};`);
|
|
338
335
|
b.append(`t_animate(${varName}, ${entryVarName}, ${exitVarName});`);
|
|
339
336
|
} else if (name === ":transition-in") {
|
|
340
337
|
let outAttribute = node.attributes.find((a) => a.name === ":transition-out");
|
|
341
338
|
if (outAttribute && outAttribute.value) {
|
|
342
339
|
let outValue = trimMatched(outAttribute.value, "{", "}");
|
|
343
|
-
b.append(`const ${entryVarName} = ${getAnimationDetails(value
|
|
344
|
-
b.append(`const ${exitVarName} = ${getAnimationDetails(outValue
|
|
340
|
+
b.append(`const ${entryVarName} = ${getAnimationDetails(value)};`);
|
|
341
|
+
b.append(`const ${exitVarName} = ${getAnimationDetails(outValue)};`);
|
|
345
342
|
b.append(`t_animate(${varName}, ${entryVarName}, ${exitVarName});`);
|
|
346
343
|
} else {
|
|
347
|
-
b.append(`const ${entryVarName} = ${getAnimationDetails(value
|
|
344
|
+
b.append(`const ${entryVarName} = ${getAnimationDetails(value)};`);
|
|
348
345
|
b.append(`t_animate(${varName}, ${entryVarName});`);
|
|
349
346
|
}
|
|
350
347
|
} else if (name === ":transition-out") {
|
|
@@ -353,7 +350,7 @@ function buildTransitionAttribute(
|
|
|
353
350
|
// This has already been handled with :transition-in, above
|
|
354
351
|
return;
|
|
355
352
|
} else {
|
|
356
|
-
b.append(`const ${exitVarName} = ${getAnimationDetails(value
|
|
353
|
+
b.append(`const ${exitVarName} = ${getAnimationDetails(value)};`);
|
|
357
354
|
b.append(`t_animate(${varName}, null, ${entryVarName});`);
|
|
358
355
|
}
|
|
359
356
|
} else {
|
|
@@ -361,7 +358,7 @@ function buildTransitionAttribute(
|
|
|
361
358
|
}
|
|
362
359
|
}
|
|
363
360
|
|
|
364
|
-
function getAnimationDetails(value: string
|
|
361
|
+
function getAnimationDetails(value: string) {
|
|
365
362
|
// HACK: Split by commas, but not when in brackets
|
|
366
363
|
let parts: string[] = [];
|
|
367
364
|
let start = 0;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type ControlNode from "../../types/nodes/ControlNode";
|
|
1
|
+
import { type ControlNode } from "../../types/nodes/ControlNode";
|
|
2
2
|
import isControlNode from "../../types/nodes/isControlNode";
|
|
3
3
|
import Builder from "../../utils/Builder";
|
|
4
|
-
import trimAny from "../../utils/trimAny";
|
|
5
4
|
import trimEnd from "../../utils/trimEnd";
|
|
6
5
|
import trimMatched from "../../utils/trimMatched";
|
|
7
6
|
import nextVarName from "../utils/nextVarName";
|
|
8
|
-
import type BuildStatus from "./BuildStatus";
|
|
7
|
+
import { type BuildStatus } from "./BuildStatus";
|
|
9
8
|
import buildAddFragment from "./buildAddFragment";
|
|
10
9
|
import buildFragment from "./buildFragment";
|
|
11
10
|
import buildNode from "./buildNode";
|
|
@@ -14,13 +13,7 @@ const forLoopRegex = /for\s*\((.+?);.*?;.*?\)/;
|
|
|
14
13
|
const forLoopVarsRegex = /(?:let\s+|var\s+){0,1}([^\s,;+=]+)(?:\s*=\s*[^,;]+){0,1}/g;
|
|
15
14
|
const forOfRegex = /for\s*\(\s*(?:let\s*|var\s*){0,1}(.+?)\s+(?:of|in).*?\)/;
|
|
16
15
|
|
|
17
|
-
export default function buildForNode(
|
|
18
|
-
node: ControlNode,
|
|
19
|
-
status: BuildStatus,
|
|
20
|
-
b: Builder,
|
|
21
|
-
parentName: string,
|
|
22
|
-
anchorName: string,
|
|
23
|
-
) {
|
|
16
|
+
export default function buildForNode(node: ControlNode, status: BuildStatus, b: Builder) {
|
|
24
17
|
const forParentName = node.parentName!;
|
|
25
18
|
const forAnchorName = node.varName!;
|
|
26
19
|
|