@torpor/view 0.1.11 → 0.3.0
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/.oxlintrc.json +3 -0
- package/CHANGELOG.md +37 -0
- package/README.md +28 -27
- package/dist/Component-d19HOoEw.d.ts +11 -0
- package/dist/Component-d19HOoEw.d.ts.map +1 -0
- package/dist/ServerSlotRender-BiG4xB8e.d.ts +41 -0
- package/dist/ServerSlotRender-BiG4xB8e.d.ts.map +1 -0
- package/dist/compile.d.ts +202 -148
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +3380 -3747
- package/dist/compile.js.map +1 -1
- package/dist/formatText-B0FXBdFT.js +410 -0
- package/dist/formatText-B0FXBdFT.js.map +1 -0
- package/dist/index.d.ts +373 -170
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +826 -760
- package/dist/index.js.map +1 -1
- package/dist/ssr.d.ts +13 -8
- package/dist/ssr.d.ts.map +1 -0
- package/dist/ssr.js +18 -27
- package/dist/ssr.js.map +1 -1
- package/package.json +18 -22
- package/scripts/buildTestOutput.ts +1 -1
- package/scripts/copyToRepl.ts +9 -7
- package/src/ambient.d.ts +1 -0
- package/src/compile/build/client/BuildStatus.ts +6 -4
- package/src/compile/build/client/addMappedText.ts +25 -0
- package/src/compile/build/client/buildAddFragment.ts +26 -4
- package/src/compile/build/client/buildAwaitNode.ts +86 -54
- package/src/compile/build/client/buildCode.ts +91 -57
- package/src/compile/build/client/buildComponentNode.ts +23 -43
- package/src/compile/build/client/buildControlNode.ts +5 -4
- package/src/compile/build/client/buildElementNode.ts +70 -78
- package/src/compile/build/client/buildForNode.ts +24 -12
- package/src/compile/build/client/buildFragment.ts +29 -43
- package/src/compile/build/client/buildFragmentText.ts +27 -20
- package/src/compile/build/client/buildHtmlNode.ts +5 -3
- package/src/compile/build/client/buildIfNode.ts +44 -29
- package/src/compile/build/client/buildMount.ts +1 -1
- package/src/compile/build/client/buildNode.ts +8 -7
- package/src/compile/build/client/buildReplaceNode.ts +5 -3
- package/src/compile/build/client/buildRootNode.ts +2 -2
- package/src/compile/build/client/buildRun.ts +1 -1
- package/src/compile/build/client/buildScriptNode.ts +5 -3
- package/src/compile/build/client/buildSlotNode.ts +7 -23
- package/src/compile/build/client/buildSpecialNode.ts +10 -14
- package/src/compile/build/client/buildStyles.ts +53 -18
- package/src/compile/build/client/buildSwitchNode.ts +53 -32
- package/src/compile/build/client/buildTextNode.ts +31 -28
- package/src/compile/build/client/replaceForVarNames.ts +1 -1
- package/src/compile/build/client/stashRun.ts +22 -0
- package/src/compile/build/client/stashRunWithOffsets.ts +32 -0
- package/src/compile/build/server/BuildServerStatus.ts +3 -3
- package/src/compile/build/server/buildServerAwaitNode.ts +5 -5
- package/src/compile/build/server/buildServerCode.ts +60 -39
- package/src/compile/build/server/buildServerComponentNode.ts +21 -41
- package/src/compile/build/server/buildServerControlNode.ts +7 -4
- package/src/compile/build/server/buildServerElementNode.ts +18 -29
- package/src/compile/build/server/buildServerForNode.ts +5 -5
- package/src/compile/build/server/buildServerHtmlNode.ts +3 -3
- package/src/compile/build/server/buildServerIfNode.ts +5 -5
- package/src/compile/build/server/buildServerNode.ts +7 -6
- package/src/compile/build/server/buildServerReplaceNode.ts +5 -5
- 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 +14 -26
- package/src/compile/build/server/buildServerSpecialNode.ts +10 -13
- package/src/compile/build/server/buildServerSwitchNode.ts +5 -5
- package/src/compile/build/server/buildServerTextNode.ts +9 -23
- package/src/compile/build/utils/nextVarName.ts +2 -2
- package/src/compile/build.ts +9 -4
- package/src/compile/buildType.ts +2 -2
- package/src/compile/parse/ParseComponentStatus.ts +24 -0
- package/src/compile/parse/ParseStatus.ts +6 -26
- package/src/compile/parse/addSpaceElement.ts +6 -5
- package/src/compile/parse/parseCode.ts +116 -60
- package/src/compile/parse/parseControl.ts +34 -32
- package/src/compile/parse/parseElement.ts +56 -121
- package/src/compile/parse/parseImports.ts +1 -1
- package/src/compile/parse/parseInlineScript.ts +12 -26
- package/src/compile/parse/parseMarkup.ts +9 -3
- package/src/compile/parse/parseStyles.ts +4 -4
- package/src/compile/parse/parseTag.ts +50 -8
- package/src/compile/parse/parseText.ts +96 -0
- package/src/compile/parse/scopeStyles.ts +9 -8
- package/src/compile/parse/slottifyChildNodes.ts +8 -7
- package/src/compile/parse/utils/accept.ts +1 -1
- package/src/compile/parse/utils/addError.ts +24 -6
- 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 +5 -2
- package/src/compile/types/CompileError.ts +8 -5
- package/src/compile/types/Import.ts +2 -2
- package/src/compile/types/ParseResult.ts +4 -4
- package/src/compile/types/ScriptChunk.ts +6 -0
- package/src/compile/types/SourceMapping.ts +7 -0
- package/src/compile/types/SourceRange.ts +4 -0
- package/src/compile/types/nodes/Attribute.ts +7 -2
- package/src/compile/types/nodes/ControlNode.ts +8 -6
- package/src/compile/types/nodes/ElementNode.ts +11 -6
- package/src/compile/types/nodes/Fragment.ts +10 -2
- package/src/compile/types/nodes/NodeType.ts +3 -1
- package/src/compile/types/nodes/OperationType.ts +3 -1
- 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 +5 -3
- 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 +25 -11
- package/src/compile/utils/endOfString.ts +8 -0
- package/src/compile/utils/endOfTemplateString.ts +14 -0
- package/src/compile/{types/nodes → utils}/isComponentNode.ts +2 -2
- package/src/compile/utils/isControlNode.ts +6 -0
- package/src/compile/utils/isElementNode.ts +6 -0
- package/src/compile/utils/isParentNode.ts +6 -0
- package/src/compile/{types/nodes → utils}/isSpaceNode.ts +3 -3
- package/src/compile/utils/isSpecialNode.ts +6 -0
- package/src/compile/utils/isTextNode.ts +6 -0
- package/src/compile.ts +2 -2
- package/src/debug/printNode.ts +12 -8
- package/src/debug/printRanges.ts +74 -0
- package/src/debug/printSignalDiagram.ts +139 -0
- package/src/debug/printSimpleDiagram.ts +88 -0
- package/src/index.ts +15 -8
- package/src/render/$batch.ts +22 -0
- package/src/render/$cache.ts +34 -0
- package/src/render/$mount.ts +1 -1
- package/src/render/$peek.ts +14 -0
- package/src/render/$run.ts +16 -13
- package/src/render/$serverBatch.ts +3 -0
- package/src/render/$serverCache.ts +3 -0
- package/src/render/$serverMount.ts +1 -1
- package/src/render/$serverPeek.ts +3 -0
- package/src/render/$serverRun.ts +1 -1
- package/src/render/$unwrap.ts +3 -1
- package/src/render/$watch.ts +12 -13
- package/src/render/addAnimation.ts +1 -1
- package/src/render/addFragment.ts +16 -24
- package/src/render/applyProps.ts +1 -1
- package/src/render/buildClasses.ts +31 -0
- package/src/render/buildStyles.ts +19 -0
- package/src/render/clearLayoutSlot.ts +1 -1
- package/src/render/clearRange.ts +43 -50
- package/src/render/context.ts +19 -48
- package/src/render/fillLayoutSlot.ts +3 -3
- package/src/render/getFragment.ts +1 -1
- package/src/render/hydrate.ts +9 -2
- package/src/render/hydrateRoot.ts +2 -2
- package/src/render/isCommentNode.ts +3 -0
- package/src/render/isFragmentNode.ts +3 -0
- package/src/render/isTextNode.ts +3 -0
- package/src/render/mount.ts +12 -4
- package/src/render/moveRange.ts +5 -3
- package/src/render/newListItem.ts +4 -4
- package/src/render/newRange.ts +6 -5
- package/src/render/nodeAnchor.ts +6 -6
- package/src/render/nodeCheckHydrationBreak.ts +3 -3
- package/src/render/nodeChild.ts +2 -2
- package/src/render/nodeNext.ts +2 -2
- package/src/render/nodeRoot.ts +18 -4
- package/src/render/popRange.ts +2 -2
- package/src/render/pushRange.ts +12 -4
- package/src/render/runControl.ts +1 -5
- package/src/render/runControlBranch.ts +10 -24
- package/src/render/runList.ts +6 -5
- package/src/render/runListItems.ts +39 -39
- package/src/render/setAttribute.ts +1 -1
- package/src/render/setDynamicElement.ts +2 -2
- package/src/ssr.ts +7 -4
- package/src/types/Animation.ts +1 -1
- package/src/types/BuildOptions.ts +6 -2
- package/src/types/Cleanup.ts +3 -1
- package/src/types/Component.ts +4 -2
- package/src/types/Computed.ts +62 -0
- package/src/types/Context.ts +99 -0
- package/src/types/Effect.ts +45 -9
- package/src/types/ListItem.ts +3 -3
- package/src/types/ProxyData.ts +6 -4
- package/src/types/ProxySignal.ts +28 -0
- package/src/types/Range.ts +10 -16
- package/src/types/ServerComponent.ts +5 -3
- package/src/types/ServerSlotRender.ts +3 -1
- package/src/types/SlotRender.ts +4 -2
- package/src/types/Subscription.ts +57 -0
- package/src/types/Template.ts +6 -5
- package/src/types/TemplateComponent.ts +7 -5
- package/src/types/WatchOptions.ts +8 -2
- package/src/types/constants.ts +14 -0
- package/src/watch/batchEnd.ts +17 -0
- package/src/watch/batchStart.ts +5 -0
- package/src/watch/checkComputed.ts +46 -0
- package/src/watch/checkEffect.ts +30 -0
- package/src/watch/checkSources.ts +63 -0
- package/src/watch/clearSources.ts +39 -0
- package/src/watch/clearTargets.ts +28 -0
- package/src/watch/deactivateSources.ts +19 -0
- package/src/watch/proxyGet.ts +106 -51
- package/src/watch/proxySet.ts +17 -13
- package/src/watch/runCleanups.ts +40 -0
- package/src/watch/runComputed.ts +36 -0
- package/src/watch/runEffect.ts +38 -13
- package/src/watch/symbols.ts +3 -1
- package/src/watch/trackEffect.ts +63 -15
- package/src/watch/trackProxyEffect.ts +21 -0
- package/src/watch/transferEffects.ts +66 -62
- package/src/watch/triggerEffects.ts +55 -18
- package/src/watch/updateSignal.ts +102 -0
- package/src/wrappers/ReactiveDate.ts +68 -0
- package/test/attributes/attributes.test.ts +2 -2
- package/test/attributes/components/output/Attributes-client.ts +8 -20
- package/test/attributes/components/output/Attributes-server.ts +9 -11
- package/test/attributes/components/temp/{Attributes-client-4620a40099e57a7fdaab895b204d85881f6dbfb7.ts → Attributes-client-9b2935d7824ba501776fdc6c48861422c15b6a12.ts} +8 -20
- package/test/attributes/components/temp/Attributes-server-716db6e335e5a372a34dd931e5f358ee6d1869e5.ts +16 -0
- package/test/attributes/disappearing.test.ts +2 -2
- package/test/attributes/parse.test.ts +161 -248
- package/test/await/await.test.ts +2 -2
- package/test/await/components/Await.torp +11 -13
- package/test/await/components/output/Await-client.ts +31 -46
- package/test/await/components/output/Await-server.ts +13 -14
- package/test/await/components/temp/{Await-client-9c30564ea39457e614e60c0cc0a71c431e8a1e76.ts → Await-client-e969f4bd0712acf259ddfaa5a3b3448307201fd2.ts} +31 -46
- package/test/await/components/temp/{Await-server-f02f39af3bb3344ca6b18a1d64d60b21913fba31.ts → Await-server-614014fab69e234b8271088b10397cf0452d9a76.ts} +13 -14
- package/test/bench/components/Bench.torp +4 -4
- package/test/bench/components/output/Bench-client.ts +43 -46
- package/test/bench/components/output/Bench-server.ts +16 -17
- package/test/bench/components/temp/Bench-client-7f31596dafc8077370d8d90b1bb9b6e0208154e7.ts +205 -0
- package/test/bench/components/temp/{Bench-server-00cefa588803c01ca4f2741c595e4f045cdd101e.ts → Bench-server-341b20073668f4f2160cd2ba37847c7db15e1e0f.ts} +16 -17
- package/test/bind/bind.test.ts +2 -2
- package/test/bind/component.test.ts +2 -2
- package/test/bind/components/BindComponent.torp +3 -18
- package/test/bind/components/BindText.torp +8 -10
- package/test/bind/components/output/BindComponent-client.ts +26 -47
- package/test/bind/components/output/BindComponent-server.ts +25 -36
- package/test/bind/components/output/BindText-client.ts +9 -16
- package/test/bind/components/output/BindText-server.ts +10 -11
- package/test/bind/components/temp/BindComponent-client-22eccb5354a2b0267841e015f3a2a0baf534bf89.ts +72 -0
- package/test/bind/components/temp/BindComponent-server-0da6ba90a409468fd1f7358f8198e96b7595ff80.ts +41 -0
- package/test/bind/components/temp/{BindText-client-134676d616abbad6b8a7ec48df0a2e38cbfe3b87.ts → BindText-client-7692ae1570533cc17e2186e9c7d4768529e4a2fe.ts} +9 -16
- package/test/bind/components/temp/BindText-server-6801c5f8e66a65405b45061bc037a011620c0591.ts +20 -0
- package/test/build-server/build-server.test.ts +2 -1
- package/test/build-server/components/IfNested.torp +11 -13
- package/test/{if/components/temp/IfNested-client-f3045daba052e459add6e7f84e8d21ba7b0d81e4.ts → build-server/components/output/IfNested-client.ts} +23 -27
- package/test/build-server/components/output/IfNested-server.ts +29 -0
- package/test/build-server/components/temp/IfNested-client-eefdd449fa700b2e7326bc72df8b32ddcadf9d21.ts +88 -0
- package/test/build-server/components/temp/IfNested-server-7a53e4969b5dfe5073f05edbcb1b986f718bb939.ts +29 -0
- package/test/buildHtml.ts +3 -2
- package/test/buildOutputFiles.ts +7 -7
- package/test/child-component/child-component.test.ts +2 -2
- package/test/child-component/components/ParentChild.torp +1 -3
- package/test/child-component/components/output/ParentChild-client.ts +13 -24
- package/test/child-component/components/output/ParentChild-server.ts +20 -22
- package/test/child-component/components/temp/{ParentChild-client-50ca7e499599209c9d674f2561413ca14a282c22.ts → ParentChild-client-2dfd600f7d409630d429a1d2d18c038bd08b08da.ts} +13 -24
- package/test/child-component/components/temp/ParentChild-server-448d57c3229189c1d297d01dfb0f33646d280e90.ts +37 -0
- package/test/class/class.test.ts +2 -2
- package/test/class/components/Class.torp +22 -24
- package/test/class/components/output/Class-client.ts +17 -37
- package/test/class/components/output/Class-server.ts +25 -25
- package/test/class/components/temp/{Class-client-de2491c550647203bea08727fa8c88f30654db0a.ts → Class-client-5af6a50cd454ae019b2aa79457ba7ead83b8c056.ts} +17 -37
- package/test/class/components/temp/Class-server-eb70ff01fbc7d6d53e16c3593ba021a6bf0317f9.ts +40 -0
- package/test/comments/html-comments.test.ts +16 -24
- package/test/comments/js-block-comments.test.ts +16 -25
- package/test/comments/js-line-comments.test.ts +16 -25
- package/test/component/component.test.ts +2 -2
- package/test/component/components/Component.torp +1 -1
- package/test/component/components/output/Component-client.ts +5 -10
- package/test/component/components/output/Component-server.ts +13 -13
- package/test/component/components/output/Header-client.ts +6 -12
- package/test/component/components/output/Header-server.ts +9 -11
- package/test/component/components/temp/{Component-client-350d20784712c710929cc3ab34c6828b0ea338d8.ts → Component-client-fdc327499be0a01f987d0f2897baf022a247c77c.ts} +5 -10
- package/test/component/components/temp/Component-server-f53221ac7b1c922ef10de2d1fe8fb534d0169fe7.ts +24 -0
- package/test/component/components/temp/{Header-client-903877003b220272b0cb5bfd62d7d748ad46c477.ts → Header-client-6beb5770e68e6b19595e53e20bc906765fc6c260.ts} +6 -12
- package/test/component/components/temp/Header-server-940b0984f9b6c11f310db9200c9075ded385eda5.ts +16 -0
- package/test/console/components/output/Console-client.ts +5 -10
- package/test/console/components/output/Console-server.ts +9 -11
- package/test/console/components/temp/{Console-client-4fa3b3679cee88bf6151185438e36d14010944b7.ts → Console-client-2b58290ac407ebbe89a0613d64eb9cd141b99887.ts} +5 -10
- package/test/console/components/temp/Console-server-bde0121ce434f767435b1841fc4c24402becdba2.ts +15 -0
- package/test/console/console.test.ts +2 -2
- package/test/const/components/Const.torp +4 -6
- package/test/const/components/output/Const-client.ts +8 -13
- package/test/const/components/output/Const-server.ts +10 -12
- package/test/const/components/temp/{Const-client-7dff2758c14bfbd208e301a702ae1781e6daba1b.ts → Const-client-d1037557e7ef75a8fe06f56816e65883047e9421.ts} +8 -13
- package/test/const/components/temp/Const-server-32ddc3617afe2324f17a4cff6c0f086df6694778.ts +18 -0
- package/test/const/const.test.ts +2 -2
- package/test/context/components/ChildA.torp +10 -0
- package/test/context/components/ChildB.torp +8 -0
- package/test/context/components/Parent.torp +11 -0
- package/test/context/components/output/ChildA-client.ts +38 -0
- package/test/context/components/output/ChildA-server.ts +19 -0
- package/test/{party/components/temp/CssStyle-client-37465dd48d1479db1bae513eb0b92c4e9a15e9ea.ts → context/components/output/ChildB-client.ts} +10 -12
- package/test/context/components/output/ChildB-server.ts +18 -0
- package/test/context/components/output/Parent-server.ts +31 -0
- package/test/context/components/temp/ChildA-client-9dea3e29ffcb82ca1779f6ff671e19b1c106fc4a.ts +38 -0
- package/test/context/components/temp/ChildA-server-54024d23c8241c3f475068f4fe3a3a14fd1c5870.ts +19 -0
- package/test/{special-head/components/temp/Head-client-18616689a7d6f83ca076c9d825606b049de9d3ef.ts → context/components/temp/ChildB-client-4b801099936c8aa013a1220f291375f67eba1acb.ts} +10 -21
- package/test/context/components/temp/ChildB-server-f9b71341863bf869248bd406dbe8c7726a30ff90.ts +18 -0
- package/test/context/components/temp/Parent-client-9898b2e521527c86d69905053b6727ea8fd28166.ts +41 -0
- package/test/context/components/temp/Parent-server-b592ff0f516f4592e56d3a0bcb1f271ed28e812c.ts +31 -0
- package/test/context/context.test.ts +37 -0
- package/test/effects/components/For.torp +3 -5
- package/test/effects/components/If.torp +5 -7
- package/test/effects/components/NestedIf.torp +6 -8
- package/test/effects/components/output/For-client.ts +23 -25
- package/test/effects/components/output/For-server.ts +10 -12
- package/test/effects/components/output/If-client.ts +19 -25
- package/test/effects/components/output/If-server.ts +11 -13
- package/test/effects/components/output/NestedIf-client.ts +26 -31
- package/test/effects/components/output/NestedIf-server.ts +13 -15
- package/test/effects/components/temp/{For-client-35bf9bea43f53d6c0cf807f9e31500765fa0b455.ts → For-client-7c7d7c0dba2547f816b9bd9c6a95d6873ec00ffd.ts} +23 -25
- package/test/effects/components/temp/For-server-9e2de4efaff38ecf6c8a169c629d83c385489ca1.ts +20 -0
- package/test/effects/components/temp/{If-client-efb994796596d9d08f59a0ab5ffdacc74bd04545.ts → If-client-f0480a98f80b32612d12765c6838ff6db5982e82.ts} +19 -25
- package/test/effects/components/temp/If-server-ab409671b5d4c918047394a37b6e96b0e17063ca.ts +22 -0
- package/test/effects/components/temp/{NestedIf-client-845b3789b8a938439bff758bc9b3731d769c8ff6.ts → NestedIf-client-702deffd158f219c5da4199b563a62cd54385a7f.ts} +26 -31
- package/test/effects/components/temp/NestedIf-server-40f6bfd99a7e75fb4f9f874adab77e5eed97c629.ts +26 -0
- package/test/effects/for-effect.test.ts +15 -15
- package/test/effects/if-effect.test.ts +7 -7
- package/test/effects/nested-if-effect.test.ts +11 -11
- package/test/events/components/Increment.torp +10 -12
- package/test/events/components/output/Increment-client.ts +10 -15
- package/test/events/components/output/Increment-server.ts +11 -12
- package/test/events/components/temp/{Increment-client-1b5f9e231c5c4fc059d77ca0da632719283e5ac4.ts → Increment-client-84c09711baf098c82ee226598ba7a36913616b75.ts} +10 -15
- package/test/events/components/temp/Increment-server-e77c6b207023ac60e033ca542ee82473ef017f74.ts +23 -0
- package/test/events/events.test.ts +9 -15
- package/test/for/components/output/For-client.ts +19 -19
- package/test/for/components/output/For-server.ts +11 -13
- package/test/for/components/output/ForEscape-client.ts +23 -37
- package/test/for/components/output/ForEscape-server.ts +12 -13
- package/test/for/components/output/ForIn-client.ts +19 -20
- package/test/for/components/output/ForIn-server.ts +11 -13
- package/test/for/components/output/ForOf-client.ts +19 -20
- package/test/for/components/output/ForOf-server.ts +11 -13
- package/test/for/components/temp/{For-client-8ecb11a2f34c81f837bffdb88598da06d8c19158.ts → For-client-2f6b4b81670b0ba31b01176b4f61ebf321e945bb.ts} +19 -19
- package/test/for/components/temp/For-server-5144615e53d23da5062b7169e847e0777d068738.ts +20 -0
- package/test/for/components/temp/{ForEscape-client-14e7648415d967cdc57bf03d176eb6b6dddf0fb2.ts → ForEscape-client-8d0fcc940851e687173b6a9129c3d83e0fc771ef.ts} +23 -37
- package/test/for/components/temp/ForEscape-server-b359d8d3e12bac290855a1b27387ddd963562c08.ts +23 -0
- package/test/for/components/temp/{ForIn-client-25cd67f246a50fc6d926a8c66aa5e106f19578a8.ts → ForIn-client-fa0614a1c7b8aa6e8819ed91a518479fd80453ae.ts} +19 -20
- package/test/for/components/temp/ForIn-server-5fd472a7a5a5c00b384791780025a0c3bdc9c41b.ts +20 -0
- package/test/for/components/temp/{ForOf-client-8f6598ccd9dc7b79aff6167b90ccea94f3029c84.ts → ForOf-client-11006c4239d9018363e582dc5b54b50477d652e7.ts} +19 -20
- package/test/for/components/temp/ForOf-server-197b29abcb60412c6c8670b2d4a2e644b650faa3.ts +20 -0
- package/test/for/for-escape.test.ts +2 -2
- package/test/for/for-in.test.ts +4 -4
- package/test/for/for-of.test.ts +4 -4
- package/test/for/for-with-key.test.ts +28 -36
- package/test/for/for.test.ts +2 -2
- package/test/function/components/Function.torp +7 -10
- package/test/function/components/output/Function-client.ts +9 -15
- package/test/function/components/output/Function-server.ts +11 -13
- package/test/function/components/temp/{Function-client-4e2168306756eb927d5ed4b673334b357eecaa74.ts → Function-client-ec5fe7d599d6099bdfab78c2a0c8edf77a23cd9b.ts} +9 -15
- package/test/function/components/temp/Function-server-fee2402b0ef4ad4c3d2779afb190ce46dbedf737.ts +25 -0
- package/test/function/function.test.ts +7 -13
- package/test/helpers.ts +44 -9
- package/test/html/components/output/Html-client.ts +6 -12
- package/test/html/components/output/Html-server.ts +9 -11
- package/test/html/components/temp/{Html-client-93b0d666142c64cd651dc37f14f12884b2f30612.ts → Html-client-82ff34dcdcbdf4be1112bcb1baac8027cdc32de7.ts} +6 -12
- package/test/html/components/temp/Html-server-14fa484fc2a617bc0f24432a2e37e7a756f87a0f.ts +15 -0
- package/test/html/html.test.ts +2 -2
- package/test/hydrateComponent.ts +4 -5
- package/test/if/components/output/IfAfterIf-client.ts +21 -23
- package/test/if/components/output/IfAfterIf-server.ts +12 -14
- package/test/if/components/output/IfElse-client.ts +14 -18
- package/test/if/components/output/IfElse-server.ts +11 -13
- package/test/if/components/output/IfElseIf-client.ts +16 -22
- package/test/if/components/output/IfElseIf-server.ts +12 -14
- package/test/if/components/output/IfFalse-client.ts +13 -16
- package/test/if/components/output/IfFalse-server.ts +10 -12
- package/test/if/components/output/IfNested-client.ts +23 -27
- package/test/if/components/output/IfNested-server.ts +14 -16
- package/test/if/components/temp/{IfAfterIf-client-6b4833209a01cdad18d453839e9c8b5dad2a8510.ts → IfAfterIf-client-c1cfd21a6ace4945703ba8f46aada923a60265d9.ts} +21 -23
- package/test/if/components/temp/IfAfterIf-server-26c9a638e3933a53208bfe66f8f37067511a28aa.ts +23 -0
- package/test/if/components/temp/{IfElse-client-f7eb8e5fe5e62975a2442c4b0ff3344fa44cef69.ts → IfElse-client-06dfcacd3a5225dcb0947587bcd4fae9ec3d3c1e.ts} +14 -18
- package/test/if/components/temp/IfElse-server-146b3779f85ea02a281c6042dddefa5372945fb0.ts +22 -0
- package/test/if/components/temp/{IfElseIf-client-734f1b2d9133294573770c1ffc2b589273498532.ts → IfElseIf-client-26df9a728c9cb712d5ac0235b4c99885f25545b8.ts} +16 -22
- package/test/if/components/temp/IfElseIf-server-f094cdb45bc0fcd3144ca493346994b2445d2ff0.ts +25 -0
- package/test/if/components/temp/{IfFalse-client-8a388cb48b4a5879d491f57d1f2551834de1e72e.ts → IfFalse-client-de6fc8e9eb222153608490e6d172e9aae9000aa1.ts} +13 -16
- package/test/if/components/temp/IfFalse-server-b6d3446fd7d4219d5cb3c1009dec76870e73fa30.ts +19 -0
- package/test/if/components/temp/IfNested-client-eefdd449fa700b2e7326bc72df8b32ddcadf9d21.ts +88 -0
- package/test/if/components/temp/IfNested-server-7a53e4969b5dfe5073f05edbcb1b986f718bb939.ts +29 -0
- package/test/if/else-if-true.test.ts +4 -4
- package/test/if/else-true.test.ts +4 -4
- package/test/if/if-after-if.test.ts +4 -4
- package/test/if/if-else-false.test.ts +4 -4
- package/test/if/if-else-true.test.ts +4 -4
- package/test/if/if-false.test.ts +4 -4
- package/test/if/if-nested.test.ts +4 -4
- package/test/imports/commented-imports.ts +1 -1
- package/test/imports/imports.ts +1 -1
- package/test/imports/multiple-imports.ts +1 -1
- package/test/mount/components/Mount.torp +1 -1
- package/test/mount/components/output/Mount-client.ts +6 -11
- package/test/mount/components/output/Mount-server.ts +11 -13
- package/test/mount/components/temp/{Mount-client-efa5c34fbfc7646e114a1a58f0814b6dff33e566.ts → Mount-client-29896228d7d0ef3692a9d13065c1bbfbe3198cdc.ts} +6 -11
- package/test/mount/components/temp/Mount-server-1c5aef88b8cc25b8e02851c0aa7fedffea987224.ts +22 -0
- package/test/mount/mount.test.ts +4 -4
- package/test/mountComponent.ts +1 -1
- package/test/on-mount/components/OnMount.torp +1 -1
- package/test/on-mount/components/output/OnMount-client.ts +5 -10
- package/test/on-mount/components/output/OnMount-server.ts +9 -11
- package/test/on-mount/components/temp/{OnMount-client-4bb62e8bf1fcd67798598fe03bf5455a57f0a6be.ts → OnMount-client-038f8c6bbcf0278406909d6ba5394f311924fda9.ts} +5 -10
- package/test/on-mount/components/temp/OnMount-server-ff4afcd976fd907c539e763d7887b38c61737be7.ts +15 -0
- package/test/on-mount/on-mount.test.ts +6 -6
- package/test/party/1-declare-state.test.ts +2 -2
- package/test/party/10-on-mount.test.ts +2 -2
- package/test/party/12-props.test.ts +2 -2
- package/test/party/13-emit-to-parent.test.ts +2 -2
- package/test/party/14-slot.test.ts +2 -2
- package/test/party/15-slot-fallback.test.ts +2 -2
- package/test/party/16-context.test.ts +2 -2
- package/test/party/17-input-text.test.ts +2 -2
- package/test/party/18-input-checkbox.test.ts +2 -2
- package/test/party/19-input-radio.test.ts +2 -2
- package/test/party/2-update-state.test.ts +2 -2
- package/test/party/20-input-select.test.ts +2 -2
- package/test/party/3-computed-state.test.ts +2 -2
- package/test/party/4-minimal-template.test.ts +2 -2
- package/test/party/5-styling.test.ts +2 -2
- package/test/party/6-loop.test.ts +2 -2
- package/test/party/7-event-click.test.ts +2 -2
- package/test/party/8-dom-ref.test.ts +4 -4
- package/test/party/9-conditional.test.ts +2 -2
- package/test/party/components/AnswerButton.torp +2 -5
- package/test/party/components/AnswerButtonApp.torp +3 -5
- package/test/party/components/ColorSelect.torp +8 -10
- package/test/party/components/Counter.torp +2 -4
- package/test/party/components/CssStyle.torp +2 -4
- package/test/party/components/FunnyButton.torp +2 -2
- package/test/party/components/FunnyButtonApp.torp +2 -4
- package/test/party/components/InputFocused.torp +1 -1
- package/test/party/components/InputHello.torp +2 -4
- package/test/party/components/IsAvailable.torp +3 -5
- package/test/party/components/PickPill.torp +5 -7
- package/test/party/components/TrafficLight.torp +12 -14
- package/test/party/components/UserProfile.torp +4 -6
- package/test/party/components/UserProfileApp.torp +1 -1
- package/test/party/components/UserProfileContext.torp +6 -8
- package/test/party/components/UserProfileContextApp.torp +3 -5
- package/test/party/components/output/AnswerButton-client.ts +7 -14
- package/test/party/components/output/AnswerButton-server.ts +8 -10
- package/test/party/components/output/AnswerButtonApp-client.ts +10 -16
- package/test/party/components/output/AnswerButtonApp-server.ts +14 -13
- package/test/party/components/output/ColorSelect-client.ts +26 -30
- package/test/party/components/output/ColorSelect-server.ts +12 -13
- package/test/party/components/output/Colors-client.ts +19 -20
- package/test/party/components/output/Colors-server.ts +12 -13
- package/test/party/components/output/Counter-client.ts +11 -16
- package/test/party/components/output/Counter-server.ts +10 -11
- package/test/party/components/output/CssStyle-client.ts +7 -12
- package/test/party/components/output/CssStyle-server.ts +12 -11
- package/test/party/components/output/DoubleCount-client.ts +6 -11
- package/test/party/components/output/DoubleCount-server.ts +10 -11
- package/test/party/components/output/FunnyButton-client.ts +4 -10
- package/test/party/components/output/FunnyButton-server.ts +11 -12
- package/test/party/components/output/FunnyButtonApp-client.ts +12 -22
- package/test/party/components/output/FunnyButtonApp-server.ts +21 -20
- package/test/party/components/output/HelloWorld-client.ts +5 -10
- package/test/party/components/output/HelloWorld-server.ts +9 -11
- package/test/party/components/output/InputFocused-client.ts +6 -11
- package/test/party/components/output/InputFocused-server.ts +11 -13
- package/test/party/components/output/InputHello-client.ts +12 -17
- package/test/party/components/output/InputHello-server.ts +10 -11
- package/test/party/components/output/IsAvailable-client.ts +12 -17
- package/test/party/components/output/IsAvailable-server.ts +10 -11
- package/test/party/components/output/Name-client.ts +6 -11
- package/test/party/components/output/Name-server.ts +10 -11
- package/test/party/components/output/NameUpdate-client.ts +6 -11
- package/test/party/components/output/NameUpdate-server.ts +10 -11
- package/test/party/components/output/PageTitle-client.ts +6 -11
- package/test/party/components/output/PageTitle-server.ts +10 -11
- package/test/party/components/output/PickPill-client.ts +12 -17
- package/test/party/components/output/PickPill-server.ts +10 -11
- package/test/party/components/output/Time-client.ts +6 -11
- package/test/party/components/output/Time-server.ts +10 -11
- package/test/party/components/output/TrafficLight-client.ts +21 -29
- package/test/party/components/output/TrafficLight-server.ts +14 -15
- package/test/party/components/output/UserProfile-client.ts +12 -24
- package/test/party/components/output/UserProfile-server.ts +8 -10
- package/test/party/components/output/UserProfileApp-client.ts +6 -11
- package/test/party/components/output/UserProfileApp-server.ts +14 -14
- package/test/party/components/output/UserProfileContext-client.ts +12 -18
- package/test/party/components/output/UserProfileContext-server.ts +10 -10
- package/test/party/components/output/UserProfileContextApp-client.ts +12 -18
- package/test/party/components/output/UserProfileContextApp-server.ts +15 -14
- package/test/party/components/temp/{AnswerButton-client-ad8f8db36b7aaa68d8de5898a324bacfbe9f20df.ts → AnswerButton-client-df895c3e7a88fd7ede9f951fc9de2ed75c27a5cb.ts} +7 -14
- package/test/party/components/temp/AnswerButton-server-fa0e78b504a78d0e2dcd33a9a589f62e5b99c675.ts +15 -0
- package/test/party/components/temp/{AnswerButtonApp-client-5661f07868550612bcdeee268b82c473af6a2613.ts → AnswerButtonApp-client-4c05ef36b1c0e93370fb463643419928717fa701.ts} +10 -16
- package/test/party/components/temp/AnswerButtonApp-server-062042691dabfa1a20d4088030c0b5bee1cd0be2.ts +39 -0
- package/test/party/components/temp/{ColorSelect-client-70bf59d6399d63c0eed421b9d370a1e5c97a89ca.ts → ColorSelect-client-5db8d1b0924361fdb5efb867c14491402ec9668c.ts} +26 -30
- package/test/party/components/temp/ColorSelect-server-8722b440cb7266a18a71b35c166be6dd6566fcec.ts +33 -0
- package/test/party/components/temp/{Colors-client-806316cc5e01e8235c0b025cad34b1068addf5a5.ts → Colors-client-6d3ac693e85bdda50b8742282915997063a32769.ts} +19 -20
- package/test/party/components/temp/Colors-server-16572e26a55214c26683ce560b058b55d8c92685.ts +22 -0
- package/test/party/components/temp/{Counter-client-3b876c148f2b14da1766eff77eb6c494f7be6414.ts → Counter-client-0c604a107c5b84cdbf725f307dfe29d34f8a2cc8.ts} +11 -16
- package/test/party/components/temp/Counter-server-db18f030a6e02ab17708d6a17eb3e590965090e5.ts +25 -0
- package/test/party/components/temp/CssStyle-client-2a642d115ad52539f97c051c34687b8d6d12b324.ts +24 -0
- package/test/party/components/temp/CssStyle-server-0477c5497707dd9071105e5ec9045a3a7d1dd62d.ts +18 -0
- package/test/party/components/temp/{DoubleCount-client-6d4cf1e54368e3c6082e37c1e04f9ecde90624f2.ts → DoubleCount-client-8c85c3af12c471ea23bb702bbf5a3e240420f3ec.ts} +6 -11
- package/test/party/components/temp/DoubleCount-server-5b04bb31269f9c8de6c25be427f57ab6e3d4dc19.ts +24 -0
- package/test/party/components/temp/{FunnyButton-client-6d5662018a5a5529fd52ee82f7c88975b5c3355a.ts → FunnyButton-client-850dd3da0fa803c1bce5c53e88fcd2d48d279eb8.ts} +4 -10
- package/test/party/components/temp/{FunnyButton-server-e0adab2be2d283acb8a8b580479ade999dc918e9.ts → FunnyButton-server-3df0067ec21476e7525d1c3de7099431c976f73b.ts} +11 -12
- package/test/party/components/temp/{FunnyButtonApp-client-daa929c6d64f67e4a1a387b884317a4bb615b5d4.ts → FunnyButtonApp-client-00300846d11a3d0a5a620c2ade87b935b7f0ebf8.ts} +12 -22
- package/test/party/components/temp/FunnyButtonApp-server-4cd83d2c71615fe4c905920e5ea836df4ed66c5e.ts +37 -0
- package/test/party/components/temp/{HelloWorld-client-7344e400b4adb975fa8263d3081a06de0a793e57.ts → HelloWorld-client-890b311ad9a3919379acdc1d52807ea36cc9f489.ts} +5 -10
- package/test/party/components/temp/HelloWorld-server-e2c800d7f5cd3e772a9e5bbd7af58b00611b79d5.ts +15 -0
- package/test/party/components/temp/{InputFocused-client-20d755aea7dfaf1fd5e42dcade8fb7867f59ef28.ts → InputFocused-client-03527f9ceb52f66ac53887dbc884a0aa83bb7a23.ts} +6 -11
- package/test/party/components/temp/InputFocused-server-544a76ea64852474a3c7bf450b6fac36cbaf21c6.ts +23 -0
- package/test/party/components/temp/{InputHello-client-2a4cbd980534fde14b9d3e8a2f8e4f59a4f15d64.ts → InputHello-client-f65a477624975b68b7aaa3614fbf198d4476480f.ts} +12 -17
- package/test/party/components/temp/InputHello-server-102d293d6c0fff7feda50d64bbd607df7d09393a.ts +22 -0
- package/test/party/components/temp/{IsAvailable-client-3949f85aea0e935c3b59ab1389baee836eff1866.ts → IsAvailable-client-8767437fd92cf79713de5b00828e1502e38d79e3.ts} +12 -17
- package/test/party/components/temp/IsAvailable-server-2cf1e0d72df4bc194b5e00a1b415ba99f488525f.ts +21 -0
- package/test/party/components/temp/{Name-client-62f0dab96aff130e81882099d7c0a111ba99cebd.ts → Name-client-08903a8df8bdff5288170d3c89658192956587a9.ts} +6 -11
- package/test/party/components/temp/Name-server-7d95226078ef4cd13b0ac6c5365ccbe4b8b9c0a2.ts +21 -0
- package/test/party/components/temp/{NameUpdate-client-6ceb440637c99142bafcf8512eabf831c113b8c7.ts → NameUpdate-client-d65b2476c3721d2efddf9385a61433e2a2dd0d72.ts} +6 -11
- package/test/party/components/temp/NameUpdate-server-9c901f861eddfde14440c2591dfafb2b1fb1993d.ts +22 -0
- package/test/party/components/temp/{PageTitle-client-75fea3a37fb1213bc13f56160bb6779486b2e6e9.ts → PageTitle-client-c006df9a3e662488a1db089de53fd485c6b923e4.ts} +6 -11
- package/test/party/components/temp/PageTitle-server-f4676ec6feccaa03b89d52835c6635536eb885ef.ts +26 -0
- package/test/party/components/temp/{PickPill-client-0f13aa652cb1bd45f57d5a249f8364e80204441a.ts → PickPill-client-af8357daf3f6633c7f451d0bddd72fefe786d5c3.ts} +12 -17
- package/test/party/components/temp/PickPill-server-d8fb383bc25f7d26bb0153088a2ee19c765fc66b.ts +22 -0
- package/test/party/components/temp/{Time-client-2013f274e90b45be3138727f2298305e1951131f.ts → Time-client-94380d45de7275a5cec98e5f58c15b74b13e9c3e.ts} +6 -11
- package/test/party/components/temp/{Time-server-8e0278a4b16925903f3c4ceedbf1332cde4921fa.ts → Time-server-3f71a83b6fd357b57e85344281454ee793024e7b.ts} +10 -11
- package/test/party/components/temp/{TrafficLight-client-4a90675ca6157ed7701aefa0d9141575960a1d47.ts → TrafficLight-client-12b20962b4146ef08fe0c37597441533c7699408.ts} +21 -29
- package/test/party/components/temp/TrafficLight-server-625a774075633be88822f4d345e1421a77aba98a.ts +39 -0
- package/test/party/components/temp/{UserProfile-client-11c2a928de5a5ed4cab45186f08ca09f6161afb5.ts → UserProfile-client-e5330b2c96bd8b225cb6291bc8b1d9f35c93307e.ts} +12 -24
- package/test/party/components/temp/UserProfile-server-6e89fd7f8ade8e8d64630e5da8361d7a1fa2ff5a.ts +21 -0
- package/test/party/components/temp/{UserProfileApp-client-e0bfaa4ffed336c8be4b23dd81800501980c9938.ts → UserProfileApp-client-4c86e4f9a0d042f4f4811868f0146e872b17353c.ts} +6 -11
- package/test/party/components/temp/UserProfileApp-server-754d269451abf8fd04e519b8edde33d25c73ce28.ts +27 -0
- package/test/party/components/temp/{UserProfileContext-client-c97c077254210061b3c9ba561f681c0cf4f6167f.ts → UserProfileContext-client-424131db3cc89ae4babe127b9108ffc5696c9e1d.ts} +12 -18
- package/test/party/components/temp/UserProfileContext-server-e72e8ccee2703cce216f2368a1555d64acc2654c.ts +20 -0
- package/test/party/components/temp/{UserProfileContextApp-client-05ce216919de6ffde56d1c2c39299173d9b611b3.ts → UserProfileContextApp-client-5f94a7ccf3e4542ea40d8046ad75eeb21005c55f.ts} +12 -18
- package/test/party/components/temp/UserProfileContextApp-server-267ac147e0e59e53aeb6741a8cd0f3ef1216051f.ts +34 -0
- package/test/preact.test.ts +2560 -0
- package/test/props/components/Reactive.torp +2 -4
- package/test/props/components/output/Reactive-client.ts +12 -22
- package/test/props/components/output/Reactive-server.ts +20 -20
- package/test/props/components/temp/{Reactive-client-cf6e602b2f74fce8e9451b6c41c6f8ff8eab63a3.ts → Reactive-client-9bc3643675fc563f96efb00bc3c4b843ba4b7f2e.ts} +12 -22
- package/test/props/components/temp/Reactive-server-8a84d0fc1f375d91438d840ca9753e32d86366ac.ts +40 -0
- package/test/props/reactive.test.ts +2 -2
- package/test/replace/components/Replace.torp +3 -5
- package/test/replace/components/output/Replace-client.ts +10 -19
- package/test/replace/components/output/Replace-server.ts +11 -12
- package/test/replace/components/temp/{Replace-client-2a9ee3430708b469fa31bbc6989eed5b2f22984d.ts → Replace-client-6f21ff3eb303bd5488d211087dc35fcf998d4e2a.ts} +10 -19
- package/test/replace/components/temp/Replace-server-b536cf6d792ae73aaa7f5ea04cda6858a07479f9.ts +21 -0
- package/test/replace/replace.test.ts +2 -2
- package/test/script/script-with-comments.test.ts +14 -19
- package/test/script/script-with-strings.test.ts +14 -19
- package/test/script/script.test.ts +14 -19
- package/test/slots/basic-slot.test.ts +2 -2
- package/test/slots/components/Article.torp +3 -3
- package/test/slots/components/Basic.torp +1 -1
- package/test/slots/components/Header.torp +2 -2
- package/test/slots/components/Let.torp +3 -3
- package/test/slots/components/List.torp +1 -1
- package/test/slots/components/Named.torp +3 -3
- package/test/slots/components/Unused.torp +1 -1
- package/test/slots/components/output/Article-client.ts +4 -8
- package/test/slots/components/output/Article-server.ts +14 -15
- package/test/slots/components/output/Basic-client.ts +7 -14
- package/test/slots/components/output/Basic-server.ts +17 -18
- package/test/slots/components/output/Header-client.ts +4 -9
- package/test/slots/components/output/Header-server.ts +11 -12
- package/test/slots/components/output/Let-client.ts +7 -14
- package/test/slots/components/output/Let-server.ts +16 -17
- package/test/slots/components/output/List-client.ts +17 -16
- package/test/slots/components/output/List-server.ts +12 -13
- package/test/slots/components/output/Named-client.ts +9 -19
- package/test/slots/components/output/Named-server.ts +21 -23
- package/test/slots/components/output/Unused-client.ts +5 -10
- package/test/slots/components/output/Unused-server.ts +13 -13
- package/test/slots/components/temp/{Article-client-3f2da4b399f94ae8c329489e1ba0ba98196df9c5.ts → Article-client-0b674ee98ae7f85021bfb8b912f28e3c4b35e877.ts} +4 -8
- package/test/slots/components/temp/Article-server-3db1718b70b86b456514b54ae17a597d07cc0ca9.ts +27 -0
- package/test/slots/components/temp/{Basic-client-a2c4bf685d4b75d0395da427b7754c2a58374dd7.ts → Basic-client-196f7f0244dca0baeffb547eec55c089a108283d.ts} +7 -14
- package/test/slots/components/temp/Basic-server-a22e6ec236b84e09d4d59c7abc4f0b22bf60f22c.ts +32 -0
- package/test/slots/components/temp/{Header-client-d7418b71df5db36d58a73e909233863a6c03678b.ts → Header-client-e5c784d60469523803898ee4d8b85fb82a7b7c0b.ts} +4 -9
- package/test/slots/components/temp/Header-server-3182d735443d9cf6a0cc7891919cc2c08df2aa8f.ts +21 -0
- package/test/slots/components/temp/{Let-client-913f9dede92b68a3f4a13d1f56f99b3e08e01efe.ts → Let-client-645271fcd63cd500001c75740b22b1b387330657.ts} +7 -14
- package/test/slots/components/temp/Let-server-b6d6e2012155c7533a0eb4ee0aaf00157a7d4493.ts +35 -0
- package/test/slots/components/temp/{List-client-6bc2d267a8b2028a14b12b2c70feb7c6a47d6d64.ts → List-client-ee6047ac396dc0b6fce5e38af51c38093fae83a2.ts} +17 -16
- package/test/slots/components/temp/List-server-1ee246e864cdb31bb8f52cf4424b6ef0e9b41cf1.ts +25 -0
- package/test/slots/components/temp/{Named-client-f6e7a984759ce8f50bc52dcf56f6f06cab925a80.ts → Named-client-559988562c5de1ae6017d2ad6de063f4363064b6.ts} +9 -19
- package/test/slots/components/temp/Named-server-f2ce3d301e916ea38901a92185c25512b11d42d4.ts +41 -0
- package/test/slots/components/temp/{Unused-client-ea0a096aa7a1c958f3bf807f35340b96f8a025ee.ts → Unused-client-52d1828bd28ebf7046a2e948a369563c0ea83b98.ts} +5 -10
- package/test/slots/components/temp/Unused-server-f5248f5cd4616c65eaf27c67385f13ed671accad.ts +22 -0
- package/test/slots/let-slot.test.ts +4 -4
- package/test/slots/named-slot.test.ts +2 -2
- package/test/slots/unused-slot.test.ts +2 -2
- package/test/source-maps/components/Source.torp +19 -0
- package/test/source-maps/components/output/Source-client.ts +63 -0
- package/test/source-maps/components/output/Source-server.ts +26 -0
- package/test/source-maps/components/temp/Source-client-ae8c4811ff658c13ee8c9b9e0e53fff1b83b178b.ts +63 -0
- package/test/source-maps/components/temp/Source-server-70b20214c52b8820f450324943e8a1ffb0a72d5e.ts +26 -0
- package/test/source-maps/parse.test.ts +62 -0
- package/test/special-component/components/BigTitle.torp +1 -1
- package/test/special-component/components/Component.torp +2 -2
- package/test/special-component/components/SmallTitle.torp +1 -1
- package/test/special-component/components/output/BigTitle-client.ts +4 -8
- package/test/special-component/components/output/BigTitle-server.ts +10 -11
- package/test/special-component/components/output/Component-client.ts +7 -15
- package/test/special-component/components/output/Component-server.ts +19 -19
- package/test/special-component/components/output/SmallTitle-client.ts +4 -8
- package/test/special-component/components/output/SmallTitle-server.ts +10 -11
- package/test/special-component/components/temp/{BigTitle-client-c4bd66406d55ce83ab4491c4114d563055e1c275.ts → BigTitle-client-cb3055f809aaf17bd1fa82748d039ac3730a8d44.ts} +4 -8
- package/test/special-component/components/temp/BigTitle-server-fef9d1e1deacfde2be4469c2e63a801b2e518dff.ts +19 -0
- package/test/special-component/components/temp/{Component-client-c39c66cf5274445bb863fd759e0ef223613a9f3a.ts → Component-client-0eb9553b52acce2dfa564242295a4c57a38bd540.ts} +7 -15
- package/test/special-component/components/temp/Component-server-9d0fddeff790bfb2b6cfbcd2edf677837f5b8120.ts +43 -0
- package/test/special-component/components/temp/{SmallTitle-client-e4b3e51243ca4f1efca21ac0f957b81e8bc93167.ts → SmallTitle-client-5a65b233be29395e9650f57d9708a33de1279af3.ts} +4 -8
- package/test/special-component/components/temp/SmallTitle-server-11f8b6b3c613716d6a5371883a9b55434bb43ad5.ts +19 -0
- package/test/special-component/special-component.test.ts +2 -2
- package/test/special-element/components/Element.torp +2 -2
- package/test/special-element/components/output/Element-client.ts +5 -11
- package/test/special-element/components/output/Element-server.ts +9 -11
- package/test/special-element/components/temp/{Element-client-c5701ed44faa4ec8ae558505063684a84cada3f2.ts → Element-client-745e610fbd5c652d327c8ac349d49d5ee4c8d9ea.ts} +5 -11
- package/test/special-element/components/temp/Element-server-7aef6d0ed7369aa2418183519c8320e0409a5641.ts +15 -0
- package/test/special-element/special-element.test.ts +2 -2
- package/test/special-head/components/Head.torp +2 -6
- package/test/special-head/components/output/Head-client.ts +8 -27
- package/test/special-head/components/output/Head-server.ts +8 -13
- package/test/special-head/components/temp/Head-client-bbbb5e712247ee41ca65a7ffd457987de5e99b3e.ts +19 -0
- package/test/special-head/components/temp/Head-server-c3de2e6b56aabc095380370d8bf93ae3bc7c10d9.ts +12 -0
- package/test/special-head/special-head.test.ts +2 -2
- package/test/special-self/components/Self.torp +4 -6
- package/test/special-self/components/output/Self-client.ts +18 -23
- package/test/special-self/components/output/Self-server.ts +14 -14
- package/test/special-self/components/temp/{Self-client-43a0a90fac58867c88bf32221883e8da342a0295.ts → Self-client-dfe57df69e3677e94f7b5f3657c82602054ef19e.ts} +18 -23
- package/test/special-self/components/temp/Self-server-5d135dab2b6fd4ba7fe3f56768f0725607d36bd9.ts +27 -0
- package/test/special-self/special-self.test.ts +2 -2
- package/test/style/components/Style.torp +1 -1
- package/test/style/components/output/Style-client.ts +7 -13
- package/test/style/components/output/Style-server.ts +10 -12
- package/test/style/components/temp/{Style-client-bc13f8dbb5f754e4eebb2473fc63a139ebf1ba92.ts → Style-client-9491a5aff97f118df542f976d7f7a21e7cc88c62.ts} +7 -13
- package/test/style/components/temp/Style-server-8b8cbe1868cab30d9e34dda52921652768ada1db.ts +16 -0
- package/test/style/parse.test.ts +507 -193
- package/test/style/style.test.ts +2 -2
- package/test/svg/components/Shape.torp +1 -1
- package/test/svg/components/output/Shape-client.ts +23 -23
- package/test/svg/components/output/Shape-server.ts +12 -13
- package/test/svg/components/temp/{Shape-client-052ea7838de07222602834de58968a3f89e6ea56.ts → Shape-client-4cc148d8b70d3750d2982360aad76b74d194b60e.ts} +23 -23
- package/test/svg/components/temp/Shape-server-76aaef570e067031ff39635ffe37626364c2200a.ts +23 -0
- package/test/svg/svg.test.ts +4 -4
- package/test/switch/components/Switch.torp +16 -18
- package/test/switch/components/output/Switch-client.ts +22 -30
- package/test/switch/components/output/Switch-server.ts +12 -14
- package/test/switch/components/temp/{Switch-client-30113fadf131c72e7c24160fa62068b651716896.ts → Switch-client-5fc00f4d41300dc7587b113d8e53a102beca7558.ts} +22 -30
- package/test/switch/components/temp/Switch-server-440f7e852145b79656c0023ddc776e4d1d077d2a.ts +36 -0
- package/test/switch/switch-values.test.ts +4 -4
- package/test/template/basic-file.test.ts +61 -88
- package/test/template/empty-file.test.ts +7 -12
- package/test/template/errors.test.ts +64 -34
- package/test/text/components/Text.torp +5 -7
- package/test/text/components/output/Text-client.ts +9 -17
- package/test/text/components/output/Text-server.ts +8 -10
- package/test/text/components/temp/{Text-client-e335aae6d8aef389dfdbb5bee14e3dd3d41e86bd.ts → Text-client-6c3be8a1a31a13eff86ce8b5330829cd15b07fab.ts} +9 -17
- package/test/text/components/temp/Text-server-ac34d47e755aa39b2d89cb44f854450c3db1ddff.ts +22 -0
- package/test/text/text.test.ts +4 -4
- package/test/watch-array/ArrayState.ts +2 -2
- package/test/watch-array/array-all-functions-unkeyed.test.ts +16 -14
- package/test/watch-array/array-all-functions.test.ts +16 -14
- package/test/watch-array/array-empty.test.ts +8 -6
- package/test/watch-array/array-entries.test.ts +11 -9
- package/test/watch-array/array-indexes.test.ts +11 -9
- package/test/watch-array/array-pop.test.ts +10 -8
- package/test/watch-array/array-push.test.ts +10 -8
- package/test/watch-array/array-reassign.test.ts +11 -9
- package/test/watch-array/array-reverse.test.ts +10 -8
- package/test/watch-array/array-set-object.test.ts +10 -8
- package/test/watch-array/array-set-property.test.ts +10 -8
- package/test/watch-array/array-shift.test.ts +10 -8
- package/test/watch-array/array-sort.test.ts +11 -9
- package/test/watch-array/array-splice-add.test.ts +10 -8
- package/test/watch-array/array-splice-delete-all.test.ts +10 -8
- package/test/watch-array/array-splice-delete-and-add.test.ts +10 -8
- package/test/watch-array/array-splice-delete-end.test.ts +10 -8
- package/test/watch-array/array-splice-delete.test.ts +10 -8
- package/test/watch-array/array-swap.test.ts +10 -8
- package/test/watch-array/array-unshift.test.ts +10 -8
- package/test/watch-array/array-update-assignment.test.ts +10 -8
- package/test/watch-array/components/output/Array-client.ts +19 -21
- package/test/watch-array/components/output/Array-server.ts +11 -13
- package/test/watch-array/components/output/ArrayEntries-client.ts +21 -23
- package/test/watch-array/components/output/ArrayEntries-server.ts +11 -13
- package/test/watch-array/components/output/ArrayIndexes-client.ts +19 -21
- package/test/watch-array/components/output/ArrayIndexes-server.ts +11 -13
- package/test/watch-array/components/output/ArrayUnkeyed-client.ts +19 -20
- package/test/watch-array/components/output/ArrayUnkeyed-server.ts +11 -13
- package/test/watch-array/components/temp/{Array-client-d048f5c224a3f2e2729878dbb069ce15ca913e12.ts → Array-client-552f81452d33fe6dc715c9f6bb7986f06475d761.ts} +19 -21
- package/test/watch-array/components/temp/Array-server-16921ef3289ecba5881fcd59e3353fbfad60d4d3.ts +20 -0
- package/test/watch-array/components/temp/{ArrayEntries-client-741607b276718f5deb520e3b657dbf6abbb8081c.ts → ArrayEntries-client-736755fba2492e74812ff9c905202810de54e15a.ts} +21 -23
- package/test/watch-array/components/temp/ArrayEntries-server-ac150fc9fd18c1d9dab9b329f7703e190f5c2725.ts +20 -0
- package/test/watch-array/components/temp/{ArrayIndexes-client-8ab14b254ef67dafad5228c9ec1906eb3b3babef.ts → ArrayIndexes-client-a496328fa92ffca676ab8893013a0cfec1734ad1.ts} +19 -21
- package/test/watch-array/components/temp/ArrayIndexes-server-e8fc511c0d27796dc1733f8cc63377f7a4511f76.ts +20 -0
- package/test/watch-array/components/temp/{ArrayUnkeyed-client-9684aba82757748815b94c04bf3f8d1f98332535.ts → ArrayUnkeyed-client-5a2c5cb1fecba52653f7f35cfd07627682930c15.ts} +19 -20
- package/test/watch-array/components/temp/ArrayUnkeyed-server-916a5cdb7c36d95946cafdc69dca782291af24e4.ts +20 -0
- package/test/watch-object/components/Watched.torp +5 -7
- package/test/watch-object/components/output/Watched-client.ts +7 -13
- package/test/watch-object/components/output/Watched-server.ts +8 -10
- package/test/watch-object/components/temp/{Watched-client-d26e846bbeb8271ec5dc2a1ceb75b362af44d3bd.ts → Watched-client-1f0409aa6e2c425d0319a23caec7d10ad313d579.ts} +7 -13
- package/test/watch-object/components/temp/Watched-server-156afd257b562162d86417f2bbf5afe1bf57de06.ts +16 -0
- package/test/watch-object/watch-object.test.ts +11 -9
- package/{tsup.config.ts → tsdown.config.ts} +2 -4
- package/dist/Component-CysAnHpO.d.cts +0 -8
- package/dist/Component-CysAnHpO.d.ts +0 -8
- package/dist/ServerSlotRender-t1sOutne.d.cts +0 -15
- package/dist/ServerSlotRender-t1sOutne.d.ts +0 -15
- package/dist/chunk-EGRHWZRV.js +0 -1
- package/dist/chunk-EGRHWZRV.js.map +0 -1
- package/dist/chunk-T6JGCJ5T.js +0 -45
- package/dist/chunk-T6JGCJ5T.js.map +0 -1
- package/dist/compile.cjs +0 -4074
- package/dist/compile.cjs.map +0 -1
- package/dist/compile.d.cts +0 -156
- package/dist/index.cjs +0 -895
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -208
- package/dist/metafile-cjs.json +0 -1
- package/dist/metafile-esm.json +0 -1
- package/dist/ssr.cjs +0 -106
- package/dist/ssr.cjs.map +0 -1
- package/dist/ssr.d.cts +0 -14
- package/src/compile/build/client/buildHeadNode.ts +0 -17
- package/src/compile/build/utils/isReactiveAttribute.ts +0 -16
- package/src/compile/types/nodes/isControlNode.ts +0 -6
- package/src/compile/types/nodes/isElementNode.ts +0 -6
- package/src/compile/types/nodes/isParentNode.ts +0 -6
- package/src/compile/types/nodes/isSpecialNode.ts +0 -6
- package/src/compile/types/nodes/isTextNode.ts +0 -6
- package/src/debug/printHtml.ts +0 -25
- package/src/render/getClasses.ts +0 -24
- package/src/render/getStyles.ts +0 -7
- package/src/render/isComment.ts +0 -3
- package/src/render/isText.ts +0 -3
- package/src/types/ProxyPropData.ts +0 -11
- package/src/watch/removeEffect.ts +0 -34
- package/test/attributes/components/temp/Attributes-server-80f9f58fd6cb30df11867386d4f0b15b44401ebe.ts +0 -18
- package/test/bench/components/temp/Bench-client-fca94b485c6263778751927240ab3ca4048d7a10.ts +0 -208
- package/test/bind/components/temp/BindComponent-client-6f650efb818a185ef33e1b071cfd77415a803dd3.ts +0 -93
- package/test/bind/components/temp/BindComponent-server-2e6caf0cbbb2831eb4bfbd7dcd6cf4d5c422d047.ts +0 -52
- package/test/bind/components/temp/BindText-server-807a1ddcb68410b30429cb088d2e204ed6f585b2.ts +0 -21
- package/test/child-component/components/temp/ParentChild-server-5e4a7fa5f4cd1c7dbe6866819025d2c03bfc62cb.ts +0 -39
- package/test/class/components/temp/Class-server-c24c01d0d3a98169172aba453c183c4152705be9.ts +0 -40
- package/test/component/components/temp/Component-server-57f59c74599572da6322a67cb97848cfbfcf6968.ts +0 -24
- package/test/component/components/temp/Header-server-6969d20782edd8f99d4b5c5b7b5563ce26e6dc2d.ts +0 -18
- package/test/console/components/temp/Console-server-cfb2208b130d5f15403df19ae8341aaa1c9ad33a.ts +0 -17
- package/test/const/components/temp/Const-server-1cf6ed84f72d3b15b318b80937b8de1f2c0f188c.ts +0 -20
- package/test/effects/components/temp/For-server-efe60939d185315f4c9b567b6867c6d5af14d9aa.ts +0 -22
- package/test/effects/components/temp/If-server-2424b7b812d350d7eb8ff9afb1146807217320cd.ts +0 -24
- package/test/effects/components/temp/NestedIf-server-ab260586490cb5afed31377d2226bb5a1fc30e2d.ts +0 -28
- package/test/events/components/temp/Increment-server-b084f43082e2ec31dbe5f9edc1cb6e37e4c8df9d.ts +0 -24
- package/test/for/components/temp/For-server-3b6ead39728c79206203c519a215390d07d80f7e.ts +0 -22
- package/test/for/components/temp/ForEscape-server-ed906c8cd593a0b467073ada415734de31dc38d9.ts +0 -24
- package/test/for/components/temp/ForIn-server-c8f13304a2ba235e091685256909fbfa50bdd5fd.ts +0 -22
- package/test/for/components/temp/ForOf-server-8c2c33ca6595bf0a5e952ca9971e595e18446623.ts +0 -22
- package/test/function/components/temp/Function-server-2b19d0cd881c31dc67132107c6e322a18701c318.ts +0 -27
- package/test/html/components/temp/Html-server-d159b0ef04b1f65ae4f9e05a7b44b21e7aa14cf9.ts +0 -17
- package/test/if/components/temp/IfAfterIf-server-a5005147e7902d1a5a048c9fe07feb9804eb6560.ts +0 -25
- package/test/if/components/temp/IfElse-server-80d93e5fc4ceba7a645f7081fa11b177dbe730d0.ts +0 -24
- package/test/if/components/temp/IfElseIf-server-ddc7348705d51b02538301e0aa704130748992cf.ts +0 -27
- package/test/if/components/temp/IfFalse-server-e8385013cfdde584b43cc0d71311cbb417859116.ts +0 -21
- package/test/if/components/temp/IfNested-server-285a5d8e0e0fcc8ccf421df152fdc00811782835.ts +0 -31
- package/test/mount/components/temp/Mount-server-62f94f276c2d6c9048765a77b575cb21146917f1.ts +0 -24
- package/test/on-mount/components/temp/OnMount-server-c531f718eb68754ea6c3001d5db9c07c511e434c.ts +0 -17
- package/test/party/components/temp/AnswerButton-server-928b5d447afa865fa09e0142c79bb1f2c1b86875.ts +0 -17
- package/test/party/components/temp/AnswerButtonApp-server-e4ea88e0f4d65508950594437e5e34424bd28897.ts +0 -38
- package/test/party/components/temp/ColorSelect-server-90f83722bd85155ebb2b8ccdaf053cd28d3152be.ts +0 -34
- package/test/party/components/temp/Colors-server-e13d49ba57f7b0dc6fb10a333ec872f5207e1ff0.ts +0 -23
- package/test/party/components/temp/Counter-server-7adf9376b38d97f1fd4b9c14108e6814e81f14ea.ts +0 -26
- package/test/party/components/temp/CssStyle-server-90a950501a20bfa5feac84ca6d97898c25bce2ed.ts +0 -17
- package/test/party/components/temp/DoubleCount-server-62c94483ebe9661e5ecc4f489787e32448ddcafa.ts +0 -25
- package/test/party/components/temp/FunnyButtonApp-server-80d85ede7da558154a5aa17cd602d6724bf1c9cb.ts +0 -36
- package/test/party/components/temp/HelloWorld-server-e0ed80e7531f303952a4af30d646263ff2e4ead6.ts +0 -17
- package/test/party/components/temp/InputFocused-server-ee70758a515227c04788be0e298a79c277994ccd.ts +0 -25
- package/test/party/components/temp/InputHello-server-1b9dd5442ded022abe92a9075ca5a4bb90486cbe.ts +0 -23
- package/test/party/components/temp/IsAvailable-server-123daa1ae56b77defe6666faddb44ba4252dd0fb.ts +0 -22
- package/test/party/components/temp/Name-server-a402418f1ca2d8a0e6403596ec03ec47b5ff40ec.ts +0 -22
- package/test/party/components/temp/NameUpdate-server-b7dcc875e894a5606544fcd78bda575ea07632ca.ts +0 -23
- package/test/party/components/temp/PageTitle-server-12dcb4e437aaef227c704a2ee8bbdee55ca323dc.ts +0 -27
- package/test/party/components/temp/PickPill-server-f10dae4708e36775a5e1a5ad10c6c0c309335009.ts +0 -23
- package/test/party/components/temp/TrafficLight-server-04bb3b2f11322ccc97a9a8a8fbb26c3c99843042.ts +0 -40
- package/test/party/components/temp/UserProfile-server-a0576b8d9dd15b3fab6c11758984c686ddfe2f66.ts +0 -23
- package/test/party/components/temp/UserProfileApp-server-86c204098fd0ffbeded50372354488768b255156.ts +0 -27
- package/test/party/components/temp/UserProfileContext-server-2d32476b00448bdec6c1c45aac5087a5152c2471.ts +0 -20
- package/test/party/components/temp/UserProfileContextApp-server-c970abaa8326db9a5efc3a5c64741743ae0dd1ca.ts +0 -33
- package/test/props/components/temp/Reactive-server-206bcc8984bad12c5712661b77d000216cdfe66d.ts +0 -40
- package/test/replace/components/temp/Replace-server-9519943d193b681e1d7894a0d7952affdfb0660c.ts +0 -22
- package/test/slots/components/temp/Article-server-b84141b05064f5ea1e4b535faafe459df0d875fb.ts +0 -28
- package/test/slots/components/temp/Basic-server-6b37594c9bf74e0c86a05b20213f69651e2cc937.ts +0 -33
- package/test/slots/components/temp/Header-server-d8e8ccb129d84478f0c4f8dc8ad1d2091188cc7b.ts +0 -22
- package/test/slots/components/temp/Let-server-8cad3b1199bec801bc3a1f2f3dbc20f2ef1e9741.ts +0 -36
- package/test/slots/components/temp/List-server-f4f63df4d19e15311da347284935a1bb530a8df4.ts +0 -26
- package/test/slots/components/temp/Named-server-2aac48bb8c7300d1a8858917fe81edc17c6372fa.ts +0 -43
- package/test/slots/components/temp/Unused-server-6e832928d7db6c43c556e7bda8af34ac37c0d4c1.ts +0 -22
- package/test/special-component/components/temp/BigTitle-server-d8919a4c975e022c936584bd668917cb89aa8e20.ts +0 -20
- package/test/special-component/components/temp/Component-server-14cd9beb57d6e833f75ab8c6624eb9841444ef63.ts +0 -43
- package/test/special-component/components/temp/SmallTitle-server-0a9b5098e4dda96f8c1da30294d71b39997dd118.ts +0 -20
- package/test/special-element/components/temp/Element-server-166d672256ef4635168de0090e490e48b569c7d6.ts +0 -17
- package/test/special-head/components/temp/Head-server-c0956653b544ff632e36da15d5f7623fa285953a.ts +0 -17
- package/test/special-self/components/temp/Self-server-b857c30c279a16dd81ad29567fb8abb9b2a0c239.ts +0 -27
- package/test/style/components/temp/Style-server-85720cb43e20ab000f98bc632c29454a51ae92d9.ts +0 -18
- package/test/svg/components/temp/Shape-server-9951ff1dcc7aa0827f28d3f8d970813767115ae3.ts +0 -24
- package/test/switch/components/temp/Switch-server-c1b5e1c657438ee3d8afdbf2166c5295cafc5604.ts +0 -38
- package/test/text/components/temp/Text-server-e37d33aa182f36461927d8ce36040bfd05e2f227.ts +0 -24
- package/test/watch-array/components/temp/Array-server-c907209008ac6177f614b62931a2bb1f1c3a04e1.ts +0 -22
- package/test/watch-array/components/temp/ArrayEntries-server-57c1ab0045fa4a02de95f69a65de6f54efe9850c.ts +0 -22
- package/test/watch-array/components/temp/ArrayIndexes-server-f093878b94a37617e2e697a786caa680f75630a7.ts +0 -22
- package/test/watch-array/components/temp/ArrayUnkeyed-server-c893fa024be07e5e7fce608c3ae456bdf2279dbe.ts +0 -22
- package/test/watch-object/components/temp/Watched-server-312fca1e769d7594fc5bb6295ccf55b544dd2f4d.ts +0 -18
- /package/src/compile/{build/utils → utils}/isFullyReactive.ts +0 -0
- /package/src/compile/{build/utils → utils}/isReactive.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,807 +1,873 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var context = {
|
|
10
|
-
activeEffect: null,
|
|
11
|
-
activeRange: null,
|
|
12
|
-
mountEffects: [],
|
|
13
|
-
stashedEvents: [],
|
|
14
|
-
stashedAnimations: [],
|
|
15
|
-
hydrationNode: null
|
|
16
|
-
//hn: null,
|
|
17
|
-
//get hydrationNode() {
|
|
18
|
-
// return this.hn;
|
|
19
|
-
//},
|
|
20
|
-
//set hydrationNode(value) {
|
|
21
|
-
// console.log(`set hydration ${printNode(value)}`);
|
|
22
|
-
// this.hn = value;
|
|
23
|
-
//},
|
|
24
|
-
};
|
|
25
|
-
var context_default = context;
|
|
26
|
-
|
|
27
|
-
// src/render/$mount.ts
|
|
1
|
+
import { $batch, $cache, $peek, COMPUTED_TYPE, EFFECT_TYPE, SIGNAL_TYPE, batchEnd, batchStart, buildClasses, buildStyles, checkComputed, context_default, formatText, runEffect, trackEffect } from "./formatText-B0FXBdFT.js";
|
|
2
|
+
|
|
3
|
+
//#region src/render/$mount.ts
|
|
4
|
+
/**
|
|
5
|
+
* Runs and re-runs a function on component mount
|
|
6
|
+
*
|
|
7
|
+
* @param fn The function to run, which may return a cleanup function
|
|
8
|
+
*/
|
|
28
9
|
function $mount(fn) {
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
10
|
+
context_default.mountEffects.push(fn);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/render/$run.ts
|
|
15
|
+
/**
|
|
16
|
+
* Runs and re-runs a function that depends on a watched object
|
|
17
|
+
*
|
|
18
|
+
* @param fn The function to run, which may return a cleanup function.
|
|
19
|
+
*/
|
|
20
|
+
function $run(fn, name) {
|
|
21
|
+
let effect = {
|
|
22
|
+
type: EFFECT_TYPE,
|
|
23
|
+
run: fn,
|
|
24
|
+
cleanup: void 0,
|
|
25
|
+
firstSource: null,
|
|
26
|
+
nextEffect: null,
|
|
27
|
+
extent: 0,
|
|
28
|
+
nextEffectToRun: null,
|
|
29
|
+
didError: false,
|
|
30
|
+
name
|
|
31
|
+
};
|
|
32
|
+
runEffect(effect);
|
|
33
|
+
return effect;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/watch/symbols.ts
|
|
38
|
+
const proxyDataSymbol = Symbol("_proxy_data");
|
|
39
|
+
const proxyHandledSymbol = Symbol("_proxy_handled");
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/render/$unwrap.ts
|
|
43
|
+
/**
|
|
44
|
+
* Returns the target object of a proxy
|
|
45
|
+
*
|
|
46
|
+
* @param object The proxy object
|
|
47
|
+
*/
|
|
61
48
|
function $unwrap(object) {
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
49
|
+
return object !== void 0 && object !== null && object[proxyDataSymbol] !== void 0 ? object[proxyDataSymbol].target ?? object : object;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/watch/trackProxyEffect.ts
|
|
54
|
+
function trackProxyEffect(data, key) {
|
|
55
|
+
let signal = data.signals.get(key);
|
|
56
|
+
if (signal === void 0) {
|
|
57
|
+
signal = {
|
|
58
|
+
type: SIGNAL_TYPE,
|
|
59
|
+
firstTarget: null,
|
|
60
|
+
nextSignalToUpdate: null
|
|
61
|
+
};
|
|
62
|
+
data.signals.set(key, signal);
|
|
63
|
+
}
|
|
64
|
+
trackEffect(signal);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/watch/updateSignal.ts
|
|
69
|
+
let lastEffect;
|
|
70
|
+
/**
|
|
71
|
+
* When a signal is changed, we need to
|
|
72
|
+
* - Set the signal's subscriptions to recalc
|
|
73
|
+
* - Set any dependent computed values to recalc
|
|
74
|
+
* - Gather dependent effects that will need to be re-run
|
|
75
|
+
*/
|
|
76
|
+
function updateSignal(proxy, key) {
|
|
77
|
+
let signal = proxy.signals.get(key);
|
|
78
|
+
if (signal !== void 0 && signal.firstTarget !== null) {
|
|
79
|
+
batchStart();
|
|
80
|
+
try {
|
|
81
|
+
if (context_default.firstSignalToUpdate === null) context_default.firstSignalToUpdate = signal;
|
|
82
|
+
else if (signal.nextSignalToUpdate === null) {
|
|
83
|
+
let lastSignal = context_default.firstSignalToUpdate;
|
|
84
|
+
while (lastSignal.nextSignalToUpdate !== null) lastSignal = lastSignal.nextSignalToUpdate;
|
|
85
|
+
lastSignal.nextSignalToUpdate = signal;
|
|
86
|
+
}
|
|
87
|
+
lastEffect = context_default.firstEffectToRun;
|
|
88
|
+
if (lastEffect !== null) while (lastEffect.nextEffectToRun !== null) lastEffect = lastEffect.nextEffectToRun;
|
|
89
|
+
let targetSub = signal.firstTarget;
|
|
90
|
+
let computed;
|
|
91
|
+
outer: while (true) {
|
|
92
|
+
targetSub.active = false;
|
|
93
|
+
targetSub.recalc = true;
|
|
94
|
+
const target = targetSub.target;
|
|
95
|
+
if (target.type === EFFECT_TYPE) {
|
|
96
|
+
if (lastEffect === null) {
|
|
97
|
+
context_default.firstEffectToRun = target;
|
|
98
|
+
lastEffect = target;
|
|
99
|
+
} else if (target.nextEffectToRun === null && lastEffect !== target) {
|
|
100
|
+
lastEffect.nextEffectToRun = target;
|
|
101
|
+
lastEffect = target;
|
|
102
|
+
}
|
|
103
|
+
} else if (!target.recalc) {
|
|
104
|
+
target.recalc = true;
|
|
105
|
+
if (target.firstTarget !== null) {
|
|
106
|
+
computed = target;
|
|
107
|
+
computed.rollback = targetSub;
|
|
108
|
+
targetSub = target.firstTarget;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
while (targetSub.nextTarget === null && computed !== void 0) {
|
|
113
|
+
targetSub = computed.rollback;
|
|
114
|
+
if (targetSub.source.type !== COMPUTED_TYPE) {
|
|
115
|
+
computed = void 0;
|
|
116
|
+
continue outer;
|
|
117
|
+
}
|
|
118
|
+
computed = targetSub.source;
|
|
119
|
+
}
|
|
120
|
+
if (targetSub.nextTarget === null) break;
|
|
121
|
+
targetSub = targetSub.nextTarget;
|
|
122
|
+
}
|
|
123
|
+
} finally {
|
|
124
|
+
batchEnd();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/watch/proxyGet.ts
|
|
131
|
+
function proxyGet(target, key, receiver) {
|
|
132
|
+
let data = target[proxyDataSymbol];
|
|
133
|
+
if (key === proxyDataSymbol) return data;
|
|
134
|
+
let signal = data.signals.get(key);
|
|
135
|
+
if (signal === void 0) {
|
|
136
|
+
const propDescriptor = Object.getOwnPropertyDescriptor(target, key);
|
|
137
|
+
if (propDescriptor !== void 0) {
|
|
138
|
+
if (propDescriptor.writable) {
|
|
139
|
+
if (data.shallow !== true) {
|
|
140
|
+
const value = target[key];
|
|
141
|
+
if (value !== void 0 && value !== null && typeof value === "object" && value[proxyDataSymbol] === void 0 && value.then === void 0) target[key] = $watch(value);
|
|
142
|
+
}
|
|
143
|
+
trackProxyEffect(data, key);
|
|
144
|
+
} else if (propDescriptor.get) {
|
|
145
|
+
const oldRegisterComputed = context_default.registerComputed;
|
|
146
|
+
try {
|
|
147
|
+
context_default.registerComputed = (computed) => {
|
|
148
|
+
data.signals.set(key, computed);
|
|
149
|
+
};
|
|
150
|
+
return Reflect.get(target, key, receiver);
|
|
151
|
+
} finally {
|
|
152
|
+
context_default.registerComputed = oldRegisterComputed;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
} else if (data.isArray) {
|
|
156
|
+
if (arrayWrapper[key] !== void 0) return arrayWrapper[key](data, target, key);
|
|
157
|
+
}
|
|
158
|
+
} else if (signal.type === SIGNAL_TYPE) trackProxyEffect(data, key);
|
|
159
|
+
else if (signal.type === COMPUTED_TYPE) {
|
|
160
|
+
if (signal.running) throw new Error("Cycle detected");
|
|
161
|
+
else if (signal.recalc) checkComputed(signal);
|
|
162
|
+
else if (signal.didError) throw signal.value;
|
|
163
|
+
else trackEffect(signal);
|
|
164
|
+
return signal.value;
|
|
165
|
+
}
|
|
166
|
+
return Reflect.get(target, key, receiver);
|
|
167
|
+
}
|
|
168
|
+
const arrayWrapper = {
|
|
169
|
+
[Symbol.iterator]: function(data, target, key) {
|
|
170
|
+
trackProxyEffect(data, "length");
|
|
171
|
+
context_default.activeTarget = null;
|
|
172
|
+
return target[key];
|
|
173
|
+
},
|
|
174
|
+
pop: arrayHandle,
|
|
175
|
+
push: arrayHandle,
|
|
176
|
+
reverse: arrayHandle,
|
|
177
|
+
shift: arrayHandle,
|
|
178
|
+
sort: arrayHandle,
|
|
179
|
+
splice: arrayHandle,
|
|
180
|
+
unshift: arrayHandle
|
|
181
|
+
};
|
|
182
|
+
function arrayHandle(data, target, key) {
|
|
183
|
+
return function(...args) {
|
|
184
|
+
const result = target[key].apply(target, args);
|
|
185
|
+
updateSignal(data, "length");
|
|
186
|
+
return result;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/watch/proxySet.ts
|
|
192
|
+
function proxySet(target, key, value, receiver) {
|
|
193
|
+
const oldValue = target[key];
|
|
194
|
+
if (value !== oldValue) {
|
|
195
|
+
if (context_default.batchOperation > 100) throw new Error("Cycle detected");
|
|
196
|
+
let data = target[proxyDataSymbol];
|
|
197
|
+
if (oldValue && oldValue[proxyDataSymbol] !== void 0) value = $watch(value, { shallow: oldValue[proxyDataSymbol].shallow });
|
|
198
|
+
Reflect.set(target, key, value, receiver);
|
|
199
|
+
updateSignal(data, key);
|
|
200
|
+
if (data.isArray && !isNaN(+String(key))) updateSignal(data, "length");
|
|
201
|
+
}
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region src/render/$watch.ts
|
|
207
|
+
/**
|
|
208
|
+
* Watches an object and runs effects when its properties are changed
|
|
209
|
+
*
|
|
210
|
+
* @param object The object to watch
|
|
211
|
+
*/
|
|
202
212
|
function $watch(object, options) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
};
|
|
220
|
-
return new Proxy(object, handler);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// src/render/addAnimation.ts
|
|
213
|
+
if (object === void 0 || object === null || object[proxyDataSymbol] !== void 0) return object;
|
|
214
|
+
object[proxyDataSymbol] = {
|
|
215
|
+
target: object,
|
|
216
|
+
isArray: Array.isArray(object),
|
|
217
|
+
shallow: options?.shallow === true,
|
|
218
|
+
signals: /* @__PURE__ */ new Map()
|
|
219
|
+
};
|
|
220
|
+
const handler = {
|
|
221
|
+
get: proxyGet,
|
|
222
|
+
set: proxySet
|
|
223
|
+
};
|
|
224
|
+
return new Proxy(object, handler);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/render/addAnimation.ts
|
|
224
229
|
function addAnimation(el, entry, exit) {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
context_default.stashedAnimations.push({
|
|
231
|
+
range: context_default.activeRange,
|
|
232
|
+
el,
|
|
233
|
+
in: entry,
|
|
234
|
+
out: exit
|
|
235
|
+
});
|
|
231
236
|
}
|
|
232
237
|
|
|
233
|
-
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/render/addEvent.ts
|
|
234
240
|
function addEvent(el, type, listener) {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
241
|
+
context_default.stashedEvents.push({
|
|
242
|
+
range: context_default.activeRange,
|
|
243
|
+
el,
|
|
244
|
+
type,
|
|
245
|
+
listener
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/motion/animate.ts
|
|
251
|
+
/**
|
|
252
|
+
* Adds an animation for an element
|
|
253
|
+
* @param el The element to animate
|
|
254
|
+
* @param enter Whether the animation is being run on enter
|
|
255
|
+
* @param keyframes The Web Animation API keyframes
|
|
256
|
+
* @param options The Web Animmation API options
|
|
257
|
+
*/
|
|
239
258
|
async function animate(el, enter, keyframes, options) {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
259
|
+
let animationOptions = Object.assign({
|
|
260
|
+
direction: enter ? "normal" : "reverse",
|
|
261
|
+
duration: 300,
|
|
262
|
+
easing: "ease-in-out",
|
|
263
|
+
fill: "forwards"
|
|
264
|
+
}, options);
|
|
265
|
+
const animation = el.animate(keyframes, animationOptions);
|
|
266
|
+
setTimeout(() => {
|
|
267
|
+
animation.timeline = el.ownerDocument.timeline;
|
|
268
|
+
}, 1);
|
|
269
|
+
let activeRange = context_default.activeRange;
|
|
270
|
+
if (activeRange) {
|
|
271
|
+
activeRange.animations ??= /* @__PURE__ */ new Set();
|
|
272
|
+
activeRange.animations.add(animation);
|
|
273
|
+
await animation.finished;
|
|
274
|
+
activeRange.animations.delete(animation);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/render/isFragmentNode.ts
|
|
280
|
+
function isFragmentNode(node) {
|
|
281
|
+
return node.nodeType === 11;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/render/addFragment.ts
|
|
265
286
|
function addFragment(fragment, parent, before, endNode) {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
if (animation.out) {
|
|
307
|
-
return () => {
|
|
308
|
-
animate(animation.el, false, animation.out.keyframes, animation.out.options);
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
context_default.stashedAnimations.length = 0;
|
|
314
|
-
context_default.activeRange = range;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
// src/render/applyProps.ts
|
|
287
|
+
const range = context_default.activeRange;
|
|
288
|
+
const hydrationNode = context_default.hydrationNode;
|
|
289
|
+
if (hydrationNode !== null) range.endNode = endNode ?? hydrationNode;
|
|
290
|
+
else {
|
|
291
|
+
range.startNode = fragment.firstChild;
|
|
292
|
+
range.endNode = fragment.lastChild;
|
|
293
|
+
}
|
|
294
|
+
parent = before?.parentNode ?? parent;
|
|
295
|
+
if (hydrationNode === null) parent.insertBefore(fragment, before);
|
|
296
|
+
if (!isFragmentNode(parent)) {
|
|
297
|
+
if (hydrationNode === null) {
|
|
298
|
+
for (let effect of context_default.mountEffects) $run(effect);
|
|
299
|
+
context_default.mountEffects.length = 0;
|
|
300
|
+
}
|
|
301
|
+
for (let event of context_default.stashedEvents) {
|
|
302
|
+
context_default.activeRange = event.range;
|
|
303
|
+
$run(function addFragmentEvent() {
|
|
304
|
+
event.el.addEventListener(event.type, event.listener);
|
|
305
|
+
return () => {
|
|
306
|
+
event.el.removeEventListener(event.type, event.listener);
|
|
307
|
+
};
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
context_default.stashedEvents.length = 0;
|
|
311
|
+
for (let animation of context_default.stashedAnimations) {
|
|
312
|
+
context_default.activeRange = animation.range;
|
|
313
|
+
$run(function addFragmentAnimation() {
|
|
314
|
+
if (animation.in !== void 0) animate(animation.el, true, animation.in.keyframes, animation.in.options);
|
|
315
|
+
if (animation.out !== void 0) return () => {
|
|
316
|
+
animate(animation.el, false, animation.out.keyframes, animation.out.options);
|
|
317
|
+
};
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
context_default.stashedAnimations.length = 0;
|
|
321
|
+
context_default.activeRange = range;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
//#endregion
|
|
326
|
+
//#region src/render/applyProps.ts
|
|
319
327
|
function applyProps(el, props, propNamesUsed) {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
// src/render/clearRange.ts
|
|
328
|
+
if (props !== void 0) {
|
|
329
|
+
for (let [name, value] of Object.entries(props)) if (!propNamesUsed.includes(name)) if (name.startsWith("on")) {
|
|
330
|
+
const eventName = name.substring(2);
|
|
331
|
+
el.addEventListener(eventName, value);
|
|
332
|
+
} else $run(function setAttribute$1() {
|
|
333
|
+
el.setAttribute(name, value);
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/render/clearRange.ts
|
|
337
340
|
function clearRange(range) {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
if (range.animations) {
|
|
356
|
-
for (let animation of range.animations) {
|
|
357
|
-
animations.push(animation);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
if (range.children) {
|
|
361
|
-
for (let child of range.children) {
|
|
362
|
-
clearEffects(child, animations);
|
|
363
|
-
}
|
|
364
|
-
range.children.length = 0;
|
|
365
|
-
}
|
|
341
|
+
let animations = range.animations !== null ? Array.from(range.animations) : void 0;
|
|
342
|
+
let childRange = range.nextRange;
|
|
343
|
+
while (childRange !== null && childRange.depth > range.depth) {
|
|
344
|
+
if (childRange.animations !== null) {
|
|
345
|
+
animations ??= [];
|
|
346
|
+
animations.push(...childRange.animations);
|
|
347
|
+
}
|
|
348
|
+
releaseRange(childRange);
|
|
349
|
+
childRange.depth = -2;
|
|
350
|
+
childRange = childRange.nextRange;
|
|
351
|
+
}
|
|
352
|
+
range.nextRange = childRange;
|
|
353
|
+
if (range.previousRange !== null) range.previousRange.nextRange = range.nextRange;
|
|
354
|
+
if (range.nextRange !== null) range.nextRange.previousRange = range.previousRange;
|
|
355
|
+
if (animations !== void 0) Promise.all(animations.map((a) => a.finished)).then(() => clearNodes(range));
|
|
356
|
+
else clearNodes(range);
|
|
366
357
|
}
|
|
367
358
|
function clearNodes(range) {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
359
|
+
if (range.startNode !== null && range.endNode !== null) {
|
|
360
|
+
let currentNode = range.endNode;
|
|
361
|
+
while (currentNode !== range.startNode) {
|
|
362
|
+
let previousNode = currentNode.previousSibling;
|
|
363
|
+
currentNode.remove();
|
|
364
|
+
currentNode = previousNode;
|
|
365
|
+
}
|
|
366
|
+
currentNode.remove();
|
|
367
|
+
}
|
|
368
|
+
releaseRange(range);
|
|
369
|
+
}
|
|
370
|
+
function releaseRange(range) {
|
|
371
|
+
range.startNode = null;
|
|
372
|
+
range.endNode = null;
|
|
373
|
+
range.previousRange = null;
|
|
374
|
+
range.nextRange = null;
|
|
375
|
+
range.animations = null;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/render/clearLayoutSlot.ts
|
|
385
380
|
function clearLayoutSlot(range) {
|
|
386
|
-
|
|
381
|
+
clearRange(range);
|
|
387
382
|
}
|
|
388
383
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
384
|
+
//#endregion
|
|
385
|
+
//#region src/render/newRange.ts
|
|
386
|
+
function newRange(name) {
|
|
387
|
+
return {
|
|
388
|
+
startNode: null,
|
|
389
|
+
endNode: null,
|
|
390
|
+
previousRange: null,
|
|
391
|
+
nextRange: null,
|
|
392
|
+
depth: -1,
|
|
393
|
+
animations: null,
|
|
394
|
+
name
|
|
395
|
+
};
|
|
399
396
|
}
|
|
400
397
|
|
|
401
|
-
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region src/render/popRange.ts
|
|
402
400
|
function popRange(oldRange) {
|
|
403
|
-
|
|
401
|
+
context_default.activeRange = oldRange;
|
|
404
402
|
}
|
|
405
403
|
|
|
406
|
-
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region src/render/pushRange.ts
|
|
407
406
|
function pushRange(range, toParent = false) {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
407
|
+
const activeRange = context_default.activeRange;
|
|
408
|
+
if (toParent) {
|
|
409
|
+
const previousRange = context_default.previousRange;
|
|
410
|
+
range.previousRange = previousRange;
|
|
411
|
+
const nextRange = previousRange.nextRange;
|
|
412
|
+
previousRange.nextRange = range;
|
|
413
|
+
range.nextRange = nextRange;
|
|
414
|
+
range.depth = activeRange.depth + 1;
|
|
415
|
+
}
|
|
416
|
+
context_default.activeRange = range;
|
|
417
|
+
context_default.previousRange = range;
|
|
418
|
+
return activeRange;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region src/render/fillLayoutSlot.ts
|
|
417
423
|
function fillLayoutSlot(component, slot, parent, anchor, $props, $context) {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
popRange(oldRange);
|
|
424
|
-
return range;
|
|
424
|
+
const range = newRange();
|
|
425
|
+
const oldRange = pushRange(range);
|
|
426
|
+
component(parent, anchor, $props, $context, { _: slot });
|
|
427
|
+
popRange(oldRange);
|
|
428
|
+
return range;
|
|
425
429
|
}
|
|
426
430
|
|
|
427
|
-
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region src/render/getFragment.ts
|
|
428
433
|
function getFragment(document, array, index, html, ns) {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
434
|
+
if (array[index] === void 0) if (ns === true) {
|
|
435
|
+
const template = document.createElementNS("http://www.w3.org/2000/svg", "template");
|
|
436
|
+
template.innerHTML = html;
|
|
437
|
+
const fragment = new DocumentFragment();
|
|
438
|
+
fragment.append(...template.childNodes);
|
|
439
|
+
array[index] = fragment;
|
|
440
|
+
} else {
|
|
441
|
+
const template = document.createElement("template");
|
|
442
|
+
template.innerHTML = html;
|
|
443
|
+
array[index] = template.content;
|
|
444
|
+
}
|
|
445
|
+
return array[index].cloneNode(true);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
//#endregion
|
|
449
|
+
//#region src/render/hydrate.ts
|
|
450
|
+
/**
|
|
451
|
+
* Hydrates a component into an existing DOM tree
|
|
452
|
+
* @param parent The parent node
|
|
453
|
+
* @param component The component to mount
|
|
454
|
+
* @param props An object containing component props
|
|
455
|
+
*/
|
|
447
456
|
function hydrate(parent, component, props, slots) {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
457
|
+
context_default.hydrationNode = parent.firstChild;
|
|
458
|
+
context_default.rootRange = newRange();
|
|
459
|
+
context_default.previousRange = context_default.rootRange;
|
|
460
|
+
pushRange(context_default.rootRange);
|
|
461
|
+
component(parent, null, props, void 0, slots);
|
|
462
|
+
context_default.hydrationNode = null;
|
|
463
|
+
for (let effect of context_default.mountEffects) $run(effect);
|
|
464
|
+
context_default.mountEffects.length = 0;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
//#endregion
|
|
468
|
+
//#region src/render/mount.ts
|
|
469
|
+
/**
|
|
470
|
+
* Mounts a component into a DOM node
|
|
471
|
+
*
|
|
472
|
+
* @param parent The node to mount the component into
|
|
473
|
+
* @param component The component to mount
|
|
474
|
+
* @param props An object containing component props
|
|
475
|
+
*/
|
|
458
476
|
function mount(parent, component, props, slots) {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
component(parent, null, props, void 0, slots);
|
|
477
|
+
if (parent.childElementCount > 0) throw new Error("The parent node must have no child elements");
|
|
478
|
+
while (parent.firstChild !== null) parent.firstChild.remove();
|
|
479
|
+
context_default.rootRange = newRange();
|
|
480
|
+
context_default.previousRange = context_default.rootRange;
|
|
481
|
+
pushRange(context_default.rootRange);
|
|
482
|
+
component(parent, null, props, void 0, slots);
|
|
466
483
|
}
|
|
467
484
|
|
|
468
|
-
|
|
485
|
+
//#endregion
|
|
486
|
+
//#region src/render/newListItem.ts
|
|
469
487
|
function newListItem(data, key) {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
488
|
+
return {
|
|
489
|
+
startNode: null,
|
|
490
|
+
endNode: null,
|
|
491
|
+
previousRange: null,
|
|
492
|
+
nextRange: null,
|
|
493
|
+
depth: -1,
|
|
494
|
+
animations: null,
|
|
495
|
+
data,
|
|
496
|
+
key
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region src/render/hydrationMarkers.ts
|
|
502
|
+
const HYDRATION_START = "[";
|
|
503
|
+
const HYDRATION_END = "]";
|
|
504
|
+
const HYDRATION_BREAK = "^";
|
|
505
|
+
|
|
506
|
+
//#endregion
|
|
507
|
+
//#region src/render/isCommentNode.ts
|
|
508
|
+
function isCommentNode(node) {
|
|
509
|
+
return node.nodeType === 8;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
//#endregion
|
|
513
|
+
//#region src/render/isTextNode.ts
|
|
514
|
+
function isTextNode(node) {
|
|
515
|
+
return node.nodeType === 3;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
//#endregion
|
|
519
|
+
//#region src/render/nodeCheckHydrationBreak.ts
|
|
520
|
+
/**
|
|
521
|
+
* When hydrating, removes and skips hydration comments that are inserted at the
|
|
522
|
+
* start of branches and used to split up text nodes that would otherwise be
|
|
523
|
+
* joined in HTML.
|
|
524
|
+
*
|
|
525
|
+
* @param node The node to check and maybe skip.
|
|
526
|
+
* @returns The next node.
|
|
527
|
+
*/
|
|
498
528
|
function nodeCheckHydrationBreak(node) {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
|
|
529
|
+
if (context_default.hydrationNode !== null) {
|
|
530
|
+
if (node !== null && isCommentNode(node) && node.data === HYDRATION_BREAK) {
|
|
531
|
+
let comment = node;
|
|
532
|
+
node = node.nextSibling;
|
|
533
|
+
comment.remove();
|
|
534
|
+
}
|
|
535
|
+
context_default.hydrationNode = node;
|
|
536
|
+
}
|
|
537
|
+
return node;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region src/render/nodeNext.ts
|
|
542
|
+
/**
|
|
543
|
+
* Gets the next sibling of a node.
|
|
544
|
+
*
|
|
545
|
+
* When hydrating, sets the hydration node.
|
|
546
|
+
*
|
|
547
|
+
* @param node The node.
|
|
548
|
+
* @param text Whether we require a text node.
|
|
549
|
+
*/
|
|
511
550
|
function nodeNext(node, text = false) {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
551
|
+
if (context_default.hydrationNode !== null && text && isTextNode(node)) return node;
|
|
552
|
+
return nodeCheckHydrationBreak(node.nextSibling);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
//#endregion
|
|
556
|
+
//#region src/render/nodeAnchor.ts
|
|
557
|
+
/**
|
|
558
|
+
* Gets the anchor node for a control statement or component.
|
|
559
|
+
*
|
|
560
|
+
* When mounting, this just returns the anchor node parameter (because it was
|
|
561
|
+
* created).
|
|
562
|
+
*
|
|
563
|
+
* When hydrating, there should be matched <![> and <!]> comments in the HTML,
|
|
564
|
+
* and the anchor node should be after the end comment. The matched comment
|
|
565
|
+
* nodes will be deleted, and the hydration node set to the first node inside
|
|
566
|
+
* the matched comments.
|
|
567
|
+
*
|
|
568
|
+
* @param node The potential anchor node.
|
|
569
|
+
* @returns The anchor node.
|
|
570
|
+
*/
|
|
520
571
|
function nodeAnchor(node) {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
572
|
+
if (context_default.hydrationNode !== null) {
|
|
573
|
+
if (isCommentNode(node) && node.data === HYDRATION_START) {
|
|
574
|
+
let currentNode = nodeNext(node);
|
|
575
|
+
node.remove();
|
|
576
|
+
let level = 1;
|
|
577
|
+
while (currentNode !== null) {
|
|
578
|
+
if (isCommentNode(currentNode)) {
|
|
579
|
+
if (currentNode.data === HYDRATION_START) level += 1;
|
|
580
|
+
else if (currentNode.data === HYDRATION_END) {
|
|
581
|
+
level -= 1;
|
|
582
|
+
if (level === 0) {
|
|
583
|
+
const endNode = currentNode.nextSibling;
|
|
584
|
+
currentNode.remove();
|
|
585
|
+
if (context_default.hydrationNode === currentNode) context_default.hydrationNode = endNode;
|
|
586
|
+
return endNode;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
currentNode = currentNode.nextSibling;
|
|
591
|
+
}
|
|
592
|
+
if (currentNode === null) throw new Error("End hydration comment not found");
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return node;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
//#endregion
|
|
599
|
+
//#region src/render/nodeChild.ts
|
|
600
|
+
/**
|
|
601
|
+
* Gets the first child of a node.
|
|
602
|
+
*
|
|
603
|
+
* Sets the hydration node.
|
|
604
|
+
*
|
|
605
|
+
* @param parent The parent node.
|
|
606
|
+
*/
|
|
553
607
|
function nodeChild(parent) {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
608
|
+
let childNode = parent.firstChild;
|
|
609
|
+
if (context_default.hydrationNode !== null) {
|
|
610
|
+
if (childNode === null) childNode = parent.appendChild(parent.ownerDocument.createTextNode(""));
|
|
611
|
+
context_default.hydrationNode = childNode;
|
|
612
|
+
}
|
|
613
|
+
return childNode;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
//#endregion
|
|
617
|
+
//#region src/render/nodeRoot.ts
|
|
618
|
+
/**
|
|
619
|
+
* Gets the first child in a fragment.
|
|
620
|
+
*
|
|
621
|
+
* When hydrating, also sets the active range's start node, while we have it.
|
|
622
|
+
*
|
|
623
|
+
* @param parent The parent of the fragment.
|
|
624
|
+
* @param text Whether we require a text node.
|
|
625
|
+
*/
|
|
565
626
|
function nodeRoot(parent, text = false) {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
|
|
627
|
+
if (context_default.hydrationNode !== null) {
|
|
628
|
+
let rootNode = context_default.hydrationNode;
|
|
629
|
+
if (text && !isTextNode(rootNode) && rootNode.previousSibling !== null && isTextNode(rootNode.previousSibling)) {
|
|
630
|
+
rootNode = rootNode.previousSibling;
|
|
631
|
+
context_default.hydrationNode = rootNode;
|
|
632
|
+
}
|
|
633
|
+
if (isCommentNode(rootNode) && rootNode.data === HYDRATION_START) {
|
|
634
|
+
rootNode = rootNode.nextSibling;
|
|
635
|
+
context_default.hydrationNode = rootNode;
|
|
636
|
+
}
|
|
637
|
+
const range = context_default.activeRange;
|
|
638
|
+
if (range.startNode === null) range.startNode = rootNode;
|
|
639
|
+
return rootNode;
|
|
640
|
+
} else return parent.firstChild;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
//#endregion
|
|
644
|
+
//#region src/render/nodeSkip.ts
|
|
645
|
+
/**
|
|
646
|
+
* Gets the sibling of a node, x nodes after it.
|
|
647
|
+
*
|
|
648
|
+
* When hydrating, sets the hydration node.
|
|
649
|
+
*
|
|
650
|
+
* @param node The node.
|
|
651
|
+
* @param count The number of nodes to skip.
|
|
652
|
+
*/
|
|
583
653
|
function nodeSkip(node, count) {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}
|
|
588
|
-
return nextNode;
|
|
654
|
+
let nextNode = node;
|
|
655
|
+
for (let i = 0; i < count; i++) nextNode = nodeCheckHydrationBreak(nextNode.nextSibling);
|
|
656
|
+
return nextNode;
|
|
589
657
|
}
|
|
590
658
|
|
|
591
|
-
|
|
659
|
+
//#endregion
|
|
660
|
+
//#region src/render/runControl.ts
|
|
661
|
+
/**
|
|
662
|
+
* Runs an`if`, `switch` or `await` control statement
|
|
663
|
+
* @param create A function that creates the control statement's branches
|
|
664
|
+
*/
|
|
592
665
|
function runControl(range, anchor, create) {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
const oldRange = pushRange(newRange(), true);
|
|
616
|
-
const oldEffect = context_default.activeEffect;
|
|
617
|
-
context_default.activeEffect = null;
|
|
618
|
-
create();
|
|
619
|
-
context_default.activeEffect = oldEffect;
|
|
620
|
-
popRange(oldRange);
|
|
621
|
-
range.index = index;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
// src/render/moveRange.ts
|
|
666
|
+
const oldRange = pushRange(range, true);
|
|
667
|
+
$run(function runControl$1() {
|
|
668
|
+
const oldBranchRange = pushRange(range);
|
|
669
|
+
create(anchor);
|
|
670
|
+
popRange(oldBranchRange);
|
|
671
|
+
});
|
|
672
|
+
if (context_default.hydrationNode) anchor = context_default.hydrationNode.nextSibling;
|
|
673
|
+
popRange(oldRange);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
//#endregion
|
|
677
|
+
//#region src/render/runControlBranch.ts
|
|
678
|
+
function runControlBranch(range, create) {
|
|
679
|
+
if (range.depth === -2) return;
|
|
680
|
+
if (range.nextRange !== null && range.nextRange.depth > range.depth) clearRange(range.nextRange);
|
|
681
|
+
const oldRange = pushRange(newRange(), true);
|
|
682
|
+
create();
|
|
683
|
+
popRange(oldRange);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
//#endregion
|
|
687
|
+
//#region src/render/moveRange.ts
|
|
625
688
|
function moveRange(parent, range, before) {
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
function runList(
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
popRange(oldRange);
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
// src/render/setAttribute.ts
|
|
689
|
+
parent = before?.parentNode ?? parent;
|
|
690
|
+
const endNode = range.endNode ?? range.startNode;
|
|
691
|
+
let currentNode = range.startNode;
|
|
692
|
+
while (currentNode !== null) {
|
|
693
|
+
const nextNode = currentNode.nextSibling;
|
|
694
|
+
parent.insertBefore(currentNode, before);
|
|
695
|
+
if (currentNode === endNode) break;
|
|
696
|
+
currentNode = nextNode;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
//#endregion
|
|
701
|
+
//#region src/render/runListItems.ts
|
|
702
|
+
/**
|
|
703
|
+
* @param range The list's range
|
|
704
|
+
* @param parent The parent DOM element
|
|
705
|
+
* @param anchor The DOM element to create new items before
|
|
706
|
+
* @param oldItems The list of current items
|
|
707
|
+
* @param newItems The list of future items
|
|
708
|
+
* @param create A function that creates the DOM elements for a new item
|
|
709
|
+
*/
|
|
710
|
+
function runListItems(range, parent, anchor, oldItems, newItems, create, update) {
|
|
711
|
+
let oldStartIndex = 0;
|
|
712
|
+
let oldEndIndex = oldItems.length - 1;
|
|
713
|
+
let oldStartItem = oldItems[0];
|
|
714
|
+
let oldEndItem = oldItems[oldEndIndex];
|
|
715
|
+
let newStartIndex = 0;
|
|
716
|
+
let newEndIndex = newItems.length - 1;
|
|
717
|
+
let newStartItem = newItems[0];
|
|
718
|
+
let newEndItem = newItems[newEndIndex];
|
|
719
|
+
let oldKeyToIndex;
|
|
720
|
+
let newKeyToIndex;
|
|
721
|
+
while (oldStartIndex <= oldEndIndex && newStartIndex <= newEndIndex) if (oldStartItem === null) oldStartItem = oldItems[++oldStartIndex];
|
|
722
|
+
else if (oldEndItem === null) oldEndItem = oldItems[--oldEndIndex];
|
|
723
|
+
else if (newStartItem === null) newStartItem = newItems[++newStartIndex];
|
|
724
|
+
else if (newEndItem === null) newEndItem = newItems[--newEndIndex];
|
|
725
|
+
else if (oldStartItem.key === newStartItem.key) {
|
|
726
|
+
transferListItemData(oldStartItem, newStartItem, update);
|
|
727
|
+
oldStartItem = oldItems[++oldStartIndex];
|
|
728
|
+
newStartItem = newItems[++newStartIndex];
|
|
729
|
+
} else if (oldEndItem.key === newEndItem.key) {
|
|
730
|
+
transferListItemData(oldEndItem, newEndItem, update);
|
|
731
|
+
oldEndItem = oldItems[--oldEndIndex];
|
|
732
|
+
newEndItem = newItems[--newEndIndex];
|
|
733
|
+
} else if (oldStartItem.key === newEndItem.key) {
|
|
734
|
+
moveRange(parent, oldStartItem, oldEndItem.endNode.nextSibling);
|
|
735
|
+
transferListItemData(oldStartItem, newEndItem, update);
|
|
736
|
+
oldStartItem = oldItems[++oldStartIndex];
|
|
737
|
+
newEndItem = newItems[--newEndIndex];
|
|
738
|
+
} else if (oldEndItem.key === newStartItem.key) {
|
|
739
|
+
moveRange(parent, oldEndItem, oldStartItem.startNode);
|
|
740
|
+
transferListItemData(oldEndItem, newStartItem, update);
|
|
741
|
+
oldEndItem = oldItems[--oldEndIndex];
|
|
742
|
+
newStartItem = newItems[++newStartIndex];
|
|
743
|
+
} else {
|
|
744
|
+
if (oldKeyToIndex === void 0 || newKeyToIndex === void 0) {
|
|
745
|
+
oldKeyToIndex = /* @__PURE__ */ new Map();
|
|
746
|
+
for (let i = oldStartIndex; i < oldEndIndex; i++) oldKeyToIndex.set(oldItems[i].key, i);
|
|
747
|
+
newKeyToIndex = /* @__PURE__ */ new Map();
|
|
748
|
+
for (let i = newStartIndex; i < newEndIndex; i++) newKeyToIndex.set(newItems[i].key, i);
|
|
749
|
+
}
|
|
750
|
+
let oldIndex = oldKeyToIndex.get(newStartItem.key);
|
|
751
|
+
let newIndex = newKeyToIndex.get(oldStartItem.key);
|
|
752
|
+
if (oldIndex === void 0 && newIndex === void 0) {
|
|
753
|
+
newStartItem.data = $watch(newStartItem.data, { shallow: true });
|
|
754
|
+
create(newStartItem, oldStartItem.startNode);
|
|
755
|
+
newStartItem.previousRange = oldStartItem.previousRange;
|
|
756
|
+
newStartItem.nextRange = oldStartItem;
|
|
757
|
+
oldStartItem.previousRange = newStartItem;
|
|
758
|
+
clearRange(oldStartItem);
|
|
759
|
+
oldStartItem = oldItems[++oldStartIndex];
|
|
760
|
+
newStartItem = newItems[++newStartIndex];
|
|
761
|
+
} else if (oldIndex === void 0) {
|
|
762
|
+
newStartItem.data = $watch(newStartItem.data, { shallow: true });
|
|
763
|
+
create(newStartItem, oldStartItem.startNode);
|
|
764
|
+
newStartItem = newItems[++newStartIndex];
|
|
765
|
+
} else if (newIndex === void 0) {
|
|
766
|
+
clearRange(oldStartItem);
|
|
767
|
+
oldStartItem = oldItems[++oldStartIndex];
|
|
768
|
+
} else {
|
|
769
|
+
const oldData = oldItems[oldIndex];
|
|
770
|
+
moveRange(parent, oldData, oldStartItem.startNode);
|
|
771
|
+
transferListItemData(oldData, newStartItem, update);
|
|
772
|
+
oldItems[oldIndex] = null;
|
|
773
|
+
newStartItem = newItems[++newStartIndex];
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
if (oldStartIndex <= oldEndIndex || newStartIndex <= newEndIndex) if (oldStartIndex > oldEndIndex) {
|
|
777
|
+
let before = oldStartItem?.startNode ?? oldItems[oldItems.length - 1]?.endNode?.nextSibling ?? anchor;
|
|
778
|
+
for (; newStartIndex <= newEndIndex; newStartItem = newItems[++newStartIndex]) {
|
|
779
|
+
newStartItem.data = $watch(newStartItem.data, { shallow: true });
|
|
780
|
+
create(newStartItem, before);
|
|
781
|
+
before = newStartItem.endNode.nextSibling;
|
|
782
|
+
}
|
|
783
|
+
} else for (; oldEndIndex >= oldStartIndex; oldStartItem = oldItems[oldEndIndex--]) clearRange(oldStartItem);
|
|
784
|
+
if (newItems.length > 0) range.nextRange = newItems[0];
|
|
785
|
+
else if (oldItems.length > 0) range.nextRange = oldItems[oldItems.length - 1].nextRange;
|
|
786
|
+
}
|
|
787
|
+
function transferListItemData(oldItem, newItem, update) {
|
|
788
|
+
newItem.startNode = oldItem.startNode;
|
|
789
|
+
newItem.endNode = oldItem.endNode;
|
|
790
|
+
update(oldItem, newItem);
|
|
791
|
+
newItem.data = oldItem.data;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
//#endregion
|
|
795
|
+
//#region src/render/runList.ts
|
|
796
|
+
/**
|
|
797
|
+
* Runs a `for` control statement
|
|
798
|
+
* @param create A function that creates the control statement's branches
|
|
799
|
+
*/
|
|
800
|
+
function runList(range, parent, anchor, buildItems, create, update) {
|
|
801
|
+
const oldRange = pushRange(range, true);
|
|
802
|
+
let listItems = [];
|
|
803
|
+
$run(function runList$1() {
|
|
804
|
+
const oldBranchRange = pushRange(range);
|
|
805
|
+
const newItems = buildItems();
|
|
806
|
+
context_default.activeTarget = null;
|
|
807
|
+
runListItems(range, parent, anchor, listItems, newItems, create, update);
|
|
808
|
+
listItems = newItems;
|
|
809
|
+
popRange(oldBranchRange);
|
|
810
|
+
});
|
|
811
|
+
if (context_default.hydrationNode !== null) anchor = context_default.hydrationNode.nextSibling;
|
|
812
|
+
popRange(oldRange);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
//#endregion
|
|
816
|
+
//#region src/render/setAttribute.ts
|
|
758
817
|
function setAttribute(el, name, value) {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
} else {
|
|
762
|
-
el.setAttribute(name, value);
|
|
763
|
-
}
|
|
818
|
+
if (value === false || value === void 0 || value === null) el.removeAttribute(name);
|
|
819
|
+
else el.setAttribute(name, value);
|
|
764
820
|
}
|
|
765
821
|
|
|
766
|
-
|
|
822
|
+
//#endregion
|
|
823
|
+
//#region src/render/setDynamicElement.ts
|
|
767
824
|
function setDynamicElement(el, tag) {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
825
|
+
if (context_default.hydrationNode !== null) return el;
|
|
826
|
+
let newElement = el.ownerDocument.createElement(tag);
|
|
827
|
+
el.replaceWith(newElement);
|
|
828
|
+
return newElement;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
//#endregion
|
|
832
|
+
//#region src/wrappers/ReactiveDate.ts
|
|
833
|
+
let initialized = false;
|
|
834
|
+
/**
|
|
835
|
+
* Wraps a Date object for $watching.
|
|
836
|
+
*/
|
|
837
|
+
var ReactiveDate = class ReactiveDate extends Date {
|
|
838
|
+
constructor(...params) {
|
|
839
|
+
super(...params);
|
|
840
|
+
if (!initialized) this.#init();
|
|
841
|
+
this[proxyHandledSymbol] = true;
|
|
842
|
+
this[proxyDataSymbol] = {
|
|
843
|
+
target: this,
|
|
844
|
+
isArray: false,
|
|
845
|
+
shallow: true,
|
|
846
|
+
signals: /* @__PURE__ */ new Map()
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
#init() {
|
|
850
|
+
initialized = true;
|
|
851
|
+
let reactivePrototype = ReactiveDate.prototype;
|
|
852
|
+
let datePrototype = Date.prototype;
|
|
853
|
+
const methods = Object.getOwnPropertyNames(datePrototype);
|
|
854
|
+
for (const method of methods) {
|
|
855
|
+
if (method.startsWith("get") || method.startsWith("to") || method === "valueOf") reactivePrototype[method] = function(...args) {
|
|
856
|
+
const data = this[proxyDataSymbol];
|
|
857
|
+
const result = datePrototype[method].apply(this, args);
|
|
858
|
+
trackProxyEffect(data, "#time");
|
|
859
|
+
return result;
|
|
860
|
+
};
|
|
861
|
+
if (method.startsWith("set")) reactivePrototype[method] = function(...args) {
|
|
862
|
+
const data = this[proxyDataSymbol];
|
|
863
|
+
const result = datePrototype[method].apply(this, args);
|
|
864
|
+
updateSignal(data, "#time");
|
|
865
|
+
return result;
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
}
|
|
806
869
|
};
|
|
870
|
+
|
|
871
|
+
//#endregion
|
|
872
|
+
export { $batch, $cache, $mount, $peek, $run, $unwrap, $watch, ReactiveDate, clearLayoutSlot, fillLayoutSlot, hydrate, mount, addFragment as t_add_fragment, nodeAnchor as t_anchor, addAnimation as t_animate, applyProps as t_apply_props, setAttribute as t_attribute, nodeChild as t_child, buildClasses as t_class, setDynamicElement as t_dynamic, addEvent as t_event, formatText as t_fmt, getFragment as t_fragment, newListItem as t_list_item, nodeNext as t_next, popRange as t_pop_range, pushRange as t_push_range, newRange as t_range, nodeRoot as t_root, runControlBranch as t_run_branch, runControl as t_run_control, runList as t_run_list, nodeSkip as t_skip, buildStyles as t_style };
|
|
807
873
|
//# sourceMappingURL=index.js.map
|