@warp-drive-mirror/core 5.10.0-alpha.2 → 5.10.0-alpha.21
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/README.md +116 -6
- package/dist/{-private-ffnwf62T.js → -private-BiuED7nc.js} +5 -4
- package/dist/{-private-ffnwf62T.js.map → -private-BiuED7nc.js.map} +1 -1
- package/dist/{-private-CArItnX4.js → -private-CvZfrDZl.js} +566 -179
- package/dist/-private-CvZfrDZl.js.map +1 -0
- package/dist/{aliases-BWYW5EhX.d.ts → aliases-BG5TxALl.d.ts} +4 -3
- package/dist/aliases-BG5TxALl.d.ts.map +1 -0
- package/dist/{change-C7kqv2kW.d.ts → change-INHMiZ2a.d.ts} +4 -4
- package/dist/change-INHMiZ2a.d.ts.map +1 -0
- package/dist/{concepts-DFldVwEM.d.ts → concepts-vh86nAcd.d.ts} +14 -7
- package/dist/concepts-vh86nAcd.d.ts.map +1 -0
- package/dist/{configure-B_F639tN.d.ts → configure-BfXDuPUb.d.ts} +57 -10
- package/dist/configure-BfXDuPUb.d.ts.map +1 -0
- package/dist/configure.d.ts +2 -2
- package/dist/configure.js +2 -2
- package/dist/{document-Ca4ZZBd9.d.ts → document-B8Fup751.d.ts} +22 -6
- package/dist/document-B8Fup751.d.ts.map +1 -0
- package/dist/{error-0uD6GkNX.d.ts → error-j5n1yL9m.d.ts} +4 -4
- package/dist/error-j5n1yL9m.d.ts.map +1 -0
- package/dist/{fields-FM7peCiM.d.ts → fields-r1rZJB9d.d.ts} +134 -9
- package/dist/fields-r1rZJB9d.d.ts.map +1 -0
- package/dist/graph/-private.d.ts +1 -1
- package/dist/graph/-private.js +25 -40
- package/dist/graph/-private.js.map +1 -1
- package/dist/{graph-DLqYXP2z.d.ts → graph-BqxaFjEb.d.ts} +25 -7
- package/dist/graph-BqxaFjEb.d.ts.map +1 -0
- package/dist/{identifier-DQnqOSJK.d.ts → identifier-DmgDehQK.d.ts} +29 -6
- package/dist/identifier-DmgDehQK.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{internal-BrqYbG_y.d.ts → internal-D_WIXC4r.d.ts} +1524 -1121
- package/dist/internal-D_WIXC4r.d.ts.map +1 -0
- package/dist/{json-api-raw-C5APJHHB.d.ts → json-api-raw-juUdIITO.d.ts} +44 -4
- package/dist/json-api-raw-juUdIITO.d.ts.map +1 -0
- package/dist/{mutations-CqtoGB4t.d.ts → mutations-CA39mior.d.ts} +18 -4
- package/dist/mutations-CA39mior.d.ts.map +1 -0
- package/dist/{operations-D1qA6r0_.d.ts → operations-C1WAEKKq.d.ts} +39 -7
- package/dist/operations-C1WAEKKq.d.ts.map +1 -0
- package/dist/{params-DrEx3bf8.d.ts → params-CNLjCRyH.d.ts} +11 -3
- package/dist/params-CNLjCRyH.d.ts.map +1 -0
- package/dist/{raw-D5hnjiq7.d.ts → raw-adYGuEGM.d.ts} +10 -3
- package/dist/raw-adYGuEGM.d.ts.map +1 -0
- package/dist/reactive/-private.d.ts +1 -1
- package/dist/reactive/-private.js +1 -1
- package/dist/reactive.d.ts +2 -2
- package/dist/reactive.js +3 -3
- package/dist/{record-D3QQcaIR.d.ts → record-f5-uOgHt.d.ts} +22 -4
- package/dist/record-f5-uOgHt.d.ts.map +1 -0
- package/dist/{relationship-CmHzMPKf.d.ts → relationship-99pc4CaS.d.ts} +10 -5
- package/dist/relationship-99pc4CaS.d.ts.map +1 -0
- package/dist/{request-o_qGAoFV.js → request-CxtnNIIp.js} +52 -23
- package/dist/request-CxtnNIIp.js.map +1 -0
- package/dist/request.d.ts +1 -1
- package/dist/request.js +1 -1
- package/dist/signals/-leaked.d.ts +86 -18
- package/dist/signals/-leaked.d.ts.map +1 -1
- package/dist/signals/-leaked.js +1 -1
- package/dist/{src-C-xK8l3f.js → src-ccp1WKyt.js} +350 -456
- package/dist/src-ccp1WKyt.js.map +1 -0
- package/dist/store/-private.d.ts +2 -2
- package/dist/store/-private.js +2 -2
- package/dist/{store-DNF9Rgoh.js → store-C8iKKtQK.js} +17 -3
- package/dist/store-C8iKKtQK.js.map +1 -0
- package/dist/store.d.ts +1 -1
- package/dist/store.js +1 -1
- package/dist/{symbols-DjRDCeX0.d.ts → symbols-DVa1PMFG.d.ts} +10 -3
- package/dist/symbols-DVa1PMFG.d.ts.map +1 -0
- package/dist/types/-private.d.ts +1 -2
- package/dist/types/-private.d.ts.map +1 -1
- package/dist/types/-private.js +115 -2
- package/dist/types/-private.js.map +1 -0
- package/dist/types/cache/aliases.d.ts +1 -1
- package/dist/types/cache/change.d.ts +1 -1
- package/dist/types/cache/mutations.d.ts +1 -1
- package/dist/types/cache/operations.d.ts +1 -1
- package/dist/types/cache/relationship.d.ts +1 -1
- package/dist/types/cache.d.ts +1 -1
- package/dist/types/graph.d.ts +1 -1
- package/dist/types/identifier.d.ts +1 -1
- package/dist/types/identifier.js +34 -5
- package/dist/types/identifier.js.map +1 -1
- package/dist/types/json/raw.d.ts +1 -1
- package/dist/types/params.d.ts +1 -1
- package/dist/types/record.d.ts +1 -1
- package/dist/types/record.js +26 -2
- package/dist/types/record.js.map +1 -1
- package/dist/types/request.d.ts +1 -1
- package/dist/types/request.js +82 -3
- package/dist/types/request.js.map +1 -1
- package/dist/types/runtime.d.ts +10 -7
- package/dist/types/runtime.d.ts.map +1 -1
- package/dist/types/runtime.js +9 -6
- package/dist/types/runtime.js.map +1 -1
- package/dist/types/schema/concepts.d.ts +1 -1
- package/dist/types/schema/fields.d.ts +1 -1
- package/dist/types/schema/fields.js +133 -5
- package/dist/types/schema/fields.js.map +1 -1
- package/dist/types/schema/schema-service.d.ts +1 -1
- package/dist/types/spec/document.d.ts +1 -1
- package/dist/types/spec/error.d.ts +1 -1
- package/dist/types/spec/json-api-raw.d.ts +1 -1
- package/dist/types/symbols.d.ts +1 -1
- package/dist/types/symbols.js +16 -3
- package/dist/types/symbols.js.map +1 -1
- package/dist/types/utils.d.ts +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/unpkg/{dev-deprecated/-private-CM5N2rtZ.js → dev/-private-B4pCmkq-.js} +566 -179
- package/dist/unpkg/dev/-private-B4pCmkq-.js.map +1 -0
- package/dist/unpkg/{prod-deprecated/-private-207KndDu.js → dev/-private-BiuED7nc.js} +5 -4
- package/dist/unpkg/{dev-deprecated/-private-BO-nArRb.js.map → dev/-private-BiuED7nc.js.map} +1 -1
- package/dist/unpkg/dev/configure.js +2 -2
- package/dist/unpkg/dev/graph/-private.js +26 -41
- package/dist/unpkg/dev/graph/-private.js.map +1 -1
- package/dist/unpkg/dev/index.js +1 -1
- package/dist/unpkg/dev/reactive/-private.js +1 -1
- package/dist/unpkg/dev/reactive.js +3 -3
- package/dist/unpkg/{dev-deprecated/request-DXPAtRhE.js → dev/request-oWpijCPQ.js} +52 -23
- package/dist/unpkg/dev/request-oWpijCPQ.js.map +1 -0
- package/dist/unpkg/dev/request.js +1 -1
- package/dist/unpkg/dev/{runtime-DW881fpw.js → runtime-RYvEtg99.js} +2 -3
- package/dist/unpkg/dev/{runtime-DW881fpw.js.map → runtime-RYvEtg99.js.map} +1 -1
- package/dist/unpkg/dev/signals/-leaked.js +1 -1
- package/dist/unpkg/dev/{src-kn6qfEPI.js → src-C4ET4R1n.js} +339 -444
- package/dist/unpkg/dev/src-C4ET4R1n.js.map +1 -0
- package/dist/unpkg/dev/store/-private.js +2 -2
- package/dist/unpkg/{dev-deprecated/store-D-z_1Jxe.js → dev/store-dZViNfMK.js} +18 -4
- package/dist/unpkg/dev/store-dZViNfMK.js.map +1 -0
- package/dist/unpkg/dev/store.js +1 -1
- package/dist/unpkg/dev/types/-private.js +106 -2
- package/dist/unpkg/dev/types/-private.js.map +1 -0
- package/dist/unpkg/dev/types/identifier.js +34 -5
- package/dist/unpkg/dev/types/identifier.js.map +1 -1
- package/dist/unpkg/dev/types/record.js +26 -2
- package/dist/unpkg/dev/types/record.js.map +1 -1
- package/dist/unpkg/dev/types/request.js +82 -3
- package/dist/unpkg/dev/types/request.js.map +1 -1
- package/dist/unpkg/dev/types/runtime.js +9 -6
- package/dist/unpkg/dev/types/runtime.js.map +1 -1
- package/dist/unpkg/dev/types/schema/fields.js +133 -5
- package/dist/unpkg/dev/types/schema/fields.js.map +1 -1
- package/dist/unpkg/dev/types/symbols.js +16 -3
- package/dist/unpkg/dev/types/symbols.js.map +1 -1
- package/dist/unpkg/dev/utils/string.js +1 -2
- package/dist/unpkg/{dev/-private-CM5N2rtZ.js → dev-deprecated/-private-B4pCmkq-.js} +566 -179
- package/dist/unpkg/dev-deprecated/-private-B4pCmkq-.js.map +1 -0
- package/dist/unpkg/dev-deprecated/{-private-BO-nArRb.js → -private-BiuED7nc.js} +5 -4
- package/dist/unpkg/{prod/-private-207KndDu.js.map → dev-deprecated/-private-BiuED7nc.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/configure.js +2 -2
- package/dist/unpkg/dev-deprecated/graph/-private.js +26 -41
- package/dist/unpkg/dev-deprecated/graph/-private.js.map +1 -1
- package/dist/unpkg/dev-deprecated/index.js +1 -1
- package/dist/unpkg/dev-deprecated/reactive/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/reactive.js +3 -3
- package/dist/unpkg/{dev/request-DXPAtRhE.js → dev-deprecated/request-oWpijCPQ.js} +52 -23
- package/dist/unpkg/dev-deprecated/request-oWpijCPQ.js.map +1 -0
- package/dist/unpkg/dev-deprecated/request.js +1 -1
- package/dist/unpkg/dev-deprecated/{runtime-BIra6K31.js → runtime-DZVuMuzL.js} +2 -3
- package/dist/unpkg/dev-deprecated/{runtime-BIra6K31.js.map → runtime-DZVuMuzL.js.map} +1 -1
- package/dist/unpkg/dev-deprecated/signals/-leaked.js +1 -1
- package/dist/unpkg/dev-deprecated/{src-DXwW-R57.js → src-jHpowq3S.js} +344 -450
- package/dist/unpkg/dev-deprecated/src-jHpowq3S.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store/-private.js +2 -2
- package/dist/unpkg/{dev/store-C0p6sclI.js → dev-deprecated/store-I7YB0_rC.js} +18 -4
- package/dist/unpkg/dev-deprecated/store-I7YB0_rC.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store.js +1 -1
- package/dist/unpkg/dev-deprecated/types/-private.js +106 -2
- package/dist/unpkg/dev-deprecated/types/-private.js.map +1 -0
- package/dist/unpkg/dev-deprecated/types/identifier.js +34 -5
- package/dist/unpkg/dev-deprecated/types/identifier.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/record.js +26 -2
- package/dist/unpkg/dev-deprecated/types/record.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/request.js +82 -3
- package/dist/unpkg/dev-deprecated/types/request.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/runtime.js +9 -6
- package/dist/unpkg/dev-deprecated/types/runtime.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/schema/fields.js +133 -5
- package/dist/unpkg/dev-deprecated/types/schema/fields.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/symbols.js +16 -3
- package/dist/unpkg/dev-deprecated/types/symbols.js.map +1 -1
- package/dist/unpkg/dev-deprecated/utils/string.js +1 -2
- package/dist/unpkg/prod/-private-BiuED7nc.js +23 -0
- package/dist/unpkg/{prod-deprecated/-private-207KndDu.js.map → prod/-private-BiuED7nc.js.map} +1 -1
- package/dist/unpkg/{prod-deprecated/-private-CdDed4yB.js → prod/-private-CrUi_3E_.js} +539 -173
- package/dist/unpkg/prod/-private-CrUi_3E_.js.map +1 -0
- package/dist/unpkg/prod/configure.js +2 -2
- package/dist/unpkg/prod/graph/-private.js +24 -35
- package/dist/unpkg/prod/graph/-private.js.map +1 -1
- package/dist/unpkg/prod/index.js +1 -1
- package/dist/unpkg/prod/reactive/-private.js +1 -1
- package/dist/unpkg/prod/reactive.js +3 -3
- package/dist/unpkg/prod/{request-C7WZg-zk.js → request-Cgw3j6Dx.js} +51 -21
- package/dist/unpkg/prod/request-Cgw3j6Dx.js.map +1 -0
- package/dist/unpkg/prod/request.js +1 -1
- package/dist/unpkg/prod/signals/-leaked.js +1 -1
- package/dist/unpkg/prod/{src-B-GfFQcx.js → src-DFmPDGQ6.js} +311 -414
- package/dist/unpkg/prod/src-DFmPDGQ6.js.map +1 -0
- package/dist/unpkg/prod/store/-private.js +2 -2
- package/dist/unpkg/prod/{store-BWhmb7Ob.js → store-Bz9R5hGB.js} +17 -3
- package/dist/unpkg/prod/store-Bz9R5hGB.js.map +1 -0
- package/dist/unpkg/prod/store.js +1 -1
- package/dist/unpkg/prod/types/-private.js +94 -2
- package/dist/unpkg/prod/types/-private.js.map +1 -0
- package/dist/unpkg/prod/types/identifier.js +34 -5
- package/dist/unpkg/prod/types/identifier.js.map +1 -1
- package/dist/unpkg/prod/types/record.js +26 -2
- package/dist/unpkg/prod/types/record.js.map +1 -1
- package/dist/unpkg/prod/types/request.js +82 -3
- package/dist/unpkg/prod/types/request.js.map +1 -1
- package/dist/unpkg/prod/types/runtime.js +9 -6
- package/dist/unpkg/prod/types/runtime.js.map +1 -1
- package/dist/unpkg/prod/types/schema/fields.js +133 -5
- package/dist/unpkg/prod/types/schema/fields.js.map +1 -1
- package/dist/unpkg/prod/types/symbols.js +16 -3
- package/dist/unpkg/prod/types/symbols.js.map +1 -1
- package/dist/unpkg/prod/utils/string.js +1 -2
- package/dist/unpkg/{dev/-private-BO-nArRb.js → prod-deprecated/-private-BiuED7nc.js} +5 -4
- package/dist/unpkg/{dev/-private-BO-nArRb.js.map → prod-deprecated/-private-BiuED7nc.js.map} +1 -1
- package/dist/unpkg/{prod/-private-CdDed4yB.js → prod-deprecated/-private-CrUi_3E_.js} +539 -173
- package/dist/unpkg/prod-deprecated/-private-CrUi_3E_.js.map +1 -0
- package/dist/unpkg/prod-deprecated/configure.js +2 -2
- package/dist/unpkg/prod-deprecated/graph/-private.js +24 -35
- package/dist/unpkg/prod-deprecated/graph/-private.js.map +1 -1
- package/dist/unpkg/prod-deprecated/index.js +1 -1
- package/dist/unpkg/prod-deprecated/reactive/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/reactive.js +3 -3
- package/dist/unpkg/prod-deprecated/{request-C7WZg-zk.js → request-Cgw3j6Dx.js} +51 -21
- package/dist/unpkg/prod-deprecated/request-Cgw3j6Dx.js.map +1 -0
- package/dist/unpkg/prod-deprecated/request.js +1 -1
- package/dist/unpkg/prod-deprecated/signals/-leaked.js +1 -1
- package/dist/unpkg/prod-deprecated/{src-Bp8ZJctZ.js → src-BgQLcshl.js} +316 -420
- package/dist/unpkg/prod-deprecated/src-BgQLcshl.js.map +1 -0
- package/dist/unpkg/prod-deprecated/store/-private.js +2 -2
- package/dist/unpkg/prod-deprecated/{store-BWhmb7Ob.js → store-Bz9R5hGB.js} +17 -3
- package/dist/unpkg/prod-deprecated/store-Bz9R5hGB.js.map +1 -0
- package/dist/unpkg/prod-deprecated/store.js +1 -1
- package/dist/unpkg/prod-deprecated/types/-private.js +94 -2
- package/dist/unpkg/prod-deprecated/types/-private.js.map +1 -0
- package/dist/unpkg/prod-deprecated/types/identifier.js +34 -5
- package/dist/unpkg/prod-deprecated/types/identifier.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/record.js +26 -2
- package/dist/unpkg/prod-deprecated/types/record.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/request.js +82 -3
- package/dist/unpkg/prod-deprecated/types/request.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/runtime.js +9 -6
- package/dist/unpkg/prod-deprecated/types/runtime.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/schema/fields.js +133 -5
- package/dist/unpkg/prod-deprecated/types/schema/fields.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/symbols.js +16 -3
- package/dist/unpkg/prod-deprecated/types/symbols.js.map +1 -1
- package/dist/unpkg/prod-deprecated/utils/string.js +1 -2
- package/dist/utils/string.d.ts +0 -2
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +1 -2
- package/dist/{utils-BtURiy8l.d.ts → utils-BVKvrO6e.d.ts} +8 -3
- package/dist/utils-BVKvrO6e.d.ts.map +1 -0
- package/logos/README.md +1 -1
- package/package.json +9 -9
- package/dist/-private-CArItnX4.js.map +0 -1
- package/dist/-private-CWh7qdp_.js +0 -120
- package/dist/-private-CWh7qdp_.js.map +0 -1
- package/dist/aliases-BWYW5EhX.d.ts.map +0 -1
- package/dist/change-C7kqv2kW.d.ts.map +0 -1
- package/dist/concepts-DFldVwEM.d.ts.map +0 -1
- package/dist/configure-B_F639tN.d.ts.map +0 -1
- package/dist/document-Ca4ZZBd9.d.ts.map +0 -1
- package/dist/error-0uD6GkNX.d.ts.map +0 -1
- package/dist/fields-FM7peCiM.d.ts.map +0 -1
- package/dist/graph-DLqYXP2z.d.ts.map +0 -1
- package/dist/identifier-DQnqOSJK.d.ts.map +0 -1
- package/dist/internal-BrqYbG_y.d.ts.map +0 -1
- package/dist/json-api-raw-C5APJHHB.d.ts.map +0 -1
- package/dist/mutations-CqtoGB4t.d.ts.map +0 -1
- package/dist/operations-D1qA6r0_.d.ts.map +0 -1
- package/dist/params-DrEx3bf8.d.ts.map +0 -1
- package/dist/raw-D5hnjiq7.d.ts.map +0 -1
- package/dist/record-D3QQcaIR.d.ts.map +0 -1
- package/dist/relationship-CmHzMPKf.d.ts.map +0 -1
- package/dist/request-o_qGAoFV.js.map +0 -1
- package/dist/src-C-xK8l3f.js.map +0 -1
- package/dist/store-DNF9Rgoh.js.map +0 -1
- package/dist/symbols-DjRDCeX0.d.ts.map +0 -1
- package/dist/types/schema/fields.type-test.d.ts +0 -1
- package/dist/types/schema/fields.type-test.js +0 -79
- package/dist/types/schema/fields.type-test.js.map +0 -1
- package/dist/unpkg/dev/-private-BP52H-vC.js +0 -111
- package/dist/unpkg/dev/-private-BP52H-vC.js.map +0 -1
- package/dist/unpkg/dev/-private-CM5N2rtZ.js.map +0 -1
- package/dist/unpkg/dev/request-DXPAtRhE.js.map +0 -1
- package/dist/unpkg/dev/src-kn6qfEPI.js.map +0 -1
- package/dist/unpkg/dev/store-C0p6sclI.js.map +0 -1
- package/dist/unpkg/dev/types/schema/fields.type-test.js +0 -79
- package/dist/unpkg/dev/types/schema/fields.type-test.js.map +0 -1
- package/dist/unpkg/dev-deprecated/-private-BP52H-vC.js +0 -111
- package/dist/unpkg/dev-deprecated/-private-BP52H-vC.js.map +0 -1
- package/dist/unpkg/dev-deprecated/-private-CM5N2rtZ.js.map +0 -1
- package/dist/unpkg/dev-deprecated/request-DXPAtRhE.js.map +0 -1
- package/dist/unpkg/dev-deprecated/src-DXwW-R57.js.map +0 -1
- package/dist/unpkg/dev-deprecated/store-D-z_1Jxe.js.map +0 -1
- package/dist/unpkg/dev-deprecated/types/schema/fields.type-test.js +0 -79
- package/dist/unpkg/dev-deprecated/types/schema/fields.type-test.js.map +0 -1
- package/dist/unpkg/prod/-private-207KndDu.js +0 -22
- package/dist/unpkg/prod/-private-CdDed4yB.js.map +0 -1
- package/dist/unpkg/prod/-private-JmhZBKGb.js +0 -99
- package/dist/unpkg/prod/-private-JmhZBKGb.js.map +0 -1
- package/dist/unpkg/prod/request-C7WZg-zk.js.map +0 -1
- package/dist/unpkg/prod/src-B-GfFQcx.js.map +0 -1
- package/dist/unpkg/prod/store-BWhmb7Ob.js.map +0 -1
- package/dist/unpkg/prod/types/schema/fields.type-test.js +0 -79
- package/dist/unpkg/prod/types/schema/fields.type-test.js.map +0 -1
- package/dist/unpkg/prod-deprecated/-private-CdDed4yB.js.map +0 -1
- package/dist/unpkg/prod-deprecated/-private-JmhZBKGb.js +0 -99
- package/dist/unpkg/prod-deprecated/-private-JmhZBKGb.js.map +0 -1
- package/dist/unpkg/prod-deprecated/request-C7WZg-zk.js.map +0 -1
- package/dist/unpkg/prod-deprecated/src-Bp8ZJctZ.js.map +0 -1
- package/dist/unpkg/prod-deprecated/store-BWhmb7Ob.js.map +0 -1
- package/dist/unpkg/prod-deprecated/types/schema/fields.type-test.js +0 -79
- package/dist/unpkg/prod-deprecated/types/schema/fields.type-test.js.map +0 -1
- package/dist/utils-BtURiy8l.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as setPromiseResult, o as DOMError, u as getPromiseResult } from "./request-
|
|
1
|
+
import { getOrSetGlobal, peekTransient, setTransient } from "./types/-private.js";
|
|
2
|
+
import { f as setPromiseResult, o as DOMError, u as getPromiseResult } from "./request-oWpijCPQ.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/signals/reactivity/configure.ts
|
|
5
5
|
const ARRAY_SIGNAL = getOrSetGlobal("#[]", Symbol("#[]"));
|
|
6
6
|
const OBJECT_SIGNAL = getOrSetGlobal("#{}", Symbol("#{}"));
|
|
7
7
|
/**
|
|
@@ -15,10 +15,12 @@ const OBJECT_SIGNAL = getOrSetGlobal("#{}", Symbol("#{}"));
|
|
|
15
15
|
* The hooks which MUST be configured in order to use reactive arrays,
|
|
16
16
|
* resources and documents with framework specfic signals or TC39 signals.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* To support multiple frameworks on the same page, import
|
|
19
|
+
* `@warp-drive-mirror/alien-signals/install` before each framework's `install` entry
|
|
20
|
+
* point. Its hooks implement {@link SignalHooks.register}, so each framework's
|
|
21
|
+
* hooks, passed to {@link registerSignals}, are added to its signals graph
|
|
22
|
+
* instead of replacing it, and its memos stay up to date for every framework.
|
|
23
|
+
* See [Using Ember and React on the Same Page](/guides/the-manual/cookbook/multiple-frameworks-on-one-page.md).
|
|
22
24
|
*
|
|
23
25
|
* Unlike many signals implementations, WarpDrive does not wrap values as
|
|
24
26
|
* signals directly, but instead uses signals to alert the reactive layer
|
|
@@ -33,6 +35,8 @@ const OBJECT_SIGNAL = getOrSetGlobal("#{}", Symbol("#{}"));
|
|
|
33
35
|
* scenarios you may also be interested in integrating with the {@link NotificationManager}
|
|
34
36
|
* more directly.
|
|
35
37
|
*
|
|
38
|
+
* @summary The create, consume, notify, and memo hooks a framework or TC39 signals implementation
|
|
39
|
+
* supplies to `setupSignals` to make WarpDrive data reactive.
|
|
36
40
|
* @public
|
|
37
41
|
*/
|
|
38
42
|
/**
|
|
@@ -48,11 +52,14 @@ const OBJECT_SIGNAL = getOrSetGlobal("#{}", Symbol("#{}"));
|
|
|
48
52
|
* }
|
|
49
53
|
* ```
|
|
50
54
|
*
|
|
55
|
+
* @summary The options passed to the `setupSignals` callback, including the well-known key WarpDrive
|
|
56
|
+
* uses for an array's contents signal.
|
|
51
57
|
* @public
|
|
52
58
|
*/
|
|
53
59
|
/**
|
|
54
|
-
* Configures the signals implementation to use
|
|
55
|
-
*
|
|
60
|
+
* Configures the signals implementation to use, replacing any configured
|
|
61
|
+
* before. To add a framework's hooks alongside those of other frameworks, use
|
|
62
|
+
* {@link registerSignals} instead.
|
|
56
63
|
*
|
|
57
64
|
* See {@link HooksOptions} for the options passed to the provided function
|
|
58
65
|
* when called.
|
|
@@ -60,6 +67,8 @@ const OBJECT_SIGNAL = getOrSetGlobal("#{}", Symbol("#{}"));
|
|
|
60
67
|
* See {@link SignalHooks} for the implementation the callback function should
|
|
61
68
|
* return.
|
|
62
69
|
*
|
|
70
|
+
* @summary Registers the signal hooks WarpDrive uses for reactivity, built by a callback that receives
|
|
71
|
+
* `HooksOptions`.
|
|
63
72
|
* @public
|
|
64
73
|
* @param buildConfig - a function that takes options and returns a configuration object
|
|
65
74
|
*/
|
|
@@ -68,6 +77,33 @@ function setupSignals(buildConfig) {
|
|
|
68
77
|
setTransient("signalHooks", hooks);
|
|
69
78
|
}
|
|
70
79
|
/**
|
|
80
|
+
* Adds the hooks built by `buildConfig` to the configured signals implementation if it composes
|
|
81
|
+
* other implementations, such as `@warp-drive-mirror/alien-signals`, and otherwise configures them with
|
|
82
|
+
* {@link setupSignals}.
|
|
83
|
+
*
|
|
84
|
+
* A framework's `install` entry point calls this rather than `setupSignals`, so that importing
|
|
85
|
+
* `@warp-drive-mirror/alien-signals/install` first lets every framework on the page share its signals
|
|
86
|
+
* and memos.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* import { registerSignals } from '@warp-drive-mirror/core/configure';
|
|
91
|
+
*
|
|
92
|
+
* registerSignals(buildSignalConfig);
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @summary Registers signal hooks with the configured composing implementation, or configures
|
|
96
|
+
* them with `setupSignals` when there is none.
|
|
97
|
+
* @since 5.10.0
|
|
98
|
+
* @public
|
|
99
|
+
* @param buildConfig - a function that takes options and returns a configuration object
|
|
100
|
+
*/
|
|
101
|
+
function registerSignals(buildConfig) {
|
|
102
|
+
const signalHooks = peekTransient("signalHooks");
|
|
103
|
+
if (signalHooks?.register) signalHooks.register(buildConfig);
|
|
104
|
+
else setupSignals(buildConfig);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
71
107
|
* Internal method for consuming the configured `createSignal` hook
|
|
72
108
|
*
|
|
73
109
|
* @private
|
|
@@ -128,8 +164,7 @@ function waitFor(promise) {
|
|
|
128
164
|
return promise;
|
|
129
165
|
}
|
|
130
166
|
|
|
131
|
-
|
|
132
|
-
//#region src/signals/reactivity/internal.ts
|
|
167
|
+
// src/signals/reactivity/internal.ts
|
|
133
168
|
const INITIALIZER_PROTO = { isInitializer: true };
|
|
134
169
|
/**
|
|
135
170
|
* Wraps `fn` so that a signal can recognize it as a lazy initializer
|
|
@@ -395,8 +430,7 @@ function printMemo(memo, key, lines = [], depth = 0) {
|
|
|
395
430
|
return lines;
|
|
396
431
|
}
|
|
397
432
|
|
|
398
|
-
|
|
399
|
-
//#region src/signals/reactivity/signal.ts
|
|
433
|
+
// src/signals/reactivity/signal.ts
|
|
400
434
|
/**
|
|
401
435
|
* Creates a signal for the key/object pairing and subscribes to the signal.
|
|
402
436
|
*
|
|
@@ -552,8 +586,7 @@ function defineGate(obj, key, desc) {
|
|
|
552
586
|
Object.defineProperty(obj, key, options);
|
|
553
587
|
}
|
|
554
588
|
|
|
555
|
-
|
|
556
|
-
//#region src/signals/request-state.ts
|
|
589
|
+
// src/signals/request-state.ts
|
|
557
590
|
const RequestCache = /* @__PURE__ */ new WeakMap();
|
|
558
591
|
function isAbortError(error) {
|
|
559
592
|
return error instanceof DOMError && error.name === "AbortError";
|
|
@@ -609,6 +642,8 @@ async function watchStream(stream, loadingState) {
|
|
|
609
642
|
* reactive properties that can be used to build UIs that respond
|
|
610
643
|
* to the progress of a request.
|
|
611
644
|
*
|
|
645
|
+
* @summary Reactive download progress for a request, such as bytes loaded and timing, built by lazily
|
|
646
|
+
* reading its response stream.
|
|
612
647
|
* @hideconstructor
|
|
613
648
|
*/
|
|
614
649
|
var RequestLoadingState = class {
|
|
@@ -827,9 +862,11 @@ defineNonEnumerableSignal(RequestLoadingState.prototype, "_lastPacketTime", 0);
|
|
|
827
862
|
*
|
|
828
863
|
*/
|
|
829
864
|
/**
|
|
830
|
-
* The state of a request
|
|
831
|
-
*
|
|
832
|
-
* cancelled
|
|
865
|
+
* The state of a request that was aborted before it settled.
|
|
866
|
+
*
|
|
867
|
+
* A cancelled request has `status: 'cancelled'` and its `reason` is an
|
|
868
|
+
* `AbortError`. `isError` is also `true`, as for a {@link RejectedRequest},
|
|
869
|
+
* so check `status` or `isCancelled` to tell the two apart.
|
|
833
870
|
*
|
|
834
871
|
*/
|
|
835
872
|
/**
|
|
@@ -863,6 +900,8 @@ defineNonEnumerableSignal(RequestLoadingState.prototype, "_lastPacketTime", 0);
|
|
|
863
900
|
* - {@link RejectedRequest}
|
|
864
901
|
* - {@link CancelledRequest}
|
|
865
902
|
*
|
|
903
|
+
* @summary The reactive pending, fulfilled, rejected, or cancelled state of a request `Future`, as
|
|
904
|
+
* returned by `getRequestState`.
|
|
866
905
|
*/
|
|
867
906
|
const RequestStateProto = {};
|
|
868
907
|
function performRefresh(requester, request, isReload) {
|
|
@@ -917,7 +956,7 @@ function createRequestState(future) {
|
|
|
917
956
|
if (state.isError) {
|
|
918
957
|
promiseState.error = state.result;
|
|
919
958
|
promiseState.reason = state.result;
|
|
920
|
-
promiseState.status = "rejected";
|
|
959
|
+
promiseState.status = isAbortError(state.result) ? "cancelled" : "rejected";
|
|
921
960
|
promiseState.isError = true;
|
|
922
961
|
promiseState.isPending = false;
|
|
923
962
|
promiseState.isLoading = false;
|
|
@@ -953,7 +992,7 @@ function createRequestState(future) {
|
|
|
953
992
|
});
|
|
954
993
|
promiseState.error = error;
|
|
955
994
|
promiseState.reason = error;
|
|
956
|
-
promiseState.status = "rejected";
|
|
995
|
+
promiseState.status = isAbortError(error) ? "cancelled" : "rejected";
|
|
957
996
|
promiseState.isError = true;
|
|
958
997
|
promiseState.isPending = false;
|
|
959
998
|
promiseState.isLoading = false;
|
|
@@ -965,6 +1004,26 @@ function createRequestState(future) {
|
|
|
965
1004
|
/**
|
|
966
1005
|
* `getRequestState` can be used in both JavaScript and Template contexts.
|
|
967
1006
|
*
|
|
1007
|
+
* It returns a {@link RequestState}: a reactive object that updates as the
|
|
1008
|
+
* request advances. Calling it again with the same {@link Future} returns the
|
|
1009
|
+
* same object. Check `status` to narrow it to one of four states:
|
|
1010
|
+
*
|
|
1011
|
+
* - {@link PendingRequest} (`'pending'`) is the initial state, before the
|
|
1012
|
+
* request settles.
|
|
1013
|
+
* - {@link ResolvedRequest} (`'fulfilled'`) holds the response content on `value`.
|
|
1014
|
+
* - {@link RejectedRequest} (`'rejected'`) holds the error on `reason`.
|
|
1015
|
+
* - {@link CancelledRequest} (`'cancelled'`) is a request that was aborted.
|
|
1016
|
+
* `isError` is also `true` for a cancelled request, so check `status` or
|
|
1017
|
+
* `isCancelled` rather than `isError` if you handle it differently.
|
|
1018
|
+
*
|
|
1019
|
+
* Every state also exposes a {@link RequestLoadingState} on `loadingState`
|
|
1020
|
+
* for tracking the progress of the response stream.
|
|
1021
|
+
*
|
|
1022
|
+
* The [Reactive Control Flow](/guides/the-manual/reactivity/control-flow) guide shows
|
|
1023
|
+
* how to render request states with it, and
|
|
1024
|
+
* [Using The Response](/guides/the-manual/requests/using-the-response) covers the
|
|
1025
|
+
* `Future` it reads.
|
|
1026
|
+
*
|
|
968
1027
|
* ```ts
|
|
969
1028
|
* import { getRequestState } from '@warp-drive-mirror/ember';
|
|
970
1029
|
*
|
|
@@ -1011,6 +1070,10 @@ function createRequestState(future) {
|
|
|
1011
1070
|
* which offers a number of additional capabilities for requests *beyond* what
|
|
1012
1071
|
* `RequestState` provides.
|
|
1013
1072
|
*
|
|
1073
|
+
* @param future - the request {@link Future} to track, as returned by `store.request` or `requestManager.request`
|
|
1074
|
+
* @return the cached {@link RequestState} for `future`
|
|
1075
|
+
* @summary Returns a cached, reactive state object tracking a request `Future` through pending, success,
|
|
1076
|
+
* error, and cancellation.
|
|
1014
1077
|
*/
|
|
1015
1078
|
function getRequestState(future) {
|
|
1016
1079
|
let state = RequestCache.get(future);
|
|
@@ -1021,8 +1084,7 @@ function getRequestState(future) {
|
|
|
1021
1084
|
return state;
|
|
1022
1085
|
}
|
|
1023
1086
|
|
|
1024
|
-
|
|
1025
|
-
//#region ../../node_modules/.pnpm/decorat_5d4eca388601a94e7fbc656401b751d1/node_modules/decorator-transforms/dist/runtime--fcdnjmJ.js
|
|
1087
|
+
// ../../node_modules/.pnpm/decorat_5d4eca388601a94e7fbc656401b751d1/node_modules/decorator-transforms/dist/runtime--fcdnjmJ.js
|
|
1026
1088
|
const deferred = /* @__PURE__ */ new WeakMap();
|
|
1027
1089
|
function deferDecorator(proto, prop, desc) {
|
|
1028
1090
|
let map = deferred.get(proto);
|
|
@@ -1072,8 +1134,7 @@ function initializeDeferredDecorator(target, prop) {
|
|
|
1072
1134
|
});
|
|
1073
1135
|
}
|
|
1074
1136
|
|
|
1075
|
-
|
|
1076
|
-
//#region src/signals/request-subscription.ts
|
|
1137
|
+
// src/signals/request-subscription.ts
|
|
1077
1138
|
const DEFAULT_DEADLINE = 3e4;
|
|
1078
1139
|
/**
|
|
1079
1140
|
* A symbol used to dispose of a {@link RequestSubscription} when the
|
|
@@ -1086,28 +1147,47 @@ function isNeverString(val) {
|
|
|
1086
1147
|
/**
|
|
1087
1148
|
* The individual autorefresh strategies a {@link RequestSubscription}
|
|
1088
1149
|
* may combine, see {@link AutorefreshBehaviorCombos}.
|
|
1150
|
+
*
|
|
1151
|
+
* @summary One autorefresh trigger for a request subscription: on reconnecting (`online`), on a timer
|
|
1152
|
+
* (`interval`), or on store invalidation (`invalid`).
|
|
1089
1153
|
*/
|
|
1090
1154
|
/**
|
|
1091
1155
|
* The value accepted by {@link SubscriptionArgs.autorefresh}: either a
|
|
1092
1156
|
* boolean, a single {@link AutorefreshBehaviorType}, or a comma-separated
|
|
1093
1157
|
* combination of up to three of them.
|
|
1158
|
+
*
|
|
1159
|
+
* @summary The accepted values for a request subscription's `autorefresh` option: a boolean or a
|
|
1160
|
+
* comma-separated mix of `online`, `interval`, and `invalid`.
|
|
1094
1161
|
*/
|
|
1095
1162
|
/**
|
|
1096
1163
|
* Utilities to assist in recovering from the error.
|
|
1164
|
+
*
|
|
1165
|
+
* @summary The online and visibility state plus a `retry` function that a request subscription exposes
|
|
1166
|
+
* for recovering from a failed request.
|
|
1097
1167
|
*/
|
|
1098
1168
|
/** @deprecated use {@link RecoveryFeatures} */
|
|
1099
1169
|
/**
|
|
1100
1170
|
* Utilities for keeping the request fresh
|
|
1171
|
+
*
|
|
1172
|
+
* @summary The online, visibility, and refreshing state plus `refresh`, `reload`, and `abort` functions a
|
|
1173
|
+
* request subscription exposes alongside successful content.
|
|
1101
1174
|
*/
|
|
1102
1175
|
/**
|
|
1103
1176
|
* The args accepted by the `<Request />` component.
|
|
1177
|
+
*
|
|
1178
|
+
* @summary The arguments of the `<Request />` component: the request or query to run, autorefresh
|
|
1179
|
+
* options, and an optional store or subscription.
|
|
1104
1180
|
*/
|
|
1105
1181
|
/**
|
|
1106
1182
|
* The args accepted by a {@link RequestSubscription}.
|
|
1183
|
+
*
|
|
1184
|
+
* @summary Options for a request subscription: the request or query to monitor and its autorefresh settings.
|
|
1107
1185
|
*/
|
|
1108
1186
|
/**
|
|
1109
1187
|
* A reactive class
|
|
1110
1188
|
*
|
|
1189
|
+
* @summary Reactive subscription that monitors a request or query, tracking online, visibility and refresh state and
|
|
1190
|
+
* handling autorefresh, reload and retry.
|
|
1111
1191
|
* @hideconstructor
|
|
1112
1192
|
*/
|
|
1113
1193
|
var RequestSubscription = class {
|
|
@@ -1207,8 +1287,14 @@ var RequestSubscription = class {
|
|
|
1207
1287
|
* @internal
|
|
1208
1288
|
*/
|
|
1209
1289
|
async _beginPolling() {
|
|
1290
|
+
let initialRequest;
|
|
1291
|
+
try {
|
|
1292
|
+
initialRequest = this.isIdle ? null : this.request;
|
|
1293
|
+
} catch (e) {
|
|
1294
|
+
throw new Error(`Unable to begin polling the request`, { cause: e });
|
|
1295
|
+
}
|
|
1210
1296
|
try {
|
|
1211
|
-
if (
|
|
1297
|
+
if (initialRequest) await initialRequest;
|
|
1212
1298
|
} catch {} finally {
|
|
1213
1299
|
if (!this.isDestroyed) this._scheduleInterval();
|
|
1214
1300
|
}
|
|
@@ -1533,6 +1619,9 @@ function isStore(store) {
|
|
|
1533
1619
|
/**
|
|
1534
1620
|
* Creates a {@link RequestSubscription}, the reactive class powering the
|
|
1535
1621
|
* `<Request />` component's autorefresh, retry, and refresh behaviors.
|
|
1622
|
+
*
|
|
1623
|
+
* @summary Creates a reactive subscription to a request or query that tracks its state and handles
|
|
1624
|
+
* autorefresh, retry, and refresh.
|
|
1536
1625
|
*/
|
|
1537
1626
|
function createRequestSubscription(store, args) {
|
|
1538
1627
|
return new RequestSubscription(store, args);
|
|
@@ -1561,8 +1650,7 @@ function _DISPOSE$2() {
|
|
|
1561
1650
|
});
|
|
1562
1651
|
}
|
|
1563
1652
|
|
|
1564
|
-
|
|
1565
|
-
//#region src/signals/page-cache.ts
|
|
1653
|
+
// src/signals/page-cache.ts
|
|
1566
1654
|
const { abs } = Math;
|
|
1567
1655
|
/**
|
|
1568
1656
|
* Extracts the `data` member of a document type, or the document type itself
|
|
@@ -1599,6 +1687,8 @@ function getHref(link) {
|
|
|
1599
1687
|
* }
|
|
1600
1688
|
* ```
|
|
1601
1689
|
*
|
|
1690
|
+
* @summary Experimental: one page of a paginated collection, exposing its request, loading and error status, data,
|
|
1691
|
+
* and links to neighboring pages.
|
|
1602
1692
|
* @since 5.9.0
|
|
1603
1693
|
* @public
|
|
1604
1694
|
* @hideconstructor
|
|
@@ -1781,63 +1871,209 @@ var PageCache = class {
|
|
|
1781
1871
|
decorateMethodV2(this.prototype, "isLinked", [memoized]);
|
|
1782
1872
|
}
|
|
1783
1873
|
async load(request) {
|
|
1874
|
+
this.request = request;
|
|
1875
|
+
this.state = getRequestState(this.request);
|
|
1876
|
+
let content;
|
|
1784
1877
|
try {
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1878
|
+
content = (await this.request).content;
|
|
1879
|
+
} catch {
|
|
1880
|
+
return null;
|
|
1881
|
+
}
|
|
1882
|
+
this.applyDocument(content);
|
|
1883
|
+
return content;
|
|
1884
|
+
}
|
|
1885
|
+
/**
|
|
1886
|
+
* Re-applies an already-loaded page from a newer request for the same page
|
|
1887
|
+
* (a reload, or a route-driven navigation back to it). The newer document is
|
|
1888
|
+
* authoritative: its links and page hints replace the ones recorded from
|
|
1889
|
+
* the earlier load, and the collection total is updated from it. The page
|
|
1890
|
+
* keeps its current request until the newer one resolves, so a page on
|
|
1891
|
+
* screen does not flash a loading state; a rejected request leaves the
|
|
1892
|
+
* page untouched.
|
|
1893
|
+
*
|
|
1894
|
+
* @internal
|
|
1895
|
+
*/
|
|
1896
|
+
async update(request) {
|
|
1897
|
+
const state = getRequestState(request);
|
|
1898
|
+
let content;
|
|
1899
|
+
try {
|
|
1900
|
+
content = (await request).content;
|
|
1901
|
+
} catch {
|
|
1902
|
+
return null;
|
|
1903
|
+
}
|
|
1904
|
+
this.request = request;
|
|
1905
|
+
this.state = state;
|
|
1906
|
+
this.applyDocument(content);
|
|
1907
|
+
return content;
|
|
1908
|
+
}
|
|
1909
|
+
/**
|
|
1910
|
+
* Records a loaded document's links and page number, and links this page
|
|
1911
|
+
* into the shared page graph.
|
|
1912
|
+
*
|
|
1913
|
+
* The document is authoritative for what it states: a link it names
|
|
1914
|
+
* explicitly (including an explicit `null`) overwrites whatever a neighbor
|
|
1915
|
+
* or an earlier load of this page recorded, and a link it omits is kept.
|
|
1916
|
+
* `next`/`prev` name the adjacent pages; `first`/`last` name the ends of
|
|
1917
|
+
* the collection, beyond which nothing may remain linked.
|
|
1918
|
+
*
|
|
1919
|
+
* For a numbered collection the document must also agree with the page
|
|
1920
|
+
* numbers: `next` is the page after this one, `prev` the page before, a
|
|
1921
|
+
* page without `prev` is page 1, a page without `next` is the last page,
|
|
1922
|
+
* `first` is page 1 and `last` is page `totalPages`. A document that
|
|
1923
|
+
* contradicts this is a server (or collection-mixing) bug and is asserted
|
|
1924
|
+
* in development, before anything is recorded from it. A cursor collection
|
|
1925
|
+
* has no numbers, so there its links are the only authority.
|
|
1926
|
+
*
|
|
1927
|
+
* @internal
|
|
1928
|
+
*/
|
|
1929
|
+
applyDocument(content) {
|
|
1930
|
+
const links = content?.links ?? {};
|
|
1931
|
+
const self = getHref(content?.links?.self);
|
|
1932
|
+
const first = getHref(content?.links?.first);
|
|
1933
|
+
const last = getHref(content?.links?.last);
|
|
1934
|
+
const next = getHref(content?.links?.next);
|
|
1935
|
+
const prev = getHref(content?.links?.prev);
|
|
1936
|
+
((test) => {
|
|
1937
|
+
if (!test) throw new Error("Expected the page to have a self link");
|
|
1938
|
+
})(self);
|
|
1939
|
+
const { currentPage, totalPages } = this.manager.readPageHints(content);
|
|
1940
|
+
const firstPage = first ? this.manager.getPageCache(first) : null;
|
|
1941
|
+
const lastPage = last ? this.manager.getPageCache(last) : null;
|
|
1942
|
+
const prevPage = prev ? this.manager.getPageCache(prev) : null;
|
|
1943
|
+
const nextPage = next ? this.manager.getPageCache(next) : null;
|
|
1944
|
+
if (this.manager.isNumbered) {
|
|
1945
|
+
const ownNumber = (page) => page === this ? currentPage : page.pageNumber;
|
|
1793
1946
|
((test) => {
|
|
1794
|
-
if (!test) throw new Error(
|
|
1795
|
-
})(
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
}
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1947
|
+
if (!test) throw new Error(`Page ${self} is page ${currentPage} but the collection has ${totalPages} pages: it lies beyond the collection total`);
|
|
1948
|
+
})(!currentPage || !totalPages || currentPage <= totalPages);
|
|
1949
|
+
((test) => {
|
|
1950
|
+
if (!test) throw new Error(`Page ${self} is page ${currentPage} and has no prev link but is not the first page`);
|
|
1951
|
+
})(!("prev" in links && !prev && currentPage > 1));
|
|
1952
|
+
((test) => {
|
|
1953
|
+
if (!test) throw new Error(`Page ${self} is page ${currentPage} of ${totalPages} and has no next link but is not the last page`);
|
|
1954
|
+
})(!("next" in links && !next && currentPage > 0 && totalPages > 0 && currentPage < totalPages));
|
|
1955
|
+
((test) => {
|
|
1956
|
+
if (!test) throw new Error(`Page ${self} is page ${currentPage} but its next link names page ${nextPage ? ownNumber(nextPage) : 0}, expected page ${currentPage + 1}`);
|
|
1957
|
+
})(!nextPage || !currentPage || !ownNumber(nextPage) || ownNumber(nextPage) === currentPage + 1);
|
|
1958
|
+
((test) => {
|
|
1959
|
+
if (!test) throw new Error(`Page ${self} is page ${currentPage} but its prev link names page ${prevPage ? ownNumber(prevPage) : 0}, expected page ${currentPage - 1}`);
|
|
1960
|
+
})(!prevPage || !currentPage || !ownNumber(prevPage) || ownNumber(prevPage) === currentPage - 1);
|
|
1961
|
+
((test) => {
|
|
1962
|
+
if (!test) throw new Error(`Page ${self} has a first link that names page ${firstPage ? ownNumber(firstPage) : 0}, expected page 1`);
|
|
1963
|
+
})(!firstPage || !ownNumber(firstPage) || ownNumber(firstPage) === 1);
|
|
1964
|
+
((test) => {
|
|
1965
|
+
if (!test) throw new Error(`Page ${self} has a last link that names page ${lastPage ? ownNumber(lastPage) : 0}, expected the last page ${totalPages}`);
|
|
1966
|
+
})(!lastPage || !totalPages || !ownNumber(lastPage) || ownNumber(lastPage) === totalPages);
|
|
1967
|
+
((test) => {
|
|
1968
|
+
if (!test) throw new Error(`Page ${self} has a first link to ${first} but that first page has a page linked before it`);
|
|
1969
|
+
})(!firstPage?.before);
|
|
1970
|
+
}
|
|
1971
|
+
if (currentPage) this.pageNumber = currentPage;
|
|
1972
|
+
this.manager.totalPages = totalPages;
|
|
1973
|
+
const stated = {};
|
|
1974
|
+
if ("first" in links) stated.first = first;
|
|
1975
|
+
if ("last" in links) stated.last = last;
|
|
1976
|
+
if ("next" in links) stated.next = next;
|
|
1977
|
+
if ("prev" in links) stated.prev = prev;
|
|
1978
|
+
this.updateLinks(stated);
|
|
1979
|
+
if ("next" in links && !next) {
|
|
1980
|
+
const after = this.after;
|
|
1981
|
+
this.detachAfter();
|
|
1982
|
+
if (after?.prevLink === self) after.updateLinks({ prev: null });
|
|
1983
|
+
}
|
|
1984
|
+
if ("prev" in links && !prev) {
|
|
1985
|
+
const before = this.before;
|
|
1986
|
+
this.detachBefore();
|
|
1987
|
+
if (before?.nextLink === self) before.updateLinks({ next: null });
|
|
1988
|
+
}
|
|
1989
|
+
if (lastPage) {
|
|
1990
|
+
lastPage.detachAfter();
|
|
1991
|
+
lastPage.updateLinks({ next: null });
|
|
1992
|
+
}
|
|
1993
|
+
if (firstPage) {
|
|
1994
|
+
firstPage.detachBefore();
|
|
1995
|
+
firstPage.updateLinks({ prev: null });
|
|
1996
|
+
}
|
|
1997
|
+
if (firstPage) {
|
|
1998
|
+
firstPage.setPageNumber(1);
|
|
1999
|
+
if (firstPage !== this && !firstPage.after) this.linkFirst(firstPage);
|
|
2000
|
+
}
|
|
2001
|
+
if (lastPage) {
|
|
2002
|
+
lastPage.setPageNumber(this.manager.totalPages);
|
|
2003
|
+
if (lastPage !== this && !lastPage.before) this.linkLast(lastPage);
|
|
2004
|
+
}
|
|
2005
|
+
if (nextPage) {
|
|
2006
|
+
nextPage.setPageNumber(this.pageNumber + 1);
|
|
2007
|
+
nextPage.updateLinks({ prev: self });
|
|
2008
|
+
}
|
|
2009
|
+
if (prevPage) {
|
|
2010
|
+
prevPage.setPageNumber(this.pageNumber - 1);
|
|
2011
|
+
prevPage.updateLinks({ next: self });
|
|
2012
|
+
}
|
|
2013
|
+
if (nextPage && this.after && this.after !== nextPage && this.after.pageNumber <= nextPage.pageNumber) this.detachAfter();
|
|
2014
|
+
if (prevPage && this.before && this.before !== prevPage && this.before.pageNumber >= prevPage.pageNumber) this.detachBefore();
|
|
2015
|
+
if (this.isLinked) {
|
|
2016
|
+
if (prevPage) prevPage.updateLinkage({ after: this });
|
|
2017
|
+
if (nextPage) nextPage.updateLinkage({ before: this });
|
|
2018
|
+
} else if (prevPage?.isLinked) {
|
|
2019
|
+
this.updateLinkage({ before: prevPage });
|
|
2020
|
+
if (nextPage) nextPage.updateLinkage({ before: this });
|
|
2021
|
+
} else if (nextPage?.isLinked) {
|
|
2022
|
+
this.updateLinkage({ after: nextPage });
|
|
2023
|
+
if (prevPage) prevPage.updateLinkage({ after: this });
|
|
2024
|
+
} else if ((prevPage || nextPage) && (firstPage || lastPage)) this.lookupLinkage(firstPage, lastPage);
|
|
2025
|
+
else if (prevPage || nextPage) this.updateLinkage({
|
|
2026
|
+
before: prevPage,
|
|
2027
|
+
after: nextPage
|
|
2028
|
+
});
|
|
2029
|
+
}
|
|
2030
|
+
/** @internal */
|
|
2031
|
+
detachAfter() {
|
|
2032
|
+
const after = this.after;
|
|
2033
|
+
if (after) {
|
|
2034
|
+
if (after.before === this) after.setBefore(null);
|
|
2035
|
+
this.setAfter(null);
|
|
2036
|
+
}
|
|
1839
2037
|
}
|
|
1840
2038
|
/** @internal */
|
|
2039
|
+
detachBefore() {
|
|
2040
|
+
const before = this.before;
|
|
2041
|
+
if (before) {
|
|
2042
|
+
if (before.after === this) before.setAfter(null);
|
|
2043
|
+
this.setBefore(null);
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
/**
|
|
2047
|
+
* Links an unlinked `first` page before the earliest page reachable
|
|
2048
|
+
* backwards from this one that must follow it.
|
|
2049
|
+
*
|
|
2050
|
+
* @internal
|
|
2051
|
+
*/
|
|
2052
|
+
linkFirst(firstPage) {
|
|
2053
|
+
let head = this;
|
|
2054
|
+
while (head.before && head.before !== firstPage && (!head.before.pageNumber || head.before.pageNumber > firstPage.pageNumber)) head = head.before;
|
|
2055
|
+
firstPage.updateLinkage({ after: head });
|
|
2056
|
+
}
|
|
2057
|
+
/**
|
|
2058
|
+
* Links an unlinked `last` page after the furthest page reachable forwards
|
|
2059
|
+
* from this one that must precede it.
|
|
2060
|
+
*
|
|
2061
|
+
* @internal
|
|
2062
|
+
*/
|
|
2063
|
+
linkLast(lastPage) {
|
|
2064
|
+
let tail = this;
|
|
2065
|
+
while (tail.after && tail.after !== lastPage && (!tail.after.pageNumber || !lastPage.pageNumber || tail.after.pageNumber < lastPage.pageNumber)) tail = tail.after;
|
|
2066
|
+
lastPage.updateLinkage({ before: tail });
|
|
2067
|
+
}
|
|
2068
|
+
/**
|
|
2069
|
+
* Places this page between `before` and `after` in the graph (a missing side
|
|
2070
|
+
* is taken from the given side's current neighbor, so a single side splices
|
|
2071
|
+
* this page in). Pointers this page or the displaced neighbors held to their
|
|
2072
|
+
* old positions are cleared first, so a page moved within the graph never
|
|
2073
|
+
* leaves a dangling link behind that could close a cycle.
|
|
2074
|
+
*
|
|
2075
|
+
* @internal
|
|
2076
|
+
*/
|
|
1841
2077
|
updateLinkage({ before, after }) {
|
|
1842
2078
|
((test) => {
|
|
1843
2079
|
if (!test) throw new Error("Expected at least one of before or after page states to link to this page");
|
|
@@ -1845,10 +2081,16 @@ var PageCache = class {
|
|
|
1845
2081
|
const leftSide = before ?? after?.before;
|
|
1846
2082
|
const rightSide = after ?? before?.after;
|
|
1847
2083
|
if (leftSide && leftSide !== this) {
|
|
2084
|
+
if (this.before !== leftSide) this.detachBefore();
|
|
2085
|
+
const displaced = leftSide.after;
|
|
2086
|
+
if (displaced && displaced !== this && displaced !== rightSide && displaced.before === leftSide) displaced.setBefore(null);
|
|
1848
2087
|
leftSide.setAfter(this);
|
|
1849
2088
|
this.setBefore(leftSide);
|
|
1850
2089
|
}
|
|
1851
2090
|
if (rightSide && rightSide !== this) {
|
|
2091
|
+
if (this.after !== rightSide) this.detachAfter();
|
|
2092
|
+
const displaced = rightSide.before;
|
|
2093
|
+
if (displaced && displaced !== this && displaced !== leftSide && displaced.after === rightSide) displaced.setAfter(null);
|
|
1852
2094
|
rightSide.setBefore(this);
|
|
1853
2095
|
this.setAfter(rightSide);
|
|
1854
2096
|
}
|
|
@@ -1888,16 +2130,18 @@ var PageCache = class {
|
|
|
1888
2130
|
})(page !== this);
|
|
1889
2131
|
this.after = page;
|
|
1890
2132
|
}
|
|
1891
|
-
/**
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
if (
|
|
1900
|
-
if (
|
|
2133
|
+
/**
|
|
2134
|
+
* Records the given links. Only the keys present are applied, so a caller
|
|
2135
|
+
* states exactly what it knows: an explicit `null` clears a link, an
|
|
2136
|
+
* omitted key leaves the recorded link alone.
|
|
2137
|
+
*
|
|
2138
|
+
* @internal
|
|
2139
|
+
*/
|
|
2140
|
+
updateLinks = (links) => {
|
|
2141
|
+
if ("prev" in links) this.prevLink = links.prev ?? null;
|
|
2142
|
+
if ("next" in links) this.nextLink = links.next ?? null;
|
|
2143
|
+
if ("first" in links) this.firstLink = links.first ?? null;
|
|
2144
|
+
if ("last" in links) this.lastLink = links.last ?? null;
|
|
1901
2145
|
};
|
|
1902
2146
|
/** @internal */
|
|
1903
2147
|
setPageNumber = (pageNumber) => {
|
|
@@ -1905,8 +2149,7 @@ var PageCache = class {
|
|
|
1905
2149
|
};
|
|
1906
2150
|
};
|
|
1907
2151
|
|
|
1908
|
-
|
|
1909
|
-
//#region src/signals/pagination-cache.ts
|
|
2152
|
+
// src/signals/pagination-cache.ts
|
|
1910
2153
|
const PaginationCacheMap = /* @__PURE__ */ new Map();
|
|
1911
2154
|
/**
|
|
1912
2155
|
* A hint function for extracting the `currentPage` and `totalPages` from a loaded
|
|
@@ -1923,6 +2166,8 @@ const PaginationCacheMap = /* @__PURE__ */ new Map();
|
|
|
1923
2166
|
* collection must provide the same function reference — define it once at module
|
|
1924
2167
|
* scope and import it everywhere.
|
|
1925
2168
|
*
|
|
2169
|
+
* @summary Experimental: a function you pass to `<Paginate />` that reads `currentPage` and `totalPages` from a
|
|
2170
|
+
* loaded document when they are not in the default `meta` locations.
|
|
1926
2171
|
* @since 5.9.0
|
|
1927
2172
|
* @public
|
|
1928
2173
|
*/
|
|
@@ -1931,6 +2176,8 @@ const PaginationCacheMap = /* @__PURE__ */ new Map();
|
|
|
1931
2176
|
* document `meta`, matching the behavior used before `pageHints` was configurable.
|
|
1932
2177
|
* Used whenever the consumer does not provide a `pageHints` function.
|
|
1933
2178
|
*
|
|
2179
|
+
* @summary Experimental: the fallback page-hints function, reading `meta.page` or `meta.currentPage` and
|
|
2180
|
+
* `meta.totalPages` from a document, with `0` meaning unknown.
|
|
1934
2181
|
* @since 5.9.0
|
|
1935
2182
|
* @public
|
|
1936
2183
|
*/
|
|
@@ -1950,6 +2197,8 @@ const defaultPageHints = (document) => {
|
|
|
1950
2197
|
* interact with — the cache itself is plumbing shared between the pagination
|
|
1951
2198
|
* classes.
|
|
1952
2199
|
*
|
|
2200
|
+
* @summary Experimental: the shared, app-wide store of loaded pages, page order, and `totalPages` for one paginated
|
|
2201
|
+
* collection, keyed by its `first` or `self` link.
|
|
1953
2202
|
* @since 5.9.0
|
|
1954
2203
|
* @public
|
|
1955
2204
|
* @hideconstructor
|
|
@@ -2044,17 +2293,28 @@ var PaginationCache = class {
|
|
|
2044
2293
|
}
|
|
2045
2294
|
return page;
|
|
2046
2295
|
}
|
|
2047
|
-
/**
|
|
2048
|
-
|
|
2296
|
+
/**
|
|
2297
|
+
* Loads the page at `url` with `request` when it is not loaded (or its load
|
|
2298
|
+
* failed), or re-applies `request`'s document when it is a newer request
|
|
2299
|
+
* for an already-loaded page (a reload, or navigating back to it: the newer
|
|
2300
|
+
* document is authoritative for the page's links and the collection total,
|
|
2301
|
+
* which may have changed since the first load).
|
|
2302
|
+
*
|
|
2303
|
+
* Resolves to the page once that has settled. A rejected request settles
|
|
2304
|
+
* too — it is surfaced through the page's state, not thrown. The promise
|
|
2305
|
+
* rejects only when the document contradicts the collection (see
|
|
2306
|
+
* {@link PageCache.applyDocument}), so the caller that triggered the load
|
|
2307
|
+
* is the one that hears about it.
|
|
2308
|
+
*
|
|
2309
|
+
* @internal
|
|
2310
|
+
*/
|
|
2311
|
+
async loadPage(url, request) {
|
|
2049
2312
|
const page = this.getPageCache(url);
|
|
2050
2313
|
if ((!page.isLoaded || page.isError) && request) {
|
|
2051
|
-
(
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
page.
|
|
2055
|
-
this.updateFirstPage(page);
|
|
2056
|
-
if (document) this.totalPages = this.getTotalPages(document);
|
|
2057
|
-
});
|
|
2314
|
+
await page.load(request);
|
|
2315
|
+
this.updateFirstPage(page);
|
|
2316
|
+
} else if (request && page.isSuccess && request !== page.request) {
|
|
2317
|
+
if (await page.update(request)) this.updateFirstPage(page);
|
|
2058
2318
|
}
|
|
2059
2319
|
return page;
|
|
2060
2320
|
}
|
|
@@ -2064,10 +2324,6 @@ var PaginationCache = class {
|
|
|
2064
2324
|
while (maybeFirstPage.before) maybeFirstPage = maybeFirstPage.before;
|
|
2065
2325
|
if (!this.firstPage || this.firstPage.pageNumber > maybeFirstPage.pageNumber) this.firstPage = maybeFirstPage;
|
|
2066
2326
|
}
|
|
2067
|
-
/** @internal */
|
|
2068
|
-
getTotalPages(document) {
|
|
2069
|
-
return this.readPageHints(document).totalPages;
|
|
2070
|
-
}
|
|
2071
2327
|
/**
|
|
2072
2328
|
* Every page known to the shared graph, in order — loaded pages and pages
|
|
2073
2329
|
* known only from links — across all components sharing the collection.
|
|
@@ -2083,14 +2339,13 @@ var PaginationCache = class {
|
|
|
2083
2339
|
* ```
|
|
2084
2340
|
*/
|
|
2085
2341
|
get pages() {
|
|
2086
|
-
const
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
} };
|
|
2342
|
+
const pages = [];
|
|
2343
|
+
let page = this.firstPage;
|
|
2344
|
+
while (page) {
|
|
2345
|
+
pages.push(page);
|
|
2346
|
+
page = page.after;
|
|
2347
|
+
}
|
|
2348
|
+
return pages;
|
|
2094
2349
|
}
|
|
2095
2350
|
/**
|
|
2096
2351
|
* The items of every loaded page in the shared graph, flattened into one
|
|
@@ -2104,10 +2359,9 @@ var PaginationCache = class {
|
|
|
2104
2359
|
decorateMethodV2(this.prototype, "pages", [memoized]);
|
|
2105
2360
|
}
|
|
2106
2361
|
get data() {
|
|
2107
|
-
const
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
} };
|
|
2362
|
+
const items = [];
|
|
2363
|
+
for (const page of this.pages) if (page.data) items.push(...page.data);
|
|
2364
|
+
return items;
|
|
2111
2365
|
}
|
|
2112
2366
|
static {
|
|
2113
2367
|
decorateMethodV2(this.prototype, "data", [memoized]);
|
|
@@ -2118,6 +2372,8 @@ var PaginationCache = class {
|
|
|
2118
2372
|
* `first` or `self` link). Returns the same instance for the same key for the
|
|
2119
2373
|
* lifetime of the module.
|
|
2120
2374
|
*
|
|
2375
|
+
* @summary Experimental: returns the shared pagination cache for a collection's `first` or `self` link, creating it
|
|
2376
|
+
* on first use.
|
|
2121
2377
|
* @since 5.9.0
|
|
2122
2378
|
* @public
|
|
2123
2379
|
*/
|
|
@@ -2134,6 +2390,7 @@ function getPaginationCache(key) {
|
|
|
2134
2390
|
* Primarily intended for test isolation, since the cache is keyed by url and
|
|
2135
2391
|
* otherwise persists for the lifetime of the module.
|
|
2136
2392
|
*
|
|
2393
|
+
* @summary Experimental: discards every shared pagination cache, mainly so tests start from a clean state.
|
|
2137
2394
|
* @since 5.9.0
|
|
2138
2395
|
* @public
|
|
2139
2396
|
*/
|
|
@@ -2141,8 +2398,7 @@ function clearPaginationCache() {
|
|
|
2141
2398
|
PaginationCacheMap.clear();
|
|
2142
2399
|
}
|
|
2143
2400
|
|
|
2144
|
-
|
|
2145
|
-
//#region src/signals/pagination-state.ts
|
|
2401
|
+
// src/signals/pagination-state.ts
|
|
2146
2402
|
/**
|
|
2147
2403
|
* The two navigation surfaces a `<Paginate />` component can drive. Selecting
|
|
2148
2404
|
* one (via the component's `@mode` arg) narrows the yielded state so the two
|
|
@@ -2150,25 +2406,40 @@ function clearPaginationCache() {
|
|
|
2150
2406
|
*
|
|
2151
2407
|
* - `'paged'` — single-page view, see {@link PagedPaginationState}.
|
|
2152
2408
|
* - `'infinite'` — accumulated view, see {@link InfinitePaginationState}.
|
|
2409
|
+
*
|
|
2410
|
+
* @summary Experimental: the `@mode` value of `<Paginate />`, either `'paged'` for a single-page view or
|
|
2411
|
+
* `'infinite'` for an accumulated view, which selects the yielded pagination API.
|
|
2153
2412
|
*/
|
|
2154
2413
|
/**
|
|
2155
2414
|
* The part of a {@link PaginationState} available to both navigation surfaces.
|
|
2415
|
+
*
|
|
2416
|
+
* @summary Experimental: the pagination state members available in both paged and infinite mode, namely
|
|
2417
|
+
* `totalPages` and `adoptPage`.
|
|
2156
2418
|
*/
|
|
2157
2419
|
/**
|
|
2158
2420
|
* The paged (single-page view) surface of a {@link PaginationState}: render
|
|
2159
2421
|
* {@link PaginationState.activePageRequest | activePageRequest}, navigate with
|
|
2160
2422
|
* {@link PaginationState.loadPage | loadPage}. This is what the `<Paginate />`
|
|
2161
2423
|
* component yields in `'paged'` mode (the default).
|
|
2424
|
+
*
|
|
2425
|
+
* @summary Experimental: the pagination state `<Paginate />` yields in paged mode, exposing the active page, its
|
|
2426
|
+
* request, and `loadPage` for navigating to a page by URL.
|
|
2162
2427
|
*/
|
|
2163
2428
|
/**
|
|
2164
2429
|
* The infinite (accumulated view) surface of a {@link PaginationState}: render
|
|
2165
2430
|
* {@link PaginationState.data | data}, grow it with
|
|
2166
2431
|
* {@link PaginationState.loadNext | loadNext}/{@link PaginationState.loadPrev | loadPrev}.
|
|
2167
2432
|
* This is what the `<Paginate />` component yields in `'infinite'` mode.
|
|
2433
|
+
*
|
|
2434
|
+
* @summary Experimental: the pagination state `<Paginate />` yields in infinite mode, exposing the accumulated
|
|
2435
|
+
* items and pages plus `loadNext` and `loadPrev` to extend them.
|
|
2168
2436
|
*/
|
|
2169
2437
|
/**
|
|
2170
2438
|
* Resolves a {@link PaginateMode} to the surface it exposes, so a component
|
|
2171
2439
|
* generic over the mode can yield only that surface.
|
|
2440
|
+
*
|
|
2441
|
+
* @summary Experimental: resolves a pagination mode to its state type, the infinite-mode state for `'infinite'`
|
|
2442
|
+
* and the paged-mode state otherwise.
|
|
2172
2443
|
*/
|
|
2173
2444
|
/**
|
|
2174
2445
|
* The per-component, local pagination state. It houses the state that is unique
|
|
@@ -2192,6 +2463,8 @@ function clearPaginationCache() {
|
|
|
2192
2463
|
* Instances are created via {@link getPaginationState} (or by the `<Paginate />`
|
|
2193
2464
|
* component on your behalf), never constructed directly.
|
|
2194
2465
|
*
|
|
2466
|
+
* @summary Experimental: one component's pagination state over a shared collection, tracking the active page and
|
|
2467
|
+
* the loaded run and providing paged and infinite navigation.
|
|
2195
2468
|
* @since 5.9.0
|
|
2196
2469
|
* @public
|
|
2197
2470
|
* @hideconstructor
|
|
@@ -2222,10 +2495,23 @@ var PaginationState = class {
|
|
|
2222
2495
|
* them backward/forward. Both seed to {@link initialPage}; a purely paged
|
|
2223
2496
|
* consumer never extends them, so they stay put and are effectively unused.
|
|
2224
2497
|
*
|
|
2498
|
+
* Only ever written through {@link extendRun} and {@link restartRun}, which
|
|
2499
|
+
* keep {@link runMembers} in step.
|
|
2500
|
+
*
|
|
2225
2501
|
* @internal
|
|
2226
2502
|
*/
|
|
2227
2503
|
/** @internal */
|
|
2228
2504
|
/**
|
|
2505
|
+
* Every page this component has loaded into its run — what the frontier
|
|
2506
|
+
* spanned each time it moved. Bounds the walk in {@link pages}: the shared
|
|
2507
|
+
* graph may relink a page in the run to one that another component sharing
|
|
2508
|
+
* the collection loaded, and that page is not part of this run until it is
|
|
2509
|
+
* loaded through here. Untracked bookkeeping — it only changes together with
|
|
2510
|
+
* the frontier signals, which carry the notification.
|
|
2511
|
+
*
|
|
2512
|
+
* @internal
|
|
2513
|
+
*/
|
|
2514
|
+
/**
|
|
2229
2515
|
* The request of the latest {@link adoptPage} call — only that call may
|
|
2230
2516
|
* commit. Later calls (or a {@link loadPage} navigation) claim the slot,
|
|
2231
2517
|
* superseding in-flight adoptions so the newest navigation always wins.
|
|
@@ -2238,6 +2524,7 @@ var PaginationState = class {
|
|
|
2238
2524
|
this.request = request;
|
|
2239
2525
|
this.pageHints = pageHints;
|
|
2240
2526
|
this._adoptTarget = null;
|
|
2527
|
+
this.runMembers = /* @__PURE__ */ new Set();
|
|
2241
2528
|
this.setup();
|
|
2242
2529
|
}
|
|
2243
2530
|
/**
|
|
@@ -2286,21 +2573,44 @@ var PaginationState = class {
|
|
|
2286
2573
|
* same collection to different extents each see only what they have scrolled
|
|
2287
2574
|
* through. For every page known to the whole collection, see
|
|
2288
2575
|
* {@link PaginationCache.pages}.
|
|
2576
|
+
*
|
|
2577
|
+
* The run is walked through the shared graph, so it ends early when a page
|
|
2578
|
+
* that was in it no longer follows the page before it — a reload that showed
|
|
2579
|
+
* the collection now ends sooner, or that its next cursor moved. It also ends
|
|
2580
|
+
* before a page this component never loaded: a reload may relink a page in
|
|
2581
|
+
* the run to one another component sharing the collection scrolled to, and
|
|
2582
|
+
* that page joins this run only through {@link loadNext}.
|
|
2289
2583
|
*/
|
|
2290
2584
|
static {
|
|
2291
2585
|
decorateMethodV2(this.prototype, "totalPages", [memoized]);
|
|
2292
2586
|
}
|
|
2293
2587
|
get pages() {
|
|
2294
|
-
const
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
}
|
|
2588
|
+
const pages = [];
|
|
2589
|
+
const end = this.frontierEnd;
|
|
2590
|
+
let page = this.frontierStart;
|
|
2591
|
+
while (page) {
|
|
2592
|
+
pages.push(page);
|
|
2593
|
+
if (page === end) break;
|
|
2594
|
+
const next = page.after;
|
|
2595
|
+
if (!next?.isSuccess || !this.runMembers.has(next)) break;
|
|
2596
|
+
page = next;
|
|
2597
|
+
}
|
|
2598
|
+
return pages;
|
|
2599
|
+
}
|
|
2600
|
+
/**
|
|
2601
|
+
* The last page of the run {@link pages} walks — the forward frontier, or
|
|
2602
|
+
* the page before the first one that no longer follows in the graph or that
|
|
2603
|
+
* this component never loaded.
|
|
2604
|
+
*
|
|
2605
|
+
* @internal
|
|
2606
|
+
*/
|
|
2607
|
+
static {
|
|
2608
|
+
decorateMethodV2(this.prototype, "pages", [memoized]);
|
|
2609
|
+
}
|
|
2610
|
+
get runEnd() {
|
|
2611
|
+
let end = null;
|
|
2612
|
+
for (const page of this.pages) end = page;
|
|
2613
|
+
return end;
|
|
2304
2614
|
}
|
|
2305
2615
|
/**
|
|
2306
2616
|
* The accumulated items across the loaded run, from the backward frontier to
|
|
@@ -2325,13 +2635,12 @@ var PaginationState = class {
|
|
|
2325
2635
|
* ```
|
|
2326
2636
|
*/
|
|
2327
2637
|
static {
|
|
2328
|
-
decorateMethodV2(this.prototype, "
|
|
2638
|
+
decorateMethodV2(this.prototype, "runEnd", [memoized]);
|
|
2329
2639
|
}
|
|
2330
2640
|
get data() {
|
|
2331
|
-
const
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
} };
|
|
2641
|
+
const items = [];
|
|
2642
|
+
for (const page of this.pages) if (page.data) items.push(...page.data);
|
|
2643
|
+
return items;
|
|
2335
2644
|
}
|
|
2336
2645
|
/**
|
|
2337
2646
|
* Whether a page exists after the forward frontier — i.e. there is more to load
|
|
@@ -2347,7 +2656,7 @@ var PaginationState = class {
|
|
|
2347
2656
|
decorateMethodV2(this.prototype, "data", [memoized]);
|
|
2348
2657
|
}
|
|
2349
2658
|
get hasNext() {
|
|
2350
|
-
return Boolean(this.
|
|
2659
|
+
return Boolean(this.runEnd?.nextLink);
|
|
2351
2660
|
}
|
|
2352
2661
|
/**
|
|
2353
2662
|
* Whether a page exists before the backward frontier.
|
|
@@ -2362,7 +2671,10 @@ var PaginationState = class {
|
|
|
2362
2671
|
* The request for the page just after the forward frontier, for the infinite
|
|
2363
2672
|
* surface. `null` until {@link loadNext} fires it (so a `<Request>` wrapping it
|
|
2364
2673
|
* renders its idle block), the in-flight `Future` while that page loads, then
|
|
2365
|
-
* `null` again once the frontier advances onto it. Also `null` at end-of-list
|
|
2674
|
+
* `null` again once the frontier advances onto it. Also `null` at end-of-list,
|
|
2675
|
+
* and while the page sits loaded in the shared cache (another component
|
|
2676
|
+
* scrolled to it) but outside this run — {@link loadNext} then joins it
|
|
2677
|
+
* without a request of its own.
|
|
2366
2678
|
*
|
|
2367
2679
|
* ```gts
|
|
2368
2680
|
* {{#if pages.hasNext}}
|
|
@@ -2377,9 +2689,9 @@ var PaginationState = class {
|
|
|
2377
2689
|
decorateMethodV2(this.prototype, "hasPrevious", [memoized]);
|
|
2378
2690
|
}
|
|
2379
2691
|
get nextRequest() {
|
|
2380
|
-
const url = this.
|
|
2692
|
+
const url = this.runEnd?.nextLink;
|
|
2381
2693
|
if (!url) return null;
|
|
2382
|
-
return this.
|
|
2694
|
+
return this.pendingRequest(url);
|
|
2383
2695
|
}
|
|
2384
2696
|
/**
|
|
2385
2697
|
* The request for the page just before the backward frontier. Mirror of
|
|
@@ -2391,12 +2703,24 @@ var PaginationState = class {
|
|
|
2391
2703
|
get previousRequest() {
|
|
2392
2704
|
const url = this.frontierStart?.prevLink;
|
|
2393
2705
|
if (!url) return null;
|
|
2394
|
-
return this.
|
|
2706
|
+
return this.pendingRequest(url);
|
|
2395
2707
|
}
|
|
2396
|
-
/**
|
|
2708
|
+
/**
|
|
2709
|
+
* The request of the page at `url` unless it already succeeded, in which
|
|
2710
|
+
* case there is nothing pending: the page either sits in this run, or joins
|
|
2711
|
+
* it on the next {@link loadNext}/{@link loadPrev} without a new request.
|
|
2712
|
+
*
|
|
2713
|
+
* @internal
|
|
2714
|
+
*/
|
|
2397
2715
|
static {
|
|
2398
2716
|
decorateMethodV2(this.prototype, "previousRequest", [memoized]);
|
|
2399
2717
|
}
|
|
2718
|
+
pendingRequest(url) {
|
|
2719
|
+
const page = this.paginationCache?.getPageCache(url);
|
|
2720
|
+
if (!page || page.isSuccess) return null;
|
|
2721
|
+
return page.request ?? null;
|
|
2722
|
+
}
|
|
2723
|
+
/** @internal */
|
|
2400
2724
|
async setup() {
|
|
2401
2725
|
let document;
|
|
2402
2726
|
try {
|
|
@@ -2413,9 +2737,31 @@ var PaginationState = class {
|
|
|
2413
2737
|
const cache = getPaginationCache(firstLink ?? selfLink ?? "");
|
|
2414
2738
|
cache.installPageHints(this.pageHints);
|
|
2415
2739
|
this.paginationCache = cache;
|
|
2416
|
-
|
|
2417
|
-
this.activePage = this.initialPage =
|
|
2418
|
-
this.
|
|
2740
|
+
const page = cache.getPageCache(selfLink);
|
|
2741
|
+
this.activePage = this.initialPage = page;
|
|
2742
|
+
this.restartRun(page);
|
|
2743
|
+
await cache.loadPage(selfLink, this.request);
|
|
2744
|
+
}
|
|
2745
|
+
/**
|
|
2746
|
+
* Moves the frontier onto a page adjacent to the run, recording it as a
|
|
2747
|
+
* member.
|
|
2748
|
+
*
|
|
2749
|
+
* @internal
|
|
2750
|
+
*/
|
|
2751
|
+
extendRun(dir, page) {
|
|
2752
|
+
this.runMembers.add(page);
|
|
2753
|
+
if (dir === "next") this.frontierEnd = page;
|
|
2754
|
+
else this.frontierStart = page;
|
|
2755
|
+
}
|
|
2756
|
+
/**
|
|
2757
|
+
* Restarts the run at a single page, forgetting every earlier member.
|
|
2758
|
+
*
|
|
2759
|
+
* @internal
|
|
2760
|
+
*/
|
|
2761
|
+
restartRun(page) {
|
|
2762
|
+
this.runMembers.clear();
|
|
2763
|
+
this.runMembers.add(page);
|
|
2764
|
+
this.frontierStart = this.frontierEnd = page;
|
|
2419
2765
|
}
|
|
2420
2766
|
/**
|
|
2421
2767
|
* Commits a resolved, membership-proven page into this state, making it the
|
|
@@ -2432,9 +2778,9 @@ var PaginationState = class {
|
|
|
2432
2778
|
_activate(page, url) {
|
|
2433
2779
|
this.activePage = page;
|
|
2434
2780
|
for (const existing of this.pages) if (existing === page) return;
|
|
2435
|
-
if (this.
|
|
2436
|
-
else if (this.frontierStart?.prevLink === url) this.
|
|
2437
|
-
else this.
|
|
2781
|
+
if (this.runEnd?.nextLink === url) this.extendRun("next", page);
|
|
2782
|
+
else if (this.frontierStart?.prevLink === url) this.extendRun("prev", page);
|
|
2783
|
+
else this.restartRun(page);
|
|
2438
2784
|
}
|
|
2439
2785
|
/**
|
|
2440
2786
|
* Adopts an externally-issued request into this pagination, making its page
|
|
@@ -2465,6 +2811,10 @@ var PaginationState = class {
|
|
|
2465
2811
|
* - this state has not finished setting up its own collection yet
|
|
2466
2812
|
* - the call was superseded by a newer navigation
|
|
2467
2813
|
*
|
|
2814
|
+
* In development, a document that contradicts the collection's page
|
|
2815
|
+
* numbers (a `next` that skips a page, a `first` that is not page 1, ...)
|
|
2816
|
+
* rejects instead of resolving: the graph is not updated from it.
|
|
2817
|
+
*
|
|
2468
2818
|
* ```ts
|
|
2469
2819
|
* const pages = getPaginationState(initialRequest);
|
|
2470
2820
|
* // later, e.g. in a route model hook reacting to a ?page= param:
|
|
@@ -2494,12 +2844,7 @@ var PaginationState = class {
|
|
|
2494
2844
|
if (!test) throw new Error("Expected the adopted document to have a self link");
|
|
2495
2845
|
})(selfLink);
|
|
2496
2846
|
if (!selfLink || (firstLink ?? selfLink) !== cache.key) return null;
|
|
2497
|
-
const page = cache.loadPage(selfLink, request);
|
|
2498
|
-
try {
|
|
2499
|
-
await page.request;
|
|
2500
|
-
} catch {
|
|
2501
|
-
return null;
|
|
2502
|
-
}
|
|
2847
|
+
const page = await cache.loadPage(selfLink, request);
|
|
2503
2848
|
if (this._adoptTarget !== request) return null;
|
|
2504
2849
|
this._activate(page, selfLink);
|
|
2505
2850
|
return page.value;
|
|
@@ -2546,7 +2891,7 @@ var PaginationState = class {
|
|
|
2546
2891
|
((test) => {
|
|
2547
2892
|
if (!test) throw new Error("Expected the pagination cache to be set up before loading a page");
|
|
2548
2893
|
})(cache);
|
|
2549
|
-
const frontier = dir === "next" ? this.
|
|
2894
|
+
const frontier = dir === "next" ? this.runEnd : this.frontierStart;
|
|
2550
2895
|
const url = dir === "next" ? frontier?.nextLink : frontier?.prevLink;
|
|
2551
2896
|
if (!url) return null;
|
|
2552
2897
|
const page = cache.getPageCache(url);
|
|
@@ -2559,15 +2904,12 @@ var PaginationState = class {
|
|
|
2559
2904
|
method: "GET",
|
|
2560
2905
|
url
|
|
2561
2906
|
});
|
|
2562
|
-
cache.loadPage(url, request);
|
|
2563
|
-
}
|
|
2564
|
-
try {
|
|
2907
|
+
await cache.loadPage(url, request);
|
|
2908
|
+
} else try {
|
|
2565
2909
|
await page.request;
|
|
2566
|
-
} catch {
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
if (dir === "next") this.frontierEnd = page;
|
|
2570
|
-
else this.frontierStart = page;
|
|
2910
|
+
} catch {}
|
|
2911
|
+
if (!page.isSuccess) return null;
|
|
2912
|
+
this.extendRun(dir, page);
|
|
2571
2913
|
return page.value;
|
|
2572
2914
|
};
|
|
2573
2915
|
/**
|
|
@@ -2586,7 +2928,9 @@ var PaginationState = class {
|
|
|
2586
2928
|
* On failure the page stays active and {@link activePageRequest} resolves to
|
|
2587
2929
|
* it, so a wrapping `<Request>` renders its error block. Calling again (for
|
|
2588
2930
|
* example clicking the page's link a second time) retries: the failed page
|
|
2589
|
-
* is re-requested with a forced reload.
|
|
2931
|
+
* is re-requested with a forced reload. In development, a document that
|
|
2932
|
+
* contradicts the collection's page numbers rejects instead (see
|
|
2933
|
+
* {@link adoptPage}).
|
|
2590
2934
|
*
|
|
2591
2935
|
* ```gts
|
|
2592
2936
|
* <EachLink @pages={{pages}}>
|
|
@@ -2613,12 +2957,8 @@ var PaginationState = class {
|
|
|
2613
2957
|
method: "GET",
|
|
2614
2958
|
url
|
|
2615
2959
|
});
|
|
2616
|
-
cache.loadPage(url, request);
|
|
2617
|
-
|
|
2618
|
-
await page.request;
|
|
2619
|
-
} catch {
|
|
2620
|
-
return null;
|
|
2621
|
-
}
|
|
2960
|
+
await cache.loadPage(url, request);
|
|
2961
|
+
if (!page.isSuccess) return null;
|
|
2622
2962
|
}
|
|
2623
2963
|
return page.value;
|
|
2624
2964
|
};
|
|
@@ -2645,6 +2985,8 @@ const PaginationStateCache = /* @__PURE__ */ new WeakMap();
|
|
|
2645
2985
|
* await pages.loadNext();
|
|
2646
2986
|
* ```
|
|
2647
2987
|
*
|
|
2988
|
+
* @summary Experimental: returns the pagination state for a request, creating it on first call and returning the
|
|
2989
|
+
* same instance for the same request thereafter.
|
|
2648
2990
|
* @since 5.9.0
|
|
2649
2991
|
* @public
|
|
2650
2992
|
*/
|
|
@@ -2657,8 +2999,7 @@ function getPaginationState(request, pageHints) {
|
|
|
2657
2999
|
return state;
|
|
2658
3000
|
}
|
|
2659
3001
|
|
|
2660
|
-
|
|
2661
|
-
//#region src/signals/pagination-links.ts
|
|
3002
|
+
// src/signals/pagination-links.ts
|
|
2662
3003
|
const PaginationLinksCache = /* @__PURE__ */ new WeakMap();
|
|
2663
3004
|
/**
|
|
2664
3005
|
* A single numbered link, e.g. page `3`. Loads its page and makes it active when
|
|
@@ -2678,6 +3019,8 @@ const PaginationLinksCache = /* @__PURE__ */ new WeakMap();
|
|
|
2678
3019
|
* </EachLink>
|
|
2679
3020
|
* ```
|
|
2680
3021
|
*
|
|
3022
|
+
* @summary Experimental: a numbered page link with its page number, whether it is current, its distance from the
|
|
3023
|
+
* active page, and `setActive` to load and show that page.
|
|
2681
3024
|
* @since 5.9.0
|
|
2682
3025
|
* @public
|
|
2683
3026
|
* @hideconstructor
|
|
@@ -2727,6 +3070,8 @@ var RealPaginationLink = class {
|
|
|
2727
3070
|
* </EachLink>
|
|
2728
3071
|
* ```
|
|
2729
3072
|
*
|
|
3073
|
+
* @summary Experimental: a non-navigable gap marker in numbered pagination links, standing in for a range of
|
|
3074
|
+
* not-yet-loaded pages, usually shown as an ellipsis.
|
|
2730
3075
|
* @since 5.9.0
|
|
2731
3076
|
* @public
|
|
2732
3077
|
* @hideconstructor
|
|
@@ -2779,6 +3124,8 @@ var PlaceholderPaginationLink = class {
|
|
|
2779
3124
|
* </EachLink>
|
|
2780
3125
|
* ```
|
|
2781
3126
|
*
|
|
3127
|
+
* @summary Experimental: a `first`, `prev`, `next`, or `last` link relative to the active page, with `setActive`
|
|
3128
|
+
* to load it, and the only kind of link cursor-based pagination has.
|
|
2782
3129
|
* @since 5.9.0
|
|
2783
3130
|
* @public
|
|
2784
3131
|
* @hideconstructor
|
|
@@ -2830,6 +3177,9 @@ var RelationalPaginationLink = class {
|
|
|
2830
3177
|
* }
|
|
2831
3178
|
* }
|
|
2832
3179
|
* ```
|
|
3180
|
+
*
|
|
3181
|
+
* @summary Experimental: an entry in the numbered pagination links list, either a navigable numbered link or a
|
|
3182
|
+
* placeholder for a gap, told apart by `isReal`.
|
|
2833
3183
|
*/
|
|
2834
3184
|
/**
|
|
2835
3185
|
* The reactive set of navigation links derived from a {@link PaginationState}.
|
|
@@ -2859,6 +3209,8 @@ var RelationalPaginationLink = class {
|
|
|
2859
3209
|
* - {@link PlaceholderPaginationLink}
|
|
2860
3210
|
* - {@link RelationalPaginationLink}
|
|
2861
3211
|
*
|
|
3212
|
+
* @summary Experimental: the reactive navigation links for a pagination state, with numbered links and gap
|
|
3213
|
+
* placeholders plus `first`, `prev`, `next`, and `last` links for the active page.
|
|
2862
3214
|
* @since 5.9.0
|
|
2863
3215
|
* @public
|
|
2864
3216
|
* @hideconstructor
|
|
@@ -2970,6 +3322,8 @@ var PaginationLinks = class {
|
|
|
2970
3322
|
* }
|
|
2971
3323
|
* ```
|
|
2972
3324
|
*
|
|
3325
|
+
* @summary Experimental: returns the navigation links for a paged pagination state, creating them on first call and
|
|
3326
|
+
* returning the same instance for the same state.
|
|
2973
3327
|
* @since 5.9.0
|
|
2974
3328
|
* @public
|
|
2975
3329
|
*/
|
|
@@ -2982,34 +3336,50 @@ function getPaginationLinks(state) {
|
|
|
2982
3336
|
return links;
|
|
2983
3337
|
}
|
|
2984
3338
|
|
|
2985
|
-
|
|
2986
|
-
//#region src/signals/pagination-subscription.ts
|
|
3339
|
+
// src/signals/pagination-subscription.ts
|
|
2987
3340
|
/**
|
|
2988
3341
|
* The content features available in both pagination modes: the state and
|
|
2989
3342
|
* controls of the initial request.
|
|
3343
|
+
*
|
|
3344
|
+
* @summary Experimental: the request status flags and controls, like `isRefreshing`, `refresh`, and `reload`,
|
|
3345
|
+
* that `<Paginate />` yields to its content block in both modes.
|
|
2990
3346
|
*/
|
|
2991
3347
|
/**
|
|
2992
3348
|
* The content features yielded in `'paged'` mode: navigation happens by
|
|
2993
3349
|
* loading a specific page.
|
|
3350
|
+
*
|
|
3351
|
+
* @summary Experimental: the request controls `<Paginate />` yields to its content block in paged mode, adding
|
|
3352
|
+
* `loadPage` to navigate to a page by URL.
|
|
2994
3353
|
*/
|
|
2995
3354
|
/**
|
|
2996
3355
|
* The content features yielded in `'infinite'` mode: navigation happens by
|
|
2997
3356
|
* extending the loaded run at either end.
|
|
3357
|
+
*
|
|
3358
|
+
* @summary Experimental: the request controls `<Paginate />` yields to its content block in infinite mode, adding
|
|
3359
|
+
* `loadNext` and `loadPrev` to extend the loaded pages.
|
|
2998
3360
|
*/
|
|
2999
3361
|
/**
|
|
3000
3362
|
* The full set of content features a {@link PaginationSubscription} builds —
|
|
3001
3363
|
* both modes' surfaces. The `<Paginate />` component narrows this to one mode
|
|
3002
3364
|
* via {@link PaginationContentFeaturesFor} before yielding.
|
|
3365
|
+
*
|
|
3366
|
+
* @summary Experimental: the combined paged and infinite content features a pagination subscription builds, before
|
|
3367
|
+
* `<Paginate />` narrows them to one mode.
|
|
3003
3368
|
*/
|
|
3004
3369
|
/**
|
|
3005
3370
|
* Resolves a {@link PaginateMode} to the content features it exposes. Mirror of
|
|
3006
3371
|
* {@link PaginationStateFor}.
|
|
3372
|
+
*
|
|
3373
|
+
* @summary Experimental: resolves a pagination mode to the content features `<Paginate />` yields, the infinite
|
|
3374
|
+
* set for `'infinite'` and the paged set otherwise.
|
|
3007
3375
|
*/
|
|
3008
3376
|
/**
|
|
3009
3377
|
* Lifecycle glue for the `<Paginate />` component. Owns the initial
|
|
3010
3378
|
* {@link RequestSubscription} (loading/error state, autorefresh, disposal) and
|
|
3011
3379
|
* the per-component {@link PaginationState} that it hands to the component.
|
|
3012
3380
|
*
|
|
3381
|
+
* @summary Experimental: the lifecycle core of `<Paginate />`, owning the initial request subscription and the
|
|
3382
|
+
* component's pagination state.
|
|
3013
3383
|
* @since 5.9.0
|
|
3014
3384
|
* @public
|
|
3015
3385
|
* @hideconstructor
|
|
@@ -3271,6 +3641,8 @@ defineSignal(PaginationSubscription.prototype, "_navRequest", null);
|
|
|
3271
3641
|
* subscription[DISPOSE](); // tear down when the owning component unmounts
|
|
3272
3642
|
* ```
|
|
3273
3643
|
*
|
|
3644
|
+
* @summary Experimental: creates the subscription that manages a `<Paginate />` component's initial request
|
|
3645
|
+
* lifecycle and pagination state, for managing that lifecycle yourself.
|
|
3274
3646
|
* @since 5.9.0
|
|
3275
3647
|
* @public
|
|
3276
3648
|
*/
|
|
@@ -3286,8 +3658,7 @@ function _DISPOSE$1() {
|
|
|
3286
3658
|
self._requestSubscription?.[DISPOSE]?.();
|
|
3287
3659
|
}
|
|
3288
3660
|
|
|
3289
|
-
|
|
3290
|
-
//#region src/signals/pagination-links-subscription.ts
|
|
3661
|
+
// src/signals/pagination-links-subscription.ts
|
|
3291
3662
|
/**
|
|
3292
3663
|
* The framework-agnostic core of a pagination links component (for example the
|
|
3293
3664
|
* `<EachLink />` component of `@warp-drive-mirror/ember`): it owns the component
|
|
@@ -3302,6 +3673,8 @@ function _DISPOSE$1() {
|
|
|
3302
3673
|
* `<Paginate />` component, so they stay in sync as pages load and the active
|
|
3303
3674
|
* page changes.
|
|
3304
3675
|
*
|
|
3676
|
+
* @summary Experimental: the framework-agnostic lifecycle core of a pagination links component such as
|
|
3677
|
+
* `<EachLink />`, exposing the navigation links for a paged pagination state.
|
|
3305
3678
|
* @since 5.9.0
|
|
3306
3679
|
* @public
|
|
3307
3680
|
* @hideconstructor
|
|
@@ -3343,6 +3716,8 @@ var PaginationLinksSubscription = class {
|
|
|
3343
3716
|
* subscription[DISPOSE](); // tear down when the owning component unmounts
|
|
3344
3717
|
* ```
|
|
3345
3718
|
*
|
|
3719
|
+
* @summary Experimental: creates the subscription a pagination links component such as `<EachLink />` uses to
|
|
3720
|
+
* derive navigation links from a paged pagination state.
|
|
3346
3721
|
* @since 5.9.0
|
|
3347
3722
|
* @public
|
|
3348
3723
|
*/
|
|
@@ -3357,25 +3732,30 @@ function _DISPOSE() {
|
|
|
3357
3732
|
self.isDestroyed = true;
|
|
3358
3733
|
}
|
|
3359
3734
|
|
|
3360
|
-
|
|
3361
|
-
//#region src/signals/promise-state.ts
|
|
3735
|
+
// src/signals/promise-state.ts
|
|
3362
3736
|
const PromiseCache = /* @__PURE__ */ new WeakMap();
|
|
3363
3737
|
/**
|
|
3364
3738
|
* The state of a promise in the "pending"
|
|
3365
3739
|
* state. This is the default initial state.
|
|
3366
3740
|
*
|
|
3741
|
+
* @summary The `getPromiseState` state for a promise that has not yet settled, with `isPending` true and
|
|
3742
|
+
* no value or reason.
|
|
3367
3743
|
*/
|
|
3368
3744
|
/**
|
|
3369
3745
|
* The state of a promise in the "fulfilled" state.
|
|
3370
3746
|
* This is the state of a promise that has resolved
|
|
3371
3747
|
* successfully.
|
|
3372
3748
|
*
|
|
3749
|
+
* @summary The `getPromiseState` state for a promise that resolved, with `isSuccess` true and the
|
|
3750
|
+
* resolved `value`.
|
|
3373
3751
|
*/
|
|
3374
3752
|
/**
|
|
3375
3753
|
* The state of a promise in the "rejected" state.
|
|
3376
3754
|
* This is the state of a promise that has rejected
|
|
3377
3755
|
* with an error.
|
|
3378
3756
|
*
|
|
3757
|
+
* @summary The `getPromiseState` state for a promise that rejected, with `isError` true and the
|
|
3758
|
+
* rejection `reason`.
|
|
3379
3759
|
*/
|
|
3380
3760
|
/**
|
|
3381
3761
|
* The state of a promise. This is the type that is returned
|
|
@@ -3386,6 +3766,8 @@ const PromiseCache = /* @__PURE__ */ new WeakMap();
|
|
|
3386
3766
|
* - {@link ResolvedPromise}
|
|
3387
3767
|
* - {@link RejectedPromise}
|
|
3388
3768
|
*
|
|
3769
|
+
* @summary The reactive pending, fulfilled, or rejected state of a promise, as returned by
|
|
3770
|
+
* `getPromiseState`.
|
|
3389
3771
|
*/
|
|
3390
3772
|
const PromiseStateProto = {};
|
|
3391
3773
|
defineSignal(PromiseStateProto, "reason", null);
|
|
@@ -3451,6 +3833,9 @@ function getPromise(promise) {
|
|
|
3451
3833
|
/**
|
|
3452
3834
|
* Returns a reactive state-machine for the provided promise or awaitable.
|
|
3453
3835
|
*
|
|
3836
|
+
* The [Async as Reactive State](/guides/the-manual/reactivity/derivation) guide shows
|
|
3837
|
+
* how to use it in place of tracked loading and error state.
|
|
3838
|
+
*
|
|
3454
3839
|
* Repeat calls to `getPromiseState` with the same promise will return the same state object
|
|
3455
3840
|
* making is safe and easy to use in templates and JavaScript code to produce reactive
|
|
3456
3841
|
* behaviors around promises.
|
|
@@ -3500,6 +3885,9 @@ function getPromise(promise) {
|
|
|
3500
3885
|
* If looking to use in a template, consider also the `<Await />` component.
|
|
3501
3886
|
*
|
|
3502
3887
|
* See also {@link PromiseState}
|
|
3888
|
+
*
|
|
3889
|
+
* @summary Returns a cached, reactive state object tracking whether a promise is pending, fulfilled, or
|
|
3890
|
+
* rejected, for use in JS or templates.
|
|
3503
3891
|
*/
|
|
3504
3892
|
function getPromiseState(promise) {
|
|
3505
3893
|
((test) => {
|
|
@@ -3514,6 +3902,5 @@ function getPromiseState(promise) {
|
|
|
3514
3902
|
return state;
|
|
3515
3903
|
}
|
|
3516
3904
|
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
//# sourceMappingURL=-private-CM5N2rtZ.js.map
|
|
3905
|
+
export { ARRAY_SIGNAL as A, createInternalMemo as C, notifyInternalSignal as D, makeInitializer as E, willSyncFlushWatchers as F, registerSignals as M, setupSignals as N, peekInternalSignal as O, waitFor as P, consumeInternalSignal as S, getOrCreateInternalSignal as T, entangleSignal as _, getPaginationState as a, signal as b, getPaginationCache as c, getRequestState as d, createSignalDescriptor as f, entangleInitiallyStaleSignal as g, defineSignal as h, getPaginationLinks as i, OBJECT_SIGNAL as j, withSignalStore as k, DISPOSE as l, defineNonEnumerableSignal as m, createPaginationLinksSubscription as n, clearPaginationCache as o, defineGate as p, createPaginationSubscription as r, defaultPageHints as s, getPromiseState as t, createRequestSubscription as u, gate as v, createInternalSignal as w, Signals as x, memoized as y };
|
|
3906
|
+
//# sourceMappingURL=-private-B4pCmkq-.js.map
|