@torpor/view 0.2.0 → 0.3.1
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 +31 -0
- package/README.md +27 -26
- package/dist/Component-C6Y3UwGs.d.cts +11 -0
- package/dist/Component-C6Y3UwGs.d.cts.map +1 -0
- 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/ServerSlotRender-COS6H8Yk.d.cts +41 -0
- package/dist/ServerSlotRender-COS6H8Yk.d.cts.map +1 -0
- package/dist/compile.cjs +3383 -3783
- package/dist/compile.cjs.map +1 -1
- package/dist/compile.d.cts +202 -148
- package/dist/compile.d.cts.map +1 -0
- package/dist/compile.d.ts +202 -148
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +3378 -3754
- package/dist/compile.js.map +1 -1
- package/dist/formatText-B0FXBdFT.js +410 -0
- package/dist/formatText-B0FXBdFT.js.map +1 -0
- package/dist/formatText-DufG5l83.cjs +500 -0
- package/dist/formatText-DufG5l83.cjs.map +1 -0
- package/dist/index.cjs +853 -873
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +371 -171
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +371 -171
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +819 -765
- package/dist/index.js.map +1 -1
- package/dist/ssr.cjs +29 -114
- package/dist/ssr.cjs.map +1 -1
- package/dist/ssr.d.cts +13 -8
- package/dist/ssr.d.cts.map +1 -0
- 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 +14 -15
- 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 +20 -42
- package/src/compile/build/client/buildControlNode.ts +5 -4
- package/src/compile/build/client/buildElementNode.ts +66 -71
- 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 +3 -3
- package/src/compile/build/server/buildServerCode.ts +57 -45
- package/src/compile/build/server/buildServerComponentNode.ts +10 -35
- package/src/compile/build/server/buildServerControlNode.ts +5 -2
- package/src/compile/build/server/buildServerElementNode.ts +15 -29
- package/src/compile/build/server/buildServerForNode.ts +3 -3
- package/src/compile/build/server/buildServerHtmlNode.ts +3 -3
- package/src/compile/build/server/buildServerIfNode.ts +3 -3
- package/src/compile/build/server/buildServerNode.ts +7 -6
- package/src/compile/build/server/buildServerReplaceNode.ts +3 -3
- 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 +5 -21
- package/src/compile/build/server/buildServerSpecialNode.ts +10 -13
- package/src/compile/build/server/buildServerSwitchNode.ts +3 -3
- 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 -9
- 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 +4 -0
- 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 +13 -6
- 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 +15 -24
- package/src/render/applyProps.ts +1 -1
- package/src/render/buildClasses.ts +2 -2
- 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 +2 -2
- package/src/render/isFragmentNode.ts +2 -2
- package/src/render/isTextNode.ts +2 -2
- package/src/render/mount.ts +12 -4
- package/src/render/moveRange.ts +4 -11
- package/src/render/newListItem.ts +4 -4
- package/src/render/newRange.ts +6 -5
- package/src/render/nodeAnchor.ts +3 -3
- package/src/render/nodeCheckHydrationBreak.ts +2 -2
- package/src/render/nodeChild.ts +2 -2
- package/src/render/nodeNext.ts +1 -1
- package/src/render/nodeRoot.ts +8 -3
- 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 +5 -2
- 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 +4 -2
- 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 +8 -11
- package/test/attributes/components/temp/{Attributes-client-4620a40099e57a7fdaab895b204d85881f6dbfb7.ts → Attributes-client-9b2935d7824ba501776fdc6c48861422c15b6a12.ts} +8 -20
- package/test/attributes/components/temp/{Attributes-server-f4c59f5e4757ce0113907389902499efc36cfe38.ts → Attributes-server-716db6e335e5a372a34dd931e5f358ee6d1869e5.ts} +8 -11
- 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 +2 -2
- package/test/await/components/output/Await-client.ts +25 -39
- package/test/await/components/output/Await-server.ts +9 -11
- package/test/await/components/temp/{Await-client-17b0e7c682fbff8518a440831620c1024b8be23a.ts → Await-client-e969f4bd0712acf259ddfaa5a3b3448307201fd2.ts} +25 -39
- package/test/await/components/temp/{Await-server-eb8d79f8abc791dd8e87f9713534cebf0eb2c854.ts → Await-server-614014fab69e234b8271088b10397cf0452d9a76.ts} +9 -11
- package/test/bench/components/Bench.torp +3 -3
- package/test/bench/components/output/Bench-client.ts +43 -252
- package/test/bench/components/output/Bench-server.ts +13 -26
- package/test/bench/components/temp/Bench-client-7f31596dafc8077370d8d90b1bb9b6e0208154e7.ts +205 -0
- package/test/bench/components/temp/Bench-server-341b20073668f4f2160cd2ba37847c7db15e1e0f.ts +129 -0
- package/test/bind/bind.test.ts +2 -2
- package/test/bind/component.test.ts +2 -2
- package/test/bind/components/output/BindComponent-client.ts +9 -19
- package/test/bind/components/output/BindComponent-server.ts +13 -18
- package/test/bind/components/output/BindText-client.ts +6 -13
- package/test/bind/components/output/BindText-server.ts +8 -10
- package/test/bind/components/temp/{BindComponent-client-a59ee6a598341c64c79be633ae7b22cb594dd0bc.ts → BindComponent-client-22eccb5354a2b0267841e015f3a2a0baf534bf89.ts} +9 -19
- package/test/bind/components/temp/{BindComponent-server-96120f1e75c77e02ba11ab719c225005e168d25f.ts → BindComponent-server-0da6ba90a409468fd1f7358f8198e96b7595ff80.ts} +13 -18
- package/test/bind/components/temp/{BindText-client-dac614203e672e51675b22a246983168a7c173ea.ts → BindText-client-7692ae1570533cc17e2186e9c7d4768529e4a2fe.ts} +6 -13
- package/test/bind/components/temp/{BindText-server-c713033ef787587f752fc8e6282e3a8faeee9a08.ts → BindText-server-6801c5f8e66a65405b45061bc037a011620c0591.ts} +8 -10
- package/test/build-server/build-server.test.ts +1 -0
- package/test/{if/components/temp/IfNested-client-f3045daba052e459add6e7f84e8d21ba7b0d81e4.ts → build-server/components/output/IfNested-client.ts} +23 -27
- package/test/{if/components/temp/IfNested-server-061ea3d56576a352be8a9db8424fae0f1d74cd36.ts → build-server/components/output/IfNested-server.ts} +6 -9
- 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 +2 -1
- package/test/buildOutputFiles.ts +3 -3
- package/test/child-component/child-component.test.ts +2 -2
- package/test/child-component/components/output/ParentChild-client.ts +9 -19
- package/test/child-component/components/output/ParentChild-server.ts +12 -18
- package/test/child-component/components/temp/{ParentChild-client-198e4ebc2ef5277ad7147f69d5879946fbe2d6ec.ts → ParentChild-client-2dfd600f7d409630d429a1d2d18c038bd08b08da.ts} +9 -19
- package/test/child-component/components/temp/{ParentChild-server-55e809830788ae740608136cf66664fc5434a9cd.ts → ParentChild-server-448d57c3229189c1d297d01dfb0f33646d280e90.ts} +12 -18
- package/test/class/class.test.ts +2 -2
- package/test/class/components/output/Class-client.ts +11 -29
- package/test/class/components/output/Class-server.ts +16 -19
- package/test/class/components/temp/{Class-client-7defac0b98d9c9f303670c0372e329e31823f163.ts → Class-client-5af6a50cd454ae019b2aa79457ba7ead83b8c056.ts} +11 -29
- package/test/class/components/temp/{Class-server-46563e9c3bf56b642ac496b60179decfd0b4e952.ts → Class-server-eb70ff01fbc7d6d53e16c3593ba021a6bf0317f9.ts} +16 -19
- 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 +7 -10
- package/test/component/components/output/Header-client.ts +6 -12
- package/test/component/components/output/Header-server.ts +7 -10
- package/test/component/components/temp/{Component-client-350d20784712c710929cc3ab34c6828b0ea338d8.ts → Component-client-fdc327499be0a01f987d0f2897baf022a247c77c.ts} +5 -10
- package/test/component/components/temp/{Component-server-2d4aa317e6c385036e07f4c3946fc18ba848c00d.ts → Component-server-f53221ac7b1c922ef10de2d1fe8fb534d0169fe7.ts} +7 -10
- 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 +7 -10
- 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/output/Const-client.ts +6 -11
- package/test/const/components/output/Const-server.ts +7 -10
- package/test/const/components/temp/{Const-client-b0293a037d9ed7b6ad4591c153723a3c26d46029.ts → Const-client-d1037557e7ef75a8fe06f56816e65883047e9421.ts} +6 -11
- package/test/const/components/temp/{Const-server-5fd2444a9ae7a676b7c4480e01e28f7f89624fdc.ts → Const-server-32ddc3617afe2324f17a4cff6c0f086df6694778.ts} +7 -10
- 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/context/components/output/ChildB-client.ts +27 -0
- 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/context/components/temp/ChildB-client-4b801099936c8aa013a1220f291375f67eba1acb.ts +27 -0
- 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/output/For-client.ts +18 -19
- package/test/effects/components/output/For-server.ts +6 -9
- package/test/effects/components/output/If-client.ts +14 -18
- package/test/effects/components/output/If-server.ts +6 -9
- package/test/effects/components/output/NestedIf-client.ts +22 -25
- package/test/effects/components/output/NestedIf-server.ts +6 -9
- package/test/effects/components/temp/{For-client-268e69779d5b744377af9b30df256a453adaf183.ts → For-client-7c7d7c0dba2547f816b9bd9c6a95d6873ec00ffd.ts} +18 -19
- package/test/effects/components/temp/{For-server-b15b01b4daaf50fd95de790102089eb930e84e9b.ts → For-server-9e2de4efaff38ecf6c8a169c629d83c385489ca1.ts} +6 -9
- package/test/effects/components/temp/{If-client-4df0e6fc27a6f7d60ce056fd65df687213f3a2f9.ts → If-client-f0480a98f80b32612d12765c6838ff6db5982e82.ts} +14 -18
- package/test/effects/components/temp/{If-server-0a213ea232e0225d5a8ecb012ad418136b86fbe7.ts → If-server-ab409671b5d4c918047394a37b6e96b0e17063ca.ts} +6 -9
- package/test/effects/components/temp/{NestedIf-client-bfd381672c51febbe2f101f19afd5f6ff570ce7e.ts → NestedIf-client-702deffd158f219c5da4199b563a62cd54385a7f.ts} +22 -25
- package/test/effects/components/temp/{NestedIf-server-6089abc72d6208e64d1818ddb624ad5c3f236afa.ts → NestedIf-server-40f6bfd99a7e75fb4f9f874adab77e5eed97c629.ts} +6 -9
- 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 +1 -1
- package/test/events/components/output/Increment-client.ts +7 -12
- package/test/events/components/output/Increment-server.ts +9 -11
- package/test/events/components/temp/{Increment-client-db2fd3376f12b186a4276eac470bf10b7bf2da19.ts → Increment-client-84c09711baf098c82ee226598ba7a36913616b75.ts} +7 -12
- package/test/events/components/temp/{Increment-server-062b9757192b84e5a6e247aa44e1e7887129293d.ts → Increment-server-e77c6b207023ac60e033ca542ee82473ef017f74.ts} +9 -11
- 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 +7 -10
- package/test/for/components/output/ForEscape-client.ts +23 -37
- package/test/for/components/output/ForEscape-server.ts +8 -10
- package/test/for/components/output/ForIn-client.ts +19 -20
- package/test/for/components/output/ForIn-server.ts +7 -10
- package/test/for/components/output/ForOf-client.ts +19 -20
- package/test/for/components/output/ForOf-server.ts +7 -10
- package/test/for/components/temp/{For-client-8ecb11a2f34c81f837bffdb88598da06d8c19158.ts → For-client-2f6b4b81670b0ba31b01176b4f61ebf321e945bb.ts} +19 -19
- package/test/for/components/temp/{For-server-082c156a9f047995bc55f9477295d8e3262614f5.ts → For-server-5144615e53d23da5062b7169e847e0777d068738.ts} +7 -10
- package/test/for/components/temp/{ForEscape-client-14e7648415d967cdc57bf03d176eb6b6dddf0fb2.ts → ForEscape-client-8d0fcc940851e687173b6a9129c3d83e0fc771ef.ts} +23 -37
- package/test/for/components/temp/{ForEscape-server-2db43ff8397ddbb114b5bff3d88a63728184a811.ts → ForEscape-server-b359d8d3e12bac290855a1b27387ddd963562c08.ts} +8 -10
- package/test/for/components/temp/{ForIn-client-25cd67f246a50fc6d926a8c66aa5e106f19578a8.ts → ForIn-client-fa0614a1c7b8aa6e8819ed91a518479fd80453ae.ts} +19 -20
- package/test/for/components/temp/{ForIn-server-fda7a21cbb8a7ad69c48d2a8533cc13fa98d54b6.ts → ForIn-server-5fd472a7a5a5c00b384791780025a0c3bdc9c41b.ts} +7 -10
- package/test/for/components/temp/{ForOf-client-8f6598ccd9dc7b79aff6167b90ccea94f3029c84.ts → ForOf-client-11006c4239d9018363e582dc5b54b50477d652e7.ts} +19 -20
- package/test/for/components/temp/{ForOf-server-cd2b01507304e25c34030755b915f56785375de8.ts → ForOf-server-197b29abcb60412c6c8670b2d4a2e644b650faa3.ts} +7 -10
- 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 +0 -1
- package/test/function/components/output/Function-client.ts +6 -12
- package/test/function/components/output/Function-server.ts +8 -11
- package/test/function/components/temp/{Function-client-2068eb8ae35b3157b8eda79addde6afd9f4d7006.ts → Function-client-ec5fe7d599d6099bdfab78c2a0c8edf77a23cd9b.ts} +6 -12
- package/test/function/components/temp/{Function-server-4b66a728f6f1b170d678313238bdc9158356511e.ts → Function-server-fee2402b0ef4ad4c3d2779afb190ce46dbedf737.ts} +8 -11
- 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 +7 -10
- 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 +2 -2
- package/test/if/components/output/IfAfterIf-client.ts +21 -23
- package/test/if/components/output/IfAfterIf-server.ts +6 -9
- package/test/if/components/output/IfElse-client.ts +14 -18
- package/test/if/components/output/IfElse-server.ts +6 -9
- package/test/if/components/output/IfElseIf-client.ts +16 -22
- package/test/if/components/output/IfElseIf-server.ts +6 -9
- package/test/if/components/output/IfFalse-client.ts +13 -16
- package/test/if/components/output/IfFalse-server.ts +6 -9
- package/test/if/components/output/IfNested-client.ts +23 -27
- package/test/if/components/output/IfNested-server.ts +6 -9
- package/test/if/components/temp/{IfAfterIf-client-6b4833209a01cdad18d453839e9c8b5dad2a8510.ts → IfAfterIf-client-c1cfd21a6ace4945703ba8f46aada923a60265d9.ts} +21 -23
- package/test/if/components/temp/{IfAfterIf-server-3e6a3beab27821c3e53290ee72eca811814aad38.ts → IfAfterIf-server-26c9a638e3933a53208bfe66f8f37067511a28aa.ts} +6 -9
- package/test/if/components/temp/{IfElse-client-f7eb8e5fe5e62975a2442c4b0ff3344fa44cef69.ts → IfElse-client-06dfcacd3a5225dcb0947587bcd4fae9ec3d3c1e.ts} +14 -18
- package/test/if/components/temp/{IfElse-server-1b5006dfad695f257c7453a79bde3944898fbf6d.ts → IfElse-server-146b3779f85ea02a281c6042dddefa5372945fb0.ts} +6 -9
- package/test/if/components/temp/{IfElseIf-client-734f1b2d9133294573770c1ffc2b589273498532.ts → IfElseIf-client-26df9a728c9cb712d5ac0235b4c99885f25545b8.ts} +16 -22
- package/test/if/components/temp/{IfElseIf-server-11c65065e9e5640ad65cd0c37af07f1e57c4f49c.ts → IfElseIf-server-f094cdb45bc0fcd3144ca493346994b2445d2ff0.ts} +6 -9
- package/test/if/components/temp/{IfFalse-client-8a388cb48b4a5879d491f57d1f2551834de1e72e.ts → IfFalse-client-de6fc8e9eb222153608490e6d172e9aae9000aa1.ts} +13 -16
- package/test/if/components/temp/{IfFalse-server-40d07bc07e5edffd7386fb6016cd025b98175219.ts → IfFalse-server-b6d3446fd7d4219d5cb3c1009dec76870e73fa30.ts} +6 -9
- 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 +10 -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 +7 -10
- 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/FunnyButton.torp +2 -2
- package/test/party/components/InputFocused.torp +1 -1
- package/test/party/components/UserProfile.torp +1 -1
- package/test/party/components/UserProfileApp.torp +1 -1
- package/test/party/components/UserProfileContextApp.torp +1 -1
- package/test/party/components/output/AnswerButton-client.ts +4 -10
- package/test/party/components/output/AnswerButton-server.ts +6 -9
- package/test/party/components/output/AnswerButtonApp-client.ts +6 -11
- package/test/party/components/output/AnswerButtonApp-server.ts +8 -10
- package/test/party/components/output/ColorSelect-client.ts +22 -26
- package/test/party/components/output/ColorSelect-server.ts +8 -10
- package/test/party/components/output/Colors-client.ts +19 -20
- package/test/party/components/output/Colors-server.ts +8 -10
- package/test/party/components/output/Counter-client.ts +7 -12
- package/test/party/components/output/Counter-server.ts +8 -10
- package/test/party/components/output/CssStyle-client.ts +5 -10
- package/test/party/components/output/CssStyle-server.ts +10 -10
- package/test/party/components/output/DoubleCount-client.ts +6 -11
- package/test/party/components/output/DoubleCount-server.ts +8 -10
- package/test/party/components/output/FunnyButton-client.ts +4 -10
- package/test/party/components/output/FunnyButton-server.ts +6 -8
- package/test/party/components/output/FunnyButtonApp-client.ts +7 -14
- package/test/party/components/output/FunnyButtonApp-server.ts +8 -12
- package/test/party/components/output/HelloWorld-client.ts +5 -10
- package/test/party/components/output/HelloWorld-server.ts +7 -10
- package/test/party/components/output/InputFocused-client.ts +6 -11
- package/test/party/components/output/InputFocused-server.ts +10 -13
- package/test/party/components/output/InputHello-client.ts +8 -13
- package/test/party/components/output/InputHello-server.ts +8 -10
- package/test/party/components/output/IsAvailable-client.ts +8 -13
- package/test/party/components/output/IsAvailable-server.ts +8 -10
- package/test/party/components/output/Name-client.ts +6 -11
- package/test/party/components/output/Name-server.ts +8 -10
- package/test/party/components/output/NameUpdate-client.ts +6 -11
- package/test/party/components/output/NameUpdate-server.ts +8 -10
- package/test/party/components/output/PageTitle-client.ts +6 -11
- package/test/party/components/output/PageTitle-server.ts +8 -10
- package/test/party/components/output/PickPill-client.ts +8 -13
- package/test/party/components/output/PickPill-server.ts +8 -10
- package/test/party/components/output/Time-client.ts +6 -11
- package/test/party/components/output/Time-server.ts +8 -10
- package/test/party/components/output/TrafficLight-client.ts +18 -26
- package/test/party/components/output/TrafficLight-server.ts +8 -10
- package/test/party/components/output/UserProfile-client.ts +6 -18
- package/test/party/components/output/UserProfile-server.ts +7 -10
- package/test/party/components/output/UserProfileApp-client.ts +6 -11
- package/test/party/components/output/UserProfileApp-server.ts +8 -11
- package/test/party/components/output/UserProfileContext-client.ts +7 -13
- package/test/party/components/output/UserProfileContext-server.ts +8 -9
- package/test/party/components/output/UserProfileContextApp-client.ts +7 -12
- package/test/party/components/output/UserProfileContextApp-server.ts +9 -11
- package/test/party/components/temp/{AnswerButton-client-890e28879c132eea21260eb82af832afc6a48507.ts → AnswerButton-client-df895c3e7a88fd7ede9f951fc9de2ed75c27a5cb.ts} +4 -10
- package/test/party/components/temp/{AnswerButton-server-01ffab9f6f92073640df2cf2cb5473407d82b24f.ts → AnswerButton-server-fa0e78b504a78d0e2dcd33a9a589f62e5b99c675.ts} +6 -9
- package/test/party/components/temp/{AnswerButtonApp-client-295a835cadf7e7ccec608f84ed01865dd8c73954.ts → AnswerButtonApp-client-4c05ef36b1c0e93370fb463643419928717fa701.ts} +6 -11
- package/test/party/components/temp/{AnswerButtonApp-server-b458692868307e6e08ad3deed9c2db542c28dee0.ts → AnswerButtonApp-server-062042691dabfa1a20d4088030c0b5bee1cd0be2.ts} +8 -10
- package/test/party/components/temp/{ColorSelect-client-5f74d3b38193a0c9b22317598cdbf2f56754ca2b.ts → ColorSelect-client-5db8d1b0924361fdb5efb867c14491402ec9668c.ts} +22 -26
- package/test/party/components/temp/{ColorSelect-server-cf0b1b533948a558e1705d9a7cca3c0b6ae8d315.ts → ColorSelect-server-8722b440cb7266a18a71b35c166be6dd6566fcec.ts} +8 -10
- package/test/party/components/temp/{Colors-client-806316cc5e01e8235c0b025cad34b1068addf5a5.ts → Colors-client-6d3ac693e85bdda50b8742282915997063a32769.ts} +19 -20
- package/test/party/components/temp/{Colors-server-b050714bfe752b88a99f6498f1b5c13abe6b56a5.ts → Colors-server-16572e26a55214c26683ce560b058b55d8c92685.ts} +8 -10
- package/test/party/components/temp/{Counter-client-006caeda8766cb17a161da0c6f58f006f8f16e8b.ts → Counter-client-0c604a107c5b84cdbf725f307dfe29d34f8a2cc8.ts} +7 -12
- package/test/party/components/temp/{Counter-server-931d36d8e4bcd114047bbfec8aa5f2fac0c2ce1e.ts → Counter-server-db18f030a6e02ab17708d6a17eb3e590965090e5.ts} +8 -10
- package/test/party/components/temp/{CssStyle-client-6ec06cbc4b34344234d289f6c4a9e427efff85a7.ts → CssStyle-client-2a642d115ad52539f97c051c34687b8d6d12b324.ts} +5 -10
- 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-8c013a97a08562deb6ad0f35e6e337203b0ddde9.ts → DoubleCount-server-5b04bb31269f9c8de6c25be427f57ab6e3d4dc19.ts} +8 -10
- package/test/party/components/temp/{FunnyButton-client-6d5662018a5a5529fd52ee82f7c88975b5c3355a.ts → FunnyButton-client-850dd3da0fa803c1bce5c53e88fcd2d48d279eb8.ts} +4 -10
- package/test/party/components/temp/{FunnyButton-server-3fd55a1e1dc71c183a6cea68e4c4693c988b7533.ts → FunnyButton-server-3df0067ec21476e7525d1c3de7099431c976f73b.ts} +6 -8
- package/test/party/components/temp/{FunnyButtonApp-client-1f2258b8488469d4704366bc49f5c171d8a854ae.ts → FunnyButtonApp-client-00300846d11a3d0a5a620c2ade87b935b7f0ebf8.ts} +7 -14
- package/test/party/components/temp/{FunnyButtonApp-server-6463d1c57adf61450d1415f0d76da4561ca3e798.ts → FunnyButtonApp-server-4cd83d2c71615fe4c905920e5ea836df4ed66c5e.ts} +8 -12
- 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-496d26bdeb6a168c4242e45f35d22e6ecbd211b9.ts → InputHello-client-f65a477624975b68b7aaa3614fbf198d4476480f.ts} +8 -13
- package/test/party/components/temp/{InputHello-server-a5fb3e0d8766c19d177a1f4d43d421c7da1b92ab.ts → InputHello-server-102d293d6c0fff7feda50d64bbd607df7d09393a.ts} +8 -10
- package/test/party/components/temp/{IsAvailable-client-491b92b5e21ebe1bbab47b2e422c35fb996b55e1.ts → IsAvailable-client-8767437fd92cf79713de5b00828e1502e38d79e3.ts} +8 -13
- package/test/party/components/temp/{IsAvailable-server-c0da3c019ef13617d2ab51353eb3360ddaae4189.ts → IsAvailable-server-2cf1e0d72df4bc194b5e00a1b415ba99f488525f.ts} +8 -10
- package/test/party/components/temp/{Name-client-62f0dab96aff130e81882099d7c0a111ba99cebd.ts → Name-client-08903a8df8bdff5288170d3c89658192956587a9.ts} +6 -11
- package/test/party/components/temp/{Name-server-0306b0c622d71323eb79a6b466d900380a0944f3.ts → Name-server-7d95226078ef4cd13b0ac6c5365ccbe4b8b9c0a2.ts} +8 -10
- package/test/party/components/temp/{NameUpdate-client-6ceb440637c99142bafcf8512eabf831c113b8c7.ts → NameUpdate-client-d65b2476c3721d2efddf9385a61433e2a2dd0d72.ts} +6 -11
- package/test/party/components/temp/{NameUpdate-server-a54ea11dc6b8f0b55d29ad29163cf27b9aa6ec40.ts → NameUpdate-server-9c901f861eddfde14440c2591dfafb2b1fb1993d.ts} +8 -10
- package/test/party/components/temp/{PageTitle-client-75fea3a37fb1213bc13f56160bb6779486b2e6e9.ts → PageTitle-client-c006df9a3e662488a1db089de53fd485c6b923e4.ts} +6 -11
- package/test/party/components/temp/{PageTitle-server-8b34f9af760ab39e20a60e10ee3185e70d92e42b.ts → PageTitle-server-f4676ec6feccaa03b89d52835c6635536eb885ef.ts} +8 -10
- package/test/party/components/temp/{PickPill-client-a1f48b5c28db87eb57f0ac1f6b4370e4b2952de7.ts → PickPill-client-af8357daf3f6633c7f451d0bddd72fefe786d5c3.ts} +8 -13
- package/test/party/components/temp/{PickPill-server-9596fdb8ff254cb4e1b99b714f3c5e8ea8aaa308.ts → PickPill-server-d8fb383bc25f7d26bb0153088a2ee19c765fc66b.ts} +8 -10
- package/test/party/components/temp/{Time-client-2013f274e90b45be3138727f2298305e1951131f.ts → Time-client-94380d45de7275a5cec98e5f58c15b74b13e9c3e.ts} +6 -11
- package/test/party/components/temp/{Time-server-da1cafe72c0f9a6dbf15a04dfa7282ae5187c101.ts → Time-server-3f71a83b6fd357b57e85344281454ee793024e7b.ts} +8 -10
- package/test/party/components/temp/{TrafficLight-client-d04c95686ec0ad8a9c54710773945e9904224d5e.ts → TrafficLight-client-12b20962b4146ef08fe0c37597441533c7699408.ts} +18 -26
- package/test/party/components/temp/{TrafficLight-server-6c0f66cdabfc7239b99665c3f7087462ee302e8a.ts → TrafficLight-server-625a774075633be88822f4d345e1421a77aba98a.ts} +8 -10
- package/test/party/components/temp/{UserProfile-client-a59466813b208664f35e6e394858c3d61e040644.ts → UserProfile-client-e5330b2c96bd8b225cb6291bc8b1d9f35c93307e.ts} +6 -18
- package/test/party/components/temp/{UserProfile-server-b10ec192e03dc818fe66dbd4aad14200e817e596.ts → UserProfile-server-6e89fd7f8ade8e8d64630e5da8361d7a1fa2ff5a.ts} +7 -10
- package/test/party/components/temp/{UserProfileApp-client-e0bfaa4ffed336c8be4b23dd81800501980c9938.ts → UserProfileApp-client-4c86e4f9a0d042f4f4811868f0146e872b17353c.ts} +6 -11
- package/test/party/components/temp/{UserProfileApp-server-4b308db466a80bcacd190aa71f86cf4d2b6f2873.ts → UserProfileApp-server-754d269451abf8fd04e519b8edde33d25c73ce28.ts} +8 -11
- package/test/party/components/temp/{UserProfileContext-client-7ef27199bd35b55b3dadd876174a2ef4b602b63f.ts → UserProfileContext-client-424131db3cc89ae4babe127b9108ffc5696c9e1d.ts} +7 -13
- package/test/party/components/temp/{UserProfileContext-server-df958e4fc2de2242c556ffa61ddb58aa395de50c.ts → UserProfileContext-server-e72e8ccee2703cce216f2368a1555d64acc2654c.ts} +8 -9
- package/test/party/components/temp/{UserProfileContextApp-client-b3ef357f481dfb940e1c726690d57567fde2dc23.ts → UserProfileContextApp-client-5f94a7ccf3e4542ea40d8046ad75eeb21005c55f.ts} +7 -12
- package/test/party/components/temp/{UserProfileContextApp-server-f8fe2b88db3d0dfa4dafd300006b25123cb8e3fb.ts → UserProfileContextApp-server-267ac147e0e59e53aeb6741a8cd0f3ef1216051f.ts} +9 -11
- package/test/preact.test.ts +2560 -0
- package/test/props/components/output/Reactive-client.ts +8 -17
- package/test/props/components/output/Reactive-server.ts +12 -16
- package/test/props/components/temp/{Reactive-client-21a24e3b0a76140567db8a01975317c9c0e0ad5a.ts → Reactive-client-9bc3643675fc563f96efb00bc3c4b843ba4b7f2e.ts} +8 -17
- package/test/props/components/temp/{Reactive-server-b6e37b5d3488ea74a260ca972906bfab30dde486.ts → Reactive-server-8a84d0fc1f375d91438d840ca9753e32d86366ac.ts} +12 -16
- package/test/props/reactive.test.ts +2 -2
- package/test/replace/components/output/Replace-client.ts +6 -14
- package/test/replace/components/output/Replace-server.ts +7 -9
- package/test/replace/components/temp/{Replace-client-aee34e2e40c6f4380b61e9c7c8df9af1897f06cc.ts → Replace-client-6f21ff3eb303bd5488d211087dc35fcf998d4e2a.ts} +6 -14
- package/test/replace/components/temp/{Replace-server-3521251fa687ce42af3128d22b129fe1ec6ed411.ts → Replace-server-b536cf6d792ae73aaa7f5ea04cda6858a07479f9.ts} +7 -9
- 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 +6 -8
- package/test/slots/components/output/Basic-client.ts +7 -14
- package/test/slots/components/output/Basic-server.ts +8 -12
- package/test/slots/components/output/Header-client.ts +4 -9
- package/test/slots/components/output/Header-server.ts +6 -8
- package/test/slots/components/output/Let-client.ts +7 -14
- package/test/slots/components/output/Let-server.ts +7 -11
- package/test/slots/components/output/List-client.ts +17 -16
- package/test/slots/components/output/List-server.ts +6 -8
- package/test/slots/components/output/Named-client.ts +9 -19
- package/test/slots/components/output/Named-server.ts +9 -14
- package/test/slots/components/output/Unused-client.ts +5 -10
- package/test/slots/components/output/Unused-server.ts +7 -10
- package/test/slots/components/temp/{Article-client-3f2da4b399f94ae8c329489e1ba0ba98196df9c5.ts → Article-client-0b674ee98ae7f85021bfb8b912f28e3c4b35e877.ts} +4 -8
- package/test/slots/components/temp/{Article-server-50fa458663f115c0e80a3a2846de4607d8748ecb.ts → Article-server-3db1718b70b86b456514b54ae17a597d07cc0ca9.ts} +6 -8
- package/test/slots/components/temp/{Basic-client-a2c4bf685d4b75d0395da427b7754c2a58374dd7.ts → Basic-client-196f7f0244dca0baeffb547eec55c089a108283d.ts} +7 -14
- package/test/slots/components/temp/{Basic-server-593e0ecbc8abbc90e8b06198698d244d110d97e2.ts → Basic-server-a22e6ec236b84e09d4d59c7abc4f0b22bf60f22c.ts} +8 -12
- package/test/slots/components/temp/{Header-client-d7418b71df5db36d58a73e909233863a6c03678b.ts → Header-client-e5c784d60469523803898ee4d8b85fb82a7b7c0b.ts} +4 -9
- package/test/slots/components/temp/{Header-server-d0f27afc4db322e605491e8f508e83f625e8dc38.ts → Header-server-3182d735443d9cf6a0cc7891919cc2c08df2aa8f.ts} +6 -8
- package/test/slots/components/temp/{Let-client-913f9dede92b68a3f4a13d1f56f99b3e08e01efe.ts → Let-client-645271fcd63cd500001c75740b22b1b387330657.ts} +7 -14
- package/test/slots/components/temp/{Let-server-f3c026e37c11628914c495083752d8cf285b2e85.ts → Let-server-b6d6e2012155c7533a0eb4ee0aaf00157a7d4493.ts} +7 -11
- package/test/slots/components/temp/{List-client-6bc2d267a8b2028a14b12b2c70feb7c6a47d6d64.ts → List-client-ee6047ac396dc0b6fce5e38af51c38093fae83a2.ts} +17 -16
- package/test/slots/components/temp/{List-server-8d9c174fc4b3b232f3a9fd2f59843481f023d913.ts → List-server-1ee246e864cdb31bb8f52cf4424b6ef0e9b41cf1.ts} +6 -8
- package/test/slots/components/temp/{Named-client-f6e7a984759ce8f50bc52dcf56f6f06cab925a80.ts → Named-client-559988562c5de1ae6017d2ad6de063f4363064b6.ts} +9 -19
- package/test/slots/components/temp/{Named-server-ac8d47db82d9a387c8baeee59b975bb810bad168.ts → Named-server-f2ce3d301e916ea38901a92185c25512b11d42d4.ts} +9 -14
- package/test/slots/components/temp/{Unused-client-ea0a096aa7a1c958f3bf807f35340b96f8a025ee.ts → Unused-client-52d1828bd28ebf7046a2e948a369563c0ea83b98.ts} +5 -10
- package/test/slots/components/temp/{Unused-server-1da99efc50ef70be0d9a0e5499353a17dc666936.ts → Unused-server-f5248f5cd4616c65eaf27c67385f13ed671accad.ts} +7 -10
- 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 +6 -8
- package/test/special-component/components/output/Component-client.ts +7 -15
- package/test/special-component/components/output/Component-server.ts +8 -11
- package/test/special-component/components/output/SmallTitle-client.ts +4 -8
- package/test/special-component/components/output/SmallTitle-server.ts +6 -8
- package/test/special-component/components/temp/{BigTitle-client-c4bd66406d55ce83ab4491c4114d563055e1c275.ts → BigTitle-client-cb3055f809aaf17bd1fa82748d039ac3730a8d44.ts} +4 -8
- package/test/special-component/components/temp/{BigTitle-server-34af54c15cf575163c1ff8e63978cf5257f2347c.ts → BigTitle-server-fef9d1e1deacfde2be4469c2e63a801b2e518dff.ts} +6 -8
- package/test/special-component/components/temp/{Component-client-c39c66cf5274445bb863fd759e0ef223613a9f3a.ts → Component-client-0eb9553b52acce2dfa564242295a4c57a38bd540.ts} +7 -15
- package/test/special-component/components/temp/{Component-server-ca4a2192477db4a32ad12f1a6a14d673717b0f7b.ts → Component-server-9d0fddeff790bfb2b6cfbcd2edf677837f5b8120.ts} +8 -11
- package/test/special-component/components/temp/{SmallTitle-client-e4b3e51243ca4f1efca21ac0f957b81e8bc93167.ts → SmallTitle-client-5a65b233be29395e9650f57d9708a33de1279af3.ts} +4 -8
- package/test/special-component/components/temp/{SmallTitle-server-6c9aabb9139356397e04612b4dd9d849f871a280.ts → SmallTitle-server-11f8b6b3c613716d6a5371883a9b55434bb43ad5.ts} +6 -8
- 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 +7 -10
- 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 -4
- package/test/special-head/components/output/Head-client.ts +8 -23
- package/test/special-head/components/output/Head-server.ts +5 -11
- 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/output/Self-client.ts +13 -17
- package/test/special-self/components/output/Self-server.ts +6 -9
- package/test/special-self/components/temp/{Self-client-883ca81e0e44df56f2290698e8d6b9955434a2ad.ts → Self-client-dfe57df69e3677e94f7b5f3657c82602054ef19e.ts} +13 -17
- package/test/special-self/components/temp/{Self-server-69dac409fc984db7db97df8a30c5de6794f25655.ts → Self-server-5d135dab2b6fd4ba7fe3f56768f0725607d36bd9.ts} +6 -9
- 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 +6 -12
- package/test/style/components/output/Style-server.ts +7 -10
- package/test/style/components/temp/{Style-client-ea018338497095f270308b2e73cfe6344721c6eb.ts → Style-client-9491a5aff97f118df542f976d7f7a21e7cc88c62.ts} +6 -12
- package/test/style/components/temp/{Style-server-99ff9867ee067760a463a8282773b2eb09aa14f7.ts → Style-server-8b8cbe1868cab30d9e34dda52921652768ada1db.ts} +7 -10
- 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 +8 -10
- 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/output/Switch-client.ts +16 -22
- package/test/switch/components/output/Switch-server.ts +6 -9
- package/test/switch/components/temp/{Switch-client-1482e2da8fe144d3e867dfad4618e0f364b91b49.ts → Switch-client-5fc00f4d41300dc7587b113d8e53a102beca7558.ts} +16 -22
- package/test/switch/components/temp/{Switch-server-d709eb7a418752dd4203a8f824b78c5f308c8f47.ts → Switch-server-440f7e852145b79656c0023ddc776e4d1d077d2a.ts} +6 -9
- 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/output/Text-client.ts +5 -13
- package/test/text/components/output/Text-server.ts +6 -9
- package/test/text/components/temp/{Text-client-ca2d5402358fba0df1db2353eed304b0dedb7971.ts → Text-client-6c3be8a1a31a13eff86ce8b5330829cd15b07fab.ts} +5 -13
- package/test/text/components/temp/{Text-server-9df4606b85f044ea2b38660e799988461edacb27.ts → Text-server-ac34d47e755aa39b2d89cb44f854450c3db1ddff.ts} +6 -9
- 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 +7 -10
- package/test/watch-array/components/output/ArrayEntries-client.ts +21 -23
- package/test/watch-array/components/output/ArrayEntries-server.ts +7 -10
- package/test/watch-array/components/output/ArrayIndexes-client.ts +19 -21
- package/test/watch-array/components/output/ArrayIndexes-server.ts +7 -10
- package/test/watch-array/components/output/ArrayUnkeyed-client.ts +19 -20
- package/test/watch-array/components/output/ArrayUnkeyed-server.ts +7 -10
- package/test/watch-array/components/temp/{Array-client-d048f5c224a3f2e2729878dbb069ce15ca913e12.ts → Array-client-552f81452d33fe6dc715c9f6bb7986f06475d761.ts} +19 -21
- package/test/watch-array/components/temp/{Array-server-48864ed3b67cae2bcedb216865776e44cc3a1dc2.ts → Array-server-16921ef3289ecba5881fcd59e3353fbfad60d4d3.ts} +7 -10
- package/test/watch-array/components/temp/{ArrayEntries-client-741607b276718f5deb520e3b657dbf6abbb8081c.ts → ArrayEntries-client-736755fba2492e74812ff9c905202810de54e15a.ts} +21 -23
- package/test/watch-array/components/temp/{ArrayEntries-server-401a989fd5f3a093d5d1a8ef1d4fd9d5107a6be3.ts → ArrayEntries-server-ac150fc9fd18c1d9dab9b329f7703e190f5c2725.ts} +7 -10
- package/test/watch-array/components/temp/{ArrayIndexes-client-8ab14b254ef67dafad5228c9ec1906eb3b3babef.ts → ArrayIndexes-client-a496328fa92ffca676ab8893013a0cfec1734ad1.ts} +19 -21
- package/test/watch-array/components/temp/{ArrayIndexes-server-35c31a8a4597da68d39cf20bd6b90137695514de.ts → ArrayIndexes-server-e8fc511c0d27796dc1733f8cc63377f7a4511f76.ts} +7 -10
- package/test/watch-array/components/temp/{ArrayUnkeyed-client-9684aba82757748815b94c04bf3f8d1f98332535.ts → ArrayUnkeyed-client-5a2c5cb1fecba52653f7f35cfd07627682930c15.ts} +19 -20
- package/test/watch-array/components/temp/{ArrayUnkeyed-server-19f195f0cf00760c520ac4c55aef474c8eae4c41.ts → ArrayUnkeyed-server-916a5cdb7c36d95946cafdc69dca782291af24e4.ts} +7 -10
- package/test/watch-object/components/output/Watched-client.ts +5 -11
- package/test/watch-object/components/output/Watched-server.ts +6 -9
- package/test/watch-object/components/temp/{Watched-client-ddba353c5a94f5a874e19d6d4cc6271a04e915c0.ts → Watched-client-1f0409aa6e2c425d0319a23caec7d10ad313d579.ts} +5 -11
- package/test/watch-object/components/temp/{Watched-server-e8e8c15b9fb5dda4051a289e9cd75d71078b9e95.ts → Watched-server-156afd257b562162d86417f2bbf5afe1bf57de06.ts} +6 -9
- package/test/watch-object/watch-object.test.ts +11 -9
- package/{tsup.config.ts → tsdown.config.ts} +1 -3
- package/dist/Component-CysAnHpO.d.cts +0 -8
- package/dist/Component-CysAnHpO.d.ts +0 -8
- package/dist/ServerSlotRender-BMGG0yq3.d.cts +0 -15
- package/dist/ServerSlotRender-BMGG0yq3.d.ts +0 -15
- package/dist/chunk-EGRHWZRV.js +0 -1
- package/dist/chunk-EGRHWZRV.js.map +0 -1
- package/dist/chunk-XNO4YEJ3.js +0 -64
- package/dist/chunk-XNO4YEJ3.js.map +0 -1
- package/dist/metafile-cjs.json +0 -1
- package/dist/metafile-esm.json +0 -1
- 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/types/ProxyPropData.ts +0 -11
- package/src/watch/removeEffect.ts +0 -34
- package/test/bench/components/temp/Bench-client-4e18421473e97bac7c24b17ba14751ce14dd187e.ts +0 -414
- package/test/bench/components/temp/Bench-server-4648921af9bc146718d55a7e9fc288b47a57dfda.ts +0 -142
- package/test/component/components/temp/Header-server-91088d2a5a543287bfdf1a24d92b66db6ccd294d.ts +0 -19
- package/test/console/components/temp/Console-server-7bc7f568e9c3626dca1bdafcb23186c2dbc59199.ts +0 -18
- package/test/dummy/components/temp/ProfilePreview-client-e57ca1ac502e0ddcb3ef376dd5ef27add70090d1.ts +0 -327
- package/test/dummy/components/temp/ProfilePreview-server-9d3d0f8b4f80f634db6ba97d037ab07de004b4d3.ts +0 -56
- package/test/html/components/temp/Html-server-4f73a2b0c5cd9b82666a99ec6a217c758d435008.ts +0 -18
- package/test/mount/components/temp/Mount-server-8564e4e0886ea754dfedf9a4a5fd82f0484c1d83.ts +0 -25
- package/test/on-mount/components/temp/OnMount-server-2ff035e067926fadc284030075aa5da69a05cf31.ts +0 -18
- package/test/party/components/temp/CssStyle-server-fa4bad3c82930632730e3b6b9f0e9193cab6f777.ts +0 -18
- package/test/party/components/temp/HelloWorld-server-50dd4393d55ecd33d5b7684c4f9ed41dfa0ceb5d.ts +0 -18
- package/test/party/components/temp/InputFocused-server-7b062b0dd7686ccc389c3c1a17f37e9a9bb19da9.ts +0 -26
- package/test/special-element/components/temp/Element-server-011a942cc147900d8e074c084297d8e81f05aa27.ts +0 -18
- package/test/special-head/components/temp/Head-client-967d6ea24d46308af586c7553f4658412d94716c.ts +0 -34
- package/test/special-head/components/temp/Head-server-7cf8212c95197ed6320b47483524d8b1b3e5ae68.ts +0 -18
- package/test/svg/components/temp/Shape-server-4ef7e80f09d3d4c930055d0a25184c48507e51de.ts +0 -25
- /package/src/compile/{build/utils → utils}/isFullyReactive.ts +0 -0
- /package/src/compile/{build/utils → utils}/isReactive.ts +0 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/context.ts","../src/render/$mount.ts","../src/watch/runEffect.ts","../src/render/$run.ts","../src/watch/symbols.ts","../src/render/$unwrap.ts","../src/watch/trackEffect.ts","../src/watch/removeEffect.ts","../src/watch/triggerEffects.ts","../src/watch/proxyGet.ts","../src/watch/transferEffects.ts","../src/watch/proxySet.ts","../src/render/$watch.ts","../src/render/addAnimation.ts","../src/render/addEvent.ts","../src/motion/animate.ts","../src/render/isFragmentNode.ts","../src/render/addFragment.ts","../src/render/applyProps.ts","../src/render/clearRange.ts","../src/render/clearLayoutSlot.ts","../src/render/newRange.ts","../src/render/popRange.ts","../src/render/pushRange.ts","../src/render/fillLayoutSlot.ts","../src/render/getFragment.ts","../src/render/hydrate.ts","../src/render/mount.ts","../src/render/newListItem.ts","../src/render/hydrationMarkers.ts","../src/render/isCommentNode.ts","../src/render/isTextNode.ts","../src/render/nodeCheckHydrationBreak.ts","../src/render/nodeNext.ts","../src/render/nodeAnchor.ts","../src/render/nodeChild.ts","../src/render/nodeRoot.ts","../src/render/nodeSkip.ts","../src/render/runControl.ts","../src/render/runControlBranch.ts","../src/render/moveRange.ts","../src/render/runListItems.ts","../src/render/runList.ts","../src/render/setAttribute.ts","../src/render/setDynamicElement.ts"],"sourcesContent":["import { type Animation } from \"../types/Animation\";\nimport { type Cleanup } from \"../types/Cleanup\";\nimport { type Effect } from \"../types/Effect\";\nimport { type Range } from \"../types/Range\";\n\n/**\n * The global context for setting up effects and updating subscriptions.\n */\ninterface Context {\n\t/** The effect that is currently being run. */\n\tactiveEffect: Effect | null;\n\n\t/** The range that is currently being created. */\n\tactiveRange: Range | null;\n\n\t/**\n\t * Functions that were run via $mount, which should be collected and flushed\n\t * when the component has been mounted in the DOM\n\t */\n\tmountEffects: (() => Cleanup | void)[];\n\n\t/**\n\t * Events which should be added when their element has been mounted in the\n\t * DOM\n\t */\n\tstashedEvents: {\n\t\trange: Range | null;\n\t\tel: Element;\n\t\ttype: string;\n\t\tlistener: (this: Element, ev: any) => any;\n\t}[];\n\n\t/**\n\t * Animations which should be added when their element has been mounted in\n\t * the DOM\n\t */\n\tstashedAnimations: {\n\t\trange: Range | null;\n\t\tel: HTMLElement;\n\t\tin?: Animation;\n\t\tout?: Animation;\n\t}[];\n\n\t/** The node that is actively being hydrated. */\n\thydrationNode: ChildNode | null;\n\t//hn: ChildNode | null;\n}\n\nconst context: Context = {\n\tactiveEffect: null,\n\tactiveRange: null,\n\tmountEffects: [],\n\tstashedEvents: [],\n\tstashedAnimations: [],\n\thydrationNode: null,\n\t//hn: null,\n\t//get hydrationNode() {\n\t//\treturn this.hn;\n\t//},\n\t//set hydrationNode(value) {\n\t//\tconsole.log(`set hydration ${printNode(value)}`);\n\t//\tthis.hn = value;\n\t//},\n};\n\nexport default context;\n","import { type Cleanup } from \"../types/Cleanup\";\nimport context from \"./context\";\n\n/**\n * Runs and re-runs a function on component mount\n *\n * @param fn The function to run, which may return a cleanup function\n */\nexport default function $mount(fn: () => Cleanup | void): void {\n\tcontext.mountEffects.push(fn);\n}\n","import context from \"../render/context\";\nimport { type Effect } from \"../types/Effect\";\n\nexport default function runEffect(effect: Effect): void {\n\t// Reactivate it in case it's been deactivated\n\teffect.active = true;\n\n\t// Set the active effect, so that any properties accessed while running it\n\t// will trigger it in future\n\tcontext.activeEffect = effect;\n\n\t// Run the effect to register its subscriptions and get its (optional)\n\t// cleanup function\n\tconst cleanup = effect.run();\n\n\tif (typeof cleanup === \"function\") {\n\t\teffect.cleanup = cleanup;\n\t}\n\n\tcontext.activeEffect = null;\n}\n","import { type Cleanup } from \"../types/Cleanup\";\nimport { type Effect } from \"../types/Effect\";\nimport runEffect from \"../watch/runEffect\";\nimport context from \"./context\";\n\n// TODO: Take a pipeline of operators e.g. debounce\n\n/**\n * Runs and re-runs a function that depends on a watched object\n *\n * @param fn The function to run, which may return a cleanup function\n */\nexport default function $run(fn: () => Cleanup | void): void {\n\tlet effect: Effect = {\n\t\trun: fn,\n\t\tcleanup: null,\n\t\tprops: null,\n\t\tactive: true,\n\t};\n\n\tif (context.activeRange) {\n\t\t//console.log(\"the range is \", context.activeRange.id);\n\t\t(context.activeRange.effects ??= []).push(effect);\n\t}\n\n\trunEffect(effect);\n}\n","const proxyDataSymbol: unique symbol = Symbol(\"_proxy_data\");\n\nexport { proxyDataSymbol };\n","import { proxyDataSymbol } from \"../watch/symbols\";\n\n/**\n * Returns the target object of a proxy\n *\n * @param object The proxy object\n */\nexport default function $unwrap<T extends Record<PropertyKey, any>>(object: T): T {\n\treturn object && object[proxyDataSymbol] ? object[proxyDataSymbol].target || object : object;\n}\n","import context from \"../render/context\";\nimport { type ProxyData } from \"../types/ProxyData\";\n\nexport default function trackEffect(data: ProxyData, key: PropertyKey): void {\n\t// If there's an active effect, register this target/prop with it, so that\n\t// it will be called when this prop is set\n\tif (context.activeEffect) {\n\t\t//let effectName = String(context.activeEffect.run).split(\"{\")[0].trim();\n\t\t//console.log(`tracking effect '${effectName}' for '${String(key)}'`);\n\n\t\tlet propState = data.propData.get(key);\n\t\tif (!propState) {\n\t\t\tpropState = { effects: [] };\n\t\t\tdata.propData.set(key, propState);\n\t\t}\n\n\t\tpropState.effects ||= [];\n\t\tpropState.effects.push(context.activeEffect);\n\n\t\tcontext.activeEffect.props ||= [];\n\t\tcontext.activeEffect.props.push(propState);\n\t}\n}\n","import { type Effect } from \"../types/Effect\";\n\nexport default function removeEffect(effect: Effect): void {\n\t//let effectName = String(effect.run).split(\"{\")[0].trim();\n\t//console.log(`removing effect '${effectName}'`);\n\n\t// Run any cleanup function\n\tif (effect.cleanup) {\n\t\teffect.cleanup();\n\t}\n\n\t// Delete the effect from any props that are subscribed to it\n\tif (effect.props) {\n\t\tfor (let prop of effect.props) {\n\t\t\tif (prop.effects) {\n\t\t\t\tlet length = prop.effects.length;\n\t\t\t\tlet i = length;\n\t\t\t\twhile (i--) {\n\t\t\t\t\tif (prop.effects[i] === effect) {\n\t\t\t\t\t\tprop.effects[i] = prop.effects[length - 1];\n\t\t\t\t\t\tprop.effects.pop();\n\t\t\t\t\t\tlength -= 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// TODO: should ideally delete the prop if there\n\t\t\t\t// are no more subscriptions??\n\t\t\t}\n\t\t}\n\t}\n\n\t// HACK: Set the effect to active = false for loops through sliced arrays\n\t// TODO: Proper signal tracking\n\teffect.active = false;\n}\n","import { type ProxyData } from \"../types/ProxyData\";\nimport removeEffect from \"./removeEffect\";\nimport runEffect from \"./runEffect\";\n\nexport default function triggerEffects(data: ProxyData, key: PropertyKey): void {\n\t// Get the effects for the supplied property\n\tlet effects = data.propData.get(key)?.effects;\n\tif (effects) {\n\t\t// HACK: Slice the array to get a copy, so that we can remove effects from\n\t\t// the property in removeEffect without skipping any here\n\t\tfor (let effect of effects.slice()) {\n\t\t\tif (effect.active) {\n\t\t\t\t//let effectName = String(effect.run).split(\"{\")[0].trim();\n\t\t\t\t//console.log(`triggered effect '${effectName}' for '${String(key)}'`);\n\n\t\t\t\tremoveEffect(effect);\n\n\t\t\t\trunEffect(effect);\n\t\t\t}\n\t\t}\n\t}\n}\n","import $watch from \"../render/$watch\";\nimport context from \"../render/context\";\nimport { type ProxyData } from \"../types/ProxyData\";\nimport { proxyDataSymbol } from \"./symbols\";\nimport trackEffect from \"./trackEffect\";\nimport triggerEffects from \"./triggerEffects\";\n\nexport default function proxyGet(\n\ttarget: Record<PropertyKey, any>,\n\tkey: PropertyKey,\n\treceiver: any,\n\tdata: ProxyData,\n): any {\n\tif (key === proxyDataSymbol) {\n\t\treturn data;\n\t}\n\n\t//console.log(`object get '${String(prop)}' on`, target);\n\n\t// Set the value to a new proxy if it's an object\n\t// But not if it's a Promise (i.e. has a `then` method)\n\tif (!data.propData.has(key)) {\n\t\tif (!data.shallow) {\n\t\t\tlet value = target[key];\n\t\t\tif (value && typeof value === \"object\" && !value[proxyDataSymbol] && !value.then) {\n\t\t\t\ttarget[key] = $watch(value);\n\t\t\t}\n\t\t}\n\t\tdata.propData.set(key, null);\n\t}\n\n\t// From https://stackoverflow.com/a/54136394\n\t// PERF: Because we know what methods are being called, we could potentially run them manually\n\t// on DOM nodes (i.e. if it's a splice, we know which to remove and add etc)\n\tif (data.isArray) {\n\t\tif (\n\t\t\tkey === \"pop\" ||\n\t\t\tkey === \"push\" ||\n\t\t\tkey === \"reverse\" ||\n\t\t\tkey === \"shift\" ||\n\t\t\tkey === \"sort\" ||\n\t\t\tkey === \"splice\" ||\n\t\t\tkey === \"unshift\"\n\t\t) {\n\t\t\t// Get the array method\n\t\t\tconst targetFunction: Function = target[key];\n\n\t\t\t// Run the array method\n\t\t\treturn function (...args: any[]) {\n\t\t\t\ttargetFunction.apply(target, args);\n\n\t\t\t\t// If this array has change functions, call them now via the\n\t\t\t\t// length property, which gets accessed in most functions\n\t\t\t\ttriggerEffects(data, \"length\");\n\t\t\t};\n\t\t} else if (key === Symbol.iterator) {\n\t\t\t// HACK: This prevents lists being re-run on every random property\n\t\t\t// access by disabling the active effect before properties get\n\t\t\t// accessed. I'm not sure if this is the best way to achieve this...\n\t\t\ttrackEffect(data, \"length\");\n\t\t\tcontext.activeEffect = null;\n\t\t} else {\n\t\t\t// If this property is being accessed in the course of setting up an effect, track it\n\t\t\t// TODO: Only if it's a property and not a function?\n\t\t\ttrackEffect(data, key);\n\t\t}\n\t} else {\n\t\t// If this property is being accessed in the course of setting up an effect, track it\n\t\t// TODO: Only if it's a property and not a function?\n\t\ttrackEffect(data, key);\n\t}\n\n\t// Return the property value\n\treturn Reflect.get(target, key, receiver);\n}\n","import $watch from \"../render/$watch\";\nimport { type ProxyData } from \"../types/ProxyData\";\nimport { proxyDataSymbol } from \"./symbols\";\n\n/**\n * Transfers property effect subscriptions from one object to another\n */\nexport default function transferEffects(\n\toldValue: Record<PropertyKey, any>,\n\tnewValue: Record<PropertyKey, any>,\n): void {\n\tconst oldData = oldValue[proxyDataSymbol] as ProxyData;\n\tconst newData = newValue[proxyDataSymbol] as ProxyData;\n\tmoveChildEffects(oldValue, newValue, oldData, newData);\n}\n\nfunction moveChildEffects(\n\toldValue: Record<PropertyKey, any>,\n\tnewValue: Record<PropertyKey, any>,\n\toldData: ProxyData,\n\tnewData: ProxyData,\n) {\n\t// Recursively transfer and run effects for child properties\n\t// TODO: Top down or bottom up?? Doing top down for now...\n\tfor (let [key, props] of oldData.propData.entries()) {\n\t\tif (props) {\n\t\t\t// Transfer the prop data\n\t\t\tnewData.propData.set(key, props);\n\n\t\t\tlet oldPropValue = oldValue[key];\n\t\t\tlet oldPropData = oldPropValue != null ? oldPropValue[proxyDataSymbol] : undefined;\n\n\t\t\t// If the old value was a proxy, make the new value one too\n\t\t\t// TODO: Make sure we aren't accidentally creating proxies for\n\t\t\t// things that weren't before...\n\t\t\tif (oldPropData) {\n\t\t\t\tnewValue[key] = $watch(newValue[key]);\n\t\t\t}\n\n\t\t\tlet newPropValue = newValue[key];\n\n\t\t\t// Run the effects for each property\n\t\t\tif (props.effects) {\n\t\t\t\tfor (let effect of props.effects) {\n\t\t\t\t\tif (effect.cleanup) {\n\t\t\t\t\t\teffect.cleanup();\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only run the effect if there is a new value\n\t\t\t\t\tif (newPropValue) {\n\t\t\t\t\t\teffect.run();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Recurse\n\t\t\tif (oldPropData) {\n\t\t\t\tlet newPropData = newPropValue[proxyDataSymbol];\n\t\t\t\tmoveChildEffects(oldPropValue, newPropValue, oldPropData, newPropData);\n\t\t\t}\n\t\t}\n\t}\n}\n","import $watch from \"../render/$watch\";\nimport { type ProxyData } from \"../types/ProxyData\";\nimport { proxyDataSymbol } from \"./symbols\";\nimport transferEffects from \"./transferEffects\";\nimport triggerEffects from \"./triggerEffects\";\n\nexport default function proxySet(\n\ttarget: Record<PropertyKey, any>,\n\tkey: PropertyKey,\n\tvalue: any,\n\treceiver: any,\n\tdata: ProxyData,\n) {\n\t//console.log(`object set '${String(prop)}' to '`, value, `' on`, target);\n\n\t// Only do things if the value has changed\n\tconst oldValue = target[key];\n\tif (value !== oldValue) {\n\t\tlet newValue = value;\n\n\t\t// If the value was previously a proxy, watch the new value and update\n\t\t// its effect subscriptions\n\t\tif (oldValue && oldValue[proxyDataSymbol]) {\n\t\t\tnewValue = $watch(value);\n\t\t\ttransferEffects(oldValue, newValue);\n\t\t}\n\n\t\t// Set the property value on the target\n\t\tReflect.set(target, key, newValue, receiver);\n\n\t\t// Re-run effects\n\t\ttriggerEffects(data, key);\n\n\t\t// If an item in an array is being set directly, trigger the length to\n\t\t// cause any lists to be re-run and data re-bound\n\t\t// TODO: Can we update the single item's data directly somehow?\n\t\tif (data.isArray && !isNaN(+String(key))) {\n\t\t\ttriggerEffects(data, \"length\");\n\t\t}\n\t}\n\n\treturn true;\n}\n","import { type ProxyData } from \"../types/ProxyData\";\nimport { type WatchOptions } from \"../types/WatchOptions\";\nimport proxyGet from \"../watch/proxyGet\";\nimport proxySet from \"../watch/proxySet\";\nimport { proxyDataSymbol } from \"../watch/symbols\";\n\n/**\n * Watches an object and runs effects when its properties are changed\n *\n * @param object The object to watch\n */\nexport default function $watch<T extends Record<PropertyKey, any>>(\n\tobject: T,\n\toptions?: WatchOptions,\n): T {\n\t// Return the object itself if it is undefined or null, or if it is already a proxy\n\tif (object == null || object[proxyDataSymbol]) {\n\t\treturn object;\n\t}\n\n\t// Make sure we can proxy this value\n\t// TODO: In debug mode maybe?\n\t//if (typeof object !== \"object\") {\n\t//\tthrow new Error(`$watch can't be called with a ${typeof object}`);\n\t//}\n\n\t// Create a proxy handler for each object, and store some data for it here\n\tconst data: ProxyData = {\n\t\ttarget: object,\n\t\tisArray: Array.isArray(object),\n\t\tshallow: !!options?.shallow,\n\t\tpropData: new Map(),\n\t};\n\tconst handler: ProxyHandler<T> = {\n\t\tget: function (target, prop, receiver) {\n\t\t\treturn proxyGet(target, prop, receiver, data);\n\t\t},\n\t\tset: function (target, prop, value, receiver) {\n\t\t\treturn proxySet(target, prop, value, receiver, data);\n\t\t},\n\t};\n\n\treturn new Proxy(object, handler) as T;\n}\n","import { type Animation } from \"../types/Animation\";\nimport context from \"./context\";\n\nexport default function addAnimation(el: HTMLElement, entry?: Animation, exit?: Animation): void {\n\t// Stash the event in context so that it can be added when the fragment is\n\t// added to the DOM\n\t// NOTE: We don't need to do this for hydration, but it's simpler to do it\n\t// the same way in both processes\n\tcontext.stashedAnimations.push({\n\t\trange: context.activeRange,\n\t\tel,\n\t\tin: entry,\n\t\tout: exit,\n\t});\n}\n","import context from \"./context\";\n\nexport default function addEvent(\n\tel: Element,\n\ttype: string,\n\tlistener: (this: Element, ev: any) => any,\n): void {\n\t// Stash the event in context so that it can be added when the fragment is\n\t// added to the DOM\n\t// NOTE: We don't need to do this for hydration, but it's simpler to do it\n\t// the same way in both processes\n\tcontext.stashedEvents.push({ range: context.activeRange, el, type, listener });\n}\n","import context from \"../render/context\";\n\n/**\n * Adds an animation for an element\n * @param el The element to animate\n * @param enter Whether the animation is being run on enter\n * @param keyframes The Web Animation API keyframes\n * @param options The Web Animmation API options\n */\nexport default async function animate(\n\tel: HTMLElement,\n\tenter: boolean,\n\tkeyframes: Keyframe[] | PropertyIndexedKeyframes | null,\n\toptions?: number | KeyframeAnimationOptions,\n): Promise<void> {\n\t// This is quite simplistic\n\t// We might need to\n\t// - store the animation\n\t// - reverse it if it's running and the range appears/disappears\n\t// - transfer the animation to the new element\n\tlet animationOptions = Object.assign(\n\t\t{\n\t\t\tdirection: enter ? \"normal\" : \"reverse\",\n\t\t\t// TODO: Should probably have a global setting for these somewhere\n\t\t\t// And respect browser reduce motion settings\n\t\t\tduration: 300,\n\t\t\teasing: \"ease-in-out\",\n\t\t\tfill: \"forwards\",\n\t\t},\n\t\toptions,\n\t);\n\n\tconst animation = el.animate(keyframes, animationOptions);\n\n\t// HACK: I'm not entirely sure why we need to sent the animation's timeline,\n\t// but without it, animations never start\n\t// HACK: We also need to make sure the element has been added to the DOM\n\t// with a timeout\n\tsetTimeout(() => {\n\t\tanimation.timeline = el.ownerDocument.timeline;\n\t}, 1);\n\n\t// Add the animation to the active range, so that the range won't be cleared\n\t// until the animation is completed\n\tlet activeRange = context.activeRange;\n\tif (activeRange) {\n\t\t// TODO: An option for whether to await or cancel events on range remove\n\t\t// e.g. if you are doing a client side navigation, you don't want to run animations\n\t\tactiveRange.animations ??= new Set();\n\t\tactiveRange.animations.add(animation);\n\t\tawait animation.finished;\n\t\tactiveRange.animations.delete(animation);\n\t}\n}\n","export default function isFragmentNode(node: Node | null | undefined): node is DocumentFragment {\n\treturn node?.nodeType === 11;\n}\n","import animate from \"../motion/animate\";\nimport $run from \"./$run\";\nimport context from \"./context\";\nimport isFragmentNode from \"./isFragmentNode\";\n\nexport default function addFragment(\n\tfragment: DocumentFragment,\n\tparent: ParentNode,\n\tbefore: Node | null,\n\tendNode?: ChildNode,\n): void {\n\t//console.log(`adding fragment '${fragment.textContent}' to `, parent);\n\t//console.log(\"before\", before);\n\n\tconst range = context.activeRange;\n\tconst hydrationNode = context.hydrationNode;\n\n\t// Set the active range's end node to the last node in the fragment\n\tif (range) {\n\t\tif (hydrationNode) {\n\t\t\trange.endNode = endNode ?? hydrationNode;\n\t\t} else {\n\t\t\trange.startNode = fragment.firstChild;\n\t\t\trange.endNode = fragment.lastChild;\n\t\t}\n\t}\n\n\tlet parentIsFragment = isFragmentNode(parent);\n\n\tif (!hydrationNode) {\n\t\t// HACK: We need to be able to add fragments to new fragments as well as\n\t\t// fragments that have already been added to the document. New fragments will\n\t\t// be ok, but fragments that have been added will not be parents of the before\n\t\t// element (because it's now in the document). In this case we will have to\n\t\t// use the before element's parent, which should work as long as we are always\n\t\t// passing a before element...\n\t\tif (parentIsFragment) {\n\t\t\tparent = before!.parentNode!;\n\t\t}\n\n\t\t// Add the fragment\n\t\tparent.insertBefore(fragment, before);\n\t}\n\n\t// If we're adding this fragment to the DOM, we can now run any $mount\n\t// effects, add our stashed events and play our stashed animations\n\tif (!parentIsFragment) {\n\t\t// Only run $mount effects if not hydrating (if hydrating, they will get\n\t\t// run at the end when everything is hooked up)\n\t\tif (!hydrationNode) {\n\t\t\tfor (let effect of context.mountEffects) {\n\t\t\t\t$run(effect);\n\t\t\t}\n\t\t\tcontext.mountEffects.length = 0;\n\t\t}\n\n\t\t// Set the active range for each event so it will get attached to the\n\t\t// right one and set it back afterwards\n\t\tfor (let event of context.stashedEvents) {\n\t\t\tcontext.activeRange = event.range;\n\t\t\t$run(function addFragmentEvent() {\n\t\t\t\tevent.el.addEventListener(event.type, event.listener);\n\t\t\t\treturn () => {\n\t\t\t\t\tevent.el.removeEventListener(event.type, event.listener);\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t\tcontext.stashedEvents.length = 0;\n\n\t\t// Set the active range for each animation so it will get attached to\n\t\t// the right one and set it back afterwards\n\t\tfor (let animation of context.stashedAnimations) {\n\t\t\tcontext.activeRange = animation.range;\n\t\t\t$run(function addFragmentAnimation() {\n\t\t\t\tif (animation.in) {\n\t\t\t\t\tanimate(animation.el, true, animation.in.keyframes, animation.in.options);\n\t\t\t\t}\n\t\t\t\tif (animation.out) {\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tanimate(animation.el, false, animation.out!.keyframes, animation.out!.options);\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tcontext.stashedAnimations.length = 0;\n\n\t\t// Set the active range back\n\t\tcontext.activeRange = range;\n\t}\n}\n","import $run from \"./$run\";\n\nexport default function applyProps(\n\tel: Element,\n\tprops: Record<string, any> | undefined,\n\tpropNamesUsed: string[],\n): void {\n\tif (props) {\n\t\tfor (let [name, value] of Object.entries(props)) {\n\t\t\tif (!propNamesUsed.includes(name)) {\n\t\t\t\tif (name.startsWith(\"on\")) {\n\t\t\t\t\tconst eventName = name.substring(2);\n\t\t\t\t\tel.addEventListener(eventName, value);\n\t\t\t\t} else {\n\t\t\t\t\t$run(function setAttribute() {\n\t\t\t\t\t\tel.setAttribute(name, value);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { type Range } from \"../types/Range\";\nimport removeEffect from \"../watch/removeEffect\";\nimport context from \"./context\";\n\nexport default function clearRange(range: Range): void {\n\t//console.log(\"clearing range\", range.startNode, \"to\", range.endNode);\n\n\t// Clear effects and collect animations that take place within this range and its children\n\tlet animations: Animation[] = [];\n\tclearEffects(range, animations);\n\n\t// Wait for animations, if any, then clear the range's nodes\n\tif (animations.length) {\n\t\tPromise.all(animations.map((a) => a.finished)).then(() => clearNodes(range));\n\t} else {\n\t\tclearNodes(range);\n\t}\n}\n\nfunction clearEffects(range: Range, animations: Animation[]) {\n\t// Delete the effects for this range\n\tif (range.effects) {\n\t\t// Set the active range to collect exit animations\n\t\t// We could instead have seperate entry and exit animation collections?\n\t\tconst oldRange = context.activeRange;\n\t\tcontext.activeRange = range;\n\n\t\tfor (let effect of range.effects) {\n\t\t\tremoveEffect(effect);\n\t\t}\n\n\t\tcontext.activeRange = oldRange;\n\t}\n\n\t// Collect any running animations, including ones from the effect cleanups\n\tif (range.animations) {\n\t\tfor (let animation of range.animations) {\n\t\t\tanimations.push(animation);\n\t\t}\n\t}\n\n\t// Recurse through the children\n\tif (range.children) {\n\t\tfor (let child of range.children) {\n\t\t\tclearEffects(child, animations);\n\t\t}\n\t\trange.children.length = 0;\n\t}\n}\n\nfunction clearNodes(range: Range) {\n\t// Clear the nodes for this range\n\tif (range.startNode) {\n\t\tlet currentNode = range.endNode || range.startNode;\n\t\t// DEBUG:\n\t\tif (range.startNode.parentNode !== currentNode.parentNode) {\n\t\t\tthrow new Error(\"range nodes have different parents\");\n\t\t}\n\t\twhile (currentNode !== range.startNode) {\n\t\t\tlet nextNode = currentNode.previousSibling;\n\t\t\tcurrentNode.remove();\n\t\t\tcurrentNode = nextNode!;\n\t\t}\n\t\tcurrentNode.remove();\n\n\t\t// Release the nodes\n\t\trange.startNode = null;\n\t\trange.endNode = null;\n\t}\n}\n","import type { Range } from \"../types/Range\";\nimport clearRange from \"./clearRange\";\n\nexport default function clearLayoutSlot(range: Range): void {\n\tclearRange(range);\n}\n","import { type Range } from \"../types/Range\";\n\nexport default function newRange(): Range {\n\treturn {\n\t\tstartNode: null,\n\t\tendNode: null,\n\t\tchildren: null,\n\t\tindex: 0,\n\t\teffects: null,\n\t\tanimations: null,\n\t};\n}\n","import { type Range } from \"../types/Range\";\nimport context from \"./context\";\n\nexport default function popRange(oldRange: Range | null): void {\n\tcontext.activeRange = oldRange;\n}\n","import { type Range } from \"../types/Range\";\nimport context from \"./context\";\n\nexport default function pushRange(range: Range, toParent = false): Range | null {\n\tconst activeRange = context.activeRange;\n\n\t// Add the new range to the currently active range's children, so that we\n\t// can delete the children with the parent\n\tif (toParent && activeRange) {\n\t\t(activeRange.children ??= []).push(range);\n\t}\n\n\t// Set the new active range\n\tcontext.activeRange = range;\n\n\t// Return the old active range, so that it can be reset when done\n\treturn activeRange;\n}\n","import type { Component } from \"../types/Component\";\nimport type { Range } from \"../types/Range\";\nimport type { SlotRender } from \"../types/SlotRender\";\nimport newRange from \"./newRange\";\nimport popRange from \"./popRange\";\nimport pushRange from \"./pushRange\";\n\nexport default function fillLayoutSlot(\n\tcomponent: Component,\n\tslot: SlotRender,\n\tparent: ParentNode,\n\tanchor: Node | null,\n\t$props: Record<string, string>,\n\t$context?: Record<PropertyKey, any>,\n): Range {\n\tconst range = newRange();\n\tconst oldRange = pushRange(range);\n\n\tcomponent(parent, anchor, $props, $context, {\n\t\t_: slot,\n\t});\n\n\tpopRange(oldRange);\n\n\treturn range;\n}\n","export default function getFragment(\n\tdocument: Document,\n\tarray: DocumentFragment[],\n\tindex: number,\n\thtml: string,\n\tns?: boolean,\n): DocumentFragment {\n\t// Create the fragment in the array if it hasn't yet been used\n\tif (array[index] === undefined) {\n\t\t// TODO: Should pass a string for the ns, when we support other element types\n\t\tif (ns) {\n\t\t\tconst template = document.createElementNS(\"http://www.w3.org/2000/svg\", \"template\");\n\t\t\ttemplate.innerHTML = html;\n\t\t\tconst fragment = new DocumentFragment();\n\t\t\tfragment.append(...template.childNodes);\n\t\t\tarray[index] = fragment;\n\t\t} else {\n\t\t\tconst template = document.createElement(\"template\");\n\t\t\ttemplate.innerHTML = html;\n\t\t\tarray[index] = template.content;\n\t\t}\n\t}\n\n\t// Get the fragment from the array\n\t// TODO: If we're hydrating we probably don't want to create and return a\n\t// fragment unless we really need to\n\tlet fragment = array[index].cloneNode(true) as DocumentFragment;\n\n\treturn fragment;\n}\n","import { type Component } from \"../types/Component\";\nimport { type SlotRender } from \"../types/SlotRender\";\nimport $run from \"./$run\";\nimport context from \"./context\";\n\n/**\n * Hydrates a component into an existing DOM tree\n * @param parent The parent node\n * @param component The component to mount\n * @param props An object containing component props\n */\nexport default function hydrate(\n\tparent: ParentNode,\n\tcomponent: Component,\n\tprops?: Record<string, any>,\n\tslots?: Record<string, SlotRender>,\n): void {\n\t// When mounting, the parent must have no child elements, so we can just set\n\t// the hydration node to the first child node\n\tcontext.hydrationNode = parent.firstChild;\n\n\t// Call the component's render function\n\tcomponent(parent, null, props, undefined, slots);\n\n\tcontext.hydrationNode = null;\n\n\t// Now that we've hydrated, we can run $mount effects\n\tfor (let effect of context.mountEffects) {\n\t\t$run(effect);\n\t}\n\tcontext.mountEffects.length = 0;\n}\n","import { type Component } from \"../types/Component\";\nimport { type SlotRender } from \"../types/SlotRender\";\n\n/**\n * Mounts a component into a DOM node\n *\n * @param parent The node to mount the component into\n * @param component The component to mount\n * @param props An object containing component props\n */\nexport default function mount(\n\tparent: ParentNode,\n\tcomponent: Component,\n\tprops?: Record<string, any>,\n\tslots?: Record<string, SlotRender>,\n): void {\n\t// The parent node must have no child elements, so that we can hydrate\n\t// without worrying about where to start\n\tif (parent.childElementCount) {\n\t\tthrow new Error(\"The parent node must have no child elements\");\n\t}\n\n\t// Remove all text, commments, etc\n\twhile (parent.firstChild) {\n\t\tparent.firstChild.remove();\n\t}\n\n\t// Call the component's render function\n\tcomponent(parent, null, props, undefined, slots);\n}\n","import { type ListItem } from \"../types/ListItem\";\n\nexport default function newListItem(data: Record<PropertyKey, any>, key?: any): ListItem {\n\treturn {\n\t\tstartNode: null,\n\t\tendNode: null,\n\t\tchildren: null,\n\t\tindex: 0,\n\t\teffects: null,\n\t\tanimations: null,\n\t\tdata,\n\t\tkey,\n\t};\n}\n","const HYDRATION_START = \"[\";\nconst HYDRATION_END = \"]\";\nconst HYDRATION_BREAK = \"^\";\n\nexport { HYDRATION_START, HYDRATION_END, HYDRATION_BREAK };\n","export default function isCommentNode(node: Node | null | undefined): node is Comment {\n\treturn node?.nodeType === 8;\n}\n","export default function isTextNode(node: Node | null | undefined): node is Text {\n\treturn node?.nodeType === 3;\n}\n","import context from \"./context\";\nimport { HYDRATION_BREAK } from \"./hydrationMarkers\";\nimport isCommentNode from \"./isCommentNode\";\n\n// TODO: It would be good to remove this, if possible\n\n/**\n * When hydrating, removes and skips hydration comments that are inserted at the\n * start of branches and used to split up text nodes that would otherwise be\n * joined in HTML.\n *\n * @param node The node to check and maybe skip.\n * @returns The next node.\n */\nexport default function nodeCheckHydrationBreak(node: ChildNode | null): ChildNode | null {\n\tif (context.hydrationNode) {\n\t\tif (node && isCommentNode(node) && node.data === HYDRATION_BREAK) {\n\t\t\tlet comment = node;\n\t\t\tnode = node.nextSibling;\n\t\t\tcomment.remove();\n\t\t}\n\t\tcontext.hydrationNode = node;\n\t}\n\treturn node;\n}\n","import context from \"./context\";\nimport isTextNode from \"./isTextNode\";\nimport nodeCheckHydrationBreak from \"./nodeCheckHydrationBreak\";\n\n/**\n * Gets the next sibling of a node.\n *\n * When hydrating, sets the hydration node.\n *\n * @param node The node.\n * @param text Whether we require a text node.\n */\nexport default function nodeNext(node: ChildNode, text = false): ChildNode {\n\t// If the required node is a text node, and we already have one, just use\n\t// it. This is caused by text nodes being merged in HTML\n\tif (context.hydrationNode && text && isTextNode(node)) {\n\t\treturn node;\n\t}\n\n\tlet nextNode = nodeCheckHydrationBreak(node.nextSibling);\n\n\t// NOTE: We know this is not null as it is being called from generated code\n\treturn nextNode!;\n}\n","import context from \"./context\";\nimport { HYDRATION_END, HYDRATION_START } from \"./hydrationMarkers\";\nimport isCommentNode from \"./isCommentNode\";\nimport nodeNext from \"./nodeNext\";\n\n/**\n * Gets the anchor node for a control statement or component.\n *\n * When mounting, this just returns the anchor node parameter (because it was\n * created).\n *\n * When hydrating, there should be matched <![> and <!]> comments in the HTML,\n * and the anchor node should be after the end comment. The matched comment\n * nodes will be deleted, and the hydration node set to the first node inside\n * the matched comments.\n *\n * @param node The potential anchor node.\n * @returns The anchor node.\n */\nexport default function nodeAnchor(node: ChildNode): ChildNode {\n\tif (context.hydrationNode) {\n\t\tif (isCommentNode(node) && node.data === HYDRATION_START) {\n\t\t\t// Skip and remove the start node, setting the hydration node in\n\t\t\t// nodeNext\n\t\t\tlet currentNode = nodeNext(node);\n\t\t\tnode.remove();\n\n\t\t\t// Go through siblings until we get to the end\n\t\t\tlet level = 1;\n\t\t\twhile (currentNode) {\n\t\t\t\tif (isCommentNode(currentNode)) {\n\t\t\t\t\tif (currentNode.data === HYDRATION_START) {\n\t\t\t\t\t\tlevel += 1;\n\t\t\t\t\t} else if (currentNode.data === HYDRATION_END) {\n\t\t\t\t\t\tlevel -= 1;\n\t\t\t\t\t\tif (level === 0) {\n\t\t\t\t\t\t\t// Remove the end node and return the next one\n\t\t\t\t\t\t\tconst endNode = currentNode.nextSibling;\n\t\t\t\t\t\t\tcurrentNode.remove();\n\n\t\t\t\t\t\t\t// If the statement is empty (i.e. the end comment\n\t\t\t\t\t\t\t// immediately follows the start comment), move the\n\t\t\t\t\t\t\t// hydration node past the removed end comment to\n\t\t\t\t\t\t\t// the anchor, so that we can continue to the next\n\t\t\t\t\t\t\t// nodes\n\t\t\t\t\t\t\tif (context.hydrationNode === currentNode) {\n\t\t\t\t\t\t\t\tcontext.hydrationNode = endNode;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// NOTE: We know this is not null as it is being\n\t\t\t\t\t\t\t// called from generated code\n\t\t\t\t\t\t\treturn endNode!;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcurrentNode = currentNode.nextSibling!;\n\t\t\t}\n\n\t\t\tif (!currentNode) {\n\t\t\t\tthrow new Error(\"End hydration comment not found\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn node;\n}\n","import context from \"./context\";\n\n/**\n * Gets the first child of a node.\n *\n * Sets the hydration node.\n *\n * @param parent The parent node.\n */\nexport default function nodeChild(parent: Node): ChildNode {\n\tlet childNode = parent.firstChild;\n\tif (context.hydrationNode) {\n\t\t// The child may be null when hydrating the sole text child of an\n\t\t// element with no text\n\t\tif (!childNode) {\n\t\t\tchildNode = parent.appendChild(parent.ownerDocument!.createTextNode(\"\"));\n\t\t}\n\t\tcontext.hydrationNode = childNode;\n\t}\n\n\t// NOTE: We know this is not null as it is being called from generated code\n\treturn childNode!;\n}\n","import context from \"./context\";\nimport { HYDRATION_START } from \"./hydrationMarkers\";\nimport isCommentNode from \"./isCommentNode\";\nimport isTextNode from \"./isTextNode\";\n\n/**\n * Gets the first child in a fragment.\n *\n * When hydrating, also sets the active range's start node, while we have it.\n *\n * @param parent The parent of the fragment.\n * @param text Whether we require a text node.\n */\nexport default function nodeRoot(parent: Node, text = false): ChildNode {\n\tif (context.hydrationNode) {\n\t\tlet rootNode = context.hydrationNode;\n\n\t\t// If the root node we need is a text node, and the hydration node is\n\t\t// not a text node but the previous node is, use the previous node. This\n\t\t// is caused by text nodes being merged in HTML\n\t\tif (text && !isTextNode(rootNode) && isTextNode(rootNode.previousSibling)) {\n\t\t\trootNode = rootNode.previousSibling;\n\t\t\tcontext.hydrationNode = rootNode;\n\t\t}\n\n\t\t// HACK: If the root node is a hydration start comment node, get the\n\t\t// next one instead\n\t\tif (isCommentNode(rootNode) && rootNode.data === HYDRATION_START) {\n\t\t\trootNode = rootNode.nextSibling!;\n\t\t\tcontext.hydrationNode = rootNode;\n\t\t}\n\n\t\t// If hydrating, set the active range's start node\n\t\tconst range = context.activeRange;\n\t\tif (range && !range.startNode) {\n\t\t\trange.startNode = rootNode;\n\t\t}\n\n\t\treturn rootNode;\n\t} else {\n\t\t// NOTE: We know this is not null as it is being called from generated\n\t\t// code\n\t\treturn parent.firstChild!;\n\t}\n}\n","import nodeCheckHydrationBreak from \"./nodeCheckHydrationBreak\";\n\n/**\n * Gets the sibling of a node, x nodes after it.\n *\n * When hydrating, sets the hydration node.\n *\n * @param node The node.\n * @param count The number of nodes to skip.\n */\nexport default function nodeSkip(node: ChildNode, count: number): ChildNode {\n\tlet nextNode = node;\n\n\tfor (let i = 0; i < count; i++) {\n\t\tnextNode = nodeCheckHydrationBreak(nextNode.nextSibling)!;\n\t}\n\n\t// NOTE: We know this is not null as it is being called from generated code\n\treturn nextNode!;\n}\n","import { type Range } from \"../types/Range\";\nimport $run from \"./$run\";\nimport context from \"./context\";\nimport popRange from \"./popRange\";\nimport pushRange from \"./pushRange\";\n\n/**\n * Runs an`if`, `switch` or `await` control statement\n * @param create A function that creates the control statement's branches\n */\nexport default function runControl(\n\trange: Range,\n\tanchor: Node | null,\n\tcreate: (anchor: Node | null) => void,\n): void {\n\t// Store the index in the range so that it can be accessed by the statement's\n\t// branches\n\trange.index = -1;\n\n\tconst oldRange = pushRange(range, true);\n\n\t// Run the control statement in an effect\n\t$run(function runControl() {\n\t\t// Push and pop the control statement on subsequent runs, so that new branch\n\t\t// ranges will be added to its children\n\t\tconst oldBranchRange = pushRange(range);\n\n\t\t// Run the function that creates the control statement's branches\n\t\tcreate(anchor);\n\n\t\tpopRange(oldBranchRange);\n\t});\n\n\t// If we're mounting, the anchor will be the one that is passed in, but if\n\t// we're hydrating it will be after the active branch's HTML elements, so we\n\t// need to update it after the branches have been hydrated\n\tif (context.hydrationNode) {\n\t\tanchor = context.hydrationNode.nextSibling;\n\t}\n\n\tpopRange(oldRange);\n}\n","import { type Range } from \"../types/Range\";\nimport clearRange from \"./clearRange\";\nimport context from \"./context\";\nimport newRange from \"./newRange\";\nimport popRange from \"./popRange\";\nimport pushRange from \"./pushRange\";\n\nexport default function runControlBranch(range: Range, index: number, create: () => void): void {\n\t// Only run the branch if it's not the current branch\n\tif (index >= 0 && range.index === index) {\n\t\treturn;\n\t}\n\tif (range.children?.length) {\n\t\t// Branching ranges have exactly one child\n\t\tclearRange(range.children[0]);\n\t\trange.children.length = 0;\n\t}\n\n\tconst oldRange = pushRange(newRange(), true);\n\n\t// Do NOT re-run the entire control for properties accessed while updating\n\t// its branches. E.g. we want to re-run the control for `@if ($state.x > 5)`\n\t// (in runControl) but not for `<span>{$state.text}</span>` (in\n\t// runControlBranch)\n\tconst oldEffect = context.activeEffect;\n\tcontext.activeEffect = null;\n\n\t// Run the create function\n\tcreate();\n\n\t// Set the active effect back for the next branch\n\tcontext.activeEffect = oldEffect;\n\n\tpopRange(oldRange);\n\n\t// Set the index on the branching range\n\trange.index = index;\n}\n","import { type Range } from \"../types/Range\";\nimport isFragmentNode from \"./isFragmentNode\";\n\nexport default function moveRange(parent: Node, range: Range, before: ChildNode | null): void {\n\tconst endNode = range.endNode || range.startNode;\n\tlet currentNode = range.startNode;\n\n\t// HACK: The parent may have once been a document fragment, but will now be\n\t// in the document, so we will have to use the before element's parent,\n\t// which should work as long as we are always passing a before element...\n\tif (isFragmentNode(parent)) {\n\t\tparent = before!.parentNode!;\n\t}\n\n\twhile (currentNode) {\n\t\tconst nextNode = currentNode.nextSibling;\n\t\tparent.insertBefore(currentNode, before);\n\t\tif (currentNode === endNode) break;\n\t\tcurrentNode = nextNode;\n\t}\n}\n","// Adapted from https://github.com/snabbdom/snabbdom\n// With changes from https://github.com/luwes/js-diff-benchmark\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 Simon Friis Vindum\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nimport { type ListItem } from \"../types/ListItem\";\nimport { type Range } from \"../types/Range\";\nimport $watch from \"./$watch\";\nimport clearRange from \"./clearRange\";\nimport context from \"./context\";\nimport moveRange from \"./moveRange\";\n\n/**\n * @param range The list's range\n * @param parent The parent DOM element\n * @param anchor The DOM element to create new items before\n * @param oldItems The list of current items\n * @param newItems The list of future items\n * @param create A function that creates the DOM elements for a new item\n */\nexport default function runListItems(\n\trange: Range,\n\tparent: ParentNode,\n\tanchor: Node | null,\n\toldItems: ListItem[],\n\tnewItems: ListItem[],\n\tcreate: (data: ListItem, before: Node | null) => void,\n): void {\n\tlet oldStartIndex = 0;\n\tlet oldEndIndex = oldItems.length - 1;\n\tlet oldStartItem = oldItems[0];\n\tlet oldEndItem = oldItems[oldEndIndex];\n\n\tlet newStartIndex = 0;\n\tlet newEndIndex = newItems.length - 1;\n\tlet newStartItem = newItems[0];\n\tlet newEndItem = newItems[newEndIndex];\n\n\tlet oldKeyToIndex: Map<any, number> | undefined;\n\tlet newKeyToIndex: Map<any, number> | undefined;\n\n\twhile (oldStartIndex <= oldEndIndex && newStartIndex <= newEndIndex) {\n\t\tif (oldStartItem == null) {\n\t\t\toldStartItem = oldItems[++oldStartIndex];\n\t\t} else if (oldEndItem == null) {\n\t\t\toldEndItem = oldItems[--oldEndIndex];\n\t\t} else if (newStartItem == null) {\n\t\t\tnewStartItem = newItems[++newStartIndex];\n\t\t} else if (newEndItem == null) {\n\t\t\tnewEndItem = newItems[--newEndIndex];\n\t\t} else if (oldStartItem.key === newStartItem.key) {\n\t\t\ttransferRangeMarkers(oldStartItem, newStartItem);\n\t\t\toldStartItem = oldItems[++oldStartIndex];\n\t\t\tnewStartItem = newItems[++newStartIndex];\n\t\t} else if (oldEndItem.key === newEndItem.key) {\n\t\t\ttransferRangeMarkers(oldEndItem, newEndItem);\n\t\t\toldEndItem = oldItems[--oldEndIndex];\n\t\t\tnewEndItem = newItems[--newEndIndex];\n\t\t} else if (oldStartItem.key === newEndItem.key) {\n\t\t\t// Move to the end\n\t\t\t//console.log(\"move\", oldStartItem.key, \"to the end\");\n\t\t\tmoveRange(parent, oldStartItem, oldEndItem.endNode?.nextSibling!);\n\t\t\ttransferRangeMarkers(oldStartItem, newEndItem);\n\t\t\toldStartItem = oldItems[++oldStartIndex];\n\t\t\tnewEndItem = newItems[--newEndIndex];\n\t\t} else if (oldEndItem.key === newStartItem.key) {\n\t\t\t// Move to the start\n\t\t\t//console.log(\"move\", oldEndItem.key, \"to the start\");\n\t\t\tmoveRange(parent, oldEndItem, oldStartItem?.startNode);\n\t\t\ttransferRangeMarkers(oldEndItem, newStartItem);\n\t\t\toldEndItem = oldItems[--oldEndIndex];\n\t\t\tnewStartItem = newItems[++newStartIndex];\n\t\t} else {\n\t\t\t// Lazily build maps of keys to indexes here\n\t\t\t// They are relevant only if there has been a move, or a mid-list\n\t\t\t// insertion or deletion, and not if there has been an insertion\n\t\t\t// at the end or deletion from the front\n\t\t\tif (!oldKeyToIndex || !newKeyToIndex) {\n\t\t\t\toldKeyToIndex = new Map();\n\t\t\t\tfor (let i = oldStartIndex; i < oldEndIndex; i++) {\n\t\t\t\t\toldKeyToIndex.set(oldItems[i].key, i);\n\t\t\t\t}\n\t\t\t\tnewKeyToIndex = new Map();\n\t\t\t\tfor (let i = newStartIndex; i < newEndIndex; i++) {\n\t\t\t\t\tnewKeyToIndex.set(newItems[i].key, i);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet oldIndex = oldKeyToIndex.get(newStartItem.key);\n\t\t\tlet newIndex = newKeyToIndex.get(oldStartItem.key);\n\n\t\t\tif (oldIndex === undefined && newIndex === undefined) {\n\t\t\t\t// Replace\n\t\t\t\t//console.log(\"replace\", oldStartItem.key, \"with\", newStartItem.key);\n\t\t\t\tnewStartItem.data = $watch(newStartItem.data);\n\t\t\t\tcreate(newStartItem, oldStartItem.startNode);\n\t\t\t\tclearRange(oldStartItem);\n\t\t\t\t// @ts-ignore We know we have an active range (the for loop) and that it\n\t\t\t\t// has children (because we're replacing one)\n\t\t\t\tcontext.activeRange.children.splice(oldStartIndex, 1);\n\t\t\t\toldStartItem = oldItems[++oldStartIndex];\n\t\t\t\tnewStartItem = newItems[++newStartIndex];\n\t\t\t} else if (oldIndex === undefined) {\n\t\t\t\t// Insert\n\t\t\t\t//console.log(\"insert\", newStartItem.key);\n\t\t\t\tnewStartItem.data = $watch(newStartItem.data);\n\t\t\t\tcreate(newStartItem, oldStartItem.startNode);\n\t\t\t\tnewStartItem = newItems[++newStartIndex];\n\t\t\t} else if (newIndex === undefined) {\n\t\t\t\t// Delete\n\t\t\t\t//console.log(\"delete\", oldStartItem.key);\n\t\t\t\tclearRange(oldStartItem);\n\t\t\t\t// @ts-ignore We know we have an active range (the for loop) and that it\n\t\t\t\t// has children (because we're deleting one)\n\t\t\t\tcontext.activeRange.children.splice(oldStartIndex, 1);\n\t\t\t\toldStartItem = oldItems[++oldStartIndex];\n\t\t\t} else {\n\t\t\t\t// Move\n\t\t\t\t//console.log(\"move\", newStartItem.key, \"before\", oldStartItem.key);\n\t\t\t\tconst oldData = oldItems[oldIndex];\n\t\t\t\tmoveRange(parent, oldData, oldStartItem.startNode);\n\t\t\t\ttransferRangeMarkers(oldData, newStartItem);\n\t\t\t\t// @ts-ignore TODO: Set key null instead?\n\t\t\t\toldItems[oldIndex] = null;\n\t\t\t\tnewStartItem = newItems[++newStartIndex];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (oldStartIndex <= oldEndIndex || newStartIndex <= newEndIndex) {\n\t\tif (oldStartIndex > oldEndIndex) {\n\t\t\t// The old list is exhausted; process new list additions\n\t\t\t// HACK: I think it would be better to move anchors to the end?\n\t\t\tlet before: Node | null =\n\t\t\t\toldStartItem?.startNode || oldItems[oldItems.length - 1]?.endNode?.nextSibling || anchor;\n\t\t\tfor (newStartIndex; newStartIndex <= newEndIndex; newStartItem = newItems[++newStartIndex]) {\n\t\t\t\t//console.log(\"create\", newStartItem.key);\n\t\t\t\tnewStartItem.data = $watch(newStartItem.data);\n\t\t\t\tcreate(newStartItem, before!);\n\t\t\t\tbefore = newStartItem.endNode?.nextSibling!;\n\t\t\t}\n\t\t} else {\n\t\t\t// The new list is exhausted; process old list removals\n\t\t\t// Just truncate the parent range's children collection\n\t\t\tif (range.children) {\n\t\t\t\trange.children.length = oldStartIndex;\n\t\t\t}\n\t\t\tfor (oldStartIndex; oldStartIndex <= oldEndIndex; oldStartItem = oldItems[++oldStartIndex]) {\n\t\t\t\t//console.log(\"clear\", oldStartItem.key);\n\t\t\t\tclearRange(oldStartItem);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction transferRangeMarkers(oldItem: ListItem, newItem: ListItem) {\n\tnewItem.startNode = oldItem.startNode;\n\tnewItem.endNode = oldItem.endNode;\n\n\t// Manually transfer the new data's props to the old ones (to run effects)\n\t// and then set the new data to the old one\n\tfor (let prop in oldItem.data) {\n\t\toldItem.data[prop] = newItem.data[prop];\n\t}\n\tnewItem.data = oldItem.data;\n}\n","import { type ListItem } from \"../types/ListItem\";\nimport { type Range } from \"../types/Range\";\nimport $run from \"./$run\";\nimport context from \"./context\";\nimport popRange from \"./popRange\";\nimport pushRange from \"./pushRange\";\nimport runListItems from \"./runListItems\";\n\n/**\n * Runs a `for` control statement\n * @param create A function that creates the control statement's branches\n */\nexport default function runList(\n\trange: Range,\n\tparent: ParentNode,\n\tanchor: Node | null,\n\tbuildItems: () => ListItem[],\n\tcreate: (item: ListItem, anchor: Node | null) => void,\n): void {\n\tconst oldRange = pushRange(range, true);\n\n\tlet listItems: ListItem[] = [];\n\n\t// Run the list in an effect\n\t$run(function runList() {\n\t\t// Push and pop the control statement on subsequent runs, so that new\n\t\t// item ranges will be added to its children\n\t\tconst oldBranchRange = pushRange(range);\n\n\t\t// Build the array of items with keys and data\n\t\tconst newItems = buildItems();\n\n\t\t// Do NOT re-run the list for properties accessed while updating its\n\t\t// items. E.g. we want to re-run the list for `@for (item of $items)`\n\t\t// (in buildItems, above) but not for `<span>{item.id}</span>` (in\n\t\t// runListItems, below)\n\t\tcontext.activeEffect = null;\n\n\t\t// Run the function that updates the list's items\n\t\trunListItems(range, parent, anchor, listItems, newItems, create);\n\n\t\tlistItems = newItems;\n\n\t\tpopRange(oldBranchRange);\n\t});\n\n\t// If we're mounting, the anchor will be the one that is passed in, but if\n\t// we're hydrating it will be after the items' HTML elements, so we need to\n\t// update it after all of the items have been hydrated\n\tif (context.hydrationNode) {\n\t\tanchor = context.hydrationNode.nextSibling;\n\t}\n\n\tpopRange(oldRange);\n}\n","export default function setAttribute(el: Element, name: string, value: any): void {\n\tif (value === false || value == null) {\n\t\tel.removeAttribute(name);\n\t} else {\n\t\tel.setAttribute(name, value);\n\t}\n}\n","import context from \"./context\";\n\n// TODO: Should we @toggle this instead? That would call :onmount etc again for the new element\n\nexport default function setDynamicElement(el: HTMLElement, tag: string): HTMLElement {\n\t// If hydrating, it should already have been created as the correct element\n\tif (context.hydrationNode) {\n\t\treturn el;\n\t}\n\n\t// Replace the old element with the new element\n\tlet newElement = el.ownerDocument.createElement(tag);\n\tel.replaceWith(newElement);\n\n\treturn newElement;\n}\n"],"mappings":";;;;;;;;AAgDA,IAAM,UAAmB;AAAA,EACxB,cAAc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A,QACA,YACA,QACO;AACP,QAAM,WAAW,UAAU,OAAO,IAAI;AAEtC,MAAI,YAAwB,CAAC;AAG7B,OAAK,SAASC,WAAU;AAGvB,UAAM,iBAAiB,UAAU,KAAK;AAGtC,UAAM,WAAW,WAAW;AAM5B,oBAAQ,eAAe;AAGvB,iBAAa,OAAO,QAAQ,QAAQ,WAAW,UAAU,MAAM;AAE/D,gBAAY;AAEZ,aAAS,cAAc;AAAA,EACxB,CAAC;AAKD,MAAI,gBAAQ,eAAe;AAC1B,aAAS,gBAAQ,cAAc;AAAA,EAChC;AAEA,WAAS,QAAQ;AAClB;;;ACtDe,SAAR,aAA8B,IAAa,MAAc,OAAkB;AACjF,MAAI,UAAU,SAAS,SAAS,MAAM;AACrC,OAAG,gBAAgB,IAAI;AAAA,EACxB,OAAO;AACN,OAAG,aAAa,MAAM,KAAK;AAAA,EAC5B;AACD;;;ACFe,SAAR,kBAAmC,IAAiB,KAA0B;AAEpF,MAAI,gBAAQ,eAAe;AAC1B,WAAO;AAAA,EACR;AAGA,MAAI,aAAa,GAAG,cAAc,cAAc,GAAG;AACnD,KAAG,YAAY,UAAU;AAEzB,SAAO;AACR;","names":["setAttribute","fragment","runControl","runList"]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["effect: Effect","proxyDataSymbol: unique symbol","proxyHandledSymbol: unique symbol","lastEffect: Effect | null","context","targetSub: Subscription","computed: Computed | undefined","data: ProxyData","context","arrayWrapper: Record<PropertyKey, any>","context","handler: ProxyHandler<T>","context","context","context","context","setAttribute","animations: Animation[] | undefined","context","context","context","context","context","context","context","context","runControl","context","oldKeyToIndex: Map<any, number> | undefined","newKeyToIndex: Map<any, number> | undefined","listItems: ListItem[]","runList","context","context","#init"],"sources":["../src/render/$mount.ts","../src/render/$run.ts","../src/watch/symbols.ts","../src/render/$unwrap.ts","../src/watch/trackProxyEffect.ts","../src/watch/updateSignal.ts","../src/watch/proxyGet.ts","../src/watch/proxySet.ts","../src/render/$watch.ts","../src/render/addAnimation.ts","../src/render/addEvent.ts","../src/motion/animate.ts","../src/render/isFragmentNode.ts","../src/render/addFragment.ts","../src/render/applyProps.ts","../src/render/clearRange.ts","../src/render/clearLayoutSlot.ts","../src/render/newRange.ts","../src/render/popRange.ts","../src/render/pushRange.ts","../src/render/fillLayoutSlot.ts","../src/render/getFragment.ts","../src/render/hydrate.ts","../src/render/mount.ts","../src/render/newListItem.ts","../src/render/hydrationMarkers.ts","../src/render/isCommentNode.ts","../src/render/isTextNode.ts","../src/render/nodeCheckHydrationBreak.ts","../src/render/nodeNext.ts","../src/render/nodeAnchor.ts","../src/render/nodeChild.ts","../src/render/nodeRoot.ts","../src/render/nodeSkip.ts","../src/render/runControl.ts","../src/render/runControlBranch.ts","../src/render/moveRange.ts","../src/render/runListItems.ts","../src/render/runList.ts","../src/render/setAttribute.ts","../src/render/setDynamicElement.ts","../src/wrappers/ReactiveDate.ts"],"sourcesContent":["import type Cleanup from \"../types/Cleanup\";\nimport context from \"./context\";\n\n/**\n * Runs and re-runs a function on component mount\n *\n * @param fn The function to run, which may return a cleanup function\n */\nexport default function $mount(fn: () => Cleanup | void): void {\n\tcontext.mountEffects.push(fn);\n}\n","import type Cleanup from \"../types/Cleanup\";\nimport type Effect from \"../types/Effect\";\nimport { EFFECT_TYPE } from \"../types/constants\";\nimport runEffect from \"../watch/runEffect\";\n\n// TODO: Take a pipeline of operators e.g. debounce\n\n/**\n * Runs and re-runs a function that depends on a watched object\n *\n * @param fn The function to run, which may return a cleanup function.\n */\nexport default function $run(fn: () => Cleanup | void, name?: string): Effect {\n\tlet effect: Effect = {\n\t\ttype: EFFECT_TYPE,\n\t\trun: fn,\n\t\tcleanup: undefined,\n\t\tfirstSource: null,\n\t\tnextEffect: null,\n\t\textent: 0,\n\t\tnextEffectToRun: null,\n\t\tdidError: false,\n\t\tname,\n\t\t//name: dev.effectName(fn),\n\t};\n\n\trunEffect(effect);\n\n\treturn effect;\n}\n","// TODO: Should these be branded?\nconst proxyDataSymbol: unique symbol = Symbol(\"_proxy_data\");\nconst proxyHandledSymbol: unique symbol = Symbol(\"_proxy_handled\");\n\nexport { proxyDataSymbol, proxyHandledSymbol };\n","import { proxyDataSymbol } from \"../watch/symbols\";\n\n/**\n * Returns the target object of a proxy\n *\n * @param object The proxy object\n */\nexport default function $unwrap<T extends Record<PropertyKey, any>>(object: T): T {\n\treturn object !== undefined && object !== null && object[proxyDataSymbol] !== undefined\n\t\t? (object[proxyDataSymbol].target ?? object)\n\t\t: object;\n}\n","import type ProxyData from \"../types/ProxyData\";\nimport { SIGNAL_TYPE } from \"../types/constants\";\nimport trackEffect from \"./trackEffect\";\n\nexport default function trackProxyEffect(data: ProxyData, key: PropertyKey): void {\n\t//console.log(`tracking effect '${context.activeTarget.name}' for '${String(key)}' prop`);\n\n\t// Create or get the signals\n\tlet signal = data.signals.get(key);\n\tif (signal === undefined) {\n\t\tsignal = {\n\t\t\ttype: SIGNAL_TYPE,\n\t\t\tfirstTarget: null,\n\t\t\tnextSignalToUpdate: null,\n\t\t\t//name: dev.propName(key),\n\t\t};\n\t\tdata.signals.set(key, signal);\n\t}\n\n\ttrackEffect(signal);\n}\n","import context from \"../render/context\";\nimport type Computed from \"../types/Computed\";\nimport type Effect from \"../types/Effect\";\nimport type ProxyData from \"../types/ProxyData\";\nimport type ProxySignal from \"../types/ProxySignal\";\nimport type Subscription from \"../types/Subscription\";\nimport { COMPUTED_TYPE, EFFECT_TYPE } from \"../types/constants\";\nimport batchEnd from \"./batchEnd\";\nimport batchStart from \"./batchStart\";\n\nlet lastEffect: Effect | null;\n\n/**\n * When a signal is changed, we need to\n * - Set the signal's subscriptions to recalc\n * - Set any dependent computed values to recalc\n * - Gather dependent effects that will need to be re-run\n */\nexport default function updateSignal(proxy: ProxyData, key: PropertyKey): void {\n\t//console.log(`triggering effects for '${String(key)}' on`, proxy);\n\t//console.log(\"===\");\n\t//console.log(`triggering effects for '${String(key)}'`);\n\n\tlet signal = proxy.signals.get(key) as ProxySignal;\n\tif (signal !== undefined && signal.firstTarget !== null) {\n\t\tbatchStart();\n\n\t\ttry {\n\t\t\t// Add the signal to the context for updating after triggering\n\t\t\tif (context.firstSignalToUpdate === null) {\n\t\t\t\tcontext.firstSignalToUpdate = signal;\n\t\t\t} else if (signal.nextSignalToUpdate === null) {\n\t\t\t\tlet lastSignal = context.firstSignalToUpdate;\n\t\t\t\twhile (lastSignal.nextSignalToUpdate !== null) {\n\t\t\t\t\tlastSignal = lastSignal.nextSignalToUpdate;\n\t\t\t\t}\n\t\t\t\tlastSignal.nextSignalToUpdate = signal;\n\t\t\t}\n\n\t\t\t// Cache the last effect in the chain, so we don't have to keep\n\t\t\t// looping in cases where there are lots of them for this signal\n\t\t\tlastEffect = context.firstEffectToRun;\n\t\t\tif (lastEffect !== null) {\n\t\t\t\twhile (lastEffect.nextEffectToRun !== null) {\n\t\t\t\t\tlastEffect = lastEffect.nextEffectToRun;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// De-activate all targets, so they can be re-used/updated/deleted,\n\t\t\t// and mark them to be recalculated\n\t\t\tlet targetSub: Subscription = signal.firstTarget;\n\t\t\tlet computed: Computed | undefined;\n\t\t\touter: while (true) {\n\t\t\t\t// De-activate all targets, so they can be re-used/updated/deleted\n\t\t\t\ttargetSub.active = false;\n\t\t\t\ttargetSub.recalc = true;\n\n\t\t\t\tconst target = targetSub.target;\n\t\t\t\tif (target.type === EFFECT_TYPE) {\n\t\t\t\t\t// Add the effect to the context for running after triggering\n\t\t\t\t\tif (lastEffect === null) {\n\t\t\t\t\t\tcontext.firstEffectToRun = target;\n\t\t\t\t\t\tlastEffect = target;\n\t\t\t\t\t} else if (target.nextEffectToRun === null && lastEffect !== target) {\n\t\t\t\t\t\tlastEffect.nextEffectToRun = target;\n\t\t\t\t\t\tlastEffect = target;\n\t\t\t\t\t}\n\t\t\t\t} else if (/*target.type === COMPUTED_TYPE*/ !target.recalc) {\n\t\t\t\t\t// This may need to be re-computed in the pull phase\n\t\t\t\t\ttarget.recalc = true;\n\n\t\t\t\t\t// Check the computed's targets\n\t\t\t\t\tif (target.firstTarget !== null) {\n\t\t\t\t\t\tcomputed = target;\n\t\t\t\t\t\tcomputed.rollback = targetSub;\n\t\t\t\t\t\ttargetSub = target.firstTarget;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If there are no more targets, we may need to rollback to the\n\t\t\t\t// last computed that had more targets\n\t\t\t\twhile (targetSub.nextTarget === null && computed !== undefined) {\n\t\t\t\t\ttargetSub = computed.rollback!;\n\t\t\t\t\tif (targetSub.source.type !== COMPUTED_TYPE) {\n\t\t\t\t\t\tcomputed = undefined;\n\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t}\n\t\t\t\t\tcomputed = targetSub.source;\n\t\t\t\t}\n\n\t\t\t\tif (targetSub.nextTarget === null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\ttargetSub = targetSub.nextTarget;\n\t\t\t}\n\t\t} finally {\n\t\t\tbatchEnd();\n\t\t}\n\t}\n}\n","import $watch from \"../render/$watch\";\nimport context from \"../render/context\";\nimport type Computed from \"../types/Computed\";\nimport type ProxyData from \"../types/ProxyData\";\nimport { COMPUTED_TYPE, SIGNAL_TYPE } from \"../types/constants\";\nimport checkComputed from \"./checkComputed\";\nimport { proxyDataSymbol } from \"./symbols\";\nimport trackEffect from \"./trackEffect\";\nimport trackProxyEffect from \"./trackProxyEffect\";\nimport updateSignal from \"./updateSignal\";\n\nexport default function proxyGet(\n\ttarget: Record<PropertyKey, any>,\n\tkey: PropertyKey,\n\treceiver: any,\n): any {\n\tlet data: ProxyData = target[proxyDataSymbol];\n\n\tif (key === proxyDataSymbol) {\n\t\treturn data;\n\t}\n\n\t//console.log(`object get '${String(key)}' on`, target);\n\t//console.log(`object get '${String(key)}'`);\n\n\tlet signal = data.signals.get(key);\n\tif (signal === undefined) {\n\t\tconst propDescriptor = Object.getOwnPropertyDescriptor(target, key);\n\t\tif (propDescriptor !== undefined) {\n\t\t\tif (propDescriptor.writable) {\n\t\t\t\t// Setup data for the property\n\t\t\t\tif (data.shallow !== true) {\n\t\t\t\t\t// Set the value to a new proxy if it's an object\n\t\t\t\t\tconst value = target[key];\n\t\t\t\t\tif (\n\t\t\t\t\t\tvalue !== undefined &&\n\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\ttypeof value === \"object\" &&\n\t\t\t\t\t\tvalue[proxyDataSymbol] === undefined &&\n\t\t\t\t\t\t// But not if it's a Promise (i.e. has a `then` method)\n\t\t\t\t\t\tvalue.then === undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\ttarget[key] = $watch(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If a property is being accessed in the course of setting up an\n\t\t\t\t// effect, track it\n\t\t\t\ttrackProxyEffect(data, key);\n\t\t\t} else if (propDescriptor.get) {\n\t\t\t\t// OK, we're only checking for computed values if it's read-only for\n\t\t\t\t// now, but we probably need to check any getter's value -- e.g. the\n\t\t\t\t// user may wish to add a setter to optimistically set a value, have\n\t\t\t\t// the UI update, then set the value concretely later (e.g. if\n\t\t\t\t// updating a `count` via a fetch)\n\n\t\t\t\tconst oldRegisterComputed = context.registerComputed;\n\t\t\t\ttry {\n\t\t\t\t\t// Allow calling `$cache` to assign the computed to a proxy\n\t\t\t\t\t// signal\n\t\t\t\t\tcontext.registerComputed = (computed: Computed) => {\n\t\t\t\t\t\tdata.signals.set(key, computed);\n\t\t\t\t\t};\n\t\t\t\t\treturn Reflect.get(target, key, receiver);\n\t\t\t\t} finally {\n\t\t\t\t\tcontext.registerComputed = oldRegisterComputed;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (data.isArray) {\n\t\t\t// If it's a function in an array, we may intercept it\n\t\t\tif (arrayWrapper[key] !== undefined) {\n\t\t\t\treturn arrayWrapper[key](data, target, key);\n\t\t\t}\n\t\t}\n\t} else if (signal.type === SIGNAL_TYPE) {\n\t\t// If a property is being accessed in the course of setting up an\n\t\t// effect, track it\n\t\ttrackProxyEffect(data, key);\n\t} else if (signal.type === COMPUTED_TYPE) {\n\t\tif (signal.running) {\n\t\t\tthrow new Error(\"Cycle detected\");\n\t\t} else if (signal.recalc) {\n\t\t\t// If a signal that the computed depends on has been changed,\n\t\t\t// but the computed hasn't yet been read, it may need to be\n\t\t\t// re-computed\n\t\t\tcheckComputed(signal);\n\t\t} else if (signal.didError) {\n\t\t\t// If there was a previous error, and no dependencies have\n\t\t\t// changed, throw the error again\n\t\t\tthrow signal.value;\n\t\t} else {\n\t\t\ttrackEffect(signal);\n\t\t}\n\t\treturn signal.value;\n\t}\n\n\t// Return the property value\n\treturn Reflect.get(target, key, receiver);\n}\n\n// Prevent array functions from calling functions and properties in breakable\n// ways (e.g. calling splice sets length before adding items)\nconst arrayWrapper: Record<PropertyKey, any> = {\n\t[Symbol.iterator]: function (data: ProxyData, target: any, key: PropertyKey) {\n\t\ttrackProxyEffect(data, \"length\");\n\t\t// HACK: This prevents lists being re-run on every random property\n\t\t// access by disabling the active effect before properties get\n\t\t// accessed. I'm not sure if this is the best way to achieve this...\n\t\tcontext.activeTarget = null;\n\t\treturn target[key];\n\t},\n\tpop: arrayHandle,\n\tpush: arrayHandle,\n\treverse: arrayHandle,\n\tshift: arrayHandle,\n\tsort: arrayHandle,\n\tsplice: arrayHandle,\n\tunshift: arrayHandle,\n};\n\nfunction arrayHandle(data: ProxyData, target: any, key: PropertyKey): Function {\n\t// Call the function on the target (so proxy properties don't get\n\t// intercepted) and trigger effects that depend on `length`\n\treturn function (...args: any[]) {\n\t\tconst func = target[key];\n\t\tconst result = func.apply(target, args);\n\t\tupdateSignal(data, \"length\");\n\t\treturn result;\n\t};\n}\n","import $watch from \"../render/$watch\";\nimport context from \"../render/context\";\nimport { proxyDataSymbol } from \"./symbols\";\n//import transferEffects from \"./transferEffects\";\nimport updateSignal from \"./updateSignal\";\n\nexport default function proxySet(\n\ttarget: Record<PropertyKey, any>,\n\tkey: PropertyKey,\n\tvalue: any,\n\treceiver: any,\n): boolean {\n\t//console.log(`object set '${String(key)}' to '`, value, `' on`, target);\n\t//console.log(`object set '${String(key)}'`);\n\n\t// Only do things if the value has changed\n\tconst oldValue = target[key];\n\tif (value !== oldValue) {\n\t\tif (context.batchOperation > 100) {\n\t\t\tthrow new Error(\"Cycle detected\");\n\t\t}\n\n\t\tlet data = target[proxyDataSymbol];\n\n\t\t// If the value was previously a proxy, watch the new value and update\n\t\t// its effect subscriptions\n\t\tif (oldValue && oldValue[proxyDataSymbol] !== undefined) {\n\t\t\tvalue = $watch(value, { shallow: oldValue[proxyDataSymbol].shallow });\n\t\t\t//transferEffects(oldValue, newValue);\n\t\t}\n\n\t\t// Set the property value on the target\n\t\tReflect.set(target, key, value, receiver);\n\n\t\t// Re-run effects\n\t\tupdateSignal(data, key);\n\n\t\t// If an item in an array is being set directly, trigger the length to\n\t\t// cause any lists to be re-run and data re-bound\n\t\t// TODO: Can we update the single item's data directly somehow?\n\t\tif (data.isArray && !isNaN(+String(key))) {\n\t\t\tupdateSignal(data, \"length\");\n\t\t}\n\t}\n\n\treturn true;\n}\n","import type ProxyData from \"../types/ProxyData\";\nimport type WatchOptions from \"../types/WatchOptions\";\nimport proxyGet from \"../watch/proxyGet\";\nimport proxySet from \"../watch/proxySet\";\nimport { proxyDataSymbol } from \"../watch/symbols\";\n\n/**\n * Watches an object and runs effects when its properties are changed\n *\n * @param object The object to watch\n */\nexport default function $watch<T extends Record<PropertyKey, any>>(\n\tobject: T,\n\toptions?: WatchOptions,\n): T {\n\t// Return the object itself if it is undefined or null, or if it is already a proxy\n\tif (object === undefined || object === null || object[proxyDataSymbol] !== undefined) {\n\t\treturn object;\n\t}\n\n\t// DEBUG: Make sure we can proxy this value\n\t//if (typeof object !== \"object\") {\n\t//\tthrow new Error(`$watch can't be called with a ${typeof object}`);\n\t//}\n\n\t// Create a proxy handler for each object, and store some data for it here\n\tconst data: ProxyData = {\n\t\ttarget: object,\n\t\tisArray: Array.isArray(object),\n\t\tshallow: options?.shallow === true,\n\t\tsignals: new Map(),\n\t};\n\n\t// @ts-ignore\n\tobject[proxyDataSymbol] = data;\n\n\tconst handler: ProxyHandler<T> = {\n\t\tget: proxyGet,\n\t\tset: proxySet,\n\t};\n\n\treturn new Proxy(object, handler) as T;\n}\n","import type Animation from \"../types/Animation\";\nimport context from \"./context\";\n\nexport default function addAnimation(el: HTMLElement, entry?: Animation, exit?: Animation): void {\n\t// Stash the event in context so that it can be added when the fragment is\n\t// added to the DOM\n\t// NOTE: We don't need to do this for hydration, but it's simpler to do it\n\t// the same way in both processes\n\tcontext.stashedAnimations.push({\n\t\trange: context.activeRange,\n\t\tel,\n\t\tin: entry,\n\t\tout: exit,\n\t});\n}\n","import context from \"./context\";\n\nexport default function addEvent(\n\tel: Element,\n\ttype: string,\n\tlistener: (this: Element, ev: any) => any,\n): void {\n\t// Stash the event in context so that it can be added when the fragment is\n\t// added to the DOM\n\t// NOTE: We don't need to do this for hydration, but it's simpler to do it\n\t// the same way in both processes\n\tcontext.stashedEvents.push({ range: context.activeRange, el, type, listener });\n}\n","import context from \"../render/context\";\n\n/**\n * Adds an animation for an element\n * @param el The element to animate\n * @param enter Whether the animation is being run on enter\n * @param keyframes The Web Animation API keyframes\n * @param options The Web Animmation API options\n */\nexport default async function animate(\n\tel: HTMLElement,\n\tenter: boolean,\n\tkeyframes: Keyframe[] | PropertyIndexedKeyframes | null,\n\toptions?: number | KeyframeAnimationOptions,\n): Promise<void> {\n\t// This is quite simplistic\n\t// We might need to\n\t// - store the animation\n\t// - reverse it if it's running and the range appears/disappears\n\t// - transfer the animation to the new element\n\tlet animationOptions = Object.assign(\n\t\t{\n\t\t\tdirection: enter ? \"normal\" : \"reverse\",\n\t\t\t// TODO: Should probably have a global setting for these somewhere\n\t\t\t// And respect browser reduce motion settings\n\t\t\tduration: 300,\n\t\t\teasing: \"ease-in-out\",\n\t\t\tfill: \"forwards\",\n\t\t},\n\t\toptions,\n\t);\n\n\tconst animation = el.animate(keyframes, animationOptions);\n\n\t// HACK: I'm not entirely sure why we need to sent the animation's timeline,\n\t// but without it, animations never start\n\t// HACK: We also need to make sure the element has been added to the DOM\n\t// with a timeout\n\tsetTimeout(() => {\n\t\tanimation.timeline = el.ownerDocument.timeline;\n\t}, 1);\n\n\t// Add the animation to the active range, so that the range won't be cleared\n\t// until the animation is completed\n\tlet activeRange = context.activeRange;\n\tif (activeRange) {\n\t\t// TODO: An option for whether to await or cancel events on range remove\n\t\t// e.g. if you are doing a client side navigation, you don't want to run animations\n\t\tactiveRange.animations ??= new Set();\n\t\tactiveRange.animations.add(animation);\n\t\tawait animation.finished;\n\t\tactiveRange.animations.delete(animation);\n\t}\n}\n","export default function isFragmentNode(node: Node): node is DocumentFragment {\n\treturn node.nodeType === 11;\n}\n","import animate from \"../motion/animate\";\nimport $run from \"./$run\";\nimport context from \"./context\";\nimport isFragmentNode from \"./isFragmentNode\";\n\nexport default function addFragment(\n\tfragment: DocumentFragment,\n\tparent: ParentNode,\n\tbefore: Node | null,\n\tendNode?: ChildNode,\n): void {\n\t//console.log(`adding fragment '${fragment.textContent}' to `, parent);\n\t//console.log(\"before\", before);\n\n\tconst range = context.activeRange;\n\tconst hydrationNode = context.hydrationNode;\n\n\t// Set the active range's end node to the last node in the fragment\n\tif (hydrationNode !== null) {\n\t\trange.endNode = endNode ?? hydrationNode;\n\t} else {\n\t\trange.startNode = fragment.firstChild;\n\t\trange.endNode = fragment.lastChild;\n\t}\n\n\tparent = before?.parentNode ?? parent;\n\n\t// Add the fragment\n\tif (hydrationNode === null) {\n\t\tparent.insertBefore(fragment, before);\n\t}\n\n\t// If we're adding this fragment to the DOM, we can now run any $mount\n\t// effects, add our stashed events and play our stashed animations\n\tif (!isFragmentNode(parent)) {\n\t\t// Only run $mount effects if not hydrating (if hydrating, they will get\n\t\t// run at the end when everything is hooked up)\n\t\tif (hydrationNode === null) {\n\t\t\tfor (let effect of context.mountEffects) {\n\t\t\t\t$run(effect);\n\t\t\t}\n\t\t\tcontext.mountEffects.length = 0;\n\t\t}\n\n\t\t// Set the active range for each event so it will get attached to the\n\t\t// right one and set it back afterwards\n\t\tfor (let event of context.stashedEvents) {\n\t\t\tcontext.activeRange = event.range;\n\t\t\t$run(function addFragmentEvent() {\n\t\t\t\tevent.el.addEventListener(event.type, event.listener);\n\t\t\t\treturn () => {\n\t\t\t\t\tevent.el.removeEventListener(event.type, event.listener);\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t\tcontext.stashedEvents.length = 0;\n\n\t\t// Set the active range for each animation so it will get attached to\n\t\t// the right one and set it back afterwards\n\t\t// Don't await animations\n\t\tfor (let animation of context.stashedAnimations) {\n\t\t\tcontext.activeRange = animation.range;\n\t\t\t$run(function addFragmentAnimation() {\n\t\t\t\tif (animation.in !== undefined) {\n\t\t\t\t\t// eslint-disable-next-line no-floating-promises\n\t\t\t\t\tanimate(animation.el, true, animation.in.keyframes, animation.in.options);\n\t\t\t\t}\n\t\t\t\tif (animation.out !== undefined) {\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\t// eslint-disable-next-line no-floating-promises\n\t\t\t\t\t\tanimate(animation.el, false, animation.out!.keyframes, animation.out!.options);\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tcontext.stashedAnimations.length = 0;\n\n\t\t// Set the active range back\n\t\tcontext.activeRange = range;\n\t}\n}\n","import $run from \"./$run\";\n\nexport default function applyProps(\n\tel: Element,\n\tprops: Record<string, any> | undefined,\n\tpropNamesUsed: string[],\n): void {\n\tif (props !== undefined) {\n\t\tfor (let [name, value] of Object.entries(props)) {\n\t\t\tif (!propNamesUsed.includes(name)) {\n\t\t\t\tif (name.startsWith(\"on\")) {\n\t\t\t\t\tconst eventName = name.substring(2);\n\t\t\t\t\tel.addEventListener(eventName, value);\n\t\t\t\t} else {\n\t\t\t\t\t$run(function setAttribute() {\n\t\t\t\t\t\tel.setAttribute(name, value);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import type Range from \"../types/Range\";\n\nexport default function clearRange(range: Range): void {\n\t//console.log(\"clearing range\", range.name, \"from\", range.startNode, \"to\", range.endNode);\n\n\t// Clear child ranges and collect animations that take place within this\n\t// range and its children\n\tlet animations: Animation[] | undefined =\n\t\trange.animations !== null ? Array.from(range.animations) : undefined;\n\tlet childRange = range.nextRange;\n\twhile (childRange !== null && childRange.depth > range.depth) {\n\t\tif (childRange.animations !== null) {\n\t\t\tanimations ??= [];\n\t\t\tanimations.push(...childRange.animations);\n\t\t}\n\t\treleaseRange(childRange);\n\t\t// HACK: see runControlBranch\n\t\tchildRange.depth = -2;\n\t\tchildRange = childRange.nextRange;\n\t}\n\trange.nextRange = childRange;\n\n\tif (range.previousRange !== null) {\n\t\trange.previousRange.nextRange = range.nextRange;\n\t}\n\tif (range.nextRange !== null) {\n\t\trange.nextRange.previousRange = range.previousRange;\n\t}\n\n\t// Wait for animations, if any, then clear the range's nodes\n\tif (animations !== undefined) {\n\t\t// eslint-disable-next-line no-floating-promises\n\t\tPromise.all(animations.map((a) => a.finished)).then(() => clearNodes(range));\n\t} else {\n\t\tclearNodes(range);\n\t}\n}\n\nfunction clearNodes(range: Range) {\n\t// Clear the nodes for this range\n\tif (range.startNode !== null && range.endNode !== null) {\n\t\tlet currentNode = range.endNode;\n\t\t// DEBUG:\n\t\t//if (range.startNode.parentNode !== currentNode.parentNode) {\n\t\t//\tthrow new Error(\"range nodes have different parents\");\n\t\t//}\n\t\twhile (currentNode !== range.startNode) {\n\t\t\tlet previousNode = currentNode.previousSibling;\n\t\t\tcurrentNode.remove();\n\t\t\tcurrentNode = previousNode!;\n\t\t}\n\t\tcurrentNode.remove();\n\t}\n\treleaseRange(range);\n}\n\nfunction releaseRange(range: Range) {\n\trange.startNode = null;\n\trange.endNode = null;\n\trange.previousRange = null;\n\trange.nextRange = null;\n\trange.animations = null;\n}\n","import type Range from \"../types/Range\";\nimport clearRange from \"./clearRange\";\n\nexport default function clearLayoutSlot(range: Range): void {\n\tclearRange(range);\n}\n","import type Range from \"../types/Range\";\n\nexport default function newRange(name?: string): Range {\n\treturn {\n\t\tstartNode: null,\n\t\tendNode: null,\n\t\tpreviousRange: null,\n\t\tnextRange: null,\n\t\tdepth: -1,\n\t\tanimations: null,\n\t\tname,\n\t};\n}\n","import type Range from \"../types/Range\";\nimport context from \"./context\";\n\nexport default function popRange(oldRange: Range): void {\n\tcontext.activeRange = oldRange;\n}\n","import type Range from \"../types/Range\";\nimport context from \"./context\";\n\nexport default function pushRange(range: Range, toParent = false): Range {\n\tconst activeRange = context.activeRange;\n\n\t// Add the new range to the currently active range's children, so that we\n\t// can delete the children with the parent\n\tif (toParent) {\n\t\tconst previousRange = context.previousRange;\n\t\trange.previousRange = previousRange;\n\n\t\tconst nextRange = previousRange.nextRange;\n\t\tpreviousRange.nextRange = range;\n\t\trange.nextRange = nextRange;\n\n\t\trange.depth = activeRange.depth + 1;\n\t}\n\n\t// Set the new active range\n\tcontext.activeRange = range;\n\tcontext.previousRange = range;\n\n\t// Return the old active range, so that it can be reset when done\n\treturn activeRange;\n}\n","import type Component from \"../types/Component\";\nimport type Range from \"../types/Range\";\nimport type SlotRender from \"../types/SlotRender\";\nimport newRange from \"./newRange\";\nimport popRange from \"./popRange\";\nimport pushRange from \"./pushRange\";\n\nexport default function fillLayoutSlot(\n\tcomponent: Component,\n\tslot: SlotRender,\n\tparent: ParentNode,\n\tanchor: Node | null,\n\t$props: Record<string, string>,\n\t$context?: Record<PropertyKey, any>,\n): Range {\n\tconst range = newRange();\n\tconst oldRange = pushRange(range);\n\n\tcomponent(parent, anchor, $props, $context, {\n\t\t_: slot,\n\t});\n\n\tpopRange(oldRange);\n\n\treturn range;\n}\n","export default function getFragment(\n\tdocument: Document,\n\tarray: DocumentFragment[],\n\tindex: number,\n\thtml: string,\n\tns?: boolean,\n): DocumentFragment {\n\t// Create the fragment in the array if it hasn't yet been used\n\tif (array[index] === undefined) {\n\t\t// TODO: Should pass a string for the ns, when we support other element types\n\t\tif (ns === true) {\n\t\t\tconst template = document.createElementNS(\"http://www.w3.org/2000/svg\", \"template\");\n\t\t\ttemplate.innerHTML = html;\n\t\t\tconst fragment = new DocumentFragment();\n\t\t\tfragment.append(...template.childNodes);\n\t\t\tarray[index] = fragment;\n\t\t} else {\n\t\t\tconst template = document.createElement(\"template\");\n\t\t\ttemplate.innerHTML = html;\n\t\t\tarray[index] = template.content;\n\t\t}\n\t}\n\n\t// Get the fragment from the array\n\t// TODO: If we're hydrating we probably don't want to create and return a\n\t// fragment unless we really need to\n\tlet fragment = array[index].cloneNode(true) as DocumentFragment;\n\n\treturn fragment;\n}\n","import type Component from \"../types/Component\";\nimport type SlotRender from \"../types/SlotRender\";\nimport $run from \"./$run\";\nimport context from \"./context\";\nimport newRange from \"./newRange\";\nimport pushRange from \"./pushRange\";\n\n/**\n * Hydrates a component into an existing DOM tree\n * @param parent The parent node\n * @param component The component to mount\n * @param props An object containing component props\n */\nexport default function hydrate(\n\tparent: ParentNode,\n\tcomponent: Component,\n\tprops?: Record<string, any>,\n\tslots?: Record<string, SlotRender>,\n): void {\n\t// When mounting, the parent must have no child elements, so we can just set\n\t// the hydration node to the first child node\n\tcontext.hydrationNode = parent.firstChild;\n\n\t// Create and push the root range\n\tcontext.rootRange = newRange();\n\tcontext.previousRange = context.rootRange;\n\tpushRange(context.rootRange);\n\n\t// Call the component's render function\n\tcomponent(parent, null, props, undefined, slots);\n\n\tcontext.hydrationNode = null;\n\n\t// Now that we've hydrated, we can run $mount effects\n\tfor (let effect of context.mountEffects) {\n\t\t$run(effect);\n\t}\n\tcontext.mountEffects.length = 0;\n}\n","import type Component from \"../types/Component\";\nimport type SlotRender from \"../types/SlotRender\";\nimport context from \"./context\";\nimport newRange from \"./newRange\";\nimport pushRange from \"./pushRange\";\n\n/**\n * Mounts a component into a DOM node\n *\n * @param parent The node to mount the component into\n * @param component The component to mount\n * @param props An object containing component props\n */\nexport default function mount(\n\tparent: ParentNode,\n\tcomponent: Component,\n\tprops?: Record<string, any>,\n\tslots?: Record<string, SlotRender>,\n): void {\n\t// The parent node must have no child elements, so that we can hydrate\n\t// without worrying about where to start\n\tif (parent.childElementCount > 0) {\n\t\tthrow new Error(\"The parent node must have no child elements\");\n\t}\n\n\t// Remove all text, commments, etc\n\twhile (parent.firstChild !== null) {\n\t\tparent.firstChild.remove();\n\t}\n\n\t// Create and push the root range\n\tcontext.rootRange = newRange();\n\tcontext.previousRange = context.rootRange;\n\tpushRange(context.rootRange);\n\n\t// Call the component's render function\n\tcomponent(parent, null, props, undefined, slots);\n}\n","import type ListItem from \"../types/ListItem\";\n\nexport default function newListItem(data: Record<PropertyKey, any>, key?: any): ListItem {\n\treturn {\n\t\tstartNode: null,\n\t\tendNode: null,\n\t\tpreviousRange: null,\n\t\tnextRange: null,\n\t\tdepth: -1,\n\t\tanimations: null,\n\t\tdata,\n\t\tkey,\n\t};\n}\n","const HYDRATION_START = \"[\";\nconst HYDRATION_END = \"]\";\nconst HYDRATION_BREAK = \"^\";\n\nexport { HYDRATION_START, HYDRATION_END, HYDRATION_BREAK };\n","export default function isCommentNode(node: Node): node is Comment {\n\treturn node.nodeType === 8;\n}\n","export default function isTextNode(node: Node): node is Text {\n\treturn node.nodeType === 3;\n}\n","import context from \"./context\";\nimport { HYDRATION_BREAK } from \"./hydrationMarkers\";\nimport isCommentNode from \"./isCommentNode\";\n\n// TODO: It would be good to remove this, if possible\n\n/**\n * When hydrating, removes and skips hydration comments that are inserted at the\n * start of branches and used to split up text nodes that would otherwise be\n * joined in HTML.\n *\n * @param node The node to check and maybe skip.\n * @returns The next node.\n */\nexport default function nodeCheckHydrationBreak(node: ChildNode | null): ChildNode | null {\n\tif (context.hydrationNode !== null) {\n\t\tif (node !== null && isCommentNode(node) && node.data === HYDRATION_BREAK) {\n\t\t\tlet comment = node;\n\t\t\tnode = node.nextSibling;\n\t\t\tcomment.remove();\n\t\t}\n\t\tcontext.hydrationNode = node;\n\t}\n\treturn node;\n}\n","import context from \"./context\";\nimport isTextNode from \"./isTextNode\";\nimport nodeCheckHydrationBreak from \"./nodeCheckHydrationBreak\";\n\n/**\n * Gets the next sibling of a node.\n *\n * When hydrating, sets the hydration node.\n *\n * @param node The node.\n * @param text Whether we require a text node.\n */\nexport default function nodeNext(node: ChildNode, text = false): ChildNode {\n\t// If the required node is a text node, and we already have one, just use\n\t// it. This is caused by text nodes being merged in HTML\n\tif (context.hydrationNode !== null && text && isTextNode(node)) {\n\t\treturn node;\n\t}\n\n\tlet nextNode = nodeCheckHydrationBreak(node.nextSibling);\n\n\t// NOTE: We know this is not null as it is being called from generated code\n\treturn nextNode!;\n}\n","import context from \"./context\";\nimport { HYDRATION_END, HYDRATION_START } from \"./hydrationMarkers\";\nimport isCommentNode from \"./isCommentNode\";\nimport nodeNext from \"./nodeNext\";\n\n/**\n * Gets the anchor node for a control statement or component.\n *\n * When mounting, this just returns the anchor node parameter (because it was\n * created).\n *\n * When hydrating, there should be matched <![> and <!]> comments in the HTML,\n * and the anchor node should be after the end comment. The matched comment\n * nodes will be deleted, and the hydration node set to the first node inside\n * the matched comments.\n *\n * @param node The potential anchor node.\n * @returns The anchor node.\n */\nexport default function nodeAnchor(node: ChildNode): ChildNode {\n\tif (context.hydrationNode !== null) {\n\t\tif (isCommentNode(node) && node.data === HYDRATION_START) {\n\t\t\t// Skip and remove the start node, setting the hydration node in\n\t\t\t// nodeNext\n\t\t\tlet currentNode = nodeNext(node);\n\t\t\tnode.remove();\n\n\t\t\t// Go through siblings until we get to the end\n\t\t\tlet level = 1;\n\t\t\twhile (currentNode !== null) {\n\t\t\t\tif (isCommentNode(currentNode)) {\n\t\t\t\t\tif (currentNode.data === HYDRATION_START) {\n\t\t\t\t\t\tlevel += 1;\n\t\t\t\t\t} else if (currentNode.data === HYDRATION_END) {\n\t\t\t\t\t\tlevel -= 1;\n\t\t\t\t\t\tif (level === 0) {\n\t\t\t\t\t\t\t// Remove the end node and return the next one\n\t\t\t\t\t\t\tconst endNode = currentNode.nextSibling;\n\t\t\t\t\t\t\tcurrentNode.remove();\n\n\t\t\t\t\t\t\t// If the statement is empty (i.e. the end comment\n\t\t\t\t\t\t\t// immediately follows the start comment), move the\n\t\t\t\t\t\t\t// hydration node past the removed end comment to\n\t\t\t\t\t\t\t// the anchor, so that we can continue to the next\n\t\t\t\t\t\t\t// nodes\n\t\t\t\t\t\t\tif (context.hydrationNode === currentNode) {\n\t\t\t\t\t\t\t\tcontext.hydrationNode = endNode;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// NOTE: We know this is not null as it is being\n\t\t\t\t\t\t\t// called from generated code\n\t\t\t\t\t\t\treturn endNode!;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcurrentNode = currentNode.nextSibling!;\n\t\t\t}\n\n\t\t\tif (currentNode === null) {\n\t\t\t\tthrow new Error(\"End hydration comment not found\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn node;\n}\n","import context from \"./context\";\n\n/**\n * Gets the first child of a node.\n *\n * Sets the hydration node.\n *\n * @param parent The parent node.\n */\nexport default function nodeChild(parent: Node): ChildNode {\n\tlet childNode = parent.firstChild;\n\tif (context.hydrationNode !== null) {\n\t\t// The child may be null when hydrating the sole text child of an\n\t\t// element with no text\n\t\tif (childNode === null) {\n\t\t\tchildNode = parent.appendChild(parent.ownerDocument!.createTextNode(\"\"));\n\t\t}\n\t\tcontext.hydrationNode = childNode;\n\t}\n\n\t// NOTE: We know this is not null as it is being called from generated code\n\treturn childNode!;\n}\n","import context from \"./context\";\nimport { HYDRATION_START } from \"./hydrationMarkers\";\nimport isCommentNode from \"./isCommentNode\";\nimport isTextNode from \"./isTextNode\";\n\n/**\n * Gets the first child in a fragment.\n *\n * When hydrating, also sets the active range's start node, while we have it.\n *\n * @param parent The parent of the fragment.\n * @param text Whether we require a text node.\n */\nexport default function nodeRoot(parent: Node, text = false): ChildNode {\n\tif (context.hydrationNode !== null) {\n\t\tlet rootNode = context.hydrationNode;\n\n\t\t// If the root node we need is a text node, and the hydration node is\n\t\t// not a text node but the previous node is, use the previous node. This\n\t\t// is caused by text nodes being merged in HTML\n\t\tif (\n\t\t\ttext &&\n\t\t\t!isTextNode(rootNode) &&\n\t\t\trootNode.previousSibling !== null &&\n\t\t\tisTextNode(rootNode.previousSibling)\n\t\t) {\n\t\t\trootNode = rootNode.previousSibling;\n\t\t\tcontext.hydrationNode = rootNode;\n\t\t}\n\n\t\t// HACK: If the root node is a hydration start comment node, get the\n\t\t// next one instead\n\t\tif (isCommentNode(rootNode) && rootNode.data === HYDRATION_START) {\n\t\t\trootNode = rootNode.nextSibling!;\n\t\t\tcontext.hydrationNode = rootNode;\n\t\t}\n\n\t\t// If hydrating, set the active range's start node\n\t\tconst range = context.activeRange;\n\t\tif (range.startNode === null) {\n\t\t\trange.startNode = rootNode;\n\t\t}\n\n\t\treturn rootNode;\n\t} else {\n\t\t// NOTE: We know this is not null as it is being called from generated\n\t\t// code\n\t\treturn parent.firstChild!;\n\t}\n}\n","import nodeCheckHydrationBreak from \"./nodeCheckHydrationBreak\";\n\n/**\n * Gets the sibling of a node, x nodes after it.\n *\n * When hydrating, sets the hydration node.\n *\n * @param node The node.\n * @param count The number of nodes to skip.\n */\nexport default function nodeSkip(node: ChildNode, count: number): ChildNode {\n\tlet nextNode = node;\n\n\tfor (let i = 0; i < count; i++) {\n\t\tnextNode = nodeCheckHydrationBreak(nextNode.nextSibling)!;\n\t}\n\n\t// NOTE: We know this is not null as it is being called from generated code\n\treturn nextNode!;\n}\n","import type Range from \"../types/Range\";\nimport $run from \"./$run\";\nimport context from \"./context\";\nimport popRange from \"./popRange\";\nimport pushRange from \"./pushRange\";\n\n/**\n * Runs an`if`, `switch` or `await` control statement\n * @param create A function that creates the control statement's branches\n */\nexport default function runControl(\n\trange: Range,\n\tanchor: Node | null,\n\tcreate: (anchor: Node | null) => void,\n): void {\n\tconst oldRange = pushRange(range, true);\n\n\t// Run the control statement in an effect\n\t$run(function runControl() {\n\t\t// Push and pop the control statement on subsequent runs, so that new branch\n\t\t// ranges will be added to its children\n\t\tconst oldBranchRange = pushRange(range);\n\n\t\t// Run the function that creates the control statement's branches\n\t\tcreate(anchor);\n\n\t\tpopRange(oldBranchRange);\n\t});\n\n\t// If we're mounting, the anchor will be the one that is passed in, but if\n\t// we're hydrating it will be after the active branch's HTML elements, so we\n\t// need to update it after the branches have been hydrated\n\tif (context.hydrationNode) {\n\t\tanchor = context.hydrationNode.nextSibling;\n\t}\n\n\tpopRange(oldRange);\n}\n","import type Range from \"../types/Range\";\nimport clearRange from \"./clearRange\";\nimport newRange from \"./newRange\";\nimport popRange from \"./popRange\";\nimport pushRange from \"./pushRange\";\n\nexport default function runControlBranch(range: Range, create: () => void): void {\n\t// HACK: This is bad -- it means that the parent range has been cleared,\n\t// but that should have cleared the effect that runs this child range??\n\t// TODO: Look into this further...\n\tif (range.depth === -2) return;\n\n\t// Branching ranges have exactly one child -- remove it if necessary\n\tif (range.nextRange !== null && range.nextRange.depth > range.depth) {\n\t\tclearRange(range.nextRange!);\n\t}\n\n\tconst oldRange = pushRange(newRange(), true);\n\n\t// Run the create function\n\tcreate();\n\n\tpopRange(oldRange);\n}\n","import type Range from \"../types/Range\";\n\nexport default function moveRange(parent: Node, range: Range, before: ChildNode | null): void {\n\tparent = before?.parentNode ?? parent;\n\tconst endNode = range.endNode ?? range.startNode;\n\tlet currentNode = range.startNode;\n\n\twhile (currentNode !== null) {\n\t\tconst nextNode = currentNode.nextSibling;\n\t\tparent.insertBefore(currentNode, before);\n\t\tif (currentNode === endNode) break;\n\t\tcurrentNode = nextNode;\n\t}\n}\n","// Adapted from https://github.com/snabbdom/snabbdom\n// With changes from https://github.com/luwes/js-diff-benchmark\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 Simon Friis Vindum\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nimport type ListItem from \"../types/ListItem\";\nimport type Range from \"../types/Range\";\nimport $watch from \"./$watch\";\nimport clearRange from \"./clearRange\";\nimport moveRange from \"./moveRange\";\n\n/**\n * @param range The list's range\n * @param parent The parent DOM element\n * @param anchor The DOM element to create new items before\n * @param oldItems The list of current items\n * @param newItems The list of future items\n * @param create A function that creates the DOM elements for a new item\n */\nexport default function runListItems(\n\trange: Range,\n\tparent: ParentNode,\n\tanchor: Node | null,\n\toldItems: ListItem[],\n\tnewItems: ListItem[],\n\tcreate: (item: ListItem, before: Node | null) => void,\n\tupdate: (oldItem: ListItem, newItem: ListItem) => void,\n): void {\n\tlet oldStartIndex = 0;\n\tlet oldEndIndex = oldItems.length - 1;\n\tlet oldStartItem = oldItems[0];\n\tlet oldEndItem = oldItems[oldEndIndex];\n\n\tlet newStartIndex = 0;\n\tlet newEndIndex = newItems.length - 1;\n\tlet newStartItem = newItems[0];\n\tlet newEndItem = newItems[newEndIndex];\n\n\tlet oldKeyToIndex: Map<any, number> | undefined;\n\tlet newKeyToIndex: Map<any, number> | undefined;\n\n\twhile (oldStartIndex <= oldEndIndex && newStartIndex <= newEndIndex) {\n\t\tif (oldStartItem === null) {\n\t\t\toldStartItem = oldItems[++oldStartIndex];\n\t\t} else if (oldEndItem === null) {\n\t\t\toldEndItem = oldItems[--oldEndIndex];\n\t\t} else if (newStartItem === null) {\n\t\t\tnewStartItem = newItems[++newStartIndex];\n\t\t} else if (newEndItem === null) {\n\t\t\tnewEndItem = newItems[--newEndIndex];\n\t\t} else if (oldStartItem.key === newStartItem.key) {\n\t\t\ttransferListItemData(oldStartItem, newStartItem, update);\n\t\t\toldStartItem = oldItems[++oldStartIndex];\n\t\t\tnewStartItem = newItems[++newStartIndex];\n\t\t} else if (oldEndItem.key === newEndItem.key) {\n\t\t\ttransferListItemData(oldEndItem, newEndItem, update);\n\t\t\toldEndItem = oldItems[--oldEndIndex];\n\t\t\tnewEndItem = newItems[--newEndIndex];\n\t\t} else if (oldStartItem.key === newEndItem.key) {\n\t\t\t// Move to the end\n\t\t\t//console.log(\"move\", oldStartItem.key, \"to the end\");\n\t\t\tmoveRange(parent, oldStartItem, oldEndItem.endNode!.nextSibling!);\n\t\t\ttransferListItemData(oldStartItem, newEndItem, update);\n\t\t\toldStartItem = oldItems[++oldStartIndex];\n\t\t\tnewEndItem = newItems[--newEndIndex];\n\t\t} else if (oldEndItem.key === newStartItem.key) {\n\t\t\t// Move to the start\n\t\t\t//console.log(\"move\", oldEndItem.key, \"to the start\");\n\t\t\tmoveRange(parent, oldEndItem, oldStartItem!.startNode);\n\t\t\ttransferListItemData(oldEndItem, newStartItem, update);\n\t\t\toldEndItem = oldItems[--oldEndIndex];\n\t\t\tnewStartItem = newItems[++newStartIndex];\n\t\t} else {\n\t\t\t// Lazily build maps of keys to indexes here\n\t\t\t// They are relevant only if there has been a move, or a mid-list\n\t\t\t// insertion or deletion, and not if there has been an insertion\n\t\t\t// at the end or deletion from the front\n\t\t\tif (oldKeyToIndex === undefined || newKeyToIndex === undefined) {\n\t\t\t\toldKeyToIndex = new Map();\n\t\t\t\tfor (let i = oldStartIndex; i < oldEndIndex; i++) {\n\t\t\t\t\toldKeyToIndex.set(oldItems[i].key, i);\n\t\t\t\t}\n\t\t\t\tnewKeyToIndex = new Map();\n\t\t\t\tfor (let i = newStartIndex; i < newEndIndex; i++) {\n\t\t\t\t\tnewKeyToIndex.set(newItems[i].key, i);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet oldIndex = oldKeyToIndex.get(newStartItem.key);\n\t\t\tlet newIndex = newKeyToIndex.get(oldStartItem.key);\n\n\t\t\tif (oldIndex === undefined && newIndex === undefined) {\n\t\t\t\t// Replace\n\t\t\t\t//console.log(\"replace\", oldStartItem.key, \"with\", newStartItem.key);\n\t\t\t\tnewStartItem.data = $watch(newStartItem.data, { shallow: true });\n\t\t\t\tcreate(newStartItem, oldStartItem.startNode);\n\t\t\t\tnewStartItem.previousRange = oldStartItem.previousRange;\n\t\t\t\tnewStartItem.nextRange = oldStartItem;\n\t\t\t\toldStartItem.previousRange = newStartItem;\n\t\t\t\tclearRange(oldStartItem);\n\t\t\t\toldStartItem = oldItems[++oldStartIndex];\n\t\t\t\tnewStartItem = newItems[++newStartIndex];\n\t\t\t} else if (oldIndex === undefined) {\n\t\t\t\t// Insert\n\t\t\t\t//console.log(\"insert\", newStartItem.key);\n\t\t\t\tnewStartItem.data = $watch(newStartItem.data, { shallow: true });\n\t\t\t\tcreate(newStartItem, oldStartItem.startNode);\n\t\t\t\tnewStartItem = newItems[++newStartIndex];\n\t\t\t} else if (newIndex === undefined) {\n\t\t\t\t// Delete\n\t\t\t\t//console.log(\"delete\", oldStartItem.key);\n\t\t\t\tclearRange(oldStartItem);\n\t\t\t\toldStartItem = oldItems[++oldStartIndex];\n\t\t\t} else {\n\t\t\t\t// Move\n\t\t\t\t//console.log(\"move\", newStartItem.key, \"before\", oldStartItem.key);\n\t\t\t\tconst oldData = oldItems[oldIndex];\n\t\t\t\tmoveRange(parent, oldData, oldStartItem.startNode);\n\t\t\t\ttransferListItemData(oldData, newStartItem, update);\n\t\t\t\t// @ts-ignore TODO: Set key null instead?\n\t\t\t\toldItems[oldIndex] = null;\n\t\t\t\tnewStartItem = newItems[++newStartIndex];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (oldStartIndex <= oldEndIndex || newStartIndex <= newEndIndex) {\n\t\tif (oldStartIndex > oldEndIndex) {\n\t\t\t// The old list is exhausted; process new list additions\n\t\t\t// HACK: I think it would be better to move anchors to the end?\n\t\t\tlet before =\n\t\t\t\toldStartItem?.startNode ?? oldItems[oldItems.length - 1]?.endNode?.nextSibling ?? anchor;\n\t\t\tfor (newStartIndex; newStartIndex <= newEndIndex; newStartItem = newItems[++newStartIndex]) {\n\t\t\t\t//console.log(\"create\", newStartItem.key);\n\t\t\t\tnewStartItem.data = $watch(newStartItem.data, { shallow: true });\n\t\t\t\tcreate(newStartItem, before);\n\t\t\t\tbefore = newStartItem.endNode!.nextSibling;\n\t\t\t}\n\t\t} else {\n\t\t\t// The new list is exhausted; process old list removals\n\t\t\tfor (oldEndIndex; oldEndIndex >= oldStartIndex; oldStartItem = oldItems[oldEndIndex--]) {\n\t\t\t\t//console.log(\"clear\", oldStartItem.key);\n\t\t\t\tclearRange(oldStartItem);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (newItems.length > 0) {\n\t\trange.nextRange = newItems[0];\n\t} else if (oldItems.length > 0) {\n\t\trange.nextRange = oldItems[oldItems.length - 1].nextRange;\n\t}\n}\n\nfunction transferListItemData(\n\toldItem: ListItem,\n\tnewItem: ListItem,\n\tupdate: (oldItem: ListItem, newItem: ListItem) => void,\n) {\n\tnewItem.startNode = oldItem.startNode;\n\tnewItem.endNode = oldItem.endNode;\n\t// Manually transfer the new data's props to the old ones (to run effects)\n\t// and then set the new data to the old one\n\tupdate(oldItem, newItem);\n\tnewItem.data = oldItem.data;\n}\n","import type ListItem from \"../types/ListItem\";\nimport type Range from \"../types/Range\";\nimport $run from \"./$run\";\nimport context from \"./context\";\nimport popRange from \"./popRange\";\nimport pushRange from \"./pushRange\";\nimport runListItems from \"./runListItems\";\n\n/**\n * Runs a `for` control statement\n * @param create A function that creates the control statement's branches\n */\nexport default function runList(\n\trange: Range,\n\tparent: ParentNode,\n\tanchor: Node | null,\n\tbuildItems: () => ListItem[],\n\tcreate: (item: ListItem, anchor: Node | null) => void,\n\tupdate: (oldItem: ListItem, newItem: ListItem) => void,\n): void {\n\tconst oldRange = pushRange(range, true);\n\n\tlet listItems: ListItem[] = [];\n\n\t// Run the list in an effect\n\t$run(function runList() {\n\t\t// Push and pop the control statement on subsequent runs, so that new\n\t\t// item ranges will be added to its children\n\t\tconst oldBranchRange = pushRange(range);\n\n\t\t// Build the array of items with keys and data\n\t\tconst newItems = buildItems();\n\n\t\t// Do NOT re-run the list for properties accessed while updating its\n\t\t// items. E.g. we want to re-run the list for `@for (item of $items)`\n\t\t// (in buildItems, above) but not for `<span>{item.id}</span>` (in\n\t\t// runListItems, below)\n\t\tcontext.activeTarget = null;\n\n\t\t// Run the function that updates the list's items\n\t\trunListItems(range, parent, anchor, listItems, newItems, create, update);\n\n\t\tlistItems = newItems;\n\n\t\tpopRange(oldBranchRange);\n\t});\n\n\t// If we're mounting, the anchor will be the one that is passed in, but if\n\t// we're hydrating it will be after the items' HTML elements, so we need to\n\t// update it after all of the items have been hydrated\n\tif (context.hydrationNode !== null) {\n\t\tanchor = context.hydrationNode.nextSibling;\n\t}\n\n\tpopRange(oldRange);\n}\n","export default function setAttribute(el: Element, name: string, value: any): void {\n\tif (value === false || value === undefined || value === null) {\n\t\tel.removeAttribute(name);\n\t} else {\n\t\tel.setAttribute(name, value);\n\t}\n}\n","import context from \"./context\";\n\n// TODO: Should we @toggle this instead? That would call onmount etc again for the new element\n\nexport default function setDynamicElement(el: HTMLElement, tag: string): HTMLElement {\n\t// If hydrating, it should already have been created as the correct element\n\tif (context.hydrationNode !== null) {\n\t\treturn el;\n\t}\n\n\t// Replace the old element with the new element\n\tlet newElement = el.ownerDocument.createElement(tag);\n\tel.replaceWith(newElement);\n\n\treturn newElement;\n}\n","import type ProxyData from \"../types/ProxyData\";\nimport { proxyDataSymbol, proxyHandledSymbol } from \"../watch/symbols\";\nimport trackProxyEffect from \"../watch/trackProxyEffect\";\nimport updateSignal from \"../watch/updateSignal\";\n\n// NOTE: this is mostly copied from SvelteDate, without the memoization\n// I'm not 100% sold on it, maybe it would be better to intercept $watch calls on a Date?\n\nlet initialized = false;\n\n/**\n * Wraps a Date object for $watching.\n */\nexport default class ReactiveDate extends Date {\n\tconstructor(...params: any[]) {\n\t\t// @ts-ignore\n\t\tsuper(...params);\n\n\t\tif (!initialized) {\n\t\t\tthis.#init();\n\t\t}\n\n\t\t// @ts-ignore\n\t\tthis[proxyHandledSymbol] = true;\n\t\t// @ts-ignore\n\t\tthis[proxyDataSymbol] = {\n\t\t\ttarget: this,\n\t\t\tisArray: false,\n\t\t\tshallow: true,\n\t\t\tsignals: new Map(),\n\t\t} satisfies ProxyData;\n\t}\n\n\t#init() {\n\t\tinitialized = true;\n\n\t\tlet reactivePrototype = ReactiveDate.prototype;\n\t\tlet datePrototype = Date.prototype;\n\n\t\tconst methods = Object.getOwnPropertyNames(datePrototype);\n\n\t\tfor (const method of methods) {\n\t\t\tif (method.startsWith(\"get\") || method.startsWith(\"to\") || method === \"valueOf\") {\n\t\t\t\t// @ts-ignore\n\t\t\t\treactivePrototype[method] = function (...args) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tconst data = this[proxyDataSymbol];\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tconst result = datePrototype[method].apply(this, args);\n\t\t\t\t\ttrackProxyEffect(data, \"#time\");\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (method.startsWith(\"set\")) {\n\t\t\t\t// @ts-ignore\n\t\t\t\treactivePrototype[method] = function (...args) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tconst data = this[proxyDataSymbol];\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tconst result = datePrototype[method].apply(this, args);\n\t\t\t\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;AAEpF,KAAIC,gBAAQ,kBAAkB,KAC7B,QAAO;CAIR,IAAI,aAAa,GAAG,cAAc,cAAc,IAAI;AACpD,IAAG,YAAY,WAAW;AAE1B,QAAO;;;;;ACNR,IAAI,cAAc;;;;AAKlB,IAAqB,eAArB,MAAqB,qBAAqB,KAAK;CAC9C,YAAY,GAAG,QAAe;AAE7B,QAAM,GAAG,OAAO;AAEhB,MAAI,CAAC,YACJ,OAAKC,MAAO;AAIb,OAAK,sBAAsB;AAE3B,OAAK,mBAAmB;GACvB,QAAQ;GACR,SAAS;GACT,SAAS;GACT,yBAAS,IAAI,KAAK;GAClB;;CAGF,QAAQ;AACP,gBAAc;EAEd,IAAI,oBAAoB,aAAa;EACrC,IAAI,gBAAgB,KAAK;EAEzB,MAAM,UAAU,OAAO,oBAAoB,cAAc;AAEzD,OAAK,MAAM,UAAU,SAAS;AAC7B,OAAI,OAAO,WAAW,MAAM,IAAI,OAAO,WAAW,KAAK,IAAI,WAAW,UAErE,mBAAkB,UAAU,SAAU,GAAG,MAAM;IAE9C,MAAM,OAAO,KAAK;IAElB,MAAM,SAAS,cAAc,QAAQ,MAAM,MAAM,KAAK;AACtD,qBAAiB,MAAM,QAAQ;AAC/B,WAAO;;AAIT,OAAI,OAAO,WAAW,MAAM,CAE3B,mBAAkB,UAAU,SAAU,GAAG,MAAM;IAE9C,MAAM,OAAO,KAAK;IAElB,MAAM,SAAS,cAAc,QAAQ,MAAM,MAAM,KAAK;AACtD,iBAAa,MAAM,QAAQ;AAC3B,WAAO"}
|
package/dist/ssr.cjs
CHANGED
|
@@ -1,125 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
const require_formatText = require('./formatText-DufG5l83.cjs');
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
__export(ssr_exports, {
|
|
23
|
-
$mount: () => $serverMount,
|
|
24
|
-
$run: () => $serverRun,
|
|
25
|
-
$unwrap: () => $serverUnwrap,
|
|
26
|
-
$watch: () => $serverWatch,
|
|
27
|
-
t_attr: () => formatAttributeText,
|
|
28
|
-
t_class: () => buildClasses,
|
|
29
|
-
t_fmt: () => formatText,
|
|
30
|
-
t_style: () => buildStyles
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(ssr_exports);
|
|
3
|
+
//#region src/render/$serverMount.ts
|
|
4
|
+
function $serverMount(_) {}
|
|
33
5
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// src/render/$serverRun.ts
|
|
39
|
-
function $serverRun(_) {
|
|
40
|
-
}
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/render/$serverRun.ts
|
|
8
|
+
function $serverRun(_) {}
|
|
41
9
|
|
|
42
|
-
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/render/$serverUnwrap.ts
|
|
43
12
|
function $serverUnwrap(object) {
|
|
44
|
-
|
|
13
|
+
return object;
|
|
45
14
|
}
|
|
46
15
|
|
|
47
|
-
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/render/$serverWatch.ts
|
|
48
18
|
function $serverWatch(object) {
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// src/render/buildClasses.ts
|
|
53
|
-
function buildClasses(value, styleHash) {
|
|
54
|
-
if (typeof value === "string") {
|
|
55
|
-
if (styleHash) {
|
|
56
|
-
value += " " + styleHash;
|
|
57
|
-
}
|
|
58
|
-
return value;
|
|
59
|
-
} else {
|
|
60
|
-
let classes = [];
|
|
61
|
-
gatherNames("", value, classes);
|
|
62
|
-
if (styleHash) {
|
|
63
|
-
classes.push(styleHash);
|
|
64
|
-
}
|
|
65
|
-
return classes.join(" ");
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function gatherNames(name, value, classes) {
|
|
69
|
-
if (value) {
|
|
70
|
-
if (Array.isArray(value)) {
|
|
71
|
-
for (let v of value) {
|
|
72
|
-
gatherNames(v, v, classes);
|
|
73
|
-
}
|
|
74
|
-
} else if (typeof value === "object") {
|
|
75
|
-
for (let [n, v] of Object.entries(value)) {
|
|
76
|
-
gatherNames(n, v, classes);
|
|
77
|
-
}
|
|
78
|
-
} else {
|
|
79
|
-
classes.push(name);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
19
|
+
return object;
|
|
82
20
|
}
|
|
83
21
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (typeof value === "string") {
|
|
87
|
-
return value;
|
|
88
|
-
} else {
|
|
89
|
-
let styles = [];
|
|
90
|
-
if (value) {
|
|
91
|
-
if (Array.isArray(value)) {
|
|
92
|
-
for (let v of value) {
|
|
93
|
-
styles.push(v);
|
|
94
|
-
}
|
|
95
|
-
} else if (typeof value === "object") {
|
|
96
|
-
for (let [n, v] of Object.entries(value)) {
|
|
97
|
-
styles.push(`${n}: ${v}`);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return styles.join("; ");
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// src/render/formatAttributeText.ts
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/render/formatAttributeText.ts
|
|
106
24
|
function formatAttributeText(value) {
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
t_fmt,
|
|
123
|
-
t_style
|
|
124
|
-
});
|
|
25
|
+
return (value ?? "").toString().replaceAll("\"", """);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.$batch = require_formatText.$batch;
|
|
30
|
+
exports.$cache = require_formatText.$cache;
|
|
31
|
+
exports.$mount = $serverMount;
|
|
32
|
+
exports.$peek = require_formatText.$peek;
|
|
33
|
+
exports.$run = $serverRun;
|
|
34
|
+
exports.$unwrap = $serverUnwrap;
|
|
35
|
+
exports.$watch = $serverWatch;
|
|
36
|
+
exports.t_attr = formatAttributeText;
|
|
37
|
+
exports.t_class = require_formatText.buildClasses;
|
|
38
|
+
exports.t_fmt = require_formatText.formatText;
|
|
39
|
+
exports.t_style = require_formatText.buildStyles;
|
|
125
40
|
//# sourceMappingURL=ssr.cjs.map
|
package/dist/ssr.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"ssr.cjs","names":[],"sources":["../src/render/$serverMount.ts","../src/render/$serverRun.ts","../src/render/$serverUnwrap.ts","../src/render/$serverWatch.ts","../src/render/formatAttributeText.ts"],"sourcesContent":["import type Cleanup from \"../types/Cleanup\";\n\nexport default function $serverMount(_: () => Cleanup | void): void {}\n","import type Cleanup from \"../types/Cleanup\";\n\nexport default function $serverRun(_: () => Cleanup | void): void {}\n","export default function $serverUnwrap<T extends Record<PropertyKey, any>>(object: T): T {\n\treturn object;\n}\n","export default function $serverWatch<T extends Record<PropertyKey, any>>(object: T): T {\n\treturn object;\n}\n","export default function formatAttributeText(value: any): string {\n\treturn (value ?? \"\").toString().replaceAll('\"', \""\");\n}\n"],"mappings":";;;AAEA,SAAwB,aAAa,GAA+B;;;;ACApE,SAAwB,WAAW,GAA+B;;;;ACFlE,SAAwB,cAAkD,QAAc;AACvF,QAAO;;;;;ACDR,SAAwB,aAAiD,QAAc;AACtF,QAAO;;;;;ACDR,SAAwB,oBAAoB,OAAoB;AAC/D,SAAQ,SAAS,IAAI,UAAU,CAAC,WAAW,MAAK,SAAS"}
|
package/dist/ssr.d.cts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { S as ServerSlotRender, b as t_class, f as t_fmt, a as t_style } from './ServerSlotRender-BMGG0yq3.cjs';
|
|
1
|
+
import { $batch, $cache, $peek, Cleanup, ServerSlotRender, buildClasses, buildStyles, formatText } from "./ServerSlotRender-COS6H8Yk.cjs";
|
|
3
2
|
|
|
3
|
+
//#region src/render/$serverMount.d.ts
|
|
4
4
|
declare function $serverMount(_: () => Cleanup | void): void;
|
|
5
|
-
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/render/$serverRun.d.ts
|
|
6
7
|
declare function $serverRun(_: () => Cleanup | void): void;
|
|
7
|
-
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/render/$serverUnwrap.d.ts
|
|
8
10
|
declare function $serverUnwrap<T extends Record<PropertyKey, any>>(object: T): T;
|
|
9
|
-
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/render/$serverWatch.d.ts
|
|
10
13
|
declare function $serverWatch<T extends Record<PropertyKey, any>>(object: T): T;
|
|
11
|
-
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/render/formatAttributeText.d.ts
|
|
12
16
|
declare function formatAttributeText(value: any): string;
|
|
13
|
-
|
|
14
|
-
export { $serverMount as $mount, $serverRun as $run, $serverUnwrap as $unwrap, $serverWatch as $watch, formatAttributeText as t_attr };
|
|
17
|
+
//#endregion
|
|
18
|
+
export { $batch, $cache, $serverMount as $mount, $peek, $serverRun as $run, $serverUnwrap as $unwrap, $serverWatch as $watch, type ServerSlotRender, formatAttributeText as t_attr, buildClasses as t_class, formatText as t_fmt, buildStyles as t_style };
|
|
19
|
+
//# sourceMappingURL=ssr.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr.d.cts","names":[],"sources":["../src/render/$serverMount.ts","../src/render/$serverRun.ts","../src/render/$serverUnwrap.ts","../src/render/$serverWatch.ts","../src/render/formatAttributeText.ts"],"sourcesContent":[],"mappings":";;;iBAEwB,YAAA,UAAsB;;;iBCAtB,UAAA,UAAoB;;;iBCFpB,wBAAwB,OAAO,2BAA2B,IAAI;;;iBCA9D,uBAAuB,OAAO,2BAA2B,IAAI;;;iBCA7D,mBAAA"}
|
package/dist/ssr.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { S as ServerSlotRender, b as t_class, f as t_fmt, a as t_style } from './ServerSlotRender-BMGG0yq3.js';
|
|
1
|
+
import { $batch, $cache, $peek, Cleanup, ServerSlotRender, buildClasses, buildStyles, formatText } from "./ServerSlotRender-BiG4xB8e.js";
|
|
3
2
|
|
|
3
|
+
//#region src/render/$serverMount.d.ts
|
|
4
4
|
declare function $serverMount(_: () => Cleanup | void): void;
|
|
5
|
-
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/render/$serverRun.d.ts
|
|
6
7
|
declare function $serverRun(_: () => Cleanup | void): void;
|
|
7
|
-
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/render/$serverUnwrap.d.ts
|
|
8
10
|
declare function $serverUnwrap<T extends Record<PropertyKey, any>>(object: T): T;
|
|
9
|
-
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/render/$serverWatch.d.ts
|
|
10
13
|
declare function $serverWatch<T extends Record<PropertyKey, any>>(object: T): T;
|
|
11
|
-
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/render/formatAttributeText.d.ts
|
|
12
16
|
declare function formatAttributeText(value: any): string;
|
|
13
|
-
|
|
14
|
-
export { $serverMount as $mount, $serverRun as $run, $serverUnwrap as $unwrap, $serverWatch as $watch, formatAttributeText as t_attr };
|
|
17
|
+
//#endregion
|
|
18
|
+
export { $batch, $cache, $serverMount as $mount, $peek, $serverRun as $run, $serverUnwrap as $unwrap, $serverWatch as $watch, type ServerSlotRender, formatAttributeText as t_attr, buildClasses as t_class, formatText as t_fmt, buildStyles as t_style };
|
|
19
|
+
//# sourceMappingURL=ssr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr.d.ts","names":[],"sources":["../src/render/$serverMount.ts","../src/render/$serverRun.ts","../src/render/$serverUnwrap.ts","../src/render/$serverWatch.ts","../src/render/formatAttributeText.ts"],"sourcesContent":[],"mappings":";;;iBAEwB,YAAA,UAAsB;;;iBCAtB,UAAA,UAAoB;;;iBCFpB,wBAAwB,OAAO,2BAA2B,IAAI;;;iBCA9D,uBAAuB,OAAO,2BAA2B,IAAI;;;iBCA7D,mBAAA"}
|