@torpor/view 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/compile.cjs +324 -270
- package/dist/compile.cjs.map +1 -1
- package/dist/compile.js +324 -270
- package/dist/compile.js.map +1 -1
- package/dist/index.cjs +145 -97
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -29
- package/dist/index.d.ts +72 -29
- package/dist/index.js +142 -97
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +3 -3
- package/src/compile/build/client/buildAddFragment.ts +5 -1
- package/src/compile/build/client/buildCode.ts +2 -0
- package/src/compile/build/client/buildComponentNode.ts +1 -0
- package/src/compile/build/client/buildControlNode.ts +2 -1
- package/src/compile/build/client/buildFragment.ts +47 -21
- package/src/compile/build/client/buildRootNode.ts +5 -1
- package/src/compile/build/client/buildStyles.ts +18 -14
- package/src/compile/build/server/buildServerComponentNode.ts +2 -4
- package/src/compile/build/server/buildServerControlNode.ts +2 -1
- package/src/compile/build/server/buildServerForNode.ts +2 -2
- package/src/compile/build/server/buildServerIfNode.ts +4 -0
- package/src/compile/build/server/buildServerRootNode.ts +3 -1
- package/src/compile/build/server/buildServerSwitchNode.ts +4 -0
- package/src/compile/parse/ParseStatus.ts +2 -1
- package/src/compile/parse/parseCode.ts +5 -8
- package/src/compile/parse/parseControl.ts +19 -6
- package/src/compile/parse/parseMarkup.ts +15 -8
- package/src/compile/types/comments.ts +2 -2
- package/src/compile/types/nodes/OperationType.ts +2 -1
- package/src/debug/printNode.ts +54 -36
- package/src/index.ts +5 -1
- package/src/render/addFragment.ts +5 -4
- package/src/render/clearLayoutSlot.ts +6 -0
- package/src/render/clearRange.ts +1 -1
- package/src/render/hydrationMarkers.ts +2 -2
- package/src/render/isComment.ts +2 -2
- package/src/render/isText.ts +3 -0
- package/src/render/nodeAnchor.ts +62 -27
- package/src/render/nodeCheckHydrationBreak.ts +25 -0
- package/src/render/nodeChild.ts +12 -7
- package/src/render/nodeNext.ts +16 -25
- package/src/render/nodeRoot.ts +26 -9
- package/src/render/nodeSkip.ts +20 -0
- package/src/render/runLayoutSlot.ts +26 -0
- package/test/attributes/components/output/Attributes-client.ts +7 -4
- package/test/attributes/components/output/Attributes-server.ts +1 -1
- package/test/attributes/components/temp/{Attributes-client-7b8f7b9996208e8d2d0a12d4f4a40a73df63d9d8.ts → Attributes-client-4620a40099e57a7fdaab895b204d85881f6dbfb7.ts} +7 -4
- package/test/attributes/components/temp/{Attributes-server-a1289434a5a801be1d63bfc85b621579e06452f0.ts → Attributes-server-80f9f58fd6cb30df11867386d4f0b15b44401ebe.ts} +1 -1
- package/test/await/components/output/Await-client.ts +18 -15
- package/test/await/components/output/Await-server.ts +2 -2
- package/test/await/components/temp/{Await-client-a7bf000bf2b59a3d5251a0fa18ec79890a52a547.ts → Await-client-5d753441145fbac078393af24cccadb208453d69.ts} +18 -15
- package/test/await/components/temp/{Await-server-06cd2a3d8c7eb5bef026ffe2fb11793becf547c2.ts → Await-server-f02f39af3bb3344ca6b18a1d64d60b21913fba31.ts} +2 -2
- package/test/bind/components/output/BindComponent-client.ts +18 -12
- package/test/bind/components/output/BindComponent-server.ts +3 -3
- package/test/bind/components/output/BindText-client.ts +10 -8
- package/test/bind/components/output/BindText-server.ts +1 -1
- package/test/bind/components/temp/{BindComponent-client-a645474748485a878871c062ad69e6bcf35e6550.ts → BindComponent-client-aaeb489ce72b664c6372f8764f7e665994a751a7.ts} +18 -12
- package/test/bind/components/temp/{BindComponent-server-c557e7aa944517ab87415b8bb35b41b0034254e7.ts → BindComponent-server-c630dee0bee6cea49d5eb8bea04979a737bb8f5e.ts} +3 -3
- package/test/bind/components/temp/{BindText-client-d5f7d721df55020ef337f660e5d278eb80fcc330.ts → BindText-client-134676d616abbad6b8a7ec48df0a2e38cbfe3b87.ts} +10 -8
- package/test/bind/components/temp/{BindText-server-4b94cdf60d9c9a2088306c4407e2ae30785169b0.ts → BindText-server-807a1ddcb68410b30429cb088d2e204ed6f585b2.ts} +1 -1
- package/test/buildHtml.ts +1 -1
- package/test/buildOutputFiles.ts +8 -1
- package/test/child-component/components/output/ParentChild-client.ts +17 -11
- package/test/child-component/components/output/ParentChild-server.ts +3 -3
- package/test/child-component/components/temp/{ParentChild-client-eaefb0cbfd251badab3c57ae2037d973f785a1b8.ts → ParentChild-client-6cf4d156ea46338815270faf67f56472f1a4ccd4.ts} +17 -11
- package/test/child-component/components/temp/{ParentChild-server-8f2fc556f87867e6e3393e2e9e6d696cda107b69.ts → ParentChild-server-a34a8b5acf1c00d1990f8ab7433599506265a45a.ts} +3 -3
- package/test/class/class.test.ts +1 -1
- package/test/class/components/output/Class-client.ts +27 -20
- package/test/class/components/output/Class-server.ts +4 -4
- package/test/class/components/temp/{Class-client-12f09850a5f8c27de6cf94c23a2b17aadbf66f01.ts → Class-client-0405eff591f854c04e5728df0479014ef91efc61.ts} +27 -20
- package/test/class/components/temp/Class-server-daf30ffb1bacf9877e3385dc9a3eede61c972329.ts +40 -0
- package/test/component/components/output/Component-client.ts +9 -4
- package/test/component/components/output/Component-server.ts +2 -0
- package/test/component/components/output/Header-client.ts +7 -5
- package/test/component/components/output/Header-server.ts +1 -1
- package/test/component/components/temp/{Component-client-a2fb6f30fc340bac909b64cb4f5ac68cde376de3.ts → Component-client-355b42e5f7411c399e2f50fba3580f4f7c3fa943.ts} +9 -4
- package/test/component/components/temp/{Component-server-40be12cd528ccf768f1ad40ef2a435ad2b2a2d71.ts → Component-server-81012827b18e82d787d194a0a1a9d4e07311a336.ts} +2 -0
- package/test/component/components/temp/{Header-client-75cb4aa868295ac168c16ba7b275fbb5ab9256f9.ts → Header-client-903877003b220272b0cb5bfd62d7d748ad46c477.ts} +7 -5
- package/test/component/components/temp/{Header-server-f73307874bec34a95dcd152d7f83a3ad13a0f4ac.ts → Header-server-6969d20782edd8f99d4b5c5b7b5563ce26e6dc2d.ts} +1 -1
- package/test/console/components/output/Console-client.ts +6 -4
- package/test/console/components/output/Console-server.ts +1 -1
- package/test/console/components/temp/{Console-client-2f206752ce59e59fba9bb91263b4102fd515951e.ts → Console-client-4fa3b3679cee88bf6151185438e36d14010944b7.ts} +6 -4
- package/test/console/components/temp/{Console-server-b4b15f7a0d1d2b50d87bad4870e1b8d368707c04.ts → Console-server-cfb2208b130d5f15403df19ae8341aaa1c9ad33a.ts} +1 -1
- package/test/const/components/output/Const-client.ts +7 -5
- package/test/const/components/output/Const-server.ts +2 -2
- package/test/const/components/temp/{Const-client-536e8fdf18d6f4f7f23b2789de2330ecf62d7865.ts → Const-client-7dff2758c14bfbd208e301a702ae1781e6daba1b.ts} +7 -5
- package/test/const/components/temp/{Const-server-8f84096c03a19296425aee5d243af0734b70ca61.ts → Const-server-1cf6ed84f72d3b15b318b80937b8de1f2c0f188c.ts} +2 -2
- package/test/effects/components/output/For-client.ts +12 -9
- package/test/effects/components/output/For-server.ts +2 -2
- package/test/effects/components/output/If-client.ts +14 -11
- package/test/effects/components/output/If-server.ts +4 -4
- package/test/effects/components/output/NestedIf-client.ts +17 -14
- package/test/effects/components/output/NestedIf-server.ts +5 -5
- package/test/effects/components/temp/{For-client-d8d4e4424ec3238fe9f79cc907d673612b63bcdf.ts → For-client-fbe876286c0f99b8391ff0c06c92b58bf580218f.ts} +12 -9
- package/test/effects/components/temp/{For-server-1f853c161bea31a1a5b11b00d7a021b70c778066.ts → For-server-efe60939d185315f4c9b567b6867c6d5af14d9aa.ts} +2 -2
- package/test/effects/components/temp/{If-client-bb06988422395321bf298a75bf5563c6f750f776.ts → If-client-420a093f13de6ce07d2d4bc94705901809096cd9.ts} +14 -11
- package/test/effects/components/temp/{If-server-97e3cbe059306fc607985dcd1b187df3a278d979.ts → If-server-2424b7b812d350d7eb8ff9afb1146807217320cd.ts} +4 -4
- package/test/effects/components/temp/{NestedIf-client-dc880c1ec92e716ec730dfa0bac0e3d9265bdf27.ts → NestedIf-client-af88ec303b1a4184263bb370ef5b1f1e8aca8efc.ts} +17 -14
- package/test/effects/components/temp/{NestedIf-server-9f199a33bae5d5fe34920d6a419937537a2b18dc.ts → NestedIf-server-ab260586490cb5afed31377d2226bb5a1fc30e2d.ts} +5 -5
- package/test/events/components/output/Increment-client.ts +9 -7
- package/test/events/components/output/Increment-server.ts +1 -1
- package/test/events/components/temp/{Increment-client-41bd7bc91aac8c7a9bf73527c8f7ba1794b09ab3.ts → Increment-client-1b5f9e231c5c4fc059d77ca0da632719283e5ac4.ts} +9 -7
- package/test/events/components/temp/{Increment-server-bbf5ac93c4f73382c4262ae42f4cc836bcb8ac1b.ts → Increment-server-b084f43082e2ec31dbe5f9edc1cb6e37e4c8df9d.ts} +1 -1
- package/test/for/components/output/For-client.ts +12 -9
- package/test/for/components/output/For-server.ts +2 -2
- package/test/for/components/output/ForEscape-client.ts +16 -13
- package/test/for/components/output/ForEscape-server.ts +2 -2
- package/test/for/components/output/ForIn-client.ts +12 -9
- package/test/for/components/output/ForIn-server.ts +2 -2
- package/test/for/components/output/ForOf-client.ts +12 -9
- package/test/for/components/output/ForOf-server.ts +2 -2
- package/test/for/components/temp/{For-client-0be5994e98c07a3455cd8a18a2b1b8ef3605aba6.ts → For-client-421f2a6ca501d135c0aef9d1aaea25de0e1c00e4.ts} +12 -9
- package/test/for/components/temp/{For-server-8490f15d02ae76b218feb7fa266415f44b2a4ab9.ts → For-server-3b6ead39728c79206203c519a215390d07d80f7e.ts} +2 -2
- package/test/for/components/temp/{ForEscape-client-a973a145e28b32ca55fe3dca53d885fcf5e11c37.ts → ForEscape-client-72879c80f7544c2edfc224095740bdea20e1e12d.ts} +16 -13
- package/test/for/components/temp/{ForEscape-server-375744ca1e10e5c8ed7dd6420beef72107e55568.ts → ForEscape-server-ed906c8cd593a0b467073ada415734de31dc38d9.ts} +2 -2
- package/test/for/components/temp/{ForIn-client-5cc25a98e10826e8477fe6f931d5d2bbd0b13c9f.ts → ForIn-client-e12c45d7f53e50ea3ed456110138dfb95f6930e0.ts} +12 -9
- package/test/for/components/temp/{ForIn-server-d68e82c048f7e0f1525f74724b91e5cd01cdc6a6.ts → ForIn-server-c8f13304a2ba235e091685256909fbfa50bdd5fd.ts} +2 -2
- package/test/for/components/temp/{ForOf-client-70b0d59ff72f1cffe2e0ac8523dd7ccdca4ffe39.ts → ForOf-client-422d67d6c046f1d1de655719d061ea29f67d23f7.ts} +12 -9
- package/test/for/components/temp/{ForOf-server-ac08d98dd249a3e64a366b8488450e6ce0d18def.ts → ForOf-server-8c2c33ca6595bf0a5e952ca9971e595e18446623.ts} +2 -2
- package/test/function/components/output/Function-client.ts +8 -6
- package/test/function/components/output/Function-server.ts +2 -2
- package/test/function/components/temp/{Function-client-b3ff029a821d47e1a2249a52dfb681f4b2e96232.ts → Function-client-4e2168306756eb927d5ed4b673334b357eecaa74.ts} +8 -6
- package/test/function/components/temp/{Function-server-2d32fbe35260c0948a135f287f131c5520e8bce7.ts → Function-server-2b19d0cd881c31dc67132107c6e322a18701c318.ts} +2 -2
- package/test/html/components/output/Html-client.ts +9 -6
- package/test/html/components/output/Html-server.ts +1 -1
- package/test/html/components/temp/{Html-client-766ba4a63f28f929ca16cd7d1640fe92f9b30792.ts → Html-client-2f309b06c3304a952d249057dec058a514d52874.ts} +9 -6
- package/test/html/components/temp/{Html-server-0a41da8b81bf833f331f3becdbac14be7ddc6c8c.ts → Html-server-d159b0ef04b1f65ae4f9e05a7b44b21e7aa14cf9.ts} +1 -1
- package/test/hydrateComponent.ts +1 -0
- package/test/if/components/IfAfterIf.torp +10 -12
- package/test/if/components/IfElse.torp +12 -11
- package/test/if/components/IfElseIf.torp +13 -15
- package/test/if/components/IfFalse.torp +10 -0
- package/test/if/components/IfNested.torp +11 -13
- package/test/if/components/output/IfAfterIf-client.ts +14 -13
- package/test/if/components/output/IfAfterIf-server.ts +4 -4
- package/test/if/components/output/IfElse-client.ts +14 -13
- package/test/if/components/output/IfElse-server.ts +4 -4
- package/test/if/components/output/IfElseIf-client.ts +16 -15
- package/test/if/components/output/IfElseIf-server.ts +5 -5
- package/test/if/components/output/IfFalse-client.ts +56 -0
- package/test/if/components/output/IfFalse-server.ts +21 -0
- package/test/if/components/output/IfNested-client.ts +19 -18
- package/test/if/components/output/IfNested-server.ts +6 -6
- package/test/if/components/temp/{IfAfterIf-client-49b6b8c42b0a351561f9f5f22c2ae2e844bf3b58.ts → IfAfterIf-client-5ddfc6dc62ffbc9a518220458403008e88e69e6c.ts} +14 -13
- package/test/if/components/temp/{IfAfterIf-server-eb67cf1fcf6711882266219940a47bd4a66497f3.ts → IfAfterIf-server-a5005147e7902d1a5a048c9fe07feb9804eb6560.ts} +4 -4
- package/test/if/components/temp/{IfElse-client-e236d4a2e99262ff09675bc519c07e2826c0d70b.ts → IfElse-client-815057ffb2d9a1861bb316d445321947ddedbb65.ts} +14 -13
- package/test/if/components/temp/{IfElse-server-c077e0e30f4d2adec41ab779198362d21542d055.ts → IfElse-server-80d93e5fc4ceba7a645f7081fa11b177dbe730d0.ts} +4 -4
- package/test/if/components/temp/{IfElseIf-client-b92106861f0c7ec3d09e3a42bb93d8f5bd4e3bdf.ts → IfElseIf-client-a7b16a8af24fdd3caa7b9e8e56d4bdb6ad3ab855.ts} +16 -15
- package/test/if/components/temp/{IfElseIf-server-67991eee3f56dc687cda600511c31396438e0a77.ts → IfElseIf-server-ddc7348705d51b02538301e0aa704130748992cf.ts} +5 -5
- package/test/if/components/temp/IfFalse-client-6507ff8abd4842b78da27d8a9d4964abc1d9b727.ts +56 -0
- package/test/if/components/temp/IfFalse-server-e8385013cfdde584b43cc0d71311cbb417859116.ts +21 -0
- package/test/if/components/temp/{IfNested-client-f563ac1b16a2280e457557281c4925ed447a9cd7.ts → IfNested-client-e09f8af625b4e0b3e9eb210440f8edda720f0d53.ts} +19 -18
- package/test/if/components/temp/{IfNested-server-0a2a9643324ab73b02b310cad61ba87dab146ab2.ts → IfNested-server-285a5d8e0e0fcc8ccf421df152fdc00811782835.ts} +6 -6
- package/test/if/if-else-false.test.ts +54 -0
- package/test/if/{if-true.test.ts → if-else-true.test.ts} +5 -2
- package/test/if/if-false.test.ts +1 -4
- package/test/importComponent.ts +4 -0
- package/test/mount/components/output/Mount-client.ts +7 -4
- package/test/mount/components/output/Mount-server.ts +1 -1
- package/test/mount/components/temp/{Mount-client-36dbc95a61345a1b7dcf07e6b0c998af2afca691.ts → Mount-client-efa5c34fbfc7646e114a1a58f0814b6dff33e566.ts} +7 -4
- package/test/mount/components/temp/{Mount-server-8bef1924a731f3db63cb827be3938fec685e53af.ts → Mount-server-62f94f276c2d6c9048765a77b575cb21146917f1.ts} +1 -1
- package/test/on-mount/components/output/OnMount-client.ts +7 -4
- package/test/on-mount/components/output/OnMount-server.ts +1 -1
- package/test/on-mount/components/temp/{OnMount-client-21708a638d2939ee8b017f5dc819cee4748bde87.ts → OnMount-client-4bb62e8bf1fcd67798598fe03bf5455a57f0a6be.ts} +7 -4
- package/test/on-mount/components/temp/{OnMount-server-1758fe2b16972fca7d4b9bb49d9256fce99780eb.ts → OnMount-server-c531f718eb68754ea6c3001d5db9c07c511e434c.ts} +1 -1
- package/test/party/components/output/AnswerButton-client.ts +8 -6
- package/test/party/components/output/AnswerButton-server.ts +1 -1
- package/test/party/components/output/AnswerButtonApp-client.ts +11 -7
- package/test/party/components/output/AnswerButtonApp-server.ts +2 -2
- package/test/party/components/output/ColorSelect-client.ts +11 -9
- package/test/party/components/output/ColorSelect-server.ts +2 -2
- package/test/party/components/output/Colors-client.ts +12 -9
- package/test/party/components/output/Colors-server.ts +2 -2
- package/test/party/components/output/Counter-client.ts +8 -6
- package/test/party/components/output/Counter-server.ts +1 -1
- package/test/party/components/output/CssStyle-client.ts +6 -4
- package/test/party/components/output/CssStyle-server.ts +1 -1
- package/test/party/components/output/DoubleCount-client.ts +7 -5
- package/test/party/components/output/DoubleCount-server.ts +1 -1
- package/test/party/components/output/FunnyButton-client.ts +12 -9
- package/test/party/components/output/FunnyButton-server.ts +2 -2
- package/test/party/components/output/FunnyButtonApp-client.ts +15 -9
- package/test/party/components/output/FunnyButtonApp-server.ts +3 -3
- package/test/party/components/output/HelloWorld-client.ts +6 -4
- package/test/party/components/output/HelloWorld-server.ts +1 -1
- package/test/party/components/output/InputFocused-client.ts +7 -4
- package/test/party/components/output/InputFocused-server.ts +1 -1
- package/test/party/components/output/InputHello-client.ts +8 -6
- package/test/party/components/output/InputHello-server.ts +1 -1
- package/test/party/components/output/IsAvailable-client.ts +8 -6
- package/test/party/components/output/IsAvailable-server.ts +1 -1
- package/test/party/components/output/Name-client.ts +7 -5
- package/test/party/components/output/Name-server.ts +1 -1
- package/test/party/components/output/NameUpdate-client.ts +7 -5
- package/test/party/components/output/NameUpdate-server.ts +1 -1
- package/test/party/components/output/PageTitle-client.ts +7 -5
- package/test/party/components/output/PageTitle-server.ts +1 -1
- package/test/party/components/output/PickPill-client.ts +9 -7
- package/test/party/components/output/PickPill-server.ts +1 -1
- package/test/party/components/output/Time-client.ts +7 -5
- package/test/party/components/output/Time-server.ts +1 -1
- package/test/party/components/output/TrafficLight-client.ts +19 -17
- package/test/party/components/output/TrafficLight-server.ts +5 -5
- package/test/party/components/output/UserProfile-client.ts +10 -8
- package/test/party/components/output/UserProfile-server.ts +1 -1
- package/test/party/components/output/UserProfileApp-client.ts +9 -4
- package/test/party/components/output/UserProfileApp-server.ts +2 -0
- package/test/party/components/output/UserProfileContext-client.ts +9 -7
- package/test/party/components/output/UserProfileContext-server.ts +1 -1
- package/test/party/components/output/UserProfileContextApp-client.ts +11 -7
- package/test/party/components/output/UserProfileContextApp-server.ts +2 -2
- package/test/party/components/temp/{AnswerButton-client-c3dc7edbfff2db1ea111086002147d771ee12193.ts → AnswerButton-client-ad8f8db36b7aaa68d8de5898a324bacfbe9f20df.ts} +8 -6
- package/test/party/components/temp/{AnswerButton-server-427442fa8cfc0a18817c2d37f9cb5cbcb3a88a05.ts → AnswerButton-server-928b5d447afa865fa09e0142c79bb1f2c1b86875.ts} +1 -1
- package/test/party/components/temp/{AnswerButtonApp-client-3e0b63a6bbc1dee3e6cb715c0297cc2ce58d3e4e.ts → AnswerButtonApp-client-a2b16c738467742436b1a2ddaf2d767795a4d625.ts} +11 -7
- package/test/party/components/temp/{AnswerButtonApp-server-bbc8bb739d2060ccda77ce406aa6b15d8f90b91c.ts → AnswerButtonApp-server-16161f2c9062dd11b8b6b8c898f9f1249ae2400d.ts} +2 -2
- package/test/party/components/temp/{ColorSelect-client-5ffa6f9d77de967993088c9a01b9f976f3333176.ts → ColorSelect-client-4e848c296047911f4c0e3bc1447e5562ce06087c.ts} +11 -9
- package/test/party/components/temp/{ColorSelect-server-3ed19eff17bf10b31d03ec507974ff913932c97a.ts → ColorSelect-server-90f83722bd85155ebb2b8ccdaf053cd28d3152be.ts} +2 -2
- package/test/party/components/temp/{Colors-client-3dafffc5c2a72037f4419fc45d08963872a29958.ts → Colors-client-dde7bf60e2b16383ec981b08f8414b1ebeb349a5.ts} +12 -9
- package/test/party/components/temp/{Colors-server-f9b3037a5f25979f71b5f8f3e658140be7c27920.ts → Colors-server-e13d49ba57f7b0dc6fb10a333ec872f5207e1ff0.ts} +2 -2
- package/test/party/components/temp/{Counter-client-4d553521fcfc6c9a4e05dce89e70b2ecf8785c4e.ts → Counter-client-3b876c148f2b14da1766eff77eb6c494f7be6414.ts} +8 -6
- package/test/party/components/temp/{Counter-server-36d1137c519691f5b86a18a5c27b7cf615b7e37c.ts → Counter-server-7adf9376b38d97f1fd4b9c14108e6814e81f14ea.ts} +1 -1
- package/test/party/components/temp/{CssStyle-client-59c0f261f67bc04f2829a0371f655d146101cec6.ts → CssStyle-client-37465dd48d1479db1bae513eb0b92c4e9a15e9ea.ts} +6 -4
- package/test/party/components/temp/{CssStyle-server-3e58d7e2f5c381a251f593245d3d8bf4b50925ae.ts → CssStyle-server-90a950501a20bfa5feac84ca6d97898c25bce2ed.ts} +1 -1
- package/test/party/components/temp/{DoubleCount-client-0426f128507a8d4516ef7501cd180662112b6d1d.ts → DoubleCount-client-6d4cf1e54368e3c6082e37c1e04f9ecde90624f2.ts} +7 -5
- package/test/party/components/temp/{DoubleCount-server-40fc88156e52281b80fd6b12dd73d2469201fa29.ts → DoubleCount-server-62c94483ebe9661e5ecc4f489787e32448ddcafa.ts} +1 -1
- package/test/party/components/temp/{FunnyButton-client-45f2c5dd56f2cdb80102193a978df6b0cec822ab.ts → FunnyButton-client-61a1699da08e210375edff33f7b27d3cc0e99cc3.ts} +12 -9
- package/test/party/components/temp/{FunnyButton-server-e8ab55e47c735f7e42c55d2b7504dfa4190a1b40.ts → FunnyButton-server-e0adab2be2d283acb8a8b580479ade999dc918e9.ts} +2 -2
- package/test/party/components/temp/{FunnyButtonApp-client-ac7101af922dc6ba472b75a428f340caca6be74a.ts → FunnyButtonApp-client-cbce6a591bae38ab8b312551f8741d50ae6294bf.ts} +15 -9
- package/test/party/components/temp/{FunnyButtonApp-server-f1a98a946e0bb9d1bb76b01e26d6ead8f55d32bb.ts → FunnyButtonApp-server-48d37de0c755843a2be34d7c7cb5c730689dcc2f.ts} +3 -3
- package/test/party/components/temp/{HelloWorld-client-791e8b9a0bd4b01e87fbe70f2b28d4ac356e3624.ts → HelloWorld-client-7344e400b4adb975fa8263d3081a06de0a793e57.ts} +6 -4
- package/test/party/components/temp/{HelloWorld-server-3c4b9a995a78d652d9220a20124c9e0d18fc7101.ts → HelloWorld-server-e0ed80e7531f303952a4af30d646263ff2e4ead6.ts} +1 -1
- package/test/party/components/temp/{InputFocused-client-11a9cb08909b26945bbc2451ab4c1dac09e6d113.ts → InputFocused-client-20d755aea7dfaf1fd5e42dcade8fb7867f59ef28.ts} +7 -4
- package/test/party/components/temp/{InputFocused-server-82be1a63c80d1dd3f06efaf0bef349d58cf1d9af.ts → InputFocused-server-ee70758a515227c04788be0e298a79c277994ccd.ts} +1 -1
- package/test/party/components/temp/{InputHello-client-b0453caeae0d43dc1878039c6b49318d12624d48.ts → InputHello-client-2a4cbd980534fde14b9d3e8a2f8e4f59a4f15d64.ts} +8 -6
- package/test/party/components/temp/{InputHello-server-6c982438e58d3649ee3890efec636ca4590a5cdb.ts → InputHello-server-1b9dd5442ded022abe92a9075ca5a4bb90486cbe.ts} +1 -1
- package/test/party/components/temp/{IsAvailable-client-d789346a68b26fd3f5d9f7aebc4c7bd181c47cad.ts → IsAvailable-client-3949f85aea0e935c3b59ab1389baee836eff1866.ts} +8 -6
- package/test/party/components/temp/{IsAvailable-server-a35b7ec5f111472c76aa1b67c857b169fe363594.ts → IsAvailable-server-123daa1ae56b77defe6666faddb44ba4252dd0fb.ts} +1 -1
- package/test/party/components/temp/{Name-client-cb8bef7cfca1306386b65410a0bd7a8acfaed359.ts → Name-client-62f0dab96aff130e81882099d7c0a111ba99cebd.ts} +7 -5
- package/test/party/components/temp/{Name-server-9da0823f748e9751e017078f39717298be232636.ts → Name-server-a402418f1ca2d8a0e6403596ec03ec47b5ff40ec.ts} +1 -1
- package/test/party/components/temp/{NameUpdate-client-ebef69b0da12d640994099592ce06c7e4b5089d4.ts → NameUpdate-client-6ceb440637c99142bafcf8512eabf831c113b8c7.ts} +7 -5
- package/test/party/components/temp/{NameUpdate-server-1856bdb5e010f7d7e5e67f2a0d87ac3f92f4e0ee.ts → NameUpdate-server-b7dcc875e894a5606544fcd78bda575ea07632ca.ts} +1 -1
- package/test/party/components/temp/{PageTitle-client-403645e918294e5cdeea8cb3f602e0a2642b2650.ts → PageTitle-client-75fea3a37fb1213bc13f56160bb6779486b2e6e9.ts} +7 -5
- package/test/party/components/temp/{PageTitle-server-4d959183b7029b6817372abd1d60a7e996baeb15.ts → PageTitle-server-12dcb4e437aaef227c704a2ee8bbdee55ca323dc.ts} +1 -1
- package/test/party/components/temp/{PickPill-client-b47d371ae5f41d87c96b3cdeed0a8bc06fbfa9c7.ts → PickPill-client-0f13aa652cb1bd45f57d5a249f8364e80204441a.ts} +9 -7
- package/test/party/components/temp/{PickPill-server-49e033c5f97dd2f98e1498327e16eb9c8c9d2f66.ts → PickPill-server-f10dae4708e36775a5e1a5ad10c6c0c309335009.ts} +1 -1
- package/test/party/components/temp/{Time-client-7ba4ca9322af2cb88a873c812fc776760c337c64.ts → Time-client-2013f274e90b45be3138727f2298305e1951131f.ts} +7 -5
- package/test/party/components/temp/{Time-server-08f66c7f3f32b13de06d75fe679cf58b5727c473.ts → Time-server-8e0278a4b16925903f3c4ceedbf1332cde4921fa.ts} +1 -1
- package/test/party/components/temp/{TrafficLight-client-549f9fe3418c113fb240cfa17e09c42e1e7f346a.ts → TrafficLight-client-4010f51fde4c8c21e6c232eff974c86820dbad4f.ts} +19 -17
- package/test/party/components/temp/{TrafficLight-server-ed2a8640fd82cf381eee8f4fb83bb09d174a4557.ts → TrafficLight-server-04bb3b2f11322ccc97a9a8a8fbb26c3c99843042.ts} +5 -5
- package/test/party/components/temp/{UserProfile-client-2c13aac1ad915e51dc557f9af765669e636c0fea.ts → UserProfile-client-11c2a928de5a5ed4cab45186f08ca09f6161afb5.ts} +10 -8
- package/test/party/components/temp/{UserProfile-server-cc1162a4297f6163bfb86e7a8aeea08e8c0625c6.ts → UserProfile-server-a0576b8d9dd15b3fab6c11758984c686ddfe2f66.ts} +1 -1
- package/test/party/components/temp/{UserProfileApp-client-2be7a11319cca4d7bfa0f3d2205c441d7e203780.ts → UserProfileApp-client-32b5cc129b32af5cdd94f39c6fb09a2e4806b04e.ts} +9 -4
- package/test/party/components/temp/{UserProfileApp-server-ab9ff66f787f775aa8571314fee8bcbef85489ef.ts → UserProfileApp-server-97397c42aaac0ee3902218d02c0ce6884434cc5b.ts} +2 -0
- package/test/party/components/temp/{UserProfileContext-client-2aa36f436a5f20614d77f48963ec5ca442eebd90.ts → UserProfileContext-client-c97c077254210061b3c9ba561f681c0cf4f6167f.ts} +9 -7
- package/test/party/components/temp/{UserProfileContext-server-cf58767df1e2d1dde919f59de73cdd9764bbc006.ts → UserProfileContext-server-2d32476b00448bdec6c1c45aac5087a5152c2471.ts} +1 -1
- package/test/party/components/temp/{UserProfileContextApp-client-5099052fdcd8fb4c368c45090390947424a4e9b0.ts → UserProfileContextApp-client-c4b64ccf44069bcbf18acb585afa62ac9127aeb9.ts} +11 -7
- package/test/party/components/temp/{UserProfileContextApp-server-6be8dab2ed4f8911f26bef137e7dea164f2b894d.ts → UserProfileContextApp-server-95a4b12d30cef621db55d5de102a906ac7286fb2.ts} +2 -2
- package/test/props/components/output/Reactive-client.ts +18 -12
- package/test/props/components/output/Reactive-server.ts +3 -3
- package/test/props/components/temp/{Reactive-client-e3e5f6ee2f22c46337c6ab1df2f241133c7e2646.ts → Reactive-client-249382840865c9911857b89085bc85ff901b8e8f.ts} +18 -12
- package/test/props/components/temp/{Reactive-server-0914d91287a1bc6d32d7cc56d086624762dbfc04.ts → Reactive-server-770cd3df7c877c0c99e156b2ba6d1f8b35914027.ts} +3 -3
- package/test/replace/components/output/Replace-client.ts +11 -8
- package/test/replace/components/output/Replace-server.ts +2 -2
- package/test/replace/components/temp/{Replace-client-3fdab63871fa4bb792317caefd3539b1888325b1.ts → Replace-client-ef66f06bc0cfa91e800b185dbccbca6a98693c21.ts} +11 -8
- package/test/replace/components/temp/{Replace-server-857aca7a58deffc3a1c95ab9d31628b4051ca203.ts → Replace-server-9519943d193b681e1d7894a0d7952affdfb0660c.ts} +2 -2
- package/test/slots/components/output/Article-client.ts +13 -9
- package/test/slots/components/output/Article-server.ts +2 -2
- package/test/slots/components/output/Basic-client.ts +9 -5
- package/test/slots/components/output/Basic-server.ts +2 -0
- package/test/slots/components/output/Header-client.ts +10 -7
- package/test/slots/components/output/Header-server.ts +2 -2
- package/test/slots/components/output/Let-client.ts +9 -5
- package/test/slots/components/output/Let-server.ts +2 -0
- package/test/slots/components/output/List-client.ts +12 -9
- package/test/slots/components/output/List-server.ts +2 -2
- package/test/slots/components/output/Named-client.ts +12 -8
- package/test/slots/components/output/Named-server.ts +2 -0
- package/test/slots/components/output/Unused-client.ts +9 -4
- package/test/slots/components/output/Unused-server.ts +2 -0
- package/test/slots/components/temp/{Article-client-80848d6cadd8abac61865d14ddd35685844797e0.ts → Article-client-f7676836f5ded94222b11ef81e41dd675d1af04b.ts} +13 -9
- package/test/slots/components/temp/{Article-server-a6bd47a621cc213db4313eb775a52246541dd203.ts → Article-server-b84141b05064f5ea1e4b535faafe459df0d875fb.ts} +2 -2
- package/test/slots/components/temp/{Basic-client-97b18686412869e8c814fd4542dfe826b1f7669f.ts → Basic-client-e7650b8be5f6e50fa0f2f343a145f86edfe14ff4.ts} +9 -5
- package/test/slots/components/temp/{Basic-server-248392e2cd147b537cd44e9a5a71885ef20102e4.ts → Basic-server-aed46a5b459cce50e7ddb311c42a76b9e91c2dae.ts} +2 -0
- package/test/slots/components/temp/{Header-client-e2e1e7d60b48b0841cd0c20224f520330ca96458.ts → Header-client-127c27e6bfcd5b37cc871164cd665b740418dc82.ts} +10 -7
- package/test/slots/components/temp/{Header-server-1c195508a91c32822da22a08576c8a30c9070636.ts → Header-server-d8e8ccb129d84478f0c4f8dc8ad1d2091188cc7b.ts} +2 -2
- package/test/slots/components/temp/{Let-client-be69c1f5aa32faf16239050d7836db46cfdcba2f.ts → Let-client-c107eb0fe42f125996d2c9a83ab7b3c1916ca26d.ts} +9 -5
- package/test/slots/components/temp/{Let-server-c3293219ed27aec61a6af36d451ddf6609c40027.ts → Let-server-62727e5e2db3df405cdbe7a2d339a99113fc7f4a.ts} +2 -0
- package/test/slots/components/temp/{List-client-a829b33214de829de689a72d2e8703b2266ad7a4.ts → List-client-ca1d8f9a9cc8b513323de7c5531a4ec03898d920.ts} +12 -9
- package/test/slots/components/temp/{List-server-06503834c9bfae9b8c2b61742568b020a3de961c.ts → List-server-f4f63df4d19e15311da347284935a1bb530a8df4.ts} +2 -2
- package/test/slots/components/temp/{Named-client-2d9d88f5fdf74d81c3ed1d769a476f4ac36c8b99.ts → Named-client-636b6a18c25a27099f883cb9eeb04e182e248941.ts} +12 -8
- package/test/slots/components/temp/{Named-server-65a7bbf038111475c8f07dccb34040ab8c1392c4.ts → Named-server-829daa82c94fd7142a721cabac1b3402cca8fce6.ts} +2 -0
- package/test/slots/components/temp/{Unused-client-1b16491cb800bbbbd871d9fbf5966c7275244019.ts → Unused-client-0aefcc79e9ae050358fa049a35b7e8e0a6bc2d66.ts} +9 -4
- package/test/slots/components/temp/{Unused-server-e5d1e85116bebc7e1a2882cb8f2c9ae7975a1de7.ts → Unused-server-379b45ff313e82f8b2949385f50d8ea482094520.ts} +2 -0
- package/test/special-component/components/output/BigTitle-client.ts +9 -6
- package/test/special-component/components/output/BigTitle-server.ts +2 -2
- package/test/special-component/components/output/Component-client.ts +10 -4
- package/test/special-component/components/output/Component-server.ts +2 -2
- package/test/special-component/components/output/SmallTitle-client.ts +9 -6
- package/test/special-component/components/output/SmallTitle-server.ts +2 -2
- package/test/special-component/components/temp/{BigTitle-client-881a9f84876fb3f6d994736edb253b96e71de926.ts → BigTitle-client-04ca3c7b6aaf76b81baa5a3d3720fbd2a1760550.ts} +9 -6
- package/test/special-component/components/temp/{BigTitle-server-9efc738f5eb131a4b859c4a99a8e255d93834e9a.ts → BigTitle-server-d8919a4c975e022c936584bd668917cb89aa8e20.ts} +2 -2
- package/test/special-component/components/temp/{Component-client-22f7e1d0955fb3d90939e956a1f0f77118c259b6.ts → Component-client-24cd39596c4281ee2709e6aa482818d071825b4f.ts} +10 -4
- package/test/special-component/components/temp/{Component-server-ce596cd84dc11f67c9f0588060a5b672eddf9715.ts → Component-server-3564dfcef8d015cab4944a3c75cc6cf329f3fad6.ts} +2 -2
- package/test/special-component/components/temp/{SmallTitle-client-25b3097b7ae47848dd82967403faf7745fc43388.ts → SmallTitle-client-213b422377a30fe0b12f7256e654bf0313ac9cf9.ts} +9 -6
- package/test/special-component/components/temp/{SmallTitle-server-fc105db9a91b83644d67e049ce583a3d1a61f50c.ts → SmallTitle-server-0a9b5098e4dda96f8c1da30294d71b39997dd118.ts} +2 -2
- package/test/special-element/components/output/Element-client.ts +8 -6
- package/test/special-element/components/output/Element-server.ts +1 -1
- package/test/special-element/components/temp/{Element-client-21c92c04579b1d29e8813265a10897d069aad5c5.ts → Element-client-c5701ed44faa4ec8ae558505063684a84cada3f2.ts} +8 -6
- package/test/special-element/components/temp/{Element-server-4bed9653529f39e72754126147fe8618f328853a.ts → Element-server-166d672256ef4635168de0090e490e48b569c7d6.ts} +1 -1
- package/test/special-head/components/output/Head-client.ts +6 -4
- package/test/special-head/components/output/Head-server.ts +1 -1
- package/test/special-head/components/temp/{Head-client-07e8af6386d767a52667a4fdc978a335ec388302.ts → Head-client-18616689a7d6f83ca076c9d825606b049de9d3ef.ts} +6 -4
- package/test/special-head/components/temp/{Head-server-d80a0f1ee10e9942d9a631df35a24cb1cfb15555.ts → Head-server-c0956653b544ff632e36da15d5f7623fa285953a.ts} +1 -1
- package/test/special-self/components/output/Self-client.ts +12 -8
- package/test/special-self/components/output/Self-server.ts +4 -4
- package/test/special-self/components/temp/{Self-client-911c67194be1fdd997537310bcafe712161e8251.ts → Self-client-99b34229c85a477881299311f56f48686352c3b3.ts} +12 -8
- package/test/special-self/components/temp/{Self-server-49ba9be1f6255dd4daf490c640f5222a85960218.ts → Self-server-ee440757ca9772d7b4111451a9ee05a157302e7c.ts} +4 -4
- package/test/style/components/output/Style-client.ts +7 -4
- package/test/style/components/output/Style-server.ts +1 -1
- package/test/style/components/temp/{Style-client-cbfac1e255c33a867ccbd5f9d1484a855d91a2d7.ts → Style-client-bc13f8dbb5f754e4eebb2473fc63a139ebf1ba92.ts} +7 -4
- package/test/style/components/temp/{Style-server-763d82ee2296be3f7620814aed950b505329c04c.ts → Style-server-85720cb43e20ab000f98bc632c29454a51ae92d9.ts} +1 -1
- package/test/svg/components/output/Shape-client.ts +14 -11
- package/test/svg/components/output/Shape-server.ts +4 -4
- package/test/svg/components/temp/{Shape-client-cb98b36ab2a0d9f06b484a3c988fb43c3a71a4a0.ts → Shape-client-368789c592401c3e4c99ddcdb8fe6dded45eb34a.ts} +14 -11
- package/test/svg/components/temp/{Shape-server-500d7fe4556026234ce5379b8e90595ddd094edc.ts → Shape-server-9951ff1dcc7aa0827f28d3f8d970813767115ae3.ts} +4 -4
- package/test/switch/components/output/Switch-client.ts +17 -14
- package/test/switch/components/output/Switch-server.ts +5 -5
- package/test/switch/components/temp/{Switch-client-9980de45e3346b79525c445edec7cbc3b375e8a4.ts → Switch-client-5ef1937202adac7fd5aae866357d95beb4b5805f.ts} +17 -14
- package/test/switch/components/temp/{Switch-server-1c5690726f28008bb565966af69b6e4e019dea82.ts → Switch-server-c1b5e1c657438ee3d8afdbf2166c5295cafc5604.ts} +5 -5
- package/test/template/errors.test.ts +8 -6
- package/test/text/components/output/Text-client.ts +8 -6
- package/test/text/components/output/Text-server.ts +1 -1
- package/test/text/components/temp/{Text-client-63f1d3bf9b3bd145c7ce7058716640e27144055e.ts → Text-client-e335aae6d8aef389dfdbb5bee14e3dd3d41e86bd.ts} +8 -6
- package/test/text/components/temp/{Text-server-9d3dd6f51e893e63c1999ceafce19ca1697d76ea.ts → Text-server-e37d33aa182f36461927d8ce36040bfd05e2f227.ts} +1 -1
- package/test/watch-array/components/output/Array-client.ts +12 -9
- package/test/watch-array/components/output/Array-server.ts +2 -2
- package/test/watch-array/components/output/ArrayEntries-client.ts +12 -9
- package/test/watch-array/components/output/ArrayEntries-server.ts +2 -2
- package/test/watch-array/components/output/ArrayIndexes-client.ts +12 -9
- package/test/watch-array/components/output/ArrayIndexes-server.ts +2 -2
- package/test/watch-array/components/output/ArrayUnkeyed-client.ts +12 -9
- package/test/watch-array/components/output/ArrayUnkeyed-server.ts +2 -2
- package/test/watch-array/components/temp/{Array-client-ffd82188a45877d74053c82fb3616e4aed0fc2ad.ts → Array-client-24ccac431fa237432ec4875234773f36a9a5b120.ts} +12 -9
- package/test/watch-array/components/temp/{Array-server-3715e815af887e8487b214e7de324850fe99e312.ts → Array-server-c907209008ac6177f614b62931a2bb1f1c3a04e1.ts} +2 -2
- package/test/watch-array/components/temp/{ArrayEntries-client-b6e982660628576061dbb44539e970b9549bdcfa.ts → ArrayEntries-client-ebfb391a78325be4411f24a1ecfdc45ca3a6a621.ts} +12 -9
- package/test/watch-array/components/temp/{ArrayEntries-server-85cbe80fbb7f6885287825e2cc0dfc1cb9835d79.ts → ArrayEntries-server-57c1ab0045fa4a02de95f69a65de6f54efe9850c.ts} +2 -2
- package/test/watch-array/components/temp/{ArrayIndexes-client-39337aa43bd8c10a53db836c3be233d48dd39b91.ts → ArrayIndexes-client-0a4b3226862bb1de13fdbc7a14f689d9f7ade2a1.ts} +12 -9
- package/test/watch-array/components/temp/{ArrayIndexes-server-ec623c724af0c7212675d61ea68e9dee87f96caa.ts → ArrayIndexes-server-f093878b94a37617e2e697a786caa680f75630a7.ts} +2 -2
- package/test/watch-array/components/temp/{ArrayUnkeyed-client-7606f9a6a221c8cf6a8b51e4895d10a3d7bccc11.ts → ArrayUnkeyed-client-0966fa5ed460f4c627d8d619e493601098d6a33e.ts} +12 -9
- package/test/watch-array/components/temp/{ArrayUnkeyed-server-db21cd576a4c70973abe10f6c8ef5cecb3ead86c.ts → ArrayUnkeyed-server-c893fa024be07e5e7fce608c3ae456bdf2279dbe.ts} +2 -2
- package/test/watch-object/components/output/Watched-client.ts +7 -5
- package/test/watch-object/components/output/Watched-server.ts +1 -1
- package/test/watch-object/components/temp/{Watched-client-bbffbf2cede1a5c071b770670eb39c0f0be725af.ts → Watched-client-d26e846bbeb8271ec5dc2a1ceb75b362af44d3bd.ts} +7 -5
- package/test/watch-object/components/temp/{Watched-server-0252addaf92fb0f0c1e2937f42918a1c9f31d196.ts → Watched-server-312fca1e769d7594fc5bb6295ccf55b544dd2f4d.ts} +1 -1
- package/test/class/components/temp/Class-server-853a463d2ad1a1e3da4da5ad59ad1c75461d2431.ts +0 -40
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../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/addFragment.ts","../src/render/applyProps.ts","../src/render/formatText.ts","../src/render/getClasses.ts","../src/render/getFragment.ts","../src/render/getStyles.ts","../src/render/hydrate.ts","../src/render/mount.ts","../src/render/newListItem.ts","../src/render/newRange.ts","../src/render/hydrationMarkers.ts","../src/render/isComment.ts","../src/render/nodeNext.ts","../src/render/nodeAnchor.ts","../src/render/nodeChild.ts","../src/render/nodeRoot.ts","../src/render/popRange.ts","../src/render/pushRange.ts","../src/render/runControl.ts","../src/render/clearRange.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 $mount from \"./render/$mount\";\nimport $run from \"./render/$run\";\nimport $unwrap from \"./render/$unwrap\";\nimport $watch from \"./render/$watch\";\nimport t_animate from \"./render/addAnimation\";\nimport t_event from \"./render/addEvent\";\nimport t_add_fragment from \"./render/addFragment\";\nimport t_apply_props from \"./render/applyProps\";\nimport t_fmt from \"./render/formatText\";\nimport t_class from \"./render/getClasses\";\nimport t_fragment from \"./render/getFragment\";\nimport t_style from \"./render/getStyles\";\nimport hydrate from \"./render/hydrate\";\nimport mount from \"./render/mount\";\nimport t_list_item from \"./render/newListItem\";\nimport t_range from \"./render/newRange\";\nimport t_anchor from \"./render/nodeAnchor\";\nimport t_child from \"./render/nodeChild\";\nimport t_next from \"./render/nodeNext\";\nimport t_root from \"./render/nodeRoot\";\nimport t_pop_range from \"./render/popRange\";\nimport t_push_range from \"./render/pushRange\";\nimport t_run_control from \"./render/runControl\";\nimport t_run_branch from \"./render/runControlBranch\";\nimport t_run_list from \"./render/runList\";\nimport t_attribute from \"./render/setAttribute\";\nimport t_dynamic from \"./render/setDynamicElement\";\nimport { type Component } from \"./types/Component\";\nimport { type ListItem } from \"./types/ListItem\";\nimport { type ServerComponent } from \"./types/ServerComponent\";\nimport { type ServerSlotRender } from \"./types/ServerSlotRender\";\nimport { type SlotRender } from \"./types/SlotRender\";\n\n// Mount and hydrate\nexport { mount, hydrate };\n\n// Functions for the user that can be called from components\nexport { $watch, $unwrap, $run, $mount };\n\n// Functions for use within generated code\nexport {\n\tt_animate,\n\tt_event,\n\tt_add_fragment,\n\tt_apply_props,\n\tt_fmt,\n\tt_class,\n\tt_fragment,\n\tt_style,\n\tt_range,\n\tt_anchor,\n\tt_child,\n\tt_next,\n\tt_root,\n\tt_pop_range,\n\tt_push_range,\n\tt_run_control,\n\tt_run_branch,\n\tt_list_item,\n\tt_run_list,\n\tt_attribute,\n\tt_dynamic,\n};\n\nexport type { Component, ServerComponent, SlotRender, ServerSlotRender, ListItem };\n","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","import animate from \"../motion/animate\";\nimport $run from \"./$run\";\nimport context from \"./context\";\n\nexport default function addFragment(\n\tfragment: DocumentFragment,\n\tparent: ParentNode,\n\tbefore: Node | null,\n): void {\n\t//console.log(`adding fragment '${fragment.textContent}' to ${printNode(parent)}`);\n\t//console.log(\"before\", printNode(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 = 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 = parent.nodeType === 11;\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 (!context.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","export default function formatText(value: any): string {\n\treturn value ?? \"\";\n}\n","export default function getClasses(value: unknown, styleHash?: string): string {\n\tlet classes: string[] = [];\n\tgatherNames(\"\", value, classes);\n\tif (styleHash) {\n\t\tclasses.push(styleHash);\n\t}\n\treturn classes.join(\" \");\n}\n\nfunction gatherNames(name: unknown, value: unknown, classes: string[]) {\n\tif (value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (let v of value) {\n\t\t\t\tgatherNames(v, v, classes);\n\t\t\t}\n\t\t} else if (typeof value === \"object\") {\n\t\t\tfor (let [n, v] of Object.entries(value)) {\n\t\t\t\tgatherNames(n, v, classes);\n\t\t\t}\n\t\t} else {\n\t\t\tclasses.push(name as string);\n\t\t}\n\t}\n}\n","export default function 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","export default function getStyles(value: Record<string, any>): string {\n\tlet styles: string[] = [];\n\tfor (let [n, v] of Object.entries(value)) {\n\t\tstyles.push(`${n}: ${v}`);\n\t}\n\treturn styles.join(\"; \");\n}\n","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","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","const HYDRATION_START = \"[\";\nconst HYDRATION_END = \"]\";\nconst HYDRATION_BRANCH = \"^\";\n\nexport { HYDRATION_START, HYDRATION_END, HYDRATION_BRANCH };\n","export default function isComment(node: Node): node is Comment {\n\treturn node.nodeType === 8;\n}\n","import context from \"./context\";\nimport { HYDRATION_BRANCH } from \"./hydrationMarkers\";\nimport isComment from \"./isComment\";\n\n/**\n * Gets the next sibling of a node\n */\nexport default function nodeNext(node: Node, count?: number): Node {\n\tlet nextNode = checkHydrationNode(node.nextSibling);\n\n\tif (count) {\n\t\tfor (let i = 1; i < count; i++) {\n\t\t\tnextNode = checkHydrationNode(nextNode!.nextSibling);\n\t\t}\n\t}\n\n\t// NOTE: We know nextNode is not null as it is being called from generated code\n\treturn nextNode!;\n}\n\nfunction checkHydrationNode(nextNode: ChildNode | null) {\n\tif (context.hydrationNode) {\n\t\t// Remove hydration comments that are inserted at the start of branches\n\t\t// They are just used to split up text nodes that would otherwise be joined in HTML\n\t\tif (nextNode && isComment(nextNode) && nextNode.data === HYDRATION_BRANCH) {\n\t\t\tlet comment = nextNode;\n\t\t\tnextNode = nextNode.nextSibling;\n\t\t\tcomment.remove();\n\t\t}\n\t\tcontext.hydrationNode = nextNode;\n\t}\n\treturn nextNode;\n}\n","import context from \"./context\";\nimport { HYDRATION_END, HYDRATION_START } from \"./hydrationMarkers\";\nimport isComment from \"./isComment\";\nimport nodeNext from \"./nodeNext\";\n\nexport default function nodeAnchor(node: Node): Node {\n\t// If we are hydrating, the anchor will be at the end of the paired <![> and\n\t// <!]> comments\n\tif (context.hydrationNode && isComment(node) && node.data === HYDRATION_START) {\n\t\t// Skip and remove the start node\n\t\tlet currentNode = nodeNext(node);\n\t\tnode.remove();\n\n\t\t// Go through siblings until we get to the end\n\t\tlet level = 1;\n\t\twhile (currentNode) {\n\t\t\tif (isComment(currentNode)) {\n\t\t\t\tif (currentNode.data === HYDRATION_START) {\n\t\t\t\t\tlevel += 1;\n\t\t\t\t} else if (currentNode.data === HYDRATION_END) {\n\t\t\t\t\tlevel -= 1;\n\t\t\t\t}\n\t\t\t\tif (level === 0) {\n\t\t\t\t\t// Remove the end node and return the next one\n\t\t\t\t\tconst endNode = currentNode.nextSibling;\n\t\t\t\t\tcurrentNode.remove();\n\t\t\t\t\t// NOTE: We know this is not null as it is being called from\n\t\t\t\t\t// generated code\n\t\t\t\t\treturn endNode!;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentNode = currentNode.nextSibling!;\n\t\t}\n\n\t\tif (!currentNode) {\n\t\t\tthrow new Error(\"End hydration comment not found\");\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 */\nexport default function nodeChild(parent: Node): Node {\n\tlet child = 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 (!child) {\n\t\t\tchild = parent.appendChild(parent.ownerDocument!.createTextNode(\"\"));\n\t\t}\n\t\tcontext.hydrationNode = child;\n\t}\n\t// NOTE: We know this is not null as it is being called from generated code\n\treturn child!;\n}\n","import context from \"./context\";\n\n/**\n * Gets the first child in a fragment\n * */\nexport default function nodeRoot(parent: Node): Node {\n\tconst hydrationNode = context.hydrationNode;\n\tif (hydrationNode) {\n\t\t// If hydrating, set the active range's start node, while we have it\n\t\tconst range = context.activeRange;\n\t\tif (range && !range.startNode) {\n\t\t\trange.startNode = hydrationNode;\n\t\t}\n\t\treturn hydrationNode;\n\t} else {\n\t\t// NOTE: We know this is not null as it is being called from generated code\n\t\treturn parent.firstChild!;\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 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 removeEffect from \"../watch/removeEffect\";\nimport context from \"./context\";\n\nexport default function clearRange(range: Range): void {\n\t//console.log(`clearing range ${printNode(range.startNode)} to ${printNode(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\";\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\";\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\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgDA,IAAM,UAAmB;AAAA,EACxB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc,CAAC;AAAA,EACf,eAAe,CAAC;AAAA,EAChB,mBAAmB,CAAC;AAAA,EACpB,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAShB;AAEA,IAAO,kBAAQ;;;ACzDA,SAAR,OAAwB,IAAgC;AAC9D,kBAAQ,aAAa,KAAK,EAAE;AAC7B;;;ACPe,SAAR,UAA2B,QAAsB;AAEvD,SAAO,SAAS;AAIhB,kBAAQ,eAAe;AAIvB,QAAM,UAAU,OAAO,IAAI;AAE3B,MAAI,OAAO,YAAY,YAAY;AAClC,WAAO,UAAU;AAAA,EAClB;AAEA,kBAAQ,eAAe;AACxB;;;ACRe,SAAR,KAAsB,IAAgC;AAC5D,MAAI,SAAiB;AAAA,IACpB,KAAK;AAAA,IACL,SAAS;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,EACT;AAEA,MAAI,gBAAQ,aAAa;AAExB,KAAC,gBAAQ,YAAY,YAAY,CAAC,GAAG,KAAK,MAAM;AAAA,EACjD;AAEA,YAAU,MAAM;AACjB;;;AC1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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/addFragment.ts","../src/render/applyProps.ts","../src/render/clearRange.ts","../src/render/clearLayoutSlot.ts","../src/render/formatText.ts","../src/render/getClasses.ts","../src/render/getFragment.ts","../src/render/getStyles.ts","../src/render/hydrate.ts","../src/render/mount.ts","../src/render/newListItem.ts","../src/render/newRange.ts","../src/render/hydrationMarkers.ts","../src/render/isComment.ts","../src/render/isText.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/popRange.ts","../src/render/pushRange.ts","../src/render/runControl.ts","../src/render/runControlBranch.ts","../src/render/runLayoutSlot.ts","../src/render/moveRange.ts","../src/render/runListItems.ts","../src/render/runList.ts","../src/render/setAttribute.ts","../src/render/setDynamicElement.ts"],"sourcesContent":["import $mount from \"./render/$mount\";\nimport $run from \"./render/$run\";\nimport $unwrap from \"./render/$unwrap\";\nimport $watch from \"./render/$watch\";\nimport t_animate from \"./render/addAnimation\";\nimport t_event from \"./render/addEvent\";\nimport t_add_fragment from \"./render/addFragment\";\nimport t_apply_props from \"./render/applyProps\";\nimport clearLayoutSlot from \"./render/clearLayoutSlot\";\nimport t_fmt from \"./render/formatText\";\nimport t_class from \"./render/getClasses\";\nimport t_fragment from \"./render/getFragment\";\nimport t_style from \"./render/getStyles\";\nimport hydrate from \"./render/hydrate\";\nimport mount from \"./render/mount\";\nimport t_list_item from \"./render/newListItem\";\nimport t_range from \"./render/newRange\";\nimport t_anchor from \"./render/nodeAnchor\";\nimport t_child from \"./render/nodeChild\";\nimport t_next from \"./render/nodeNext\";\nimport t_root from \"./render/nodeRoot\";\nimport t_skip from \"./render/nodeSkip\";\nimport t_pop_range from \"./render/popRange\";\nimport t_push_range from \"./render/pushRange\";\nimport t_run_control from \"./render/runControl\";\nimport t_run_branch from \"./render/runControlBranch\";\nimport runLayoutSlot from \"./render/runLayoutSlot\";\nimport t_run_list from \"./render/runList\";\nimport t_attribute from \"./render/setAttribute\";\nimport t_dynamic from \"./render/setDynamicElement\";\nimport { type Component } from \"./types/Component\";\nimport { type ListItem } from \"./types/ListItem\";\nimport { type ServerComponent } from \"./types/ServerComponent\";\nimport { type ServerSlotRender } from \"./types/ServerSlotRender\";\nimport { type SlotRender } from \"./types/SlotRender\";\n\n// Mount and hydrate\nexport { mount, hydrate, runLayoutSlot, clearLayoutSlot };\n\n// Functions for the user that can be called from components\nexport { $watch, $unwrap, $run, $mount };\n\n// Functions for use within generated code\nexport {\n\tt_animate,\n\tt_event,\n\tt_add_fragment,\n\tt_apply_props,\n\tt_fmt,\n\tt_class,\n\tt_fragment,\n\tt_style,\n\tt_range,\n\tt_anchor,\n\tt_child,\n\tt_next,\n\tt_root,\n\tt_skip,\n\tt_pop_range,\n\tt_push_range,\n\tt_run_control,\n\tt_run_branch,\n\tt_list_item,\n\tt_run_list,\n\tt_attribute,\n\tt_dynamic,\n};\n\nexport type { Component, ServerComponent, SlotRender, ServerSlotRender, ListItem };\n","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","import animate from \"../motion/animate\";\nimport $run from \"./$run\";\nimport context from \"./context\";\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 = parent.nodeType === 11;\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","export default function formatText(value: any): string {\n\treturn value ?? \"\";\n}\n","export default function getClasses(value: unknown, styleHash?: string): string {\n\tlet classes: string[] = [];\n\tgatherNames(\"\", value, classes);\n\tif (styleHash) {\n\t\tclasses.push(styleHash);\n\t}\n\treturn classes.join(\" \");\n}\n\nfunction gatherNames(name: unknown, value: unknown, classes: string[]) {\n\tif (value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (let v of value) {\n\t\t\t\tgatherNames(v, v, classes);\n\t\t\t}\n\t\t} else if (typeof value === \"object\") {\n\t\t\tfor (let [n, v] of Object.entries(value)) {\n\t\t\t\tgatherNames(n, v, classes);\n\t\t\t}\n\t\t} else {\n\t\t\tclasses.push(name as string);\n\t\t}\n\t}\n}\n","export default function 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","export default function getStyles(value: Record<string, any>): string {\n\tlet styles: string[] = [];\n\tfor (let [n, v] of Object.entries(value)) {\n\t\tstyles.push(`${n}: ${v}`);\n\t}\n\treturn styles.join(\"; \");\n}\n","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","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","const HYDRATION_START = \"[\";\nconst HYDRATION_END = \"]\";\nconst HYDRATION_BREAK = \"^\";\n\nexport { HYDRATION_START, HYDRATION_END, HYDRATION_BREAK };\n","export default function isComment(node: Node | null | undefined): node is Comment {\n\treturn node?.nodeType === 8;\n}\n","export default function isText(node: Node | null | undefined): node is Text {\n\treturn node?.nodeType === 3;\n}\n","import context from \"./context\";\nimport { HYDRATION_BREAK } from \"./hydrationMarkers\";\nimport isComment from \"./isComment\";\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 && isComment(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 isText from \"./isText\";\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 && isText(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 isComment from \"./isComment\";\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 * @param subsequent Whether this is the second time the anchor is being retrieved.\n * @returns The anchor node.\n */\nexport default function nodeAnchor(node: ChildNode, subsequent = false): ChildNode {\n\tif (context.hydrationNode) {\n\t\t// The first time we get a node anchor during hydration, the hydration\n\t\t// node gets set to the first node in the statement, and then we work\n\t\t// through the nodes until we get to the anchor node itself. So, the\n\t\t// second time we get the anchor node, the hydration node should have\n\t\t// been set to it. I'm not sure this is going to always be the case...\n\t\tif (subsequent) {\n\t\t\treturn context.hydrationNode;\n\t\t}\n\n\t\tif (isComment(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 (isComment(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 isText from \"./isText\";\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 && !isText(rootNode) && isText(rootNode.previousSibling)) {\n\t\t\trootNode = rootNode.previousSibling;\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 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 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 { 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 runLayoutSlot(\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, true);\n\n\tcomponent(parent, anchor, $props, $context, {\n\t\t_: slot,\n\t});\n\n\tpopRange(oldRange);\n\n\treturn range;\n}\n","import { type Range } from \"../types/Range\";\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\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgDA,IAAM,UAAmB;AAAA,EACxB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc,CAAC;AAAA,EACf,eAAe,CAAC;AAAA,EAChB,mBAAmB,CAAC;AAAA,EACpB,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAShB;AAEA,IAAO,kBAAQ;;;ACzDA,SAAR,OAAwB,IAAgC;AAC9D,kBAAQ,aAAa,KAAK,EAAE;AAC7B;;;ACPe,SAAR,UAA2B,QAAsB;AAEvD,SAAO,SAAS;AAIhB,kBAAQ,eAAe;AAIvB,QAAM,UAAU,OAAO,IAAI;AAE3B,MAAI,OAAO,YAAY,YAAY;AAClC,WAAO,UAAU;AAAA,EAClB;AAEA,kBAAQ,eAAe;AACxB;;;ACRe,SAAR,KAAsB,IAAgC;AAC5D,MAAI,SAAiB;AAAA,IACpB,KAAK;AAAA,IACL,SAAS;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,EACT;AAEA,MAAI,gBAAQ,aAAa;AAExB,KAAC,gBAAQ,YAA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;AACxB;;;AC7Ke,SAAR,QACN,OACA,QACA,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"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -43,29 +43,10 @@ declare function addAnimation(el: HTMLElement, entry?: Animation$1, exit?: Anima
|
|
|
43
43
|
|
|
44
44
|
declare function addEvent(el: Element, type: string, listener: (this: Element, ev: any) => any): void;
|
|
45
45
|
|
|
46
|
-
declare function addFragment(fragment: DocumentFragment, parent: ParentNode, before: Node | null): void;
|
|
46
|
+
declare function addFragment(fragment: DocumentFragment, parent: ParentNode, before: Node | null, endNode?: ChildNode): void;
|
|
47
47
|
|
|
48
48
|
declare function applyProps(el: Element, props: Record<string, any> | undefined, propNamesUsed: string[]): void;
|
|
49
49
|
|
|
50
|
-
declare function getFragment(document: Document, array: DocumentFragment[], index: number, html: string, ns?: boolean): DocumentFragment;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Hydrates a component into an existing DOM tree
|
|
54
|
-
* @param parent The parent node
|
|
55
|
-
* @param component The component to mount
|
|
56
|
-
* @param props An object containing component props
|
|
57
|
-
*/
|
|
58
|
-
declare function hydrate(parent: ParentNode, component: Component, props?: Record<string, any>, slots?: Record<string, SlotRender>): void;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Mounts a component into a DOM node
|
|
62
|
-
*
|
|
63
|
-
* @param parent The node to mount the component into
|
|
64
|
-
* @param component The component to mount
|
|
65
|
-
* @param props An object containing component props
|
|
66
|
-
*/
|
|
67
|
-
declare function mount(parent: ParentNode, component: Component, props?: Record<string, any>, slots?: Record<string, SlotRender>): void;
|
|
68
|
-
|
|
69
50
|
/**
|
|
70
51
|
* State data for a property in a proxy.
|
|
71
52
|
*/
|
|
@@ -110,6 +91,27 @@ type Range = {
|
|
|
110
91
|
animations: Set<Animation> | null;
|
|
111
92
|
};
|
|
112
93
|
|
|
94
|
+
declare function clearLayoutSlot(range: Range): void;
|
|
95
|
+
|
|
96
|
+
declare function getFragment(document: Document, array: DocumentFragment[], index: number, html: string, ns?: boolean): DocumentFragment;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Hydrates a component into an existing DOM tree
|
|
100
|
+
* @param parent The parent node
|
|
101
|
+
* @param component The component to mount
|
|
102
|
+
* @param props An object containing component props
|
|
103
|
+
*/
|
|
104
|
+
declare function hydrate(parent: ParentNode, component: Component, props?: Record<string, any>, slots?: Record<string, SlotRender>): void;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Mounts a component into a DOM node
|
|
108
|
+
*
|
|
109
|
+
* @param parent The node to mount the component into
|
|
110
|
+
* @param component The component to mount
|
|
111
|
+
* @param props An object containing component props
|
|
112
|
+
*/
|
|
113
|
+
declare function mount(parent: ParentNode, component: Component, props?: Record<string, any>, slots?: Record<string, SlotRender>): void;
|
|
114
|
+
|
|
113
115
|
type ListItem = Range & {
|
|
114
116
|
data: Record<string, any>;
|
|
115
117
|
key: any;
|
|
@@ -119,22 +121,61 @@ declare function newListItem(data: Record<PropertyKey, any>, key?: any): ListIte
|
|
|
119
121
|
|
|
120
122
|
declare function newRange(): Range;
|
|
121
123
|
|
|
122
|
-
|
|
124
|
+
/**
|
|
125
|
+
* Gets the anchor node for a control statement or component.
|
|
126
|
+
*
|
|
127
|
+
* When mounting, this just returns the anchor node parameter (because it was
|
|
128
|
+
* created).
|
|
129
|
+
*
|
|
130
|
+
* When hydrating, there should be matched <![> and <!]> comments in the HTML,
|
|
131
|
+
* and the anchor node should be after the end comment. The matched comment
|
|
132
|
+
* nodes will be deleted, and the hydration node set to the first node inside
|
|
133
|
+
* the matched comments.
|
|
134
|
+
*
|
|
135
|
+
* @param node The potential anchor node.
|
|
136
|
+
* @param subsequent Whether this is the second time the anchor is being retrieved.
|
|
137
|
+
* @returns The anchor node.
|
|
138
|
+
*/
|
|
139
|
+
declare function nodeAnchor(node: ChildNode, subsequent?: boolean): ChildNode;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Gets the first child of a node.
|
|
143
|
+
*
|
|
144
|
+
* Sets the hydration node.
|
|
145
|
+
*
|
|
146
|
+
* @param parent The parent node.
|
|
147
|
+
*/
|
|
148
|
+
declare function nodeChild(parent: Node): ChildNode;
|
|
123
149
|
|
|
124
150
|
/**
|
|
125
|
-
* Gets the
|
|
151
|
+
* Gets the next sibling of a node.
|
|
152
|
+
*
|
|
153
|
+
* When hydrating, sets the hydration node.
|
|
154
|
+
*
|
|
155
|
+
* @param node The node.
|
|
156
|
+
* @param text Whether we require a text node.
|
|
126
157
|
*/
|
|
127
|
-
declare function
|
|
158
|
+
declare function nodeNext(node: ChildNode, text?: boolean): ChildNode;
|
|
128
159
|
|
|
129
160
|
/**
|
|
130
|
-
* Gets the
|
|
161
|
+
* Gets the first child in a fragment.
|
|
162
|
+
*
|
|
163
|
+
* When hydrating, also sets the active range's start node, while we have it.
|
|
164
|
+
*
|
|
165
|
+
* @param parent The parent of the fragment.
|
|
166
|
+
* @param text Whether we require a text node.
|
|
131
167
|
*/
|
|
132
|
-
declare function
|
|
168
|
+
declare function nodeRoot(parent: Node, text?: boolean): ChildNode;
|
|
133
169
|
|
|
134
170
|
/**
|
|
135
|
-
* Gets the
|
|
136
|
-
*
|
|
137
|
-
|
|
171
|
+
* Gets the sibling of a node, x nodes after it.
|
|
172
|
+
*
|
|
173
|
+
* When hydrating, sets the hydration node.
|
|
174
|
+
*
|
|
175
|
+
* @param node The node.
|
|
176
|
+
* @param count The number of nodes to skip.
|
|
177
|
+
*/
|
|
178
|
+
declare function nodeSkip(node: ChildNode, count: number): ChildNode;
|
|
138
179
|
|
|
139
180
|
declare function popRange(oldRange: Range | null): void;
|
|
140
181
|
|
|
@@ -148,6 +189,8 @@ declare function runControl(range: Range, anchor: Node | null, create: (anchor:
|
|
|
148
189
|
|
|
149
190
|
declare function runControlBranch(range: Range, index: number, create: () => void): void;
|
|
150
191
|
|
|
192
|
+
declare function runLayoutSlot(component: Component, slot: SlotRender, parent: ParentNode, anchor: Node | null, $props: Record<string, string>, $context?: Record<PropertyKey, any>): Range;
|
|
193
|
+
|
|
151
194
|
/**
|
|
152
195
|
* Runs a `for` control statement
|
|
153
196
|
* @param create A function that creates the control statement's branches
|
|
@@ -163,4 +206,4 @@ declare function setDynamicElement(el: HTMLElement, tag: string): HTMLElement;
|
|
|
163
206
|
*/
|
|
164
207
|
type ServerComponent = ($props?: Record<string, any>, $context?: Record<string, any>, $slots?: Record<string, ServerSlotRender>) => string;
|
|
165
208
|
|
|
166
|
-
export { $mount, $run, $unwrap, $watch, Component, type ListItem, type ServerComponent, ServerSlotRender, SlotRender, hydrate, mount, addFragment as t_add_fragment, nodeAnchor as t_anchor, addAnimation as t_animate, applyProps as t_apply_props, setAttribute as t_attribute, nodeChild as t_child, setDynamicElement as t_dynamic, addEvent as t_event, getFragment as t_fragment, newListItem as t_list_item, nodeNext as t_next, popRange as t_pop_range, pushRange as t_push_range, newRange as t_range, nodeRoot as t_root, runControlBranch as t_run_branch, runControl as t_run_control, runList as t_run_list };
|
|
209
|
+
export { $mount, $run, $unwrap, $watch, Component, type ListItem, type ServerComponent, ServerSlotRender, SlotRender, clearLayoutSlot, hydrate, mount, runLayoutSlot, addFragment as t_add_fragment, nodeAnchor as t_anchor, addAnimation as t_animate, applyProps as t_apply_props, setAttribute as t_attribute, nodeChild as t_child, setDynamicElement as t_dynamic, addEvent as t_event, getFragment as t_fragment, newListItem as t_list_item, nodeNext as t_next, popRange as t_pop_range, pushRange as t_push_range, newRange as t_range, nodeRoot as t_root, runControlBranch as t_run_branch, runControl as t_run_control, runList as t_run_list, nodeSkip as t_skip };
|
package/dist/index.d.ts
CHANGED
|
@@ -43,29 +43,10 @@ declare function addAnimation(el: HTMLElement, entry?: Animation$1, exit?: Anima
|
|
|
43
43
|
|
|
44
44
|
declare function addEvent(el: Element, type: string, listener: (this: Element, ev: any) => any): void;
|
|
45
45
|
|
|
46
|
-
declare function addFragment(fragment: DocumentFragment, parent: ParentNode, before: Node | null): void;
|
|
46
|
+
declare function addFragment(fragment: DocumentFragment, parent: ParentNode, before: Node | null, endNode?: ChildNode): void;
|
|
47
47
|
|
|
48
48
|
declare function applyProps(el: Element, props: Record<string, any> | undefined, propNamesUsed: string[]): void;
|
|
49
49
|
|
|
50
|
-
declare function getFragment(document: Document, array: DocumentFragment[], index: number, html: string, ns?: boolean): DocumentFragment;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Hydrates a component into an existing DOM tree
|
|
54
|
-
* @param parent The parent node
|
|
55
|
-
* @param component The component to mount
|
|
56
|
-
* @param props An object containing component props
|
|
57
|
-
*/
|
|
58
|
-
declare function hydrate(parent: ParentNode, component: Component, props?: Record<string, any>, slots?: Record<string, SlotRender>): void;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Mounts a component into a DOM node
|
|
62
|
-
*
|
|
63
|
-
* @param parent The node to mount the component into
|
|
64
|
-
* @param component The component to mount
|
|
65
|
-
* @param props An object containing component props
|
|
66
|
-
*/
|
|
67
|
-
declare function mount(parent: ParentNode, component: Component, props?: Record<string, any>, slots?: Record<string, SlotRender>): void;
|
|
68
|
-
|
|
69
50
|
/**
|
|
70
51
|
* State data for a property in a proxy.
|
|
71
52
|
*/
|
|
@@ -110,6 +91,27 @@ type Range = {
|
|
|
110
91
|
animations: Set<Animation> | null;
|
|
111
92
|
};
|
|
112
93
|
|
|
94
|
+
declare function clearLayoutSlot(range: Range): void;
|
|
95
|
+
|
|
96
|
+
declare function getFragment(document: Document, array: DocumentFragment[], index: number, html: string, ns?: boolean): DocumentFragment;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Hydrates a component into an existing DOM tree
|
|
100
|
+
* @param parent The parent node
|
|
101
|
+
* @param component The component to mount
|
|
102
|
+
* @param props An object containing component props
|
|
103
|
+
*/
|
|
104
|
+
declare function hydrate(parent: ParentNode, component: Component, props?: Record<string, any>, slots?: Record<string, SlotRender>): void;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Mounts a component into a DOM node
|
|
108
|
+
*
|
|
109
|
+
* @param parent The node to mount the component into
|
|
110
|
+
* @param component The component to mount
|
|
111
|
+
* @param props An object containing component props
|
|
112
|
+
*/
|
|
113
|
+
declare function mount(parent: ParentNode, component: Component, props?: Record<string, any>, slots?: Record<string, SlotRender>): void;
|
|
114
|
+
|
|
113
115
|
type ListItem = Range & {
|
|
114
116
|
data: Record<string, any>;
|
|
115
117
|
key: any;
|
|
@@ -119,22 +121,61 @@ declare function newListItem(data: Record<PropertyKey, any>, key?: any): ListIte
|
|
|
119
121
|
|
|
120
122
|
declare function newRange(): Range;
|
|
121
123
|
|
|
122
|
-
|
|
124
|
+
/**
|
|
125
|
+
* Gets the anchor node for a control statement or component.
|
|
126
|
+
*
|
|
127
|
+
* When mounting, this just returns the anchor node parameter (because it was
|
|
128
|
+
* created).
|
|
129
|
+
*
|
|
130
|
+
* When hydrating, there should be matched <![> and <!]> comments in the HTML,
|
|
131
|
+
* and the anchor node should be after the end comment. The matched comment
|
|
132
|
+
* nodes will be deleted, and the hydration node set to the first node inside
|
|
133
|
+
* the matched comments.
|
|
134
|
+
*
|
|
135
|
+
* @param node The potential anchor node.
|
|
136
|
+
* @param subsequent Whether this is the second time the anchor is being retrieved.
|
|
137
|
+
* @returns The anchor node.
|
|
138
|
+
*/
|
|
139
|
+
declare function nodeAnchor(node: ChildNode, subsequent?: boolean): ChildNode;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Gets the first child of a node.
|
|
143
|
+
*
|
|
144
|
+
* Sets the hydration node.
|
|
145
|
+
*
|
|
146
|
+
* @param parent The parent node.
|
|
147
|
+
*/
|
|
148
|
+
declare function nodeChild(parent: Node): ChildNode;
|
|
123
149
|
|
|
124
150
|
/**
|
|
125
|
-
* Gets the
|
|
151
|
+
* Gets the next sibling of a node.
|
|
152
|
+
*
|
|
153
|
+
* When hydrating, sets the hydration node.
|
|
154
|
+
*
|
|
155
|
+
* @param node The node.
|
|
156
|
+
* @param text Whether we require a text node.
|
|
126
157
|
*/
|
|
127
|
-
declare function
|
|
158
|
+
declare function nodeNext(node: ChildNode, text?: boolean): ChildNode;
|
|
128
159
|
|
|
129
160
|
/**
|
|
130
|
-
* Gets the
|
|
161
|
+
* Gets the first child in a fragment.
|
|
162
|
+
*
|
|
163
|
+
* When hydrating, also sets the active range's start node, while we have it.
|
|
164
|
+
*
|
|
165
|
+
* @param parent The parent of the fragment.
|
|
166
|
+
* @param text Whether we require a text node.
|
|
131
167
|
*/
|
|
132
|
-
declare function
|
|
168
|
+
declare function nodeRoot(parent: Node, text?: boolean): ChildNode;
|
|
133
169
|
|
|
134
170
|
/**
|
|
135
|
-
* Gets the
|
|
136
|
-
*
|
|
137
|
-
|
|
171
|
+
* Gets the sibling of a node, x nodes after it.
|
|
172
|
+
*
|
|
173
|
+
* When hydrating, sets the hydration node.
|
|
174
|
+
*
|
|
175
|
+
* @param node The node.
|
|
176
|
+
* @param count The number of nodes to skip.
|
|
177
|
+
*/
|
|
178
|
+
declare function nodeSkip(node: ChildNode, count: number): ChildNode;
|
|
138
179
|
|
|
139
180
|
declare function popRange(oldRange: Range | null): void;
|
|
140
181
|
|
|
@@ -148,6 +189,8 @@ declare function runControl(range: Range, anchor: Node | null, create: (anchor:
|
|
|
148
189
|
|
|
149
190
|
declare function runControlBranch(range: Range, index: number, create: () => void): void;
|
|
150
191
|
|
|
192
|
+
declare function runLayoutSlot(component: Component, slot: SlotRender, parent: ParentNode, anchor: Node | null, $props: Record<string, string>, $context?: Record<PropertyKey, any>): Range;
|
|
193
|
+
|
|
151
194
|
/**
|
|
152
195
|
* Runs a `for` control statement
|
|
153
196
|
* @param create A function that creates the control statement's branches
|
|
@@ -163,4 +206,4 @@ declare function setDynamicElement(el: HTMLElement, tag: string): HTMLElement;
|
|
|
163
206
|
*/
|
|
164
207
|
type ServerComponent = ($props?: Record<string, any>, $context?: Record<string, any>, $slots?: Record<string, ServerSlotRender>) => string;
|
|
165
208
|
|
|
166
|
-
export { $mount, $run, $unwrap, $watch, Component, type ListItem, type ServerComponent, ServerSlotRender, SlotRender, hydrate, mount, addFragment as t_add_fragment, nodeAnchor as t_anchor, addAnimation as t_animate, applyProps as t_apply_props, setAttribute as t_attribute, nodeChild as t_child, setDynamicElement as t_dynamic, addEvent as t_event, getFragment as t_fragment, newListItem as t_list_item, nodeNext as t_next, popRange as t_pop_range, pushRange as t_push_range, newRange as t_range, nodeRoot as t_root, runControlBranch as t_run_branch, runControl as t_run_control, runList as t_run_list };
|
|
209
|
+
export { $mount, $run, $unwrap, $watch, Component, type ListItem, type ServerComponent, ServerSlotRender, SlotRender, clearLayoutSlot, hydrate, mount, runLayoutSlot, addFragment as t_add_fragment, nodeAnchor as t_anchor, addAnimation as t_animate, applyProps as t_apply_props, setAttribute as t_attribute, nodeChild as t_child, setDynamicElement as t_dynamic, addEvent as t_event, getFragment as t_fragment, newListItem as t_list_item, nodeNext as t_next, popRange as t_pop_range, pushRange as t_push_range, newRange as t_range, nodeRoot as t_root, runControlBranch as t_run_branch, runControl as t_run_control, runList as t_run_list, nodeSkip as t_skip };
|