@graphrefly/graphrefly 0.27.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backoff-HPZMEZNF.js +1 -0
- package/dist/cascading-Bp99ckMJ.d.ts +180 -0
- package/dist/cascading-CcAgRacD.d.cts +180 -0
- package/dist/chunk-22F4K3G7.js +1 -0
- package/dist/chunk-22SVXUPB.js +64 -0
- package/dist/chunk-2GQREQ6C.js +1 -0
- package/dist/chunk-3JXNEPCD.js +2 -0
- package/dist/chunk-4JJCCD5S.js +2 -0
- package/dist/chunk-4OFIQ66T.js +1 -0
- package/dist/chunk-4V4C7K56.js +1 -0
- package/dist/chunk-4VVTGLXJ.js +1 -0
- package/dist/chunk-567NWZ3T.js +1 -0
- package/dist/chunk-5JDE5JHE.js +1 -0
- package/dist/chunk-5QDBSZBV.js +1 -0
- package/dist/chunk-5Z4HDCO6.js +1 -0
- package/dist/chunk-63FFOHLA.js +1 -0
- package/dist/chunk-6QZNQS5B.js +1 -0
- package/dist/chunk-7JDLFI6N.js +1 -0
- package/dist/chunk-7TDOES3L.js +1 -0
- package/dist/chunk-A7IAQQ63.js +1 -0
- package/dist/chunk-AMG5VBHW.js +1 -0
- package/dist/chunk-AUY2YKCO.js +1 -0
- package/dist/chunk-AV3PIDFQ.js +1 -0
- package/dist/chunk-BA5URFYW.js +1 -0
- package/dist/chunk-BKPLTBL5.js +1 -0
- package/dist/chunk-BZP5T4X6.js +1 -0
- package/dist/chunk-CK2E7BTU.js +1 -0
- package/dist/chunk-CSJE2EKV.js +1 -0
- package/dist/chunk-E3AXATVZ.js +9 -0
- package/dist/chunk-ESMPEKEV.js +1 -0
- package/dist/chunk-GJR3P6JG.js +1 -0
- package/dist/chunk-GNCBXARM.js +1 -0
- package/dist/chunk-GPW2V3RE.js +1 -0
- package/dist/chunk-HSIEYSDY.js +1 -0
- package/dist/chunk-I6VIH3VA.js +1 -0
- package/dist/chunk-ISCENNXS.js +1 -0
- package/dist/chunk-JYOUF6UQ.js +1 -0
- package/dist/chunk-KASHOCF5.js +1 -0
- package/dist/chunk-LGSNR4LU.js +5 -0
- package/dist/chunk-LVGBLZM2.js +1 -0
- package/dist/chunk-MGKAO4EK.js +7 -0
- package/dist/chunk-NSG4C6BF.js +23 -0
- package/dist/chunk-OL33ZI6R.js +1 -0
- package/dist/chunk-PCZ35NXD.js +78 -0
- package/dist/chunk-PGMUCUHG.js +43 -0
- package/dist/chunk-QYADASLV.js +1 -0
- package/dist/chunk-RD52SNH2.js +1 -0
- package/dist/chunk-SLMYTGTU.js +1 -0
- package/dist/chunk-TWMEGG45.js +1 -0
- package/dist/chunk-UVJQ35G2.js +1 -0
- package/dist/chunk-VGTCGNRX.js +18 -0
- package/dist/chunk-VIMF6LGM.js +1 -0
- package/dist/chunk-VJLMUKOI.js +1 -0
- package/dist/chunk-VWPRPPKR.js +1 -0
- package/dist/chunk-W4TSQ6RJ.js +1 -0
- package/dist/chunk-WM7H7WTY.js +3 -0
- package/dist/chunk-Y32RJO24.js +1 -0
- package/dist/chunk-Y53B6NS4.js +1 -0
- package/dist/compat/index.cjs +15 -7656
- package/dist/compat/index.d.cts +15 -14
- package/dist/compat/index.d.ts +15 -14
- package/dist/compat/index.js +1 -50
- package/dist/compat/jotai/index.cjs +1 -2048
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/jotai/index.js +1 -9
- package/dist/compat/nanostores/index.cjs +1 -2175
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nanostores/index.js +1 -23
- package/dist/compat/nestjs/index.cjs +15 -6782
- package/dist/compat/nestjs/index.d.cts +7 -6
- package/dist/compat/nestjs/index.d.ts +7 -6
- package/dist/compat/nestjs/index.js +1 -83
- package/dist/compat/react/index.cjs +1 -141
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/react/index.js +1 -12
- package/dist/compat/solid/index.cjs +1 -128
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/solid/index.js +1 -12
- package/dist/compat/svelte/index.cjs +1 -131
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/svelte/index.js +1 -12
- package/dist/compat/vue/index.cjs +1 -146
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/vue/index.js +1 -12
- package/dist/compat/zustand/index.cjs +7 -4931
- package/dist/compat/zustand/index.d.cts +5 -5
- package/dist/compat/zustand/index.d.ts +5 -5
- package/dist/compat/zustand/index.js +1 -12
- package/dist/composite-BL-llbnE.d.ts +69 -0
- package/dist/composite-Dze--DaA.d.cts +69 -0
- package/dist/core/index.cjs +1 -2271
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +1 -110
- package/dist/extra/browser.cjs +1 -0
- package/dist/extra/browser.d.cts +3 -0
- package/dist/extra/browser.d.ts +3 -0
- package/dist/extra/browser.js +1 -0
- package/dist/extra/index.cjs +24 -9971
- package/dist/extra/index.d.cts +13 -6
- package/dist/extra/index.d.ts +13 -6
- package/dist/extra/index.js +1 -381
- package/dist/extra/node.cjs +3 -0
- package/dist/extra/node.d.cts +81 -0
- package/dist/extra/node.d.ts +81 -0
- package/dist/extra/node.js +2 -0
- package/dist/extra/operators.cjs +1 -0
- package/dist/extra/operators.d.cts +910 -0
- package/dist/extra/operators.d.ts +910 -0
- package/dist/extra/operators.js +1 -0
- package/dist/extra/reactive.cjs +1 -0
- package/dist/extra/reactive.d.cts +352 -0
- package/dist/extra/reactive.d.ts +352 -0
- package/dist/extra/reactive.js +1 -0
- package/dist/extra/sources.cjs +1 -2486
- package/dist/extra/sources.d.cts +6 -2
- package/dist/extra/sources.d.ts +6 -2
- package/dist/extra/sources.js +1 -57
- package/dist/extra/storage-browser.cjs +1 -0
- package/dist/extra/storage-browser.d.cts +71 -0
- package/dist/extra/storage-browser.d.ts +71 -0
- package/dist/extra/storage-browser.js +1 -0
- package/dist/extra/storage-core.cjs +1 -0
- package/dist/extra/storage-core.d.cts +98 -0
- package/dist/extra/storage-core.d.ts +98 -0
- package/dist/extra/storage-core.js +1 -0
- package/dist/extra/storage-node.cjs +2 -0
- package/dist/extra/storage-node.d.cts +60 -0
- package/dist/extra/storage-node.d.ts +60 -0
- package/dist/extra/storage-node.js +1 -0
- package/dist/fallback-BaTS7vVY.d.cts +258 -0
- package/dist/fallback-eOm3LNxP.d.ts +258 -0
- package/dist/graph/index.cjs +7 -5030
- package/dist/graph/index.d.cts +6 -5
- package/dist/graph/index.d.ts +6 -5
- package/dist/graph/index.js +1 -50
- package/dist/{graph-DNCrvZSn.d.cts → graph-DgohqXK-.d.cts} +151 -32
- package/dist/{graph-CCwGKLCm.d.ts → graph-Qjg9gWHI.d.ts} +151 -32
- package/dist/{index-BwfLUNw4.d.ts → index-2BVuRCI4.d.ts} +173 -2040
- package/dist/{index-BPVt8kqc.d.ts → index-2NvguqQA.d.ts} +10 -195
- package/dist/index-A65LZhoM.d.ts +186 -0
- package/dist/{index-DlLp-2Xn.d.cts → index-B-8FCEua.d.cts} +10 -195
- package/dist/index-B-gqvYel.d.ts +135 -0
- package/dist/index-B2PRuolf.d.cts +86 -0
- package/dist/index-BJqt9EwW.d.ts +231 -0
- package/dist/{index-BHlKbUwO.d.cts → index-BKjT5DiZ.d.cts} +173 -2040
- package/dist/{index-C0svESO4.d.ts → index-BM8BU4q6.d.ts} +1 -1
- package/dist/{index-VdHQMPy1.d.ts → index-BQaEnxBf.d.ts} +1 -1
- package/dist/index-BSfwiy5B.d.ts +192 -0
- package/dist/index-BTSkeCZs.d.cts +291 -0
- package/dist/index-BUVtw1Ay.d.cts +186 -0
- package/dist/index-BUi57v_p.d.ts +163 -0
- package/dist/{messaging-Gt4LPbyA.d.cts → index-BanNUILp.d.cts} +31 -93
- package/dist/{audit-DRlSzBu9.d.ts → index-BayHDRx6.d.cts} +27 -21
- package/dist/{index-B6D3QNSA.d.ts → index-BiyjsZ0m.d.ts} +148 -20
- package/dist/index-BqZ6vB2A.d.ts +2057 -0
- package/dist/{memory-li6FL5RM.d.ts → index-BuVidq3D.d.cts} +26 -26
- package/dist/index-Byh-xTyp.d.ts +105 -0
- package/dist/index-C08QPDcV.d.cts +321 -0
- package/dist/{demo-shell-BDkOptd6.d.ts → index-C66RJiX8.d.ts} +14 -14
- package/dist/index-C8RfjffH.d.ts +291 -0
- package/dist/index-CA1Cu7Ud.d.ts +873 -0
- package/dist/{index-ByQxazQJ.d.cts → index-CABbltIu.d.cts} +1 -1
- package/dist/{index-VHqptjhu.d.cts → index-CHEBsnYv.d.cts} +1 -1
- package/dist/{index-BuEoe-Qu.d.ts → index-CI0yDnLp.d.ts} +9 -9
- package/dist/{index-B9B7_HEY.d.ts → index-CJ45TW-h.d.ts} +1 -1
- package/dist/{index-CO8uBlUh.d.cts → index-CJZKZoo4.d.cts} +148 -20
- package/dist/{index-wEn0eFe8.d.ts → index-CX2tFJL1.d.ts} +1 -1
- package/dist/{index-BaSM3aYt.d.ts → index-CcWOJ6F0.d.ts} +3 -3
- package/dist/{audit-ClmqGOCx.d.cts → index-CiaVoZGo.d.ts} +27 -21
- package/dist/{index-Dzk2hrlR.d.ts → index-Ct5CWc4E.d.ts} +1 -1
- package/dist/index-D38duMCv.d.cts +357 -0
- package/dist/{index-C8oil6M6.d.ts → index-D5XJ2tSx.d.ts} +30 -6
- package/dist/{index-DO_6JN9Z.d.cts → index-D80do5jX.d.cts} +1 -1
- package/dist/index-D9HKAH_-.d.cts +231 -0
- package/dist/index-DBe_8XW5.d.cts +143 -0
- package/dist/{memory-C6Z2tGpC.d.cts → index-DCeTyFlB.d.ts} +26 -26
- package/dist/index-DDy8eeXS.d.ts +321 -0
- package/dist/index-DJ5oNBc8.d.ts +143 -0
- package/dist/{index-CI3DprxP.d.cts → index-DP0_O3ls.d.cts} +30 -6
- package/dist/{demo-shell-Crid1WdR.d.cts → index-DX8xS-yB.d.cts} +14 -14
- package/dist/index-DiZejfCI.d.cts +2057 -0
- package/dist/index-DknyJ2Fu.d.cts +163 -0
- package/dist/index-DoWMs-Kk.d.cts +135 -0
- package/dist/{messaging-XDoYablx.d.ts → index-DuB5aO4-.d.ts} +31 -93
- package/dist/index-DwjJGKxV.d.ts +357 -0
- package/dist/{index-B6EhDnjH.d.cts → index-H_oxVec5.d.cts} +1 -1
- package/dist/{index-3lsddbbS.d.ts → index-IMAHq-ia.d.ts} +1 -1
- package/dist/{index-B1tloyhO.d.cts → index-U1nir7MX.d.cts} +1 -1
- package/dist/index-Vg7tORgk.d.ts +86 -0
- package/dist/index-dig-r2tQ.d.cts +873 -0
- package/dist/{index-CxFrXH4m.d.ts → index-gsT79Xu9.d.ts} +1 -1
- package/dist/{index-D8wS_PeY.d.cts → index-i99Ka8s7.d.cts} +9 -9
- package/dist/index-iKkyJosF.d.cts +105 -0
- package/dist/{index-Xi3u0HCQ.d.cts → index-jleeotBT.d.cts} +1 -1
- package/dist/{index-DVGiGFGT.d.cts → index-kykKWwV-.d.cts} +3 -3
- package/dist/index-vgcLF5TH.d.cts +192 -0
- package/dist/{index-DYme44FM.d.cts → index-y1RllPn4.d.cts} +1 -1
- package/dist/index.cjs +151 -24142
- package/dist/index.d.cts +69 -2099
- package/dist/index.d.ts +69 -2099
- package/dist/index.js +1 -3868
- package/dist/{meta-CbznRPYJ.d.ts → meta-CX7YsOzp.d.cts} +5 -5
- package/dist/{meta-BxCA7rcr.d.cts → meta-CckhhFRd.d.ts} +5 -5
- package/dist/{node-BmerH3kS.d.cts → node-Dd6wHSib.d.cts} +71 -11
- package/dist/{node-BmerH3kS.d.ts → node-Dd6wHSib.d.ts} +71 -11
- package/dist/{observable-BgGUwcqp.d.ts → observable-BZJgo616.d.ts} +1 -1
- package/dist/{observable-DJt_AxzQ.d.cts → observable-kwzpLvbi.d.cts} +1 -1
- package/dist/patterns/ai/browser.cjs +25 -0
- package/dist/patterns/ai/browser.d.cts +127 -0
- package/dist/patterns/ai/browser.d.ts +127 -0
- package/dist/patterns/ai/browser.js +3 -0
- package/dist/patterns/ai/index.cjs +92 -0
- package/dist/patterns/ai/index.d.cts +17 -0
- package/dist/patterns/ai/index.d.ts +17 -0
- package/dist/patterns/ai/index.js +1 -0
- package/dist/patterns/ai/node.cjs +2 -0
- package/dist/patterns/ai/node.d.cts +58 -0
- package/dist/patterns/ai/node.d.ts +58 -0
- package/dist/patterns/ai/node.js +1 -0
- package/dist/patterns/audit/index.cjs +7 -0
- package/dist/patterns/audit/index.d.cts +6 -0
- package/dist/patterns/audit/index.d.ts +6 -0
- package/dist/patterns/audit/index.js +1 -0
- package/dist/patterns/cqrs/index.cjs +7 -0
- package/dist/patterns/cqrs/index.d.cts +5 -0
- package/dist/patterns/cqrs/index.d.ts +5 -0
- package/dist/patterns/cqrs/index.js +1 -0
- package/dist/patterns/demo-shell/index.cjs +8 -0
- package/dist/patterns/demo-shell/index.d.cts +6 -0
- package/dist/patterns/demo-shell/index.d.ts +6 -0
- package/dist/patterns/demo-shell/index.js +1 -0
- package/dist/patterns/domain-templates/index.cjs +7 -0
- package/dist/patterns/domain-templates/index.d.cts +5 -0
- package/dist/patterns/domain-templates/index.d.ts +5 -0
- package/dist/patterns/domain-templates/index.js +1 -0
- package/dist/patterns/graphspec/index.cjs +84 -0
- package/dist/patterns/graphspec/index.d.cts +7 -0
- package/dist/patterns/graphspec/index.d.ts +7 -0
- package/dist/patterns/graphspec/index.js +1 -0
- package/dist/patterns/guarded-execution/index.cjs +7 -0
- package/dist/patterns/guarded-execution/index.d.cts +7 -0
- package/dist/patterns/guarded-execution/index.d.ts +7 -0
- package/dist/patterns/guarded-execution/index.js +1 -0
- package/dist/patterns/harness/index.cjs +49 -0
- package/dist/patterns/harness/index.d.cts +11 -0
- package/dist/patterns/harness/index.d.ts +11 -0
- package/dist/patterns/harness/index.js +1 -0
- package/dist/patterns/job-queue/index.cjs +7 -0
- package/dist/patterns/job-queue/index.d.cts +5 -0
- package/dist/patterns/job-queue/index.d.ts +5 -0
- package/dist/patterns/job-queue/index.js +1 -0
- package/dist/patterns/lens/index.cjs +7 -0
- package/dist/patterns/lens/index.d.cts +7 -0
- package/dist/patterns/lens/index.d.ts +7 -0
- package/dist/patterns/lens/index.js +1 -0
- package/dist/patterns/memory/index.cjs +7 -0
- package/dist/patterns/memory/index.d.cts +5 -0
- package/dist/patterns/memory/index.d.ts +5 -0
- package/dist/patterns/memory/index.js +1 -0
- package/dist/patterns/messaging/index.cjs +7 -0
- package/dist/patterns/messaging/index.d.cts +5 -0
- package/dist/patterns/messaging/index.d.ts +5 -0
- package/dist/patterns/messaging/index.js +1 -0
- package/dist/patterns/orchestration/index.cjs +7 -0
- package/dist/patterns/orchestration/index.d.cts +6 -0
- package/dist/patterns/orchestration/index.d.ts +6 -0
- package/dist/patterns/orchestration/index.js +1 -0
- package/dist/patterns/reactive-layout/index.cjs +8 -6444
- package/dist/patterns/reactive-layout/index.d.cts +6 -6
- package/dist/patterns/reactive-layout/index.d.ts +6 -6
- package/dist/patterns/reactive-layout/index.js +1 -56
- package/dist/patterns/reduction/index.cjs +7 -0
- package/dist/patterns/reduction/index.d.cts +5 -0
- package/dist/patterns/reduction/index.d.ts +5 -0
- package/dist/patterns/reduction/index.js +1 -0
- package/dist/patterns/refine-loop/index.cjs +9 -0
- package/dist/patterns/refine-loop/index.d.cts +7 -0
- package/dist/patterns/refine-loop/index.d.ts +7 -0
- package/dist/patterns/refine-loop/index.js +1 -0
- package/dist/patterns/resilient-pipeline/index.cjs +1 -0
- package/dist/patterns/resilient-pipeline/index.d.cts +7 -0
- package/dist/patterns/resilient-pipeline/index.d.ts +7 -0
- package/dist/patterns/resilient-pipeline/index.js +1 -0
- package/dist/patterns/surface/index.cjs +15 -0
- package/dist/patterns/surface/index.d.cts +8 -0
- package/dist/patterns/surface/index.d.ts +8 -0
- package/dist/patterns/surface/index.js +1 -0
- package/dist/{reactive-layout-u5Ulnqag.d.ts → reactive-layout-BkBwVvwm.d.ts} +2 -2
- package/dist/{reactive-layout-MQP--J3F.d.cts → reactive-layout-PiFwVaWS.d.cts} +2 -2
- package/dist/reactive-log-1QTyx10a.d.ts +190 -0
- package/dist/reactive-log-BiVoSxke.d.cts +190 -0
- package/dist/{composite-aUCvjZVR.d.ts → reactive-map-CwO_COHy.d.cts} +2 -67
- package/dist/{composite-C7PcQvcs.d.cts → reactive-map-FeuTVAJb.d.ts} +2 -67
- package/dist/resilience-CBfYJW5C.d.ts +493 -0
- package/dist/resilience-XRUF267O.js +1 -0
- package/dist/resilience-uBz4yvYB.d.cts +493 -0
- package/dist/{sugar-CCOxXK1e.d.ts → sugar-CY-MCfZ9.d.ts} +17 -15
- package/dist/{sugar-D02n5JjF.d.cts → sugar-DHttV0LX.d.cts} +17 -15
- package/dist/topology-tree-CVjt2gp7.d.cts +25 -0
- package/dist/topology-tree-one6oSKY.d.ts +25 -0
- package/dist/types-O3GzJY2U.d.cts +401 -0
- package/dist/types-u64Ose53.d.ts +401 -0
- package/package.json +252 -22
- package/dist/ai-CaR_912Q.d.cts +0 -1033
- package/dist/ai-WlRltJV7.d.ts +0 -1033
- package/dist/chunk-3ZWCKRHX.js +0 -117
- package/dist/chunk-3ZWCKRHX.js.map +0 -1
- package/dist/chunk-7TAQJHQV.js +0 -103
- package/dist/chunk-7TAQJHQV.js.map +0 -1
- package/dist/chunk-APFNLIRG.js +0 -62
- package/dist/chunk-APFNLIRG.js.map +0 -1
- package/dist/chunk-AT5LKYNL.js +0 -395
- package/dist/chunk-AT5LKYNL.js.map +0 -1
- package/dist/chunk-BQ6RQQFF.js +0 -5087
- package/dist/chunk-BQ6RQQFF.js.map +0 -1
- package/dist/chunk-BVZYTZ5H.js +0 -599
- package/dist/chunk-BVZYTZ5H.js.map +0 -1
- package/dist/chunk-DST5DKZS.js +0 -1371
- package/dist/chunk-DST5DKZS.js.map +0 -1
- package/dist/chunk-GTE6PWRZ.js +0 -866
- package/dist/chunk-GTE6PWRZ.js.map +0 -1
- package/dist/chunk-HXZEYDUR.js +0 -94
- package/dist/chunk-HXZEYDUR.js.map +0 -1
- package/dist/chunk-J22W6HV3.js +0 -107
- package/dist/chunk-J22W6HV3.js.map +0 -1
- package/dist/chunk-J2VBW3DZ.js +0 -302
- package/dist/chunk-J2VBW3DZ.js.map +0 -1
- package/dist/chunk-JSCT3CR4.js +0 -38
- package/dist/chunk-JSCT3CR4.js.map +0 -1
- package/dist/chunk-JWBCY4NC.js +0 -330
- package/dist/chunk-JWBCY4NC.js.map +0 -1
- package/dist/chunk-K2AUJHVP.js +0 -2251
- package/dist/chunk-K2AUJHVP.js.map +0 -1
- package/dist/chunk-MJ2NKQQL.js +0 -119
- package/dist/chunk-MJ2NKQQL.js.map +0 -1
- package/dist/chunk-N6UR7YVY.js +0 -198
- package/dist/chunk-N6UR7YVY.js.map +0 -1
- package/dist/chunk-NC6S43JJ.js +0 -456
- package/dist/chunk-NC6S43JJ.js.map +0 -1
- package/dist/chunk-OFVJBJXR.js +0 -98
- package/dist/chunk-OFVJBJXR.js.map +0 -1
- package/dist/chunk-OHISZPOJ.js +0 -97
- package/dist/chunk-OHISZPOJ.js.map +0 -1
- package/dist/chunk-OU5CQKNW.js +0 -102
- package/dist/chunk-OU5CQKNW.js.map +0 -1
- package/dist/chunk-PF7GRZMW.js +0 -2712
- package/dist/chunk-PF7GRZMW.js.map +0 -1
- package/dist/chunk-PHOUUNK7.js +0 -2291
- package/dist/chunk-PHOUUNK7.js.map +0 -1
- package/dist/chunk-RNHBMHKA.js +0 -1665
- package/dist/chunk-RNHBMHKA.js.map +0 -1
- package/dist/chunk-SX52TAR4.js +0 -110
- package/dist/chunk-SX52TAR4.js.map +0 -1
- package/dist/chunk-VYPWMZ6H.js +0 -98
- package/dist/chunk-VYPWMZ6H.js.map +0 -1
- package/dist/chunk-WBZOVTYK.js +0 -171
- package/dist/chunk-WBZOVTYK.js.map +0 -1
- package/dist/chunk-WKNUIZOY.js +0 -354
- package/dist/chunk-WKNUIZOY.js.map +0 -1
- package/dist/chunk-X3VMZYBT.js +0 -713
- package/dist/chunk-X3VMZYBT.js.map +0 -1
- package/dist/chunk-X5R3GL6H.js +0 -525
- package/dist/chunk-X5R3GL6H.js.map +0 -1
- package/dist/chunk-XGPU467M.js +0 -136
- package/dist/chunk-XGPU467M.js.map +0 -1
- package/dist/compat/index.cjs.map +0 -1
- package/dist/compat/index.js.map +0 -1
- package/dist/compat/jotai/index.cjs.map +0 -1
- package/dist/compat/jotai/index.js.map +0 -1
- package/dist/compat/nanostores/index.cjs.map +0 -1
- package/dist/compat/nanostores/index.js.map +0 -1
- package/dist/compat/nestjs/index.cjs.map +0 -1
- package/dist/compat/nestjs/index.js.map +0 -1
- package/dist/compat/react/index.cjs.map +0 -1
- package/dist/compat/react/index.js.map +0 -1
- package/dist/compat/solid/index.cjs.map +0 -1
- package/dist/compat/solid/index.js.map +0 -1
- package/dist/compat/svelte/index.cjs.map +0 -1
- package/dist/compat/svelte/index.js.map +0 -1
- package/dist/compat/vue/index.cjs.map +0 -1
- package/dist/compat/vue/index.js.map +0 -1
- package/dist/compat/zustand/index.cjs.map +0 -1
- package/dist/compat/zustand/index.js.map +0 -1
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/extra/index.cjs.map +0 -1
- package/dist/extra/index.js.map +0 -1
- package/dist/extra/sources.cjs.map +0 -1
- package/dist/extra/sources.js.map +0 -1
- package/dist/graph/index.cjs.map +0 -1
- package/dist/graph/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/patterns/ai.cjs +0 -7930
- package/dist/patterns/ai.cjs.map +0 -1
- package/dist/patterns/ai.d.cts +0 -10
- package/dist/patterns/ai.d.ts +0 -10
- package/dist/patterns/ai.js +0 -71
- package/dist/patterns/ai.js.map +0 -1
- package/dist/patterns/audit.cjs +0 -5805
- package/dist/patterns/audit.cjs.map +0 -1
- package/dist/patterns/audit.d.cts +0 -6
- package/dist/patterns/audit.d.ts +0 -6
- package/dist/patterns/audit.js +0 -29
- package/dist/patterns/audit.js.map +0 -1
- package/dist/patterns/demo-shell.cjs +0 -5604
- package/dist/patterns/demo-shell.cjs.map +0 -1
- package/dist/patterns/demo-shell.d.cts +0 -6
- package/dist/patterns/demo-shell.d.ts +0 -6
- package/dist/patterns/demo-shell.js +0 -15
- package/dist/patterns/demo-shell.js.map +0 -1
- package/dist/patterns/memory.cjs +0 -5283
- package/dist/patterns/memory.cjs.map +0 -1
- package/dist/patterns/memory.d.cts +0 -5
- package/dist/patterns/memory.d.ts +0 -5
- package/dist/patterns/memory.js +0 -20
- package/dist/patterns/memory.js.map +0 -1
- package/dist/patterns/reactive-layout/index.cjs.map +0 -1
- package/dist/patterns/reactive-layout/index.js.map +0 -1
- package/dist/storage-CMjUUuxn.d.ts +0 -190
- package/dist/storage-DdWlZo6U.d.cts +0 -190
package/dist/chunk-X3VMZYBT.js
DELETED
|
@@ -1,713 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
analyzeAndMeasure,
|
|
3
|
-
carveTextLineSlots,
|
|
4
|
-
computeCharPositions,
|
|
5
|
-
computeLineBreaks,
|
|
6
|
-
layoutNextLine,
|
|
7
|
-
reactiveLayout
|
|
8
|
-
} from "./chunk-GTE6PWRZ.js";
|
|
9
|
-
import {
|
|
10
|
-
emitToMeta
|
|
11
|
-
} from "./chunk-JSCT3CR4.js";
|
|
12
|
-
import {
|
|
13
|
-
Graph
|
|
14
|
-
} from "./chunk-PF7GRZMW.js";
|
|
15
|
-
import {
|
|
16
|
-
derived,
|
|
17
|
-
monotonicNs,
|
|
18
|
-
node,
|
|
19
|
-
state
|
|
20
|
-
} from "./chunk-PHOUUNK7.js";
|
|
21
|
-
import {
|
|
22
|
-
__export
|
|
23
|
-
} from "./chunk-SX52TAR4.js";
|
|
24
|
-
|
|
25
|
-
// src/patterns/reactive-layout/index.ts
|
|
26
|
-
var reactive_layout_exports = {};
|
|
27
|
-
__export(reactive_layout_exports, {
|
|
28
|
-
CanvasMeasureAdapter: () => CanvasMeasureAdapter,
|
|
29
|
-
CliMeasureAdapter: () => CliMeasureAdapter,
|
|
30
|
-
ImageSizeAdapter: () => ImageSizeAdapter,
|
|
31
|
-
NodeCanvasMeasureAdapter: () => NodeCanvasMeasureAdapter,
|
|
32
|
-
PrecomputedAdapter: () => PrecomputedAdapter,
|
|
33
|
-
SvgBoundsAdapter: () => SvgBoundsAdapter,
|
|
34
|
-
analyzeAndMeasure: () => analyzeAndMeasure,
|
|
35
|
-
carveTextLineSlots: () => carveTextLineSlots,
|
|
36
|
-
circleIntervalForBand: () => circleIntervalForBand,
|
|
37
|
-
computeBlockFlow: () => computeBlockFlow,
|
|
38
|
-
computeCharPositions: () => computeCharPositions,
|
|
39
|
-
computeFlowLines: () => computeFlowLines,
|
|
40
|
-
computeLineBreaks: () => computeLineBreaks,
|
|
41
|
-
computeTotalHeight: () => computeTotalHeight,
|
|
42
|
-
layoutNextLine: () => layoutNextLine,
|
|
43
|
-
measureBlock: () => measureBlock,
|
|
44
|
-
measureBlocks: () => measureBlocks,
|
|
45
|
-
reactiveBlockLayout: () => reactiveBlockLayout,
|
|
46
|
-
reactiveFlowLayout: () => reactiveFlowLayout,
|
|
47
|
-
reactiveLayout: () => reactiveLayout,
|
|
48
|
-
rectIntervalForBand: () => rectIntervalForBand
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// src/patterns/reactive-layout/measurement-adapters.ts
|
|
52
|
-
function cellWidth(code) {
|
|
53
|
-
if (code >= 768 && code <= 879 || // Combining Diacritical Marks
|
|
54
|
-
code >= 1155 && code <= 1161 || // Cyrillic combining marks
|
|
55
|
-
code >= 1425 && code <= 1469 || // Hebrew combining marks
|
|
56
|
-
code >= 1552 && code <= 1562 || // Arabic combining marks
|
|
57
|
-
code >= 1611 && code <= 1631 || // Arabic combining marks
|
|
58
|
-
code >= 1648 && code === 1648 || // Arabic superscript alef
|
|
59
|
-
code >= 1750 && code <= 1756 || // Arabic combining marks
|
|
60
|
-
code >= 1759 && code <= 1764 || // Arabic combining marks
|
|
61
|
-
code >= 1767 && code <= 1768 || // Arabic combining marks
|
|
62
|
-
code >= 1770 && code <= 1773 || // Arabic combining marks
|
|
63
|
-
code >= 1840 && code <= 1866 || // Syriac combining marks
|
|
64
|
-
code >= 1958 && code <= 1968 || // Thaana combining marks
|
|
65
|
-
code >= 2304 && code <= 2307 || // Devanagari combining marks
|
|
66
|
-
code >= 2362 && code <= 2383 || // Devanagari combining marks
|
|
67
|
-
code >= 2385 && code <= 2391 || // Devanagari combining marks
|
|
68
|
-
code >= 2402 && code <= 2403 || // Devanagari combining marks
|
|
69
|
-
code >= 2433 && code <= 2435 || // Bengali combining marks
|
|
70
|
-
code >= 2492 && code <= 2509 || // Bengali combining marks
|
|
71
|
-
code >= 2561 && code <= 2563 || // Gurmukhi combining marks
|
|
72
|
-
code >= 2620 && code <= 2641 || // Gurmukhi combining marks
|
|
73
|
-
code >= 2672 && code <= 2673 || // Gurmukhi combining marks
|
|
74
|
-
code >= 2677 && code === 2677 || // Gurmukhi combining mark
|
|
75
|
-
code >= 3633 && code === 3633 || // Thai combining mark
|
|
76
|
-
code >= 3636 && code <= 3642 || // Thai combining marks
|
|
77
|
-
code >= 3655 && code <= 3662 || // Thai combining marks
|
|
78
|
-
code >= 3761 && code === 3761 || // Lao combining mark
|
|
79
|
-
code >= 3764 && code <= 3772 || // Lao combining marks
|
|
80
|
-
code >= 3784 && code <= 3790 || // Lao combining marks
|
|
81
|
-
code >= 7616 && code <= 7679 || // Combining Diacritical Marks Supplement
|
|
82
|
-
code >= 8400 && code <= 8447 || // Combining Diacritical Marks for Symbols
|
|
83
|
-
code >= 65024 && code <= 65039 || // Variation Selectors
|
|
84
|
-
code >= 65056 && code <= 65071 || // Combining Half Marks
|
|
85
|
-
code === 8205) {
|
|
86
|
-
return 0;
|
|
87
|
-
}
|
|
88
|
-
if (code >= 4352 && code <= 4447 || // Hangul Jamo
|
|
89
|
-
code >= 8986 && code <= 8987 || // Watch, Hourglass
|
|
90
|
-
code >= 9001 && code <= 9002 || // Angle brackets
|
|
91
|
-
code >= 9193 && code <= 9203 || // Media control symbols
|
|
92
|
-
code >= 9208 && code <= 9210 || // Media control symbols
|
|
93
|
-
code >= 9725 && code <= 9726 || // Medium squares
|
|
94
|
-
code >= 9748 && code <= 9749 || // Umbrella, Hot Beverage
|
|
95
|
-
code >= 9800 && code <= 9811 || // Zodiac symbols
|
|
96
|
-
code === 9855 || // Wheelchair
|
|
97
|
-
code === 9875 || // Anchor
|
|
98
|
-
code === 9889 || // High Voltage
|
|
99
|
-
code >= 9898 && code <= 9899 || // Medium circles
|
|
100
|
-
code >= 9917 && code <= 9918 || // Soccer, Baseball
|
|
101
|
-
code >= 9924 && code <= 9925 || // Snowman, Sun behind cloud
|
|
102
|
-
code === 9934 || // Ophiuchus
|
|
103
|
-
code === 9940 || // No Entry
|
|
104
|
-
code === 9962 || // Church
|
|
105
|
-
code >= 9970 && code <= 9971 || // Fountain, Golf
|
|
106
|
-
code === 9973 || // Sailboat
|
|
107
|
-
code === 9978 || // Tent
|
|
108
|
-
code === 9981 || // Fuel Pump
|
|
109
|
-
code === 9986 || // Scissors
|
|
110
|
-
code === 9989 || // Check Mark
|
|
111
|
-
code >= 9992 && code <= 9997 || // Airplane...Writing Hand
|
|
112
|
-
code === 9999 || // Pencil
|
|
113
|
-
code >= 10067 && code <= 10069 || // Question marks
|
|
114
|
-
code === 10071 || // Exclamation
|
|
115
|
-
code >= 10133 && code <= 10135 || // Plus, Minus, Divide
|
|
116
|
-
code === 10160 || // Curly Loop
|
|
117
|
-
code === 10175 || // Double Curly Loop
|
|
118
|
-
code >= 10548 && code <= 10549 || // Arrows
|
|
119
|
-
code >= 11013 && code <= 11015 || // Arrows
|
|
120
|
-
code >= 11035 && code <= 11036 || // Squares
|
|
121
|
-
code === 11088 || // Star
|
|
122
|
-
code === 11093 || // Circle
|
|
123
|
-
code >= 11904 && code <= 12350 || // CJK Radicals, Symbols, Punctuation
|
|
124
|
-
code >= 12352 && code <= 12447 || // Hiragana
|
|
125
|
-
code >= 12448 && code <= 12543 || // Katakana
|
|
126
|
-
code >= 12549 && code <= 12591 || // Bopomofo
|
|
127
|
-
code >= 12593 && code <= 12686 || // Hangul Compatibility Jamo
|
|
128
|
-
code >= 12688 && code <= 12771 || // Kanbun, CJK Strokes
|
|
129
|
-
code >= 12784 && code <= 12830 || // Katakana Phonetic Extensions
|
|
130
|
-
code >= 12832 && code <= 12871 || // Enclosed CJK
|
|
131
|
-
code >= 12880 && code <= 19903 || // CJK Extensions + Unified block
|
|
132
|
-
code >= 19968 && code <= 40959 || // CJK Unified Ideographs
|
|
133
|
-
code >= 43360 && code <= 43388 || // Hangul Jamo Extended-A
|
|
134
|
-
code >= 44032 && code <= 55203 || // Hangul Syllables
|
|
135
|
-
code >= 63744 && code <= 64255 || // CJK Compatibility Ideographs
|
|
136
|
-
code >= 65040 && code <= 65049 || // Vertical forms
|
|
137
|
-
code >= 65072 && code <= 65131 || // CJK Compatibility Forms
|
|
138
|
-
code >= 65281 && code <= 65376 || // Fullwidth Forms (excl. halfwidth)
|
|
139
|
-
code >= 65504 && code <= 65510 || // Fullwidth Signs
|
|
140
|
-
code >= 126980 && code === 126980 || // Mahjong Red Dragon
|
|
141
|
-
code === 127183 || // Joker
|
|
142
|
-
code >= 127344 && code <= 127345 || // A/B buttons
|
|
143
|
-
code === 127358 || // O button
|
|
144
|
-
code === 127359 || // P button
|
|
145
|
-
code === 127374 || // AB button
|
|
146
|
-
code >= 127377 && code <= 127386 || // Squared symbols
|
|
147
|
-
code >= 127456 && code <= 127487 || // Regional Indicator Symbols
|
|
148
|
-
code >= 127488 && code <= 127490 || // Enclosed ideographic
|
|
149
|
-
code === 127514 || // Squared CJK
|
|
150
|
-
code === 127535 || // Squared CJK
|
|
151
|
-
code >= 127538 && code <= 127546 || // Squared CJK
|
|
152
|
-
code >= 127568 && code <= 127569 || // Circled ideographic
|
|
153
|
-
code >= 127744 && code <= 129535 || // Misc Symbols / Emoticons / Emoji
|
|
154
|
-
code >= 129536 && code <= 129791 || // Chess, Symbols Extended-A
|
|
155
|
-
code >= 129792 && code <= 130047 || // Symbols for Legacy Computing
|
|
156
|
-
code >= 131072 && code <= 196605 || // CJK Extension B-F (excl. nonchars)
|
|
157
|
-
code >= 196608 && code <= 262141) {
|
|
158
|
-
return 2;
|
|
159
|
-
}
|
|
160
|
-
return 1;
|
|
161
|
-
}
|
|
162
|
-
function countCells(text) {
|
|
163
|
-
let cells = 0;
|
|
164
|
-
for (const ch of text) {
|
|
165
|
-
cells += cellWidth(ch.codePointAt(0));
|
|
166
|
-
}
|
|
167
|
-
return cells;
|
|
168
|
-
}
|
|
169
|
-
var CliMeasureAdapter = class {
|
|
170
|
-
cellPx;
|
|
171
|
-
constructor(opts) {
|
|
172
|
-
this.cellPx = opts?.cellPx ?? 8;
|
|
173
|
-
}
|
|
174
|
-
measureSegment(text, _font) {
|
|
175
|
-
return { width: countCells(text) * this.cellPx };
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
var PrecomputedAdapterKeyError = class extends Error {
|
|
179
|
-
name = "KeyError";
|
|
180
|
-
};
|
|
181
|
-
var PrecomputedAdapter = class {
|
|
182
|
-
metrics;
|
|
183
|
-
fallback;
|
|
184
|
-
constructor(opts) {
|
|
185
|
-
this.metrics = opts.metrics;
|
|
186
|
-
const fb = opts.fallback ?? "per-char";
|
|
187
|
-
if (fb !== "per-char" && fb !== "error") {
|
|
188
|
-
throw new Error(
|
|
189
|
-
`fallback must be 'per-char' or 'error', got ${JSON.stringify(opts.fallback)}`
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
this.fallback = fb;
|
|
193
|
-
}
|
|
194
|
-
measureSegment(text, font) {
|
|
195
|
-
const fontMap = this.metrics[font];
|
|
196
|
-
if (fontMap) {
|
|
197
|
-
const w = fontMap[text];
|
|
198
|
-
if (w !== void 0) return { width: w };
|
|
199
|
-
}
|
|
200
|
-
if (this.fallback === "error") {
|
|
201
|
-
throw new PrecomputedAdapterKeyError(
|
|
202
|
-
`PrecomputedAdapter: no metrics for segment ${JSON.stringify(text)} in font ${JSON.stringify(font)}`
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
let total = 0;
|
|
206
|
-
if (fontMap) {
|
|
207
|
-
for (const ch of text) {
|
|
208
|
-
const cw = fontMap[ch];
|
|
209
|
-
if (cw !== void 0) {
|
|
210
|
-
total += cw;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return { width: total };
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
var CanvasMeasureAdapter = class {
|
|
218
|
-
ctx = null;
|
|
219
|
-
currentFont = "";
|
|
220
|
-
emojiCorrection;
|
|
221
|
-
constructor(opts) {
|
|
222
|
-
this.emojiCorrection = opts?.emojiCorrection ?? 1;
|
|
223
|
-
}
|
|
224
|
-
getContext() {
|
|
225
|
-
if (!this.ctx) {
|
|
226
|
-
if (typeof OffscreenCanvas === "undefined") {
|
|
227
|
-
throw new Error(
|
|
228
|
-
"CanvasMeasureAdapter requires a browser environment with OffscreenCanvas support. Use CliMeasureAdapter or NodeCanvasMeasureAdapter for Node.js."
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
const canvas = new OffscreenCanvas(0, 0);
|
|
232
|
-
const ctx = canvas.getContext("2d");
|
|
233
|
-
if (!ctx) throw new Error("CanvasMeasureAdapter: failed to get 2d context");
|
|
234
|
-
this.ctx = ctx;
|
|
235
|
-
}
|
|
236
|
-
return this.ctx;
|
|
237
|
-
}
|
|
238
|
-
measureSegment(text, font) {
|
|
239
|
-
const ctx = this.getContext();
|
|
240
|
-
if (font !== this.currentFont) {
|
|
241
|
-
ctx.font = font;
|
|
242
|
-
this.currentFont = font;
|
|
243
|
-
}
|
|
244
|
-
let width = ctx.measureText(text).width;
|
|
245
|
-
if (this.emojiCorrection !== 1 && new RegExp("\\p{Emoji_Presentation}", "u").test(text)) {
|
|
246
|
-
width *= this.emojiCorrection;
|
|
247
|
-
}
|
|
248
|
-
return { width };
|
|
249
|
-
}
|
|
250
|
-
clearCache() {
|
|
251
|
-
this.currentFont = "";
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
var NodeCanvasMeasureAdapter = class {
|
|
255
|
-
ctx = null;
|
|
256
|
-
currentFont = "";
|
|
257
|
-
canvasModule;
|
|
258
|
-
constructor(canvasModule) {
|
|
259
|
-
this.canvasModule = canvasModule;
|
|
260
|
-
}
|
|
261
|
-
getContext() {
|
|
262
|
-
if (!this.ctx) {
|
|
263
|
-
const canvas = this.canvasModule.createCanvas(0, 0);
|
|
264
|
-
const ctx = canvas.getContext("2d");
|
|
265
|
-
if (!ctx) throw new Error("NodeCanvasMeasureAdapter: failed to get 2d context");
|
|
266
|
-
this.ctx = ctx;
|
|
267
|
-
}
|
|
268
|
-
return this.ctx;
|
|
269
|
-
}
|
|
270
|
-
measureSegment(text, font) {
|
|
271
|
-
const ctx = this.getContext();
|
|
272
|
-
if (font !== this.currentFont) {
|
|
273
|
-
ctx.font = font;
|
|
274
|
-
this.currentFont = font;
|
|
275
|
-
}
|
|
276
|
-
return { width: ctx.measureText(text).width };
|
|
277
|
-
}
|
|
278
|
-
clearCache() {
|
|
279
|
-
this.currentFont = "";
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
var SvgBoundsAdapter = class {
|
|
283
|
-
measureSvg(content) {
|
|
284
|
-
const viewBoxMatch = content.match(/viewBox\s*=\s*["']([^"']+)["']/);
|
|
285
|
-
if (viewBoxMatch) {
|
|
286
|
-
const parts = viewBoxMatch[1].trim().split(/[\s,]+/);
|
|
287
|
-
if (parts.length >= 4) {
|
|
288
|
-
const w = Number.parseFloat(parts[2]);
|
|
289
|
-
const h = Number.parseFloat(parts[3]);
|
|
290
|
-
if (Number.isFinite(w) && Number.isFinite(h) && w > 0 && h > 0) {
|
|
291
|
-
return { width: w, height: h };
|
|
292
|
-
}
|
|
293
|
-
throw new Error(
|
|
294
|
-
"SvgBoundsAdapter: viewBox width/height are missing, non-finite, or not positive"
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
const widthMatch = content.match(/<svg[^>]*\bwidth\s*=\s*["']?([\d.]+)/);
|
|
299
|
-
const heightMatch = content.match(/<svg[^>]*\bheight\s*=\s*["']?([\d.]+)/);
|
|
300
|
-
if (widthMatch && heightMatch) {
|
|
301
|
-
const w = Number.parseFloat(widthMatch[1]);
|
|
302
|
-
const h = Number.parseFloat(heightMatch[1]);
|
|
303
|
-
if (Number.isFinite(w) && Number.isFinite(h) && w > 0 && h > 0) {
|
|
304
|
-
return { width: w, height: h };
|
|
305
|
-
}
|
|
306
|
-
throw new Error(
|
|
307
|
-
"SvgBoundsAdapter: svg width/height attributes are non-finite or not positive"
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
|
-
throw new Error(
|
|
311
|
-
"SvgBoundsAdapter: cannot determine dimensions \u2014 SVG has no viewBox or width/height attributes"
|
|
312
|
-
);
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
var ImageSizeAdapter = class {
|
|
316
|
-
sizes;
|
|
317
|
-
constructor(sizes) {
|
|
318
|
-
this.sizes = new Map(Object.entries(sizes));
|
|
319
|
-
}
|
|
320
|
-
measureImage(src) {
|
|
321
|
-
const dims = this.sizes.get(src);
|
|
322
|
-
if (!dims) {
|
|
323
|
-
throw new Error(`ImageSizeAdapter: no dimensions registered for ${JSON.stringify(src)}`);
|
|
324
|
-
}
|
|
325
|
-
return { width: dims.width, height: dims.height };
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
// src/patterns/reactive-layout/reactive-block-layout.ts
|
|
330
|
-
function measureBlock(block, maxWidth, adapters, measureCache, defaultFont, defaultLineHeight, index) {
|
|
331
|
-
switch (block.type) {
|
|
332
|
-
case "text": {
|
|
333
|
-
const font = block.font ?? defaultFont;
|
|
334
|
-
const lineHeight = block.lineHeight ?? defaultLineHeight;
|
|
335
|
-
const segments = analyzeAndMeasure(block.text, font, adapters.text, measureCache);
|
|
336
|
-
const lineBreaks = computeLineBreaks(segments, maxWidth, adapters.text, font, measureCache);
|
|
337
|
-
const charPositions = computeCharPositions(lineBreaks, segments, lineHeight);
|
|
338
|
-
const height = lineBreaks.lineCount * lineHeight;
|
|
339
|
-
let width = 0;
|
|
340
|
-
for (const line of lineBreaks.lines) {
|
|
341
|
-
if (line.width > width) width = line.width;
|
|
342
|
-
}
|
|
343
|
-
return {
|
|
344
|
-
index,
|
|
345
|
-
type: "text",
|
|
346
|
-
width: Math.min(width, maxWidth),
|
|
347
|
-
height,
|
|
348
|
-
textSegments: segments,
|
|
349
|
-
textLineBreaks: lineBreaks,
|
|
350
|
-
textCharPositions: charPositions
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
case "image": {
|
|
354
|
-
let w;
|
|
355
|
-
let h;
|
|
356
|
-
if (block.naturalWidth != null && block.naturalHeight != null) {
|
|
357
|
-
w = block.naturalWidth;
|
|
358
|
-
h = block.naturalHeight;
|
|
359
|
-
} else if (adapters.image) {
|
|
360
|
-
const dims = adapters.image.measureImage(block.src);
|
|
361
|
-
w = dims.width;
|
|
362
|
-
h = dims.height;
|
|
363
|
-
} else {
|
|
364
|
-
throw new Error(
|
|
365
|
-
`Image block at index ${index} has no naturalWidth/naturalHeight and no ImageMeasurer adapter`
|
|
366
|
-
);
|
|
367
|
-
}
|
|
368
|
-
if (w > maxWidth) {
|
|
369
|
-
h = h * maxWidth / w;
|
|
370
|
-
w = maxWidth;
|
|
371
|
-
}
|
|
372
|
-
return { index, type: "image", width: w, height: h };
|
|
373
|
-
}
|
|
374
|
-
case "svg": {
|
|
375
|
-
let w;
|
|
376
|
-
let h;
|
|
377
|
-
if (block.viewBox) {
|
|
378
|
-
w = block.viewBox.width;
|
|
379
|
-
h = block.viewBox.height;
|
|
380
|
-
} else if (adapters.svg) {
|
|
381
|
-
const dims = adapters.svg.measureSvg(block.content);
|
|
382
|
-
w = dims.width;
|
|
383
|
-
h = dims.height;
|
|
384
|
-
} else {
|
|
385
|
-
throw new Error(`SVG block at index ${index} has no viewBox and no SvgMeasurer adapter`);
|
|
386
|
-
}
|
|
387
|
-
if (w > maxWidth) {
|
|
388
|
-
h = h * maxWidth / w;
|
|
389
|
-
w = maxWidth;
|
|
390
|
-
}
|
|
391
|
-
return { index, type: "svg", width: w, height: h };
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
function measureBlocks(blocks, maxWidth, adapters, measureCache, defaultFont, defaultLineHeight) {
|
|
396
|
-
return blocks.map(
|
|
397
|
-
(block, i) => measureBlock(block, maxWidth, adapters, measureCache, defaultFont, defaultLineHeight, i)
|
|
398
|
-
);
|
|
399
|
-
}
|
|
400
|
-
function computeBlockFlow(measured, gap) {
|
|
401
|
-
const result = [];
|
|
402
|
-
let y = 0;
|
|
403
|
-
for (let i = 0; i < measured.length; i++) {
|
|
404
|
-
const m = measured[i];
|
|
405
|
-
result.push({ ...m, x: 0, y });
|
|
406
|
-
y += m.height + (i < measured.length - 1 ? gap : 0);
|
|
407
|
-
}
|
|
408
|
-
return result;
|
|
409
|
-
}
|
|
410
|
-
function computeTotalHeight(flow) {
|
|
411
|
-
if (flow.length === 0) return 0;
|
|
412
|
-
const last = flow[flow.length - 1];
|
|
413
|
-
return last.y + last.height;
|
|
414
|
-
}
|
|
415
|
-
function reactiveBlockLayout(opts) {
|
|
416
|
-
const {
|
|
417
|
-
adapters,
|
|
418
|
-
name = "reactive-block-layout",
|
|
419
|
-
defaultFont = "16px sans-serif",
|
|
420
|
-
defaultLineHeight = 20
|
|
421
|
-
} = opts;
|
|
422
|
-
const g = new Graph(name);
|
|
423
|
-
const measureCache = /* @__PURE__ */ new Map();
|
|
424
|
-
const blocksNode = state(opts.blocks ?? [], { name: "blocks" });
|
|
425
|
-
const maxWidthNode = state(Math.max(0, opts.maxWidth ?? 800), { name: "max-width" });
|
|
426
|
-
const gapNode = state(opts.gap ?? 0, { name: "gap" });
|
|
427
|
-
const measuredBlocksNode = node(
|
|
428
|
-
[blocksNode, maxWidthNode],
|
|
429
|
-
(data, actions, ctx) => {
|
|
430
|
-
const blocksVal = data[0] != null && data[0].length > 0 ? data[0].at(-1) : ctx.prevData[0];
|
|
431
|
-
const mwVal = data[1] != null && data[1].length > 0 ? data[1].at(-1) : ctx.prevData[1];
|
|
432
|
-
const t0 = monotonicNs();
|
|
433
|
-
const result = measureBlocks(
|
|
434
|
-
blocksVal,
|
|
435
|
-
mwVal,
|
|
436
|
-
adapters,
|
|
437
|
-
measureCache,
|
|
438
|
-
defaultFont,
|
|
439
|
-
defaultLineHeight
|
|
440
|
-
);
|
|
441
|
-
const elapsed = monotonicNs() - t0;
|
|
442
|
-
const meta = measuredBlocksNode.meta;
|
|
443
|
-
if (meta) {
|
|
444
|
-
emitToMeta(meta["block-count"], result.length);
|
|
445
|
-
emitToMeta(meta["layout-time-ns"], elapsed);
|
|
446
|
-
}
|
|
447
|
-
actions.emit(result);
|
|
448
|
-
return () => {
|
|
449
|
-
measureCache.clear();
|
|
450
|
-
adapters.text.clearCache?.();
|
|
451
|
-
};
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
name: "measured-blocks",
|
|
455
|
-
describeKind: "derived",
|
|
456
|
-
meta: { "block-count": 0, "layout-time-ns": 0 },
|
|
457
|
-
equals: (a, b) => {
|
|
458
|
-
const ma = a;
|
|
459
|
-
const mb = b;
|
|
460
|
-
if (ma == null || mb == null) return ma === mb;
|
|
461
|
-
if (ma.length !== mb.length) return false;
|
|
462
|
-
for (let i = 0; i < ma.length; i++) {
|
|
463
|
-
const ba = ma[i];
|
|
464
|
-
const bb = mb[i];
|
|
465
|
-
if (ba.type !== bb.type || ba.width !== bb.width || ba.height !== bb.height || ba.index !== bb.index)
|
|
466
|
-
return false;
|
|
467
|
-
}
|
|
468
|
-
return true;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
);
|
|
472
|
-
const blockFlowNode = derived(
|
|
473
|
-
[measuredBlocksNode, gapNode],
|
|
474
|
-
([measured, gapVal]) => {
|
|
475
|
-
return computeBlockFlow(measured, gapVal);
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
name: "block-flow",
|
|
479
|
-
equals: (a, b) => {
|
|
480
|
-
const fa = a;
|
|
481
|
-
const fb = b;
|
|
482
|
-
if (fa == null || fb == null) return fa === fb;
|
|
483
|
-
if (fa.length !== fb.length) return false;
|
|
484
|
-
for (let i = 0; i < fa.length; i++) {
|
|
485
|
-
const pa = fa[i];
|
|
486
|
-
const pb = fb[i];
|
|
487
|
-
if (pa.x !== pb.x || pa.y !== pb.y || pa.width !== pb.width || pa.height !== pb.height)
|
|
488
|
-
return false;
|
|
489
|
-
}
|
|
490
|
-
return true;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
);
|
|
494
|
-
const totalHeightNode = derived(
|
|
495
|
-
[blockFlowNode],
|
|
496
|
-
([flow]) => computeTotalHeight(flow),
|
|
497
|
-
{ name: "total-height" }
|
|
498
|
-
);
|
|
499
|
-
g.add("blocks", blocksNode);
|
|
500
|
-
g.add("max-width", maxWidthNode);
|
|
501
|
-
g.add("gap", gapNode);
|
|
502
|
-
g.add("measured-blocks", measuredBlocksNode);
|
|
503
|
-
g.add("block-flow", blockFlowNode);
|
|
504
|
-
g.add("total-height", totalHeightNode);
|
|
505
|
-
return {
|
|
506
|
-
graph: g,
|
|
507
|
-
setBlocks: (blocks) => g.set("blocks", blocks),
|
|
508
|
-
setMaxWidth: (mw) => g.set("max-width", Math.max(0, mw)),
|
|
509
|
-
setGap: (gap) => g.set("gap", gap),
|
|
510
|
-
measuredBlocks: measuredBlocksNode,
|
|
511
|
-
blockFlow: blockFlowNode,
|
|
512
|
-
totalHeight: totalHeightNode
|
|
513
|
-
};
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
// src/patterns/reactive-layout/reactive-flow-layout.ts
|
|
517
|
-
function circleIntervalForBand(o, bandTop, bandBottom) {
|
|
518
|
-
const hPad = o.hPad ?? 0;
|
|
519
|
-
const vPad = o.vPad ?? 0;
|
|
520
|
-
const top = bandTop - vPad;
|
|
521
|
-
const bottom = bandBottom + vPad;
|
|
522
|
-
if (top >= o.cy + o.r || bottom <= o.cy - o.r) return null;
|
|
523
|
-
const minDy = o.cy >= top && o.cy <= bottom ? 0 : o.cy < top ? top - o.cy : o.cy - bottom;
|
|
524
|
-
if (minDy >= o.r) return null;
|
|
525
|
-
const maxDx = Math.sqrt(o.r * o.r - minDy * minDy);
|
|
526
|
-
return { left: o.cx - maxDx - hPad, right: o.cx + maxDx + hPad };
|
|
527
|
-
}
|
|
528
|
-
function rectIntervalForBand(o, bandTop, bandBottom) {
|
|
529
|
-
const hPad = o.hPad ?? 0;
|
|
530
|
-
const vPad = o.vPad ?? 0;
|
|
531
|
-
if (bandBottom <= o.y - vPad) return null;
|
|
532
|
-
if (bandTop >= o.y + o.h + vPad) return null;
|
|
533
|
-
return { left: o.x - hPad, right: o.x + o.w + hPad };
|
|
534
|
-
}
|
|
535
|
-
function obstacleIntervalForBand(o, bandTop, bandBottom) {
|
|
536
|
-
return o.kind === "circle" ? circleIntervalForBand(o, bandTop, bandBottom) : rectIntervalForBand(o, bandTop, bandBottom);
|
|
537
|
-
}
|
|
538
|
-
function computeFlowLines(segments, container, columns, obstacles, lineHeight, minSlotWidth) {
|
|
539
|
-
const lines = [];
|
|
540
|
-
let cursor = { segmentIndex: 0, graphemeIndex: 0 };
|
|
541
|
-
if (segments.length === 0 || columns.count <= 0 || lineHeight <= 0) {
|
|
542
|
-
return { lines, cursor };
|
|
543
|
-
}
|
|
544
|
-
const padX = container.paddingX ?? 0;
|
|
545
|
-
const padY = container.paddingY ?? 0;
|
|
546
|
-
const availWidth = Math.max(0, container.width - padX * 2);
|
|
547
|
-
const availHeight = Math.max(0, container.height - padY * 2);
|
|
548
|
-
const gapTotal = columns.gap * Math.max(0, columns.count - 1);
|
|
549
|
-
const colWidth = Math.max(0, (availWidth - gapTotal) / columns.count);
|
|
550
|
-
if (colWidth <= 0) return { lines, cursor };
|
|
551
|
-
outerCol: for (let col = 0; col < columns.count; col++) {
|
|
552
|
-
const colLeft = padX + col * (colWidth + columns.gap);
|
|
553
|
-
const colRight = colLeft + colWidth;
|
|
554
|
-
let bandTop = padY;
|
|
555
|
-
while (bandTop + lineHeight <= padY + availHeight) {
|
|
556
|
-
const bandBottom = bandTop + lineHeight;
|
|
557
|
-
const blocked = [];
|
|
558
|
-
for (let oi = 0; oi < obstacles.length; oi++) {
|
|
559
|
-
const iv = obstacleIntervalForBand(obstacles[oi], bandTop, bandBottom);
|
|
560
|
-
if (iv !== null) blocked.push(iv);
|
|
561
|
-
}
|
|
562
|
-
const slots = carveTextLineSlots({ left: colLeft, right: colRight }, blocked, minSlotWidth);
|
|
563
|
-
if (slots.length === 0) {
|
|
564
|
-
bandTop += lineHeight;
|
|
565
|
-
continue;
|
|
566
|
-
}
|
|
567
|
-
let hardBreakThisBand = false;
|
|
568
|
-
for (let si = 0; si < slots.length; si++) {
|
|
569
|
-
const slot = slots[si];
|
|
570
|
-
const slotW = slot.right - slot.left;
|
|
571
|
-
const line = layoutNextLine(segments, cursor, slotW);
|
|
572
|
-
if (line === null) {
|
|
573
|
-
return { lines, cursor };
|
|
574
|
-
}
|
|
575
|
-
if (line.text.length === 0 && line.width === 0) {
|
|
576
|
-
cursor = line.end;
|
|
577
|
-
hardBreakThisBand = true;
|
|
578
|
-
break;
|
|
579
|
-
}
|
|
580
|
-
lines.push({
|
|
581
|
-
x: slot.left,
|
|
582
|
-
y: bandTop,
|
|
583
|
-
width: line.width,
|
|
584
|
-
slotWidth: slotW,
|
|
585
|
-
text: line.text,
|
|
586
|
-
columnIndex: col,
|
|
587
|
-
flushToRight: slot.right < colRight - 0.5
|
|
588
|
-
});
|
|
589
|
-
cursor = line.end;
|
|
590
|
-
}
|
|
591
|
-
bandTop += lineHeight;
|
|
592
|
-
if (hardBreakThisBand) continue;
|
|
593
|
-
if (cursor.segmentIndex >= segments.length) break outerCol;
|
|
594
|
-
}
|
|
595
|
-
if (cursor.segmentIndex >= segments.length) break;
|
|
596
|
-
}
|
|
597
|
-
return { lines, cursor };
|
|
598
|
-
}
|
|
599
|
-
function reactiveFlowLayout(opts) {
|
|
600
|
-
const { adapter, name = "reactive-flow-layout", minSlotWidth = 20 } = opts;
|
|
601
|
-
const g = new Graph(name);
|
|
602
|
-
const measureCache = /* @__PURE__ */ new Map();
|
|
603
|
-
const textNode = state(opts.text ?? "", { name: "text" });
|
|
604
|
-
const fontNode = state(opts.font ?? "16px sans-serif", { name: "font" });
|
|
605
|
-
const lineHeightNode = state(opts.lineHeight ?? 20, { name: "line-height" });
|
|
606
|
-
const containerNode = state(
|
|
607
|
-
opts.container ?? { width: 800, height: 600, paddingX: 0, paddingY: 0 },
|
|
608
|
-
{ name: "container" }
|
|
609
|
-
);
|
|
610
|
-
const columnsNode = state(opts.columns ?? { count: 1, gap: 0 }, {
|
|
611
|
-
name: "columns"
|
|
612
|
-
});
|
|
613
|
-
const obstaclesNode = state(opts.obstacles ?? [], { name: "obstacles" });
|
|
614
|
-
const segmentsNode = node(
|
|
615
|
-
[textNode, fontNode],
|
|
616
|
-
(data, actions, ctx) => {
|
|
617
|
-
const b0 = data[0];
|
|
618
|
-
const textVal = b0 != null && b0.length > 0 ? b0.at(-1) : ctx.prevData[0];
|
|
619
|
-
const b1 = data[1];
|
|
620
|
-
const fontVal = b1 != null && b1.length > 0 ? b1.at(-1) : ctx.prevData[1];
|
|
621
|
-
const result = analyzeAndMeasure(textVal, fontVal, adapter, measureCache);
|
|
622
|
-
actions.emit(result);
|
|
623
|
-
return () => {
|
|
624
|
-
measureCache.clear();
|
|
625
|
-
adapter.clearCache?.();
|
|
626
|
-
};
|
|
627
|
-
},
|
|
628
|
-
{ name: "segments", describeKind: "derived" }
|
|
629
|
-
);
|
|
630
|
-
const flowLinesNode = derived(
|
|
631
|
-
[segmentsNode, containerNode, columnsNode, obstaclesNode, lineHeightNode],
|
|
632
|
-
([segs, cont, cols, obs, lh]) => {
|
|
633
|
-
const segments = segs;
|
|
634
|
-
const t0 = monotonicNs();
|
|
635
|
-
const { lines: result, cursor } = computeFlowLines(
|
|
636
|
-
segments,
|
|
637
|
-
cont,
|
|
638
|
-
cols,
|
|
639
|
-
obs,
|
|
640
|
-
lh,
|
|
641
|
-
minSlotWidth
|
|
642
|
-
);
|
|
643
|
-
const elapsed = monotonicNs() - t0;
|
|
644
|
-
const overflow = Math.max(0, segments.length - cursor.segmentIndex);
|
|
645
|
-
const meta = flowLinesNode.meta;
|
|
646
|
-
if (meta) {
|
|
647
|
-
emitToMeta(meta["line-count"], result.length);
|
|
648
|
-
emitToMeta(meta["layout-time-ns"], elapsed);
|
|
649
|
-
emitToMeta(meta["overflow-segments"], overflow);
|
|
650
|
-
}
|
|
651
|
-
return result;
|
|
652
|
-
},
|
|
653
|
-
{
|
|
654
|
-
name: "flow-lines",
|
|
655
|
-
meta: {
|
|
656
|
-
"line-count": 0,
|
|
657
|
-
"layout-time-ns": 0,
|
|
658
|
-
"overflow-segments": 0
|
|
659
|
-
},
|
|
660
|
-
equals: (a, b) => {
|
|
661
|
-
const la = a;
|
|
662
|
-
const lb = b;
|
|
663
|
-
if (la.length !== lb.length) return false;
|
|
664
|
-
for (let i = 0; i < la.length; i++) {
|
|
665
|
-
const pa = la[i];
|
|
666
|
-
const pb = lb[i];
|
|
667
|
-
if (pa.x !== pb.x || pa.y !== pb.y || pa.width !== pb.width || pa.slotWidth !== pb.slotWidth || pa.text !== pb.text || pa.columnIndex !== pb.columnIndex || pa.flushToRight !== pb.flushToRight)
|
|
668
|
-
return false;
|
|
669
|
-
}
|
|
670
|
-
return true;
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
);
|
|
674
|
-
g.add("text", textNode);
|
|
675
|
-
g.add("font", fontNode);
|
|
676
|
-
g.add("line-height", lineHeightNode);
|
|
677
|
-
g.add("container", containerNode);
|
|
678
|
-
g.add("columns", columnsNode);
|
|
679
|
-
g.add("obstacles", obstaclesNode);
|
|
680
|
-
g.add("segments", segmentsNode);
|
|
681
|
-
g.add("flow-lines", flowLinesNode);
|
|
682
|
-
return {
|
|
683
|
-
graph: g,
|
|
684
|
-
setText: (t) => g.set("text", t),
|
|
685
|
-
setFont: (f) => g.set("font", f),
|
|
686
|
-
setLineHeight: (lh) => g.set("line-height", lh),
|
|
687
|
-
setContainer: (c) => g.set("container", c),
|
|
688
|
-
setColumns: (c) => g.set("columns", c),
|
|
689
|
-
setObstacles: (o) => g.set("obstacles", o),
|
|
690
|
-
segments: segmentsNode,
|
|
691
|
-
flowLines: flowLinesNode
|
|
692
|
-
};
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
export {
|
|
696
|
-
CliMeasureAdapter,
|
|
697
|
-
PrecomputedAdapter,
|
|
698
|
-
CanvasMeasureAdapter,
|
|
699
|
-
NodeCanvasMeasureAdapter,
|
|
700
|
-
SvgBoundsAdapter,
|
|
701
|
-
ImageSizeAdapter,
|
|
702
|
-
measureBlock,
|
|
703
|
-
measureBlocks,
|
|
704
|
-
computeBlockFlow,
|
|
705
|
-
computeTotalHeight,
|
|
706
|
-
reactiveBlockLayout,
|
|
707
|
-
circleIntervalForBand,
|
|
708
|
-
rectIntervalForBand,
|
|
709
|
-
computeFlowLines,
|
|
710
|
-
reactiveFlowLayout,
|
|
711
|
-
reactive_layout_exports
|
|
712
|
-
};
|
|
713
|
-
//# sourceMappingURL=chunk-X3VMZYBT.js.map
|