@graphrefly/ts 0.0.1 → 0.0.3
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 +197 -117
- package/dist/actions-types-CH-XCU9O.d.cts +657 -0
- package/dist/actions-types-w2iPQTkv.d.ts +657 -0
- package/dist/adapters/index.cjs +5157 -2951
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +207 -70
- package/dist/adapters/index.d.ts +207 -70
- package/dist/adapters/index.js +3738 -1688
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/nestjs/microservices.cjs +841 -0
- package/dist/adapters/nestjs/microservices.cjs.map +1 -0
- package/dist/adapters/nestjs/microservices.d.cts +45 -0
- package/dist/adapters/nestjs/microservices.d.ts +45 -0
- package/dist/adapters/nestjs/microservices.js +206 -0
- package/dist/adapters/nestjs/microservices.js.map +1 -0
- package/dist/adapters/nestjs/native.cjs +1391 -0
- package/dist/adapters/nestjs/native.cjs.map +1 -0
- package/dist/adapters/nestjs/native.d.cts +111 -0
- package/dist/adapters/nestjs/native.d.ts +111 -0
- package/dist/adapters/nestjs/native.js +577 -0
- package/dist/adapters/nestjs/native.js.map +1 -0
- package/dist/adapters/nestjs/websockets.cjs +924 -0
- package/dist/adapters/nestjs/websockets.cjs.map +1 -0
- package/dist/adapters/nestjs/websockets.d.cts +47 -0
- package/dist/adapters/nestjs/websockets.d.ts +47 -0
- package/dist/adapters/nestjs/websockets.js +286 -0
- package/dist/adapters/nestjs/websockets.js.map +1 -0
- package/dist/adapters/nestjs.cjs +1085 -0
- package/dist/adapters/nestjs.cjs.map +1 -0
- package/dist/adapters/nestjs.d.cts +385 -0
- package/dist/adapters/nestjs.d.ts +385 -0
- package/dist/adapters/nestjs.js +112 -0
- package/dist/adapters/nestjs.js.map +1 -0
- package/dist/adapters/observe-storage.d.cts +3 -3
- package/dist/adapters/observe-storage.d.ts +3 -3
- package/dist/adapters/observe-storage.js +4 -4
- package/dist/adapters/react.cjs.map +1 -1
- package/dist/adapters/react.d.cts +2 -2
- package/dist/adapters/react.d.ts +2 -2
- package/dist/adapters/react.js +1 -1
- package/dist/adapters/solid.cjs.map +1 -1
- package/dist/adapters/solid.d.cts +2 -2
- package/dist/adapters/solid.d.ts +2 -2
- package/dist/adapters/solid.js +1 -1
- package/dist/adapters/svelte.cjs.map +1 -1
- package/dist/adapters/svelte.d.cts +2 -2
- package/dist/adapters/svelte.d.ts +2 -2
- package/dist/adapters/svelte.js +1 -1
- package/dist/adapters/vue.cjs.map +1 -1
- package/dist/adapters/vue.d.cts +2 -2
- package/dist/adapters/vue.d.ts +2 -2
- package/dist/adapters/vue.js +1 -1
- package/dist/{agent-runtime-BesGDZcB.d.ts → agent-runtime-types-core-CKwrBDyi.d.ts} +171 -320
- package/dist/{agent-runtime-DZTJ3C-p.d.cts → agent-runtime-types-core-bfl4m0vM.d.cts} +171 -320
- package/dist/agent-runtime-types-tool-BLPV3azj.d.cts +695 -0
- package/dist/agent-runtime-types-tool-hwqvVqNt.d.ts +695 -0
- package/dist/agentic-memory-retention-CLwI76JK.d.ts +14 -0
- package/dist/agentic-memory-retention-Cz8GR6ie.d.cts +14 -0
- package/dist/{agentic-memory-DfuVZ-lY.d.cts → agentic-memory-types-JDr7MPhh.d.cts} +13 -57
- package/dist/{agentic-memory-BmRCvh0d.d.ts → agentic-memory-types-khYJgzKL.d.ts} +13 -57
- package/dist/{capability-admission-B0BzqAm5.d.cts → capability-admission-B8RNFyaZ.d.cts} +3 -3
- package/dist/{capability-admission-g0mn9hpq.d.ts → capability-admission-Dkw1Xz3r.d.ts} +3 -3
- package/dist/chunk-2KUAG2GZ.js +9693 -0
- package/dist/chunk-2KUAG2GZ.js.map +1 -0
- package/dist/{chunk-CZNV3VXM.js → chunk-3J7UPZL5.js} +11 -11
- package/dist/{chunk-HKK2JD7Z.js → chunk-3LYI6ADX.js} +12 -125
- package/dist/chunk-3LYI6ADX.js.map +1 -0
- package/dist/{chunk-YXMZ2N6J.js → chunk-4M37FH2I.js} +1071 -1025
- package/dist/chunk-4M37FH2I.js.map +1 -0
- package/dist/{chunk-YDSIVHRR.js → chunk-4NWSNI4K.js} +1598 -1584
- package/dist/chunk-4NWSNI4K.js.map +1 -0
- package/dist/{chunk-Z2ANQ6JW.js → chunk-4Q77MMJY.js} +2 -2
- package/dist/{chunk-SS2A464I.js → chunk-54WPEODM.js} +3 -3
- package/dist/chunk-54WPEODM.js.map +1 -0
- package/dist/chunk-6E76H4OU.js +132 -0
- package/dist/chunk-6E76H4OU.js.map +1 -0
- package/dist/chunk-7GOTIIQ7.js +819 -0
- package/dist/chunk-7GOTIIQ7.js.map +1 -0
- package/dist/{chunk-V7CIJE4B.js → chunk-DKFWDTVY.js} +92 -9
- package/dist/chunk-DKFWDTVY.js.map +1 -0
- package/dist/{chunk-FBUU43PM.js → chunk-E4QCH32M.js} +448 -446
- package/dist/chunk-E4QCH32M.js.map +1 -0
- package/dist/{chunk-XKXWK2KP.js → chunk-GXU6WFEJ.js} +1157 -1021
- package/dist/chunk-GXU6WFEJ.js.map +1 -0
- package/dist/{chunk-K3FXTC3I.js → chunk-HJACH5PU.js} +3 -3
- package/dist/{chunk-GTPCOEOZ.js → chunk-IDMLXLLG.js} +3 -3
- package/dist/{chunk-DKP56CSW.js → chunk-JKAYLDQV.js} +2 -2
- package/dist/{chunk-4VLAQHZI.js → chunk-K7FB3JTD.js} +17 -1
- package/dist/chunk-K7FB3JTD.js.map +1 -0
- package/dist/{chunk-43BKLFZU.js → chunk-KFURM6FM.js} +10 -10
- package/dist/{chunk-H75VXTGT.js → chunk-L6LDXRWE.js} +3 -3
- package/dist/{chunk-H75VXTGT.js.map → chunk-L6LDXRWE.js.map} +1 -1
- package/dist/chunk-MCOFHMUU.js +4131 -0
- package/dist/chunk-MCOFHMUU.js.map +1 -0
- package/dist/chunk-MQEQMS7B.js +1009 -0
- package/dist/chunk-MQEQMS7B.js.map +1 -0
- package/dist/chunk-MTELVIYR.js +1421 -0
- package/dist/chunk-MTELVIYR.js.map +1 -0
- package/dist/{chunk-3JR3EDB2.js → chunk-NNDIFUKX.js} +121 -115
- package/dist/chunk-NNDIFUKX.js.map +1 -0
- package/dist/{chunk-2747WN4Y.js → chunk-PUSRRALM.js} +3 -3
- package/dist/{chunk-QFY4AFY4.js → chunk-PVC7WDKI.js} +58 -52
- package/dist/chunk-PVC7WDKI.js.map +1 -0
- package/dist/{chunk-VTHLCFN4.js → chunk-RAHNUYA5.js} +2 -2
- package/dist/chunk-TQPCAIQI.js +612 -0
- package/dist/chunk-TQPCAIQI.js.map +1 -0
- package/dist/{chunk-IXZBUWSP.js → chunk-UEMN5URK.js} +2 -2
- package/dist/chunk-WOS7RJYZ.js +1320 -0
- package/dist/chunk-WOS7RJYZ.js.map +1 -0
- package/dist/{chunk-6PHB5CJS.js → chunk-ZLFRB6FI.js} +2 -2
- package/dist/composition/index.cjs +1228 -1076
- package/dist/composition/index.cjs.map +1 -1
- package/dist/composition/index.d.cts +3 -3
- package/dist/composition/index.d.ts +3 -3
- package/dist/composition/index.js +4 -4
- package/dist/core/index.cjs +1198 -1046
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +23 -2
- package/dist/core/index.d.ts +23 -2
- package/dist/core/index.js +2 -2
- package/dist/cqrs/index.d.cts +3 -3
- package/dist/cqrs/index.d.ts +3 -3
- package/dist/cqrs/messaging.d.cts +4 -4
- package/dist/cqrs/messaging.d.ts +4 -4
- package/dist/cqrs/work-queue.d.cts +5 -5
- package/dist/cqrs/work-queue.d.ts +5 -5
- package/dist/data-structures/index.cjs +1226 -1074
- package/dist/data-structures/index.cjs.map +1 -1
- package/dist/data-structures/index.d.cts +8 -7
- package/dist/data-structures/index.d.ts +8 -7
- package/dist/data-structures/index.js +6 -5
- package/dist/{describe-DYMw_l1C.d.cts → describe-BumQ-3_0.d.cts} +1 -1
- package/dist/{describe-BpyJuWkw.d.ts → describe-cYr_Z5zm.d.ts} +1 -1
- package/dist/executors/tool-provider-adapters.cjs +3091 -0
- package/dist/executors/tool-provider-adapters.cjs.map +1 -0
- package/dist/executors/tool-provider-adapters.d.cts +174 -0
- package/dist/executors/tool-provider-adapters.d.ts +174 -0
- package/dist/executors/tool-provider-adapters.js +1336 -0
- package/dist/executors/tool-provider-adapters.js.map +1 -0
- package/dist/executors/tool-provider-runtime.cjs +5178 -0
- package/dist/executors/tool-provider-runtime.cjs.map +1 -0
- package/dist/executors/tool-provider-runtime.d.cts +17 -0
- package/dist/executors/tool-provider-runtime.d.ts +17 -0
- package/dist/executors/tool-provider-runtime.js +15 -0
- package/dist/executors/tool-provider-runtime.js.map +1 -0
- package/dist/executors/tool-provider.cjs +6392 -0
- package/dist/executors/tool-provider.cjs.map +1 -0
- package/dist/executors/tool-provider.d.cts +60 -0
- package/dist/executors/tool-provider.d.ts +60 -0
- package/dist/executors/tool-provider.js +89 -0
- package/dist/executors/tool-provider.js.map +1 -0
- package/dist/executors/work-queue.d.cts +6 -6
- package/dist/executors/work-queue.d.ts +6 -6
- package/dist/graph/index.cjs +1499 -1341
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +9 -8
- package/dist/graph/index.d.ts +9 -8
- package/dist/graph/index.js +23 -22
- package/dist/{graph-DCEWh4T2.d.cts → graph-C1C-wb0L.d.cts} +266 -137
- package/dist/{graph-D-1-SQeC.d.ts → graph-CS0b4V9B.d.ts} +266 -137
- package/dist/{index-72VZC0-E.d.cts → index-DLrNopda.d.cts} +151 -10
- package/dist/{index-Bmxeu0nK.d.ts → index-DzJni3_6.d.ts} +151 -10
- package/dist/index.cjs +3397 -3140
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -9
- package/dist/index.d.ts +12 -9
- package/dist/index.js +110 -109
- package/dist/inspection/boundary.d.cts +4 -4
- package/dist/inspection/boundary.d.ts +4 -4
- package/dist/measurements-BWAnochv.d.ts +294 -0
- package/dist/measurements-B_gJfD8h.d.cts +294 -0
- package/dist/messaging/index.cjs +57 -51
- package/dist/messaging/index.cjs.map +1 -1
- package/dist/messaging/index.d.cts +11 -276
- package/dist/messaging/index.d.ts +11 -276
- package/dist/messaging/index.js +1 -1
- package/dist/operators/index.cjs +1228 -1076
- package/dist/operators/index.cjs.map +1 -1
- package/dist/operators/index.d.cts +5 -5
- package/dist/operators/index.d.ts +5 -5
- package/dist/operators/index.js +5 -5
- package/dist/orchestration/index.cjs +8844 -6071
- package/dist/orchestration/index.cjs.map +1 -1
- package/dist/orchestration/index.d.cts +171 -224
- package/dist/orchestration/index.d.ts +171 -224
- package/dist/orchestration/index.js +42 -991
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/messaging.d.cts +5 -8
- package/dist/orchestration/messaging.d.ts +5 -8
- package/dist/orchestration/work-queue.cjs +1243 -5
- package/dist/orchestration/work-queue.cjs.map +1 -1
- package/dist/orchestration/work-queue.d.cts +121 -10
- package/dist/orchestration/work-queue.d.ts +121 -10
- package/dist/orchestration/work-queue.js +1067 -4
- package/dist/orchestration/work-queue.js.map +1 -1
- package/dist/patterns/event-flow.cjs +6 -20
- package/dist/patterns/event-flow.cjs.map +1 -1
- package/dist/patterns/event-flow.d.cts +4 -4
- package/dist/patterns/event-flow.d.ts +4 -4
- package/dist/patterns/event-flow.js +2 -2
- package/dist/patterns/index.cjs +453 -465
- package/dist/patterns/index.cjs.map +1 -1
- package/dist/patterns/index.d.cts +6 -5
- package/dist/patterns/index.d.ts +6 -5
- package/dist/patterns/index.js +3 -3
- package/dist/process-types-BB7oRhX3.d.cts +200 -0
- package/dist/process-types-QNhyoYJ8.d.ts +200 -0
- package/dist/{reactive-collection-DNV0-gFi.d.cts → reactive-collection-BYlWvtnp.d.cts} +4 -34
- package/dist/{reactive-collection-BAmfrGjd.d.ts → reactive-collection-efOEdGFN.d.ts} +4 -34
- package/dist/{reactive-collection-storage-BNEldDyi.d.cts → reactive-collection-storage-BjoLsoiC.d.cts} +5 -5
- package/dist/{reactive-collection-storage-YZsAQsWK.d.ts → reactive-collection-storage-DwW6UuK_.d.ts} +5 -5
- package/dist/{reactive-map-DRD1LJ2H.d.cts → reactive-map-BHacbIqz.d.cts} +7 -2
- package/dist/{reactive-map-EsDiCmJk.d.ts → reactive-map-DN4Jyqnf.d.ts} +7 -2
- package/dist/render/index.d.cts +2 -2
- package/dist/render/index.d.ts +2 -2
- package/dist/scheduled-readiness-BmqXxnzX.d.ts +91 -0
- package/dist/scheduled-readiness-CYSw7KDE.d.cts +91 -0
- package/dist/semantic-memory-graph-B_LwbM-E.d.cts +30 -0
- package/dist/semantic-memory-graph-rsFNNhwn.d.ts +30 -0
- package/dist/{semantic-memory-graph-DKuNzuWw.d.cts → semantic-memory-graph-types-Y73bbwVI.d.cts} +2 -28
- package/dist/{semantic-memory-graph-uwbwJdhe.d.ts → semantic-memory-graph-types-safmPkuX.d.ts} +2 -28
- package/dist/solutions/index.cjs +6353 -6169
- package/dist/solutions/index.cjs.map +1 -1
- package/dist/solutions/index.d.cts +12 -10
- package/dist/solutions/index.d.ts +12 -10
- package/dist/solutions/index.js +5 -5
- package/dist/solutions/reactive-layout/browser/index.cjs +116 -108
- package/dist/solutions/reactive-layout/browser/index.cjs.map +1 -1
- package/dist/solutions/reactive-layout/browser/index.d.cts +4 -4
- package/dist/solutions/reactive-layout/browser/index.d.ts +4 -4
- package/dist/solutions/reactive-layout/browser/index.js +3 -3
- package/dist/solutions/reactive-layout/index.cjs +3578 -3350
- package/dist/solutions/reactive-layout/index.cjs.map +1 -1
- package/dist/solutions/reactive-layout/index.d.cts +32 -576
- package/dist/solutions/reactive-layout/index.d.ts +32 -576
- package/dist/solutions/reactive-layout/index.js +65 -5
- package/dist/solutions/reactive-layout/node-canvas/index.cjs +127 -117
- package/dist/solutions/reactive-layout/node-canvas/index.cjs.map +1 -1
- package/dist/solutions/reactive-layout/node-canvas/index.d.cts +4 -4
- package/dist/solutions/reactive-layout/node-canvas/index.d.ts +4 -4
- package/dist/solutions/reactive-layout/node-canvas/index.js +3 -3
- package/dist/solutions/reactive-layout/react-native/index.cjs +127 -117
- package/dist/solutions/reactive-layout/react-native/index.cjs.map +1 -1
- package/dist/solutions/reactive-layout/react-native/index.d.cts +4 -4
- package/dist/solutions/reactive-layout/react-native/index.d.ts +4 -4
- package/dist/solutions/reactive-layout/react-native/index.js +3 -3
- package/dist/solutions/reactive-layout/skia/index.cjs +127 -117
- package/dist/solutions/reactive-layout/skia/index.cjs.map +1 -1
- package/dist/solutions/reactive-layout/skia/index.d.cts +4 -4
- package/dist/solutions/reactive-layout/skia/index.d.ts +4 -4
- package/dist/solutions/reactive-layout/skia/index.js +3 -3
- package/dist/solutions/work-item/actions.cjs +1609 -1428
- package/dist/solutions/work-item/actions.cjs.map +1 -1
- package/dist/solutions/work-item/actions.d.cts +23 -184
- package/dist/solutions/work-item/actions.d.ts +23 -184
- package/dist/solutions/work-item/actions.js +1558 -934
- package/dist/solutions/work-item/actions.js.map +1 -1
- package/dist/solutions/work-item/scheduling.cjs +9181 -1838
- package/dist/solutions/work-item/scheduling.cjs.map +1 -1
- package/dist/solutions/work-item/scheduling.d.cts +1763 -328
- package/dist/solutions/work-item/scheduling.d.ts +1763 -328
- package/dist/solutions/work-item/scheduling.js +117 -3
- package/dist/solutions/work-item/work-queue.d.cts +7 -7
- package/dist/solutions/work-item/work-queue.d.ts +7 -7
- package/dist/sources/browser.cjs +1318 -1083
- package/dist/sources/browser.cjs.map +1 -1
- package/dist/sources/browser.d.cts +22 -6
- package/dist/sources/browser.d.ts +22 -6
- package/dist/sources/browser.js +4 -4
- package/dist/sources/browser.js.map +1 -1
- package/dist/sources/index.cjs +1318 -1083
- package/dist/sources/index.cjs.map +1 -1
- package/dist/sources/index.d.cts +4 -4
- package/dist/sources/index.d.ts +4 -4
- package/dist/sources/index.js +4 -4
- package/dist/sources/node.d.cts +3 -3
- package/dist/sources/node.d.ts +3 -3
- package/dist/storage/browser.cjs +16 -0
- package/dist/storage/browser.cjs.map +1 -1
- package/dist/storage/browser.js +3 -3
- package/dist/storage/index.cjs +16 -0
- package/dist/storage/index.cjs.map +1 -1
- package/dist/storage/index.d.cts +5 -4
- package/dist/storage/index.d.ts +5 -4
- package/dist/storage/index.js +6 -6
- package/dist/storage/node.cjs +16 -0
- package/dist/storage/node.cjs.map +1 -1
- package/dist/storage/node.js +3 -3
- package/dist/{store-C-joM4gh.d.ts → store-6_CHF6Ge.d.ts} +1 -1
- package/dist/{store-CNJwmT-h.d.cts → store-BljX8RkQ.d.cts} +1 -1
- package/dist/types-BAw2QVVE.d.cts +274 -0
- package/dist/types-BUbbbh4f.d.cts +34 -0
- package/dist/types-CMnzoL54.d.cts +457 -0
- package/dist/{types-CcPIn7sy.d.cts → types-CTN3XoMl.d.cts} +57 -108
- package/dist/types-CV_ohy5T.d.cts +357 -0
- package/dist/{types-BsJvElYZ.d.ts → types-DChxk1vK.d.ts} +57 -108
- package/dist/types-DRu7SnLV.d.ts +274 -0
- package/dist/types-DeID_FRl.d.ts +34 -0
- package/dist/types-IhKH0hGW.d.ts +357 -0
- package/dist/types-ePlD2uyT.d.ts +457 -0
- package/dist/{work-item-runtime-qaVgsL0T.d.cts → work-item-runtime-types-BTxLskN5.d.cts} +3 -93
- package/dist/{work-item-runtime-C3M79vE9.d.ts → work-item-runtime-types-DAsZbb2y.d.ts} +3 -93
- package/dist/work-queue/index.cjs +957 -953
- package/dist/work-queue/index.cjs.map +1 -1
- package/dist/work-queue/index.d.cts +9 -357
- package/dist/work-queue/index.d.ts +9 -357
- package/dist/work-queue/index.js +957 -953
- package/dist/work-queue/index.js.map +1 -1
- package/package.json +611 -513
- package/dist/chunk-3JR3EDB2.js.map +0 -1
- package/dist/chunk-4VLAQHZI.js.map +0 -1
- package/dist/chunk-6XAIOL3X.js +0 -2407
- package/dist/chunk-6XAIOL3X.js.map +0 -1
- package/dist/chunk-FBUU43PM.js.map +0 -1
- package/dist/chunk-HKK2JD7Z.js.map +0 -1
- package/dist/chunk-PC3BTTBE.js +0 -3217
- package/dist/chunk-PC3BTTBE.js.map +0 -1
- package/dist/chunk-QFY4AFY4.js.map +0 -1
- package/dist/chunk-SS2A464I.js.map +0 -1
- package/dist/chunk-V7CIJE4B.js.map +0 -1
- package/dist/chunk-XKXWK2KP.js.map +0 -1
- package/dist/chunk-YDSIVHRR.js.map +0 -1
- package/dist/chunk-YXMZ2N6J.js.map +0 -1
- /package/dist/{chunk-CZNV3VXM.js.map → chunk-3J7UPZL5.js.map} +0 -0
- /package/dist/{chunk-Z2ANQ6JW.js.map → chunk-4Q77MMJY.js.map} +0 -0
- /package/dist/{chunk-K3FXTC3I.js.map → chunk-HJACH5PU.js.map} +0 -0
- /package/dist/{chunk-GTPCOEOZ.js.map → chunk-IDMLXLLG.js.map} +0 -0
- /package/dist/{chunk-DKP56CSW.js.map → chunk-JKAYLDQV.js.map} +0 -0
- /package/dist/{chunk-43BKLFZU.js.map → chunk-KFURM6FM.js.map} +0 -0
- /package/dist/{chunk-2747WN4Y.js.map → chunk-PUSRRALM.js.map} +0 -0
- /package/dist/{chunk-VTHLCFN4.js.map → chunk-RAHNUYA5.js.map} +0 -0
- /package/dist/{chunk-IXZBUWSP.js.map → chunk-UEMN5URK.js.map} +0 -0
- /package/dist/{chunk-6PHB5CJS.js.map → chunk-ZLFRB6FI.js.map} +0 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { z as MeasurementAdapter, ac as TextMeasureCapability, f as CellMeasureAdapterOptions, n as ImageMeasurer, o as ImageSizeLookup, a5 as Size, x as MeasureFn, r as InjectedMeasureAdapterOptions, N as PrecomputedMeasureAdapterOptions, a9 as SvgMeasurer, y as MeasuredBlock, P as PositionedBlock, j as ContentBlock, M as MeasureBlockOptions, U as ReactiveBlockLayoutOptions, T as ReactiveBlockLayoutBundle, W as ReactiveFlowLayoutOptions, V as ReactiveFlowLayoutBundle, Y as ReactiveLayoutOptions, X as ReactiveLayoutBundle, h as CircleObstacle, ag as Interval, R as PreparedSegment, i as ComputeFlowLinesOptions, l as FlowLinesResult, $ as RectObstacle, O as Obstacle, k as FlowContainer, F as FlowColumns, a4 as SegmentMeasureStats, a1 as SegmentAdapter, w as LineBreaksResult, af as CharPosition, L as LayoutCursor, u as LayoutNextLineContext, v as LayoutNextLineResult, c as BlockAdaptersProviderOptions, b as BlockAdapters, d as BlockMeasurementProviderOptions, H as Measurements, C as CapabilityTextMeasurementsOptions, g as CellTextMeasurementsOptions, q as ImageSizeMeasurementsOptions, s as InjectedTextMeasurementsOptions, J as MergeMeasurementsOptions, Q as PrecomputedTextMeasurementsOptions, Z as ReadinessMeasurementsOptions, _ as ReadinessTextMeasurementsOptions, a7 as SvgBoundsMeasurementsOptions, ad as TextMeasurementProviderOptions, D as MeasurementIssue, G as MeasurementResult } from './types-ePlD2uyT.js';
|
|
2
|
+
import { DataIssue } from './data/index.js';
|
|
3
|
+
import { d as Graph } from './graph-CS0b4V9B.js';
|
|
4
|
+
import { N as Node } from './types-DChxk1vK.js';
|
|
5
|
+
|
|
6
|
+
/** Adapter that wraps a caller-owned synchronous measurement function. */
|
|
7
|
+
declare class InjectedMeasureAdapter implements MeasurementAdapter {
|
|
8
|
+
private readonly measure;
|
|
9
|
+
private readonly shouldCache;
|
|
10
|
+
private readonly cache;
|
|
11
|
+
constructor(measure: MeasureFn, opts?: InjectedMeasureAdapterOptions);
|
|
12
|
+
measureSegment(text: string, font: string): {
|
|
13
|
+
readonly width: number;
|
|
14
|
+
};
|
|
15
|
+
clearCache(): void;
|
|
16
|
+
}
|
|
17
|
+
/** Deterministic adapter backed by caller-supplied width metrics. */
|
|
18
|
+
declare class PrecomputedMeasureAdapter implements MeasurementAdapter {
|
|
19
|
+
private readonly metrics;
|
|
20
|
+
private readonly fallback;
|
|
21
|
+
private readonly cellWidth;
|
|
22
|
+
constructor(opts: PrecomputedMeasureAdapterOptions);
|
|
23
|
+
measureSegment(text: string, font: string): {
|
|
24
|
+
readonly width: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** Fixed-cell adapter for CLI, snapshots, and tests. */
|
|
28
|
+
declare class CellMeasureAdapter implements MeasurementAdapter {
|
|
29
|
+
private readonly cellWidth;
|
|
30
|
+
private readonly wideCellWidth;
|
|
31
|
+
private readonly tabCells;
|
|
32
|
+
constructor(opts?: CellMeasureAdapterOptions);
|
|
33
|
+
measureSegment(text: string): {
|
|
34
|
+
readonly width: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** Adapter over a caller-owned platform capability such as NodeCanvas, Skia, or RN text APIs. */
|
|
38
|
+
declare class CapabilityMeasureAdapter implements MeasurementAdapter {
|
|
39
|
+
private readonly capability;
|
|
40
|
+
constructor(capability: TextMeasureCapability);
|
|
41
|
+
measureSegment(text: string, font: string): {
|
|
42
|
+
readonly width: number;
|
|
43
|
+
};
|
|
44
|
+
clearCache(): void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Minimal string-based SVG bounds reader for explicit width/height or viewBox.
|
|
48
|
+
*
|
|
49
|
+
* This is not a DOM SVG parser and does not resolve external resources.
|
|
50
|
+
*/
|
|
51
|
+
declare class SvgBoundsAdapter implements SvgMeasurer {
|
|
52
|
+
measureSvg(svg: string): Size;
|
|
53
|
+
}
|
|
54
|
+
/** Image measurer backed by explicit caller-provided dimensions; it never loads images. */
|
|
55
|
+
declare class ImageSizeAdapter implements ImageMeasurer {
|
|
56
|
+
private readonly sizes;
|
|
57
|
+
constructor(sizes: ImageSizeLookup | Record<string, Size>);
|
|
58
|
+
measureImage(src: string): Size;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Measure one text/image/SVG block using only explicit or injected synchronous adapters. */
|
|
62
|
+
declare function measureBlock(block: ContentBlock, opts: MeasureBlockOptions): MeasuredBlock;
|
|
63
|
+
/** Measure a block list while sharing a measurement cache across text blocks. */
|
|
64
|
+
declare function measureBlocks(blocks: readonly ContentBlock[], opts: MeasureBlockOptions): readonly MeasuredBlock[];
|
|
65
|
+
/** Stack measured blocks vertically with margins and a fixed gap. */
|
|
66
|
+
declare function computeBlockFlow(blocks: readonly MeasuredBlock[], gap?: number): readonly PositionedBlock[];
|
|
67
|
+
/** Compute the bottom edge of a positioned block flow. */
|
|
68
|
+
declare function computeTotalHeight(blocks: readonly PositionedBlock[]): number;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Create a graph-visible single-column text layout bundle.
|
|
72
|
+
*
|
|
73
|
+
* @param opts - Requires a graph and a graph-visible `measurements` node, plus optional
|
|
74
|
+
* `lineHeight`, `maxWidth`, `targetId`, `segmentAdapter`, and bundle `name`.
|
|
75
|
+
* @returns A `ReactiveLayoutBundle` containing input nodes, setters, and graph-visible output
|
|
76
|
+
* nodes for segments, line breaks, height, and character positions.
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* import { graph } from "@graphrefly/ts";
|
|
80
|
+
* import {
|
|
81
|
+
* cellTextMeasurements,
|
|
82
|
+
* reactiveLayout,
|
|
83
|
+
* } from "@graphrefly/ts/solutions/reactive-layout";
|
|
84
|
+
*
|
|
85
|
+
* const g = graph({ name: "article" });
|
|
86
|
+
* const text = g.state("Hello GraphReFly", { name: "text" });
|
|
87
|
+
* const font = g.state("16px system-ui", { name: "font" });
|
|
88
|
+
* const measurements = cellTextMeasurements({ graph: g, text, font });
|
|
89
|
+
*
|
|
90
|
+
* const layout = reactiveLayout({ graph: g, measurements, maxWidth: 320, lineHeight: 20 });
|
|
91
|
+
* layout.setMaxWidth(280);
|
|
92
|
+
* ```
|
|
93
|
+
* @remarks **Graph-visible:** This creates ordinary state/output nodes only; it does not add
|
|
94
|
+
* protocol behavior, hidden subscriptions, GraphSpec ownership, storage, or platform globals.
|
|
95
|
+
* @category solutions
|
|
96
|
+
*/
|
|
97
|
+
declare function reactiveLayout(opts: ReactiveLayoutOptions): ReactiveLayoutBundle;
|
|
98
|
+
/**
|
|
99
|
+
* Create a graph-visible vertical block layout bundle over the same DOM-free core.
|
|
100
|
+
*
|
|
101
|
+
* @param opts - Requires a graph and a graph-visible block `measurements` node, plus optional
|
|
102
|
+
* `gap`, `targetId`, and bundle `name`.
|
|
103
|
+
* @returns A `ReactiveBlockLayoutBundle` containing the gap input, measured block output,
|
|
104
|
+
* positioned block flow, and total height node.
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* import { graph } from "@graphrefly/ts";
|
|
108
|
+
* import {
|
|
109
|
+
* blockAdaptersProvider,
|
|
110
|
+
* blockMeasurementProvider,
|
|
111
|
+
* reactiveBlockLayout,
|
|
112
|
+
* type MeasurementAdapter,
|
|
113
|
+
* } from "@graphrefly/ts/solutions/reactive-layout";
|
|
114
|
+
*
|
|
115
|
+
* const g = graph({ name: "cards" });
|
|
116
|
+
* const blocks = g.state([{ id: "title", kind: "text", text: "Hello" }]);
|
|
117
|
+
* const maxWidth = g.state(320);
|
|
118
|
+
* const text = g.state<MeasurementAdapter>({
|
|
119
|
+
* measureSegment: (segment) => ({ width: segment.length * 8 }),
|
|
120
|
+
* });
|
|
121
|
+
* const measurements = blockMeasurementProvider({
|
|
122
|
+
* graph: g,
|
|
123
|
+
* blocks,
|
|
124
|
+
* maxWidth,
|
|
125
|
+
* adapters: blockAdaptersProvider({ graph: g, text }),
|
|
126
|
+
* });
|
|
127
|
+
*
|
|
128
|
+
* const layout = reactiveBlockLayout({ graph: g, measurements, gap: 12 });
|
|
129
|
+
* layout.setGap(16);
|
|
130
|
+
* ```
|
|
131
|
+
* @remarks **DOM-free:** Image/SVG sizing is explicit or injected; no async image loading or
|
|
132
|
+
* DOM SVG parsing occurs in the core layout bundle.
|
|
133
|
+
* @category solutions
|
|
134
|
+
*/
|
|
135
|
+
declare function reactiveBlockLayout(opts: ReactiveBlockLayoutOptions): ReactiveBlockLayoutBundle;
|
|
136
|
+
/** Create a graph-visible multi-column flow layout bundle with rectangle/circle obstacles. */
|
|
137
|
+
declare function reactiveFlowLayout(opts: ReactiveFlowLayoutOptions): ReactiveFlowLayoutBundle;
|
|
138
|
+
|
|
139
|
+
declare function columnGeometry(container: FlowContainer, columns: FlowColumns | undefined): {
|
|
140
|
+
readonly paddingX: number;
|
|
141
|
+
readonly paddingY: number;
|
|
142
|
+
readonly count: number;
|
|
143
|
+
readonly gap: number;
|
|
144
|
+
readonly width: number;
|
|
145
|
+
readonly height: number;
|
|
146
|
+
readonly columnWidth: number;
|
|
147
|
+
};
|
|
148
|
+
declare function sanitizeFlowContainer(container: FlowContainer): FlowContainer;
|
|
149
|
+
declare function sanitizeFlowColumns(columns: FlowColumns): FlowColumns;
|
|
150
|
+
declare function sanitizeObstacles(obstacles: readonly Obstacle[]): readonly Obstacle[];
|
|
151
|
+
/** Intersect a circle obstacle with a horizontal line band. */
|
|
152
|
+
declare function circleIntervalForBand(obstacle: CircleObstacle, bandTop: number, bandBottom: number): Interval | null;
|
|
153
|
+
/** Intersect a rectangle obstacle with a horizontal line band. */
|
|
154
|
+
declare function rectIntervalForBand(obstacle: RectObstacle, bandTop: number, bandBottom: number): Interval | null;
|
|
155
|
+
declare function blockedIntervalsForBand(obstacles: readonly Obstacle[], bandTop: number, bandBottom: number): Interval[];
|
|
156
|
+
/** Flow prepared text through columns and carved obstacle slots. */
|
|
157
|
+
declare function computeFlowLines(segments: readonly PreparedSegment[], opts: ComputeFlowLinesOptions): FlowLinesResult;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Segment text and measure every resulting segment with a caller-owned synchronous adapter.
|
|
161
|
+
*
|
|
162
|
+
* @param text - Text to normalize, segment, and measure.
|
|
163
|
+
* @param font - Font descriptor passed through to the measurement adapter.
|
|
164
|
+
* @param adapter - Synchronous measurement adapter used for each segment or grapheme.
|
|
165
|
+
* @param cache - Caller-owned cache keyed by font and segment text.
|
|
166
|
+
* @param stats - Optional cache hit/miss accounting object updated during measurement.
|
|
167
|
+
* @param segmentAdapter - Optional segmentation adapter; defaults to the built-in adapter.
|
|
168
|
+
* @returns A prepared segment list with widths, break kinds, and optional grapheme widths for
|
|
169
|
+
* word-like segments.
|
|
170
|
+
* @example
|
|
171
|
+
* ```ts
|
|
172
|
+
* import { analyzeAndMeasure } from "@graphrefly/ts/solutions/reactive-layout";
|
|
173
|
+
*
|
|
174
|
+
* const segments = analyzeAndMeasure(
|
|
175
|
+
* "Hello world",
|
|
176
|
+
* "16px system-ui",
|
|
177
|
+
* { measureSegment: (segment) => ({ width: segment.length * 8 }) },
|
|
178
|
+
* new Map(),
|
|
179
|
+
* );
|
|
180
|
+
* ```
|
|
181
|
+
* @remarks **Caller-owned adapter:** Measurement stays synchronous and host-injected; browser
|
|
182
|
+
* Canvas, Skia, React Native, or test adapters live outside this helper.
|
|
183
|
+
* @category solutions
|
|
184
|
+
*/
|
|
185
|
+
declare function analyzeAndMeasure(text: string, font: string, adapter: MeasurementAdapter, cache: Map<string, Map<string, number>>, stats?: SegmentMeasureStats, segmentAdapter?: SegmentAdapter): PreparedSegment[];
|
|
186
|
+
/**
|
|
187
|
+
* Compute greedy single-column line breaks over prepared segments.
|
|
188
|
+
*
|
|
189
|
+
* @param segments - Prepared segments from `analyzeAndMeasure` or a measurement provider.
|
|
190
|
+
* @param maxWidth - Maximum line width in pixels; non-finite or negative values produce no useful
|
|
191
|
+
* width budget.
|
|
192
|
+
* @param opts - Optional hyphen width and segment adapter for grapheme-aware slicing.
|
|
193
|
+
* @returns A `LineBreaksResult` containing ordered layout lines and the line count.
|
|
194
|
+
* @example
|
|
195
|
+
* ```ts
|
|
196
|
+
* import { analyzeAndMeasure, computeLineBreaks } from "@graphrefly/ts/solutions/reactive-layout";
|
|
197
|
+
*
|
|
198
|
+
* const segments = analyzeAndMeasure(
|
|
199
|
+
* "Hello world",
|
|
200
|
+
* "16px system-ui",
|
|
201
|
+
* { measureSegment: (segment) => ({ width: segment.length * 8 }) },
|
|
202
|
+
* new Map(),
|
|
203
|
+
* );
|
|
204
|
+
* const lineBreaks = computeLineBreaks(segments, 64);
|
|
205
|
+
* ```
|
|
206
|
+
* @remarks **Pure helper:** This does not subscribe, schedule, or emit messages; reactive bundles
|
|
207
|
+
* call it from ordinary graph nodes.
|
|
208
|
+
* @category solutions
|
|
209
|
+
*/
|
|
210
|
+
declare function computeLineBreaks(segments: readonly PreparedSegment[], maxWidth: number, opts?: {
|
|
211
|
+
readonly hyphenWidth?: number;
|
|
212
|
+
readonly segmentAdapter?: SegmentAdapter;
|
|
213
|
+
}): LineBreaksResult;
|
|
214
|
+
/** Lay out one line from a cursor, returning the next cursor for continuation. */
|
|
215
|
+
declare function layoutNextLine(segments: readonly PreparedSegment[], cursor: LayoutCursor, slotWidth: number, ctx?: LayoutNextLineContext): LayoutNextLineResult | null;
|
|
216
|
+
/** Subtract obstacle intervals from a horizontal text band. */
|
|
217
|
+
declare function carveTextLineSlots(base: Interval, blocked: readonly Interval[], minSlotWidth?: number): Interval[];
|
|
218
|
+
/**
|
|
219
|
+
* Compute per-grapheme boxes for already-broken lines.
|
|
220
|
+
*
|
|
221
|
+
* @param lineBreaks - Line break result whose cursors identify the visible grapheme ranges.
|
|
222
|
+
* @param segments - Prepared segments used to produce the line breaks.
|
|
223
|
+
* @param lineHeight - Height assigned to every line box.
|
|
224
|
+
* @param segmentAdapter - Optional segmentation adapter; defaults to the built-in adapter.
|
|
225
|
+
* @returns Character-position boxes in visual order, each with `x`, `y`, `width`, `height`, and
|
|
226
|
+
* zero-based line index.
|
|
227
|
+
* @example
|
|
228
|
+
* ```ts
|
|
229
|
+
* import {
|
|
230
|
+
* analyzeAndMeasure,
|
|
231
|
+
* computeCharPositions,
|
|
232
|
+
* computeLineBreaks,
|
|
233
|
+
* } from "@graphrefly/ts/solutions/reactive-layout";
|
|
234
|
+
*
|
|
235
|
+
* const segments = analyzeAndMeasure(
|
|
236
|
+
* "Hello world",
|
|
237
|
+
* "16px system-ui",
|
|
238
|
+
* { measureSegment: (segment) => ({ width: segment.length * 8 }) },
|
|
239
|
+
* new Map(),
|
|
240
|
+
* );
|
|
241
|
+
* const lineBreaks = computeLineBreaks(segments, 64);
|
|
242
|
+
* const positions = computeCharPositions(lineBreaks, segments, 20);
|
|
243
|
+
* ```
|
|
244
|
+
* @remarks **Already measured:** Widths come from the prepared segments; this helper only maps the
|
|
245
|
+
* line cursors into per-grapheme rectangles.
|
|
246
|
+
* @category solutions
|
|
247
|
+
*/
|
|
248
|
+
declare function computeCharPositions(lineBreaks: LineBreaksResult, segments: readonly PreparedSegment[], lineHeight: number, segmentAdapter?: SegmentAdapter): readonly CharPosition[];
|
|
249
|
+
|
|
250
|
+
declare function measurementIssue(code: string, message: string, targetId: string, measurementKind: string, opts?: {
|
|
251
|
+
readonly source?: string;
|
|
252
|
+
readonly details?: unknown;
|
|
253
|
+
readonly metadata?: Record<string, unknown>;
|
|
254
|
+
readonly severity?: DataIssue["severity"];
|
|
255
|
+
}): MeasurementIssue;
|
|
256
|
+
declare function measurementOk<T>(targetId: string, measurementKind: string, value: T, opts?: {
|
|
257
|
+
readonly source?: string;
|
|
258
|
+
readonly metadata?: Record<string, unknown>;
|
|
259
|
+
}): MeasurementResult<T>;
|
|
260
|
+
declare function latestMeasurementValue<T>(measurements: Measurements, targetId: string, measurementKind: string): T | undefined;
|
|
261
|
+
declare function tryMeasureHyphenWidth(adapter: MeasurementAdapter, font: string): number | undefined;
|
|
262
|
+
declare function validMeasurementSize(size: Size, label: string): Size;
|
|
263
|
+
declare function textMeasurementFacts(text: string, font: string, adapter: MeasurementAdapter, cache: Map<string, Map<string, number>>, segmentAdapter: SegmentAdapter, targetId: string, source: string): Measurements;
|
|
264
|
+
declare function inputNode<T>(g: Graph, input: T | Node<T> | undefined, fallback: T, name: string): {
|
|
265
|
+
readonly node: Node<T>;
|
|
266
|
+
readonly set: (value: T) => void;
|
|
267
|
+
};
|
|
268
|
+
declare function scopedName(scope: string, local: string): string;
|
|
269
|
+
/** Generic sync text measurement provider that emits graph-visible measurement facts. */
|
|
270
|
+
declare function textMeasurementProvider(opts: TextMeasurementProviderOptions): Node<Measurements>;
|
|
271
|
+
/** Provider helper for caller-injected synchronous text measurement. */
|
|
272
|
+
declare function injectedTextMeasurements(opts: InjectedTextMeasurementsOptions): Node<Measurements>;
|
|
273
|
+
/** Provider helper for deterministic precomputed text metrics. */
|
|
274
|
+
declare function precomputedTextMeasurements(opts: PrecomputedTextMeasurementsOptions): Node<Measurements>;
|
|
275
|
+
/** Provider helper for fixed-cell terminal/snapshot text measurement. */
|
|
276
|
+
declare function cellTextMeasurements(opts: CellTextMeasurementsOptions): Node<Measurements>;
|
|
277
|
+
/** Provider helper for caller-injected platform text capability nodes. */
|
|
278
|
+
declare function capabilityTextMeasurements(opts: CapabilityTextMeasurementsOptions): Node<Measurements>;
|
|
279
|
+
/** Provider helper that makes readiness facts an explicit measurement dependency. */
|
|
280
|
+
declare function readinessTextMeasurements(opts: ReadinessTextMeasurementsOptions): Node<Measurements>;
|
|
281
|
+
/** Provider helper that emits graph-visible readiness facts without measuring layout. */
|
|
282
|
+
declare function readinessMeasurements(opts: ReadinessMeasurementsOptions): Node<Measurements>;
|
|
283
|
+
/** Provider helper for image-size facts from caller-owned synchronous image measurers. */
|
|
284
|
+
declare function imageSizeMeasurements(opts: ImageSizeMeasurementsOptions): Node<Measurements>;
|
|
285
|
+
/** Provider helper for SVG bounds facts from caller-owned synchronous SVG measurers. */
|
|
286
|
+
declare function svgBoundsMeasurements(opts: SvgBoundsMeasurementsOptions): Node<Measurements>;
|
|
287
|
+
/** Merge provider fact nodes into the single measurements node consumed by layout bundles. */
|
|
288
|
+
declare function mergeMeasurements(opts: MergeMeasurementsOptions): Node<Measurements>;
|
|
289
|
+
/** Compose optional block measurement capability nodes into one graph-visible adapter node. */
|
|
290
|
+
declare function blockAdaptersProvider(opts: BlockAdaptersProviderOptions): Node<BlockAdapters>;
|
|
291
|
+
/** Provider helper for block measurement facts over declared block/max-width deps. */
|
|
292
|
+
declare function blockMeasurementProvider(opts: BlockMeasurementProviderOptions): Node<Measurements>;
|
|
293
|
+
|
|
294
|
+
export { rectIntervalForBand as A, svgBoundsMeasurements as B, CapabilityMeasureAdapter as C, textMeasurementProvider as D, blockedIntervalsForBand as E, columnGeometry as F, inputNode as G, latestMeasurementValue as H, ImageSizeAdapter as I, measurementIssue as J, measurementOk as K, sanitizeFlowColumns as L, sanitizeFlowContainer as M, sanitizeObstacles as N, scopedName as O, PrecomputedMeasureAdapter as P, textMeasurementFacts as Q, tryMeasureHyphenWidth as R, SvgBoundsAdapter as S, validMeasurementSize as T, CellMeasureAdapter as a, InjectedMeasureAdapter as b, analyzeAndMeasure as c, blockAdaptersProvider as d, blockMeasurementProvider as e, capabilityTextMeasurements as f, carveTextLineSlots as g, cellTextMeasurements as h, circleIntervalForBand as i, computeBlockFlow as j, computeCharPositions as k, computeFlowLines as l, computeLineBreaks as m, computeTotalHeight as n, imageSizeMeasurements as o, injectedTextMeasurements as p, layoutNextLine as q, measureBlock as r, measureBlocks as s, mergeMeasurements as t, precomputedTextMeasurements as u, reactiveBlockLayout as v, reactiveFlowLayout as w, reactiveLayout as x, readinessMeasurements as y, readinessTextMeasurements as z };
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { z as MeasurementAdapter, ac as TextMeasureCapability, f as CellMeasureAdapterOptions, n as ImageMeasurer, o as ImageSizeLookup, a5 as Size, x as MeasureFn, r as InjectedMeasureAdapterOptions, N as PrecomputedMeasureAdapterOptions, a9 as SvgMeasurer, y as MeasuredBlock, P as PositionedBlock, j as ContentBlock, M as MeasureBlockOptions, U as ReactiveBlockLayoutOptions, T as ReactiveBlockLayoutBundle, W as ReactiveFlowLayoutOptions, V as ReactiveFlowLayoutBundle, Y as ReactiveLayoutOptions, X as ReactiveLayoutBundle, h as CircleObstacle, ag as Interval, R as PreparedSegment, i as ComputeFlowLinesOptions, l as FlowLinesResult, $ as RectObstacle, O as Obstacle, k as FlowContainer, F as FlowColumns, a4 as SegmentMeasureStats, a1 as SegmentAdapter, w as LineBreaksResult, af as CharPosition, L as LayoutCursor, u as LayoutNextLineContext, v as LayoutNextLineResult, c as BlockAdaptersProviderOptions, b as BlockAdapters, d as BlockMeasurementProviderOptions, H as Measurements, C as CapabilityTextMeasurementsOptions, g as CellTextMeasurementsOptions, q as ImageSizeMeasurementsOptions, s as InjectedTextMeasurementsOptions, J as MergeMeasurementsOptions, Q as PrecomputedTextMeasurementsOptions, Z as ReadinessMeasurementsOptions, _ as ReadinessTextMeasurementsOptions, a7 as SvgBoundsMeasurementsOptions, ad as TextMeasurementProviderOptions, D as MeasurementIssue, G as MeasurementResult } from './types-CMnzoL54.cjs';
|
|
2
|
+
import { DataIssue } from './data/index.cjs';
|
|
3
|
+
import { d as Graph } from './graph-C1C-wb0L.cjs';
|
|
4
|
+
import { N as Node } from './types-CTN3XoMl.cjs';
|
|
5
|
+
|
|
6
|
+
/** Adapter that wraps a caller-owned synchronous measurement function. */
|
|
7
|
+
declare class InjectedMeasureAdapter implements MeasurementAdapter {
|
|
8
|
+
private readonly measure;
|
|
9
|
+
private readonly shouldCache;
|
|
10
|
+
private readonly cache;
|
|
11
|
+
constructor(measure: MeasureFn, opts?: InjectedMeasureAdapterOptions);
|
|
12
|
+
measureSegment(text: string, font: string): {
|
|
13
|
+
readonly width: number;
|
|
14
|
+
};
|
|
15
|
+
clearCache(): void;
|
|
16
|
+
}
|
|
17
|
+
/** Deterministic adapter backed by caller-supplied width metrics. */
|
|
18
|
+
declare class PrecomputedMeasureAdapter implements MeasurementAdapter {
|
|
19
|
+
private readonly metrics;
|
|
20
|
+
private readonly fallback;
|
|
21
|
+
private readonly cellWidth;
|
|
22
|
+
constructor(opts: PrecomputedMeasureAdapterOptions);
|
|
23
|
+
measureSegment(text: string, font: string): {
|
|
24
|
+
readonly width: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** Fixed-cell adapter for CLI, snapshots, and tests. */
|
|
28
|
+
declare class CellMeasureAdapter implements MeasurementAdapter {
|
|
29
|
+
private readonly cellWidth;
|
|
30
|
+
private readonly wideCellWidth;
|
|
31
|
+
private readonly tabCells;
|
|
32
|
+
constructor(opts?: CellMeasureAdapterOptions);
|
|
33
|
+
measureSegment(text: string): {
|
|
34
|
+
readonly width: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** Adapter over a caller-owned platform capability such as NodeCanvas, Skia, or RN text APIs. */
|
|
38
|
+
declare class CapabilityMeasureAdapter implements MeasurementAdapter {
|
|
39
|
+
private readonly capability;
|
|
40
|
+
constructor(capability: TextMeasureCapability);
|
|
41
|
+
measureSegment(text: string, font: string): {
|
|
42
|
+
readonly width: number;
|
|
43
|
+
};
|
|
44
|
+
clearCache(): void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Minimal string-based SVG bounds reader for explicit width/height or viewBox.
|
|
48
|
+
*
|
|
49
|
+
* This is not a DOM SVG parser and does not resolve external resources.
|
|
50
|
+
*/
|
|
51
|
+
declare class SvgBoundsAdapter implements SvgMeasurer {
|
|
52
|
+
measureSvg(svg: string): Size;
|
|
53
|
+
}
|
|
54
|
+
/** Image measurer backed by explicit caller-provided dimensions; it never loads images. */
|
|
55
|
+
declare class ImageSizeAdapter implements ImageMeasurer {
|
|
56
|
+
private readonly sizes;
|
|
57
|
+
constructor(sizes: ImageSizeLookup | Record<string, Size>);
|
|
58
|
+
measureImage(src: string): Size;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Measure one text/image/SVG block using only explicit or injected synchronous adapters. */
|
|
62
|
+
declare function measureBlock(block: ContentBlock, opts: MeasureBlockOptions): MeasuredBlock;
|
|
63
|
+
/** Measure a block list while sharing a measurement cache across text blocks. */
|
|
64
|
+
declare function measureBlocks(blocks: readonly ContentBlock[], opts: MeasureBlockOptions): readonly MeasuredBlock[];
|
|
65
|
+
/** Stack measured blocks vertically with margins and a fixed gap. */
|
|
66
|
+
declare function computeBlockFlow(blocks: readonly MeasuredBlock[], gap?: number): readonly PositionedBlock[];
|
|
67
|
+
/** Compute the bottom edge of a positioned block flow. */
|
|
68
|
+
declare function computeTotalHeight(blocks: readonly PositionedBlock[]): number;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Create a graph-visible single-column text layout bundle.
|
|
72
|
+
*
|
|
73
|
+
* @param opts - Requires a graph and a graph-visible `measurements` node, plus optional
|
|
74
|
+
* `lineHeight`, `maxWidth`, `targetId`, `segmentAdapter`, and bundle `name`.
|
|
75
|
+
* @returns A `ReactiveLayoutBundle` containing input nodes, setters, and graph-visible output
|
|
76
|
+
* nodes for segments, line breaks, height, and character positions.
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* import { graph } from "@graphrefly/ts";
|
|
80
|
+
* import {
|
|
81
|
+
* cellTextMeasurements,
|
|
82
|
+
* reactiveLayout,
|
|
83
|
+
* } from "@graphrefly/ts/solutions/reactive-layout";
|
|
84
|
+
*
|
|
85
|
+
* const g = graph({ name: "article" });
|
|
86
|
+
* const text = g.state("Hello GraphReFly", { name: "text" });
|
|
87
|
+
* const font = g.state("16px system-ui", { name: "font" });
|
|
88
|
+
* const measurements = cellTextMeasurements({ graph: g, text, font });
|
|
89
|
+
*
|
|
90
|
+
* const layout = reactiveLayout({ graph: g, measurements, maxWidth: 320, lineHeight: 20 });
|
|
91
|
+
* layout.setMaxWidth(280);
|
|
92
|
+
* ```
|
|
93
|
+
* @remarks **Graph-visible:** This creates ordinary state/output nodes only; it does not add
|
|
94
|
+
* protocol behavior, hidden subscriptions, GraphSpec ownership, storage, or platform globals.
|
|
95
|
+
* @category solutions
|
|
96
|
+
*/
|
|
97
|
+
declare function reactiveLayout(opts: ReactiveLayoutOptions): ReactiveLayoutBundle;
|
|
98
|
+
/**
|
|
99
|
+
* Create a graph-visible vertical block layout bundle over the same DOM-free core.
|
|
100
|
+
*
|
|
101
|
+
* @param opts - Requires a graph and a graph-visible block `measurements` node, plus optional
|
|
102
|
+
* `gap`, `targetId`, and bundle `name`.
|
|
103
|
+
* @returns A `ReactiveBlockLayoutBundle` containing the gap input, measured block output,
|
|
104
|
+
* positioned block flow, and total height node.
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* import { graph } from "@graphrefly/ts";
|
|
108
|
+
* import {
|
|
109
|
+
* blockAdaptersProvider,
|
|
110
|
+
* blockMeasurementProvider,
|
|
111
|
+
* reactiveBlockLayout,
|
|
112
|
+
* type MeasurementAdapter,
|
|
113
|
+
* } from "@graphrefly/ts/solutions/reactive-layout";
|
|
114
|
+
*
|
|
115
|
+
* const g = graph({ name: "cards" });
|
|
116
|
+
* const blocks = g.state([{ id: "title", kind: "text", text: "Hello" }]);
|
|
117
|
+
* const maxWidth = g.state(320);
|
|
118
|
+
* const text = g.state<MeasurementAdapter>({
|
|
119
|
+
* measureSegment: (segment) => ({ width: segment.length * 8 }),
|
|
120
|
+
* });
|
|
121
|
+
* const measurements = blockMeasurementProvider({
|
|
122
|
+
* graph: g,
|
|
123
|
+
* blocks,
|
|
124
|
+
* maxWidth,
|
|
125
|
+
* adapters: blockAdaptersProvider({ graph: g, text }),
|
|
126
|
+
* });
|
|
127
|
+
*
|
|
128
|
+
* const layout = reactiveBlockLayout({ graph: g, measurements, gap: 12 });
|
|
129
|
+
* layout.setGap(16);
|
|
130
|
+
* ```
|
|
131
|
+
* @remarks **DOM-free:** Image/SVG sizing is explicit or injected; no async image loading or
|
|
132
|
+
* DOM SVG parsing occurs in the core layout bundle.
|
|
133
|
+
* @category solutions
|
|
134
|
+
*/
|
|
135
|
+
declare function reactiveBlockLayout(opts: ReactiveBlockLayoutOptions): ReactiveBlockLayoutBundle;
|
|
136
|
+
/** Create a graph-visible multi-column flow layout bundle with rectangle/circle obstacles. */
|
|
137
|
+
declare function reactiveFlowLayout(opts: ReactiveFlowLayoutOptions): ReactiveFlowLayoutBundle;
|
|
138
|
+
|
|
139
|
+
declare function columnGeometry(container: FlowContainer, columns: FlowColumns | undefined): {
|
|
140
|
+
readonly paddingX: number;
|
|
141
|
+
readonly paddingY: number;
|
|
142
|
+
readonly count: number;
|
|
143
|
+
readonly gap: number;
|
|
144
|
+
readonly width: number;
|
|
145
|
+
readonly height: number;
|
|
146
|
+
readonly columnWidth: number;
|
|
147
|
+
};
|
|
148
|
+
declare function sanitizeFlowContainer(container: FlowContainer): FlowContainer;
|
|
149
|
+
declare function sanitizeFlowColumns(columns: FlowColumns): FlowColumns;
|
|
150
|
+
declare function sanitizeObstacles(obstacles: readonly Obstacle[]): readonly Obstacle[];
|
|
151
|
+
/** Intersect a circle obstacle with a horizontal line band. */
|
|
152
|
+
declare function circleIntervalForBand(obstacle: CircleObstacle, bandTop: number, bandBottom: number): Interval | null;
|
|
153
|
+
/** Intersect a rectangle obstacle with a horizontal line band. */
|
|
154
|
+
declare function rectIntervalForBand(obstacle: RectObstacle, bandTop: number, bandBottom: number): Interval | null;
|
|
155
|
+
declare function blockedIntervalsForBand(obstacles: readonly Obstacle[], bandTop: number, bandBottom: number): Interval[];
|
|
156
|
+
/** Flow prepared text through columns and carved obstacle slots. */
|
|
157
|
+
declare function computeFlowLines(segments: readonly PreparedSegment[], opts: ComputeFlowLinesOptions): FlowLinesResult;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Segment text and measure every resulting segment with a caller-owned synchronous adapter.
|
|
161
|
+
*
|
|
162
|
+
* @param text - Text to normalize, segment, and measure.
|
|
163
|
+
* @param font - Font descriptor passed through to the measurement adapter.
|
|
164
|
+
* @param adapter - Synchronous measurement adapter used for each segment or grapheme.
|
|
165
|
+
* @param cache - Caller-owned cache keyed by font and segment text.
|
|
166
|
+
* @param stats - Optional cache hit/miss accounting object updated during measurement.
|
|
167
|
+
* @param segmentAdapter - Optional segmentation adapter; defaults to the built-in adapter.
|
|
168
|
+
* @returns A prepared segment list with widths, break kinds, and optional grapheme widths for
|
|
169
|
+
* word-like segments.
|
|
170
|
+
* @example
|
|
171
|
+
* ```ts
|
|
172
|
+
* import { analyzeAndMeasure } from "@graphrefly/ts/solutions/reactive-layout";
|
|
173
|
+
*
|
|
174
|
+
* const segments = analyzeAndMeasure(
|
|
175
|
+
* "Hello world",
|
|
176
|
+
* "16px system-ui",
|
|
177
|
+
* { measureSegment: (segment) => ({ width: segment.length * 8 }) },
|
|
178
|
+
* new Map(),
|
|
179
|
+
* );
|
|
180
|
+
* ```
|
|
181
|
+
* @remarks **Caller-owned adapter:** Measurement stays synchronous and host-injected; browser
|
|
182
|
+
* Canvas, Skia, React Native, or test adapters live outside this helper.
|
|
183
|
+
* @category solutions
|
|
184
|
+
*/
|
|
185
|
+
declare function analyzeAndMeasure(text: string, font: string, adapter: MeasurementAdapter, cache: Map<string, Map<string, number>>, stats?: SegmentMeasureStats, segmentAdapter?: SegmentAdapter): PreparedSegment[];
|
|
186
|
+
/**
|
|
187
|
+
* Compute greedy single-column line breaks over prepared segments.
|
|
188
|
+
*
|
|
189
|
+
* @param segments - Prepared segments from `analyzeAndMeasure` or a measurement provider.
|
|
190
|
+
* @param maxWidth - Maximum line width in pixels; non-finite or negative values produce no useful
|
|
191
|
+
* width budget.
|
|
192
|
+
* @param opts - Optional hyphen width and segment adapter for grapheme-aware slicing.
|
|
193
|
+
* @returns A `LineBreaksResult` containing ordered layout lines and the line count.
|
|
194
|
+
* @example
|
|
195
|
+
* ```ts
|
|
196
|
+
* import { analyzeAndMeasure, computeLineBreaks } from "@graphrefly/ts/solutions/reactive-layout";
|
|
197
|
+
*
|
|
198
|
+
* const segments = analyzeAndMeasure(
|
|
199
|
+
* "Hello world",
|
|
200
|
+
* "16px system-ui",
|
|
201
|
+
* { measureSegment: (segment) => ({ width: segment.length * 8 }) },
|
|
202
|
+
* new Map(),
|
|
203
|
+
* );
|
|
204
|
+
* const lineBreaks = computeLineBreaks(segments, 64);
|
|
205
|
+
* ```
|
|
206
|
+
* @remarks **Pure helper:** This does not subscribe, schedule, or emit messages; reactive bundles
|
|
207
|
+
* call it from ordinary graph nodes.
|
|
208
|
+
* @category solutions
|
|
209
|
+
*/
|
|
210
|
+
declare function computeLineBreaks(segments: readonly PreparedSegment[], maxWidth: number, opts?: {
|
|
211
|
+
readonly hyphenWidth?: number;
|
|
212
|
+
readonly segmentAdapter?: SegmentAdapter;
|
|
213
|
+
}): LineBreaksResult;
|
|
214
|
+
/** Lay out one line from a cursor, returning the next cursor for continuation. */
|
|
215
|
+
declare function layoutNextLine(segments: readonly PreparedSegment[], cursor: LayoutCursor, slotWidth: number, ctx?: LayoutNextLineContext): LayoutNextLineResult | null;
|
|
216
|
+
/** Subtract obstacle intervals from a horizontal text band. */
|
|
217
|
+
declare function carveTextLineSlots(base: Interval, blocked: readonly Interval[], minSlotWidth?: number): Interval[];
|
|
218
|
+
/**
|
|
219
|
+
* Compute per-grapheme boxes for already-broken lines.
|
|
220
|
+
*
|
|
221
|
+
* @param lineBreaks - Line break result whose cursors identify the visible grapheme ranges.
|
|
222
|
+
* @param segments - Prepared segments used to produce the line breaks.
|
|
223
|
+
* @param lineHeight - Height assigned to every line box.
|
|
224
|
+
* @param segmentAdapter - Optional segmentation adapter; defaults to the built-in adapter.
|
|
225
|
+
* @returns Character-position boxes in visual order, each with `x`, `y`, `width`, `height`, and
|
|
226
|
+
* zero-based line index.
|
|
227
|
+
* @example
|
|
228
|
+
* ```ts
|
|
229
|
+
* import {
|
|
230
|
+
* analyzeAndMeasure,
|
|
231
|
+
* computeCharPositions,
|
|
232
|
+
* computeLineBreaks,
|
|
233
|
+
* } from "@graphrefly/ts/solutions/reactive-layout";
|
|
234
|
+
*
|
|
235
|
+
* const segments = analyzeAndMeasure(
|
|
236
|
+
* "Hello world",
|
|
237
|
+
* "16px system-ui",
|
|
238
|
+
* { measureSegment: (segment) => ({ width: segment.length * 8 }) },
|
|
239
|
+
* new Map(),
|
|
240
|
+
* );
|
|
241
|
+
* const lineBreaks = computeLineBreaks(segments, 64);
|
|
242
|
+
* const positions = computeCharPositions(lineBreaks, segments, 20);
|
|
243
|
+
* ```
|
|
244
|
+
* @remarks **Already measured:** Widths come from the prepared segments; this helper only maps the
|
|
245
|
+
* line cursors into per-grapheme rectangles.
|
|
246
|
+
* @category solutions
|
|
247
|
+
*/
|
|
248
|
+
declare function computeCharPositions(lineBreaks: LineBreaksResult, segments: readonly PreparedSegment[], lineHeight: number, segmentAdapter?: SegmentAdapter): readonly CharPosition[];
|
|
249
|
+
|
|
250
|
+
declare function measurementIssue(code: string, message: string, targetId: string, measurementKind: string, opts?: {
|
|
251
|
+
readonly source?: string;
|
|
252
|
+
readonly details?: unknown;
|
|
253
|
+
readonly metadata?: Record<string, unknown>;
|
|
254
|
+
readonly severity?: DataIssue["severity"];
|
|
255
|
+
}): MeasurementIssue;
|
|
256
|
+
declare function measurementOk<T>(targetId: string, measurementKind: string, value: T, opts?: {
|
|
257
|
+
readonly source?: string;
|
|
258
|
+
readonly metadata?: Record<string, unknown>;
|
|
259
|
+
}): MeasurementResult<T>;
|
|
260
|
+
declare function latestMeasurementValue<T>(measurements: Measurements, targetId: string, measurementKind: string): T | undefined;
|
|
261
|
+
declare function tryMeasureHyphenWidth(adapter: MeasurementAdapter, font: string): number | undefined;
|
|
262
|
+
declare function validMeasurementSize(size: Size, label: string): Size;
|
|
263
|
+
declare function textMeasurementFacts(text: string, font: string, adapter: MeasurementAdapter, cache: Map<string, Map<string, number>>, segmentAdapter: SegmentAdapter, targetId: string, source: string): Measurements;
|
|
264
|
+
declare function inputNode<T>(g: Graph, input: T | Node<T> | undefined, fallback: T, name: string): {
|
|
265
|
+
readonly node: Node<T>;
|
|
266
|
+
readonly set: (value: T) => void;
|
|
267
|
+
};
|
|
268
|
+
declare function scopedName(scope: string, local: string): string;
|
|
269
|
+
/** Generic sync text measurement provider that emits graph-visible measurement facts. */
|
|
270
|
+
declare function textMeasurementProvider(opts: TextMeasurementProviderOptions): Node<Measurements>;
|
|
271
|
+
/** Provider helper for caller-injected synchronous text measurement. */
|
|
272
|
+
declare function injectedTextMeasurements(opts: InjectedTextMeasurementsOptions): Node<Measurements>;
|
|
273
|
+
/** Provider helper for deterministic precomputed text metrics. */
|
|
274
|
+
declare function precomputedTextMeasurements(opts: PrecomputedTextMeasurementsOptions): Node<Measurements>;
|
|
275
|
+
/** Provider helper for fixed-cell terminal/snapshot text measurement. */
|
|
276
|
+
declare function cellTextMeasurements(opts: CellTextMeasurementsOptions): Node<Measurements>;
|
|
277
|
+
/** Provider helper for caller-injected platform text capability nodes. */
|
|
278
|
+
declare function capabilityTextMeasurements(opts: CapabilityTextMeasurementsOptions): Node<Measurements>;
|
|
279
|
+
/** Provider helper that makes readiness facts an explicit measurement dependency. */
|
|
280
|
+
declare function readinessTextMeasurements(opts: ReadinessTextMeasurementsOptions): Node<Measurements>;
|
|
281
|
+
/** Provider helper that emits graph-visible readiness facts without measuring layout. */
|
|
282
|
+
declare function readinessMeasurements(opts: ReadinessMeasurementsOptions): Node<Measurements>;
|
|
283
|
+
/** Provider helper for image-size facts from caller-owned synchronous image measurers. */
|
|
284
|
+
declare function imageSizeMeasurements(opts: ImageSizeMeasurementsOptions): Node<Measurements>;
|
|
285
|
+
/** Provider helper for SVG bounds facts from caller-owned synchronous SVG measurers. */
|
|
286
|
+
declare function svgBoundsMeasurements(opts: SvgBoundsMeasurementsOptions): Node<Measurements>;
|
|
287
|
+
/** Merge provider fact nodes into the single measurements node consumed by layout bundles. */
|
|
288
|
+
declare function mergeMeasurements(opts: MergeMeasurementsOptions): Node<Measurements>;
|
|
289
|
+
/** Compose optional block measurement capability nodes into one graph-visible adapter node. */
|
|
290
|
+
declare function blockAdaptersProvider(opts: BlockAdaptersProviderOptions): Node<BlockAdapters>;
|
|
291
|
+
/** Provider helper for block measurement facts over declared block/max-width deps. */
|
|
292
|
+
declare function blockMeasurementProvider(opts: BlockMeasurementProviderOptions): Node<Measurements>;
|
|
293
|
+
|
|
294
|
+
export { rectIntervalForBand as A, svgBoundsMeasurements as B, CapabilityMeasureAdapter as C, textMeasurementProvider as D, blockedIntervalsForBand as E, columnGeometry as F, inputNode as G, latestMeasurementValue as H, ImageSizeAdapter as I, measurementIssue as J, measurementOk as K, sanitizeFlowColumns as L, sanitizeFlowContainer as M, sanitizeObstacles as N, scopedName as O, PrecomputedMeasureAdapter as P, textMeasurementFacts as Q, tryMeasureHyphenWidth as R, SvgBoundsAdapter as S, validMeasurementSize as T, CellMeasureAdapter as a, InjectedMeasureAdapter as b, analyzeAndMeasure as c, blockAdaptersProvider as d, blockMeasurementProvider as e, capabilityTextMeasurements as f, carveTextLineSlots as g, cellTextMeasurements as h, circleIntervalForBand as i, computeBlockFlow as j, computeCharPositions as k, computeFlowLines as l, computeLineBreaks as m, computeTotalHeight as n, imageSizeMeasurements as o, injectedTextMeasurements as p, layoutNextLine as q, measureBlock as r, measureBlocks as s, mergeMeasurements as t, precomputedTextMeasurements as u, reactiveBlockLayout as v, reactiveFlowLayout as w, reactiveLayout as x, readinessMeasurements as y, readinessTextMeasurements as z };
|