@synnaxlabs/pluto 0.46.7 → 0.47.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/Animated-BewuBtBY.cjs +1 -0
- package/dist/Animated-Ck-9v2gm.cjs +1 -0
- package/dist/Animated-M9ynNzcI.js +356 -0
- package/dist/Animated-otpyxn5i.js +28 -0
- package/dist/Box-BvqALodh.cjs +1 -0
- package/dist/Box-D5Qv__kr.js +95 -0
- package/dist/Button-BFoGC4WW.js +305 -0
- package/dist/Button-C3dvpk52.cjs +1 -0
- package/dist/Dialog-CO4iLhHf.js +58 -0
- package/dist/Dialog-DwhFD4z2.cjs +1 -0
- package/dist/Editable-BXFY3-UW.cjs +1 -0
- package/dist/Editable-CxgdRDPb.js +193 -0
- package/dist/Haul-2Xa_nMgc.cjs +1 -0
- package/dist/Haul-BuI0PZpo.js +128 -0
- package/dist/Items-DNcTFEUJ.cjs +4 -0
- package/dist/Items-G25zb57I.js +777 -0
- package/dist/Menu-D-uhqnfk.cjs +1 -0
- package/dist/Menu-DqkB9vpH.js +156 -0
- package/dist/Provider--RxgAoVG.js +434 -0
- package/dist/Provider-575hnWmi.cjs +5 -0
- package/dist/Tags-Dekr_hwk.cjs +1 -0
- package/dist/Tags-Dpu9kD_T.js +604 -0
- package/dist/Text-BzTkWLeU.js +1580 -0
- package/dist/Text-DECnk5vG.cjs +1 -0
- package/dist/{Video-CBAgqKPg.js → Video-CITi2j07.js} +1 -1
- package/dist/{Video-DqumxMbz.cjs → Video-VlT7jSYk.cjs} +1 -1
- package/dist/_commonjsHelpers-BH3jXuIh.cjs +1 -0
- package/dist/_commonjsHelpers-ByX85dGu.js +33 -0
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/{css-BYwooBtA.js → css-D6ZBcSwh.js} +800 -799
- package/dist/css-HnNQMUzV.cjs +8 -0
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/debounce-CW9Q-DsR.js +17 -0
- package/dist/debounce-heEWeOqL.cjs +1 -0
- package/dist/deep-DRVLw7iw.js +349 -0
- package/dist/deep-DtdcJG4q.cjs +1 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dimensions-BFCMI7yN.js +19 -0
- package/dist/dimensions-CGLhBwVq.cjs +1 -0
- package/dist/eraser-Dm5Du4PL.cjs +11 -0
- package/dist/eraser-DvzR9kLf.js +955 -0
- package/dist/eslint.config.d.ts +3 -0
- package/dist/eslint.config.d.ts.map +1 -0
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +70 -67
- package/dist/external-B2Q-Yx8D.cjs +1 -0
- package/dist/external-B7hb5HYU.js +88 -0
- package/dist/external-B9a_p-VK.cjs +1 -0
- package/dist/external-BA6DRS2n.cjs +1 -0
- package/dist/external-BVcgi9yX.cjs +1 -0
- package/dist/external-BZwFEYop.js +44 -0
- package/dist/external-BhOvtmPt.js +24 -0
- package/dist/external-C5W7VXIW.cjs +1 -0
- package/dist/external-C5ssXUvL.cjs +46 -0
- package/dist/external-CGRGVYRj.js +31 -0
- package/dist/{external-CnSq_bSU.js → external-CMiEiLpE.js} +29 -19
- package/dist/external-C_dsD7px.cjs +1 -0
- package/dist/external-CeNR2kU9.js +46 -0
- package/dist/{main-CEC8k4uE.js → external-CraRr06G.js} +16962 -22990
- package/dist/external-D9LndfvY.js +29 -0
- package/dist/external-DEWhnbVF.cjs +1 -0
- package/dist/external-DUoHSX0Q.js +80 -0
- package/dist/external-DZSXelLG.js +130 -0
- package/dist/external-DrUtWpiV.js +388 -0
- package/dist/external-FIE7PzLB.cjs +1 -0
- package/dist/external-OLyg-4Ab.cjs +1 -0
- package/dist/external-_LWHQroW.cjs +1 -0
- package/dist/external-g62tixOz.cjs +85 -0
- package/dist/{external-CafWN471.js → external-x9Ylk2op.js} +108 -97
- package/dist/flex.cjs +1 -1
- package/dist/flex.js +1 -1
- package/dist/{fontString-CVUEOEMw.js → fontString-CGd4NYXa.js} +11 -10
- package/dist/fontString-yPlq8smc.cjs +1 -0
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/hooks-15yB7IKE.js +74 -0
- package/dist/hooks-D_-XdOAe.cjs +1 -0
- package/dist/index.cjs +16 -16
- package/dist/index.js +10251 -9623
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/pluto.css +1 -1
- package/dist/{provider-CKYgKu3z.js → provider-C8In649C.js} +4955 -8152
- package/dist/provider-lNhTlIWj.cjs +72 -0
- package/dist/src/aether/aether/aether.d.ts.map +1 -1
- package/dist/src/aether/main.d.ts.map +1 -1
- package/dist/src/arc/external.d.ts +1 -1
- package/dist/src/arc/external.d.ts.map +1 -1
- package/dist/src/arc/functions/Base.d.ts.map +1 -0
- package/dist/src/arc/functions/constant/Constant.d.ts.map +1 -0
- package/dist/src/arc/functions/constant/Form.d.ts.map +1 -0
- package/dist/src/arc/functions/constant/external.d.ts.map +1 -0
- package/dist/src/arc/functions/constant/index.d.ts.map +1 -0
- package/dist/src/arc/functions/external.d.ts.map +1 -0
- package/dist/src/arc/functions/index.d.ts.map +1 -0
- package/dist/src/arc/functions/operator/Operator.d.ts.map +1 -0
- package/dist/src/arc/functions/operator/external.d.ts.map +1 -0
- package/dist/src/arc/functions/operator/index.d.ts.map +1 -0
- package/dist/src/arc/functions/read/Form.d.ts.map +1 -0
- package/dist/src/arc/functions/read/Read.d.ts.map +1 -0
- package/dist/src/arc/functions/read/external.d.ts.map +1 -0
- package/dist/src/arc/functions/read/index.d.ts.map +1 -0
- package/dist/src/arc/functions/registry.d.ts.map +1 -0
- package/dist/src/arc/functions/select/Select.d.ts.map +1 -0
- package/dist/src/arc/functions/select/external.d.ts.map +1 -0
- package/dist/src/arc/functions/select/index.d.ts.map +1 -0
- package/dist/src/arc/functions/sink/Form.d.ts.map +1 -0
- package/dist/src/arc/functions/sink/Sink.d.ts.map +1 -0
- package/dist/src/arc/functions/sink/external.d.ts.map +1 -0
- package/dist/src/arc/functions/sink/index.d.ts.map +1 -0
- package/dist/src/arc/functions/source/Form.d.ts.map +1 -0
- package/dist/src/arc/functions/source/Source.d.ts.map +1 -0
- package/dist/src/arc/functions/source/external.d.ts.map +1 -0
- package/dist/src/arc/functions/source/index.d.ts.map +1 -0
- package/dist/src/arc/functions/stable/Form.d.ts.map +1 -0
- package/dist/src/arc/functions/stable/StableFor.d.ts.map +1 -0
- package/dist/src/arc/functions/stable/external.d.ts.map +1 -0
- package/dist/src/arc/functions/stable/index.d.ts.map +1 -0
- package/dist/src/arc/functions/status/Change.d.ts.map +1 -0
- package/dist/src/arc/functions/status/Form.d.ts.map +1 -0
- package/dist/src/arc/functions/status/external.d.ts.map +1 -0
- package/dist/src/arc/functions/status/index.d.ts.map +1 -0
- package/dist/src/arc/functions/types/index.d.ts.map +1 -0
- package/dist/src/arc/functions/types/spec.d.ts.map +1 -0
- package/dist/src/arc/handle/Core.d.ts.map +1 -1
- package/dist/src/arc/handle/Sink.d.ts.map +1 -1
- package/dist/src/arc/handle/Source.d.ts.map +1 -1
- package/dist/src/arc/handle/external.d.ts.map +1 -1
- package/dist/src/arc/handle/index.d.ts.map +1 -1
- package/dist/src/arc/queries.d.ts +6 -3
- package/dist/src/arc/queries.d.ts.map +1 -1
- package/dist/src/arc/queries.spec.d.ts +2 -0
- package/dist/src/arc/queries.spec.d.ts.map +1 -0
- package/dist/src/button/Button.d.ts +1 -1
- package/dist/src/button/Button.d.ts.map +1 -1
- package/dist/src/channel/AliasInput.d.ts +0 -1
- package/dist/src/channel/AliasInput.d.ts.map +1 -1
- package/dist/src/channel/CreateCalculatedIcon.d.ts +3 -0
- package/dist/src/channel/CreateCalculatedIcon.d.ts.map +1 -0
- package/dist/src/channel/LinePlot.d.ts +1 -3
- package/dist/src/channel/LinePlot.d.ts.map +1 -1
- package/dist/src/channel/external.d.ts +1 -0
- package/dist/src/channel/external.d.ts.map +1 -1
- package/dist/src/channel/queries.d.ts +77 -5
- package/dist/src/channel/queries.d.ts.map +1 -1
- package/dist/src/component/SelectSize.d.ts.map +1 -1
- package/dist/src/css/css.d.ts +1 -2
- package/dist/src/css/css.d.ts.map +1 -1
- package/dist/src/flex/Box.d.ts +1 -2
- package/dist/src/flex/Box.d.ts.map +1 -1
- package/dist/src/flex/index.d.ts +1 -1
- package/dist/src/flex/index.d.ts.map +1 -1
- package/dist/src/flux/Provider.d.ts.map +1 -1
- package/dist/src/flux/aether/provider.d.ts +1 -1
- package/dist/src/flux/aether/provider.d.ts.map +1 -1
- package/dist/src/flux/core/client.d.ts.map +1 -1
- package/dist/src/flux/core/external.d.ts.map +1 -1
- package/dist/src/flux/core/index.d.ts.map +1 -1
- package/dist/src/flux/list.d.ts +5 -1
- package/dist/src/flux/list.d.ts.map +1 -1
- package/dist/src/group/index.d.ts.map +1 -1
- package/dist/src/hardware/device/Select.d.ts +0 -1
- package/dist/src/hardware/device/Select.d.ts.map +1 -1
- package/dist/src/hardware/device/queries.d.ts +6 -6
- package/dist/src/hardware/rack/Select.d.ts +0 -1
- package/dist/src/hardware/rack/Select.d.ts.map +1 -1
- package/dist/src/header/Header.d.ts.map +1 -1
- package/dist/src/icon/registry.d.ts.map +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/input/Item.d.ts +2 -2
- package/dist/src/input/Item.d.ts.map +1 -1
- package/dist/src/log/aether/Log.d.ts.map +1 -1
- package/dist/src/menu/ContextMenu.d.ts +0 -3
- package/dist/src/menu/ContextMenu.d.ts.map +1 -1
- package/dist/src/menu/external.d.ts +1 -0
- package/dist/src/menu/external.d.ts.map +1 -1
- package/dist/src/menu/types.d.ts +4 -0
- package/dist/src/menu/types.d.ts.map +1 -0
- package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
- package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
- package/dist/src/schematic/symbol/Forms.d.ts +1 -0
- package/dist/src/schematic/symbol/Forms.d.ts.map +1 -1
- package/dist/src/schematic/symbol/Primitives.d.ts +11 -2
- package/dist/src/schematic/symbol/Primitives.d.ts.map +1 -1
- package/dist/src/schematic/symbol/Symbols.d.ts +7 -0
- package/dist/src/schematic/symbol/Symbols.d.ts.map +1 -1
- package/dist/src/schematic/symbol/registry.d.ts +2 -1
- package/dist/src/schematic/symbol/registry.d.ts.map +1 -1
- package/dist/src/select/Button.d.ts +0 -1
- package/dist/src/select/Button.d.ts.map +1 -1
- package/dist/src/select/Multiple.d.ts +5 -6
- package/dist/src/select/Multiple.d.ts.map +1 -1
- package/dist/src/select/MultipleTrigger.d.ts +0 -1
- package/dist/src/select/MultipleTrigger.d.ts.map +1 -1
- package/dist/src/select/SearchInput.d.ts.map +1 -1
- package/dist/src/select/Single.d.ts +1 -2
- package/dist/src/select/Single.d.ts.map +1 -1
- package/dist/src/select/Static.d.ts +0 -1
- package/dist/src/select/Static.d.ts.map +1 -1
- package/dist/src/select/external.d.ts +1 -0
- package/dist/src/select/external.d.ts.map +1 -1
- package/dist/src/select/flex/Alignment.d.ts +7 -0
- package/dist/src/select/flex/Alignment.d.ts.map +1 -0
- package/dist/src/select/flex/index.d.ts +2 -0
- package/dist/src/select/flex/index.d.ts.map +1 -0
- package/dist/src/select/text/Level.d.ts.map +1 -1
- package/dist/src/select/text/Weight.d.ts.map +1 -1
- package/dist/src/status/aether/errorHandler.d.ts.map +1 -1
- package/dist/src/status/aether/external.d.ts.map +1 -1
- package/dist/src/status/core/external.d.ts +0 -1
- package/dist/src/status/core/external.d.ts.map +1 -1
- package/dist/src/status/core/index.d.ts.map +1 -1
- package/dist/src/status/external.d.ts +1 -0
- package/dist/src/status/external.d.ts.map +1 -1
- package/dist/src/status/index.d.ts.map +1 -1
- package/dist/src/status/queries.d.ts +5 -1
- package/dist/src/status/queries.d.ts.map +1 -1
- package/dist/src/synnax/Provider.d.ts.map +1 -1
- package/dist/src/tabs/Selector.d.ts.map +1 -1
- package/dist/src/telem/SelectDataType.d.ts.map +1 -1
- package/dist/src/telem/aether/context.d.ts +1 -2
- package/dist/src/telem/aether/context.d.ts.map +1 -1
- package/dist/src/telem/aether/noop.d.ts +2 -1
- package/dist/src/telem/aether/noop.d.ts.map +1 -1
- package/dist/src/telem/aether/remote.d.ts.map +1 -1
- package/dist/src/telem/aether/telem.d.ts +9 -0
- package/dist/src/telem/aether/telem.d.ts.map +1 -1
- package/dist/src/telem/client/reader.d.ts +1 -1
- package/dist/src/telem/client/reader.d.ts.map +1 -1
- package/dist/src/telem/control/Controller.d.ts.map +1 -1
- package/dist/src/telem/control/aether/controller.d.ts +0 -1
- package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
- package/dist/src/telem/control/aether/state.d.ts.map +1 -1
- package/dist/src/theming/Provider.d.ts +0 -2
- package/dist/src/theming/Provider.d.ts.map +1 -1
- package/dist/src/tooltip/Config.d.ts.map +1 -1
- package/dist/src/tree/Context.d.ts.map +1 -1
- package/dist/src/vis/input/aether/index.d.ts +2 -0
- package/dist/src/vis/input/aether/index.d.ts.map +1 -0
- package/dist/src/vis/input/aether/input.d.ts +40 -0
- package/dist/src/vis/input/aether/input.d.ts.map +1 -0
- package/dist/src/vis/input/index.d.ts +2 -0
- package/dist/src/vis/input/index.d.ts.map +1 -0
- package/dist/src/vis/input/use.d.ts +9 -0
- package/dist/src/vis/input/use.d.ts.map +1 -0
- package/dist/src/vis/rule/Rule.d.ts.map +1 -1
- package/dist/src/vis/value/aether/value.d.ts +1 -2
- package/dist/src/vis/value/aether/value.d.ts.map +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theme.css +11 -0
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/types-BNX_Jj6k.js +80 -0
- package/dist/types-D-yz1qsT.cjs +1 -0
- package/dist/{units-CeCcz4O4.js → units-BqIfn6VX.js} +1 -1
- package/dist/units-DCifOxd9.cjs +1 -0
- package/dist/useStaticData-BTwIe0Il.cjs +1 -0
- package/dist/useStaticData-p8sk2VCJ.js +1051 -0
- package/dist/value-B3LTg1lE.cjs +53 -0
- package/dist/value-ChGMEPP3.js +6508 -0
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +8 -8
- package/dist/Toggle-BSJnQkJM.js +0 -26
- package/dist/Toggle-C0DIo816.cjs +0 -1
- package/dist/css-B0VZnJIa.cjs +0 -8
- package/dist/external-B0_MIms2.js +0 -78
- package/dist/external-B1ETpyFM.js +0 -89
- package/dist/external-B3WxrVX0.js +0 -30
- package/dist/external-BP7GC2X2.cjs +0 -1
- package/dist/external-Bf8170BC.js +0 -380
- package/dist/external-BgNRw5Al.js +0 -23
- package/dist/external-BgSmm_d3.js +0 -84
- package/dist/external-BmxkwvZQ.cjs +0 -1
- package/dist/external-BoVr9B-m.cjs +0 -1
- package/dist/external-BrDpLk_U.js +0 -42
- package/dist/external-CAiETio2.js +0 -10
- package/dist/external-CQpqJGka.cjs +0 -1
- package/dist/external-CmmZWsrB.cjs +0 -1
- package/dist/external-Cutp76YR.cjs +0 -1
- package/dist/external-Cux9mC64.js +0 -69
- package/dist/external-D8EUzT1C.cjs +0 -1
- package/dist/external-DEYDSJ_G.cjs +0 -1
- package/dist/external-DElBi-Q-.js +0 -87
- package/dist/external-DP8Ao5TN.cjs +0 -1
- package/dist/external-DS6CmLLZ.cjs +0 -46
- package/dist/external-DoerTjzk.js +0 -14
- package/dist/external-FJ3vTUtb.cjs +0 -1
- package/dist/external-V3s19XkB.cjs +0 -1
- package/dist/external-Zuxgy86I.cjs +0 -1
- package/dist/fontString-DBgTdlAe.cjs +0 -1
- package/dist/main-Bg0vBNCG.cjs +0 -92
- package/dist/provider-CSa0L57i.js +0 -4673
- package/dist/provider-CWezGpoq.cjs +0 -52
- package/dist/provider-Fw6FIHoE.cjs +0 -83
- package/dist/src/arc/stage/Base.d.ts.map +0 -1
- package/dist/src/arc/stage/constant/Constant.d.ts.map +0 -1
- package/dist/src/arc/stage/constant/Form.d.ts.map +0 -1
- package/dist/src/arc/stage/constant/external.d.ts.map +0 -1
- package/dist/src/arc/stage/constant/index.d.ts.map +0 -1
- package/dist/src/arc/stage/external.d.ts.map +0 -1
- package/dist/src/arc/stage/index.d.ts.map +0 -1
- package/dist/src/arc/stage/operator/Operator.d.ts.map +0 -1
- package/dist/src/arc/stage/operator/external.d.ts.map +0 -1
- package/dist/src/arc/stage/operator/index.d.ts.map +0 -1
- package/dist/src/arc/stage/read/Form.d.ts.map +0 -1
- package/dist/src/arc/stage/read/Read.d.ts.map +0 -1
- package/dist/src/arc/stage/read/external.d.ts.map +0 -1
- package/dist/src/arc/stage/read/index.d.ts.map +0 -1
- package/dist/src/arc/stage/registry.d.ts.map +0 -1
- package/dist/src/arc/stage/select/Select.d.ts.map +0 -1
- package/dist/src/arc/stage/select/external.d.ts.map +0 -1
- package/dist/src/arc/stage/select/index.d.ts.map +0 -1
- package/dist/src/arc/stage/sink/Form.d.ts.map +0 -1
- package/dist/src/arc/stage/sink/Sink.d.ts.map +0 -1
- package/dist/src/arc/stage/sink/external.d.ts.map +0 -1
- package/dist/src/arc/stage/sink/index.d.ts.map +0 -1
- package/dist/src/arc/stage/source/Form.d.ts.map +0 -1
- package/dist/src/arc/stage/source/Source.d.ts.map +0 -1
- package/dist/src/arc/stage/source/external.d.ts.map +0 -1
- package/dist/src/arc/stage/source/index.d.ts.map +0 -1
- package/dist/src/arc/stage/stable/Form.d.ts.map +0 -1
- package/dist/src/arc/stage/stable/StableFor.d.ts.map +0 -1
- package/dist/src/arc/stage/stable/external.d.ts.map +0 -1
- package/dist/src/arc/stage/stable/index.d.ts.map +0 -1
- package/dist/src/arc/stage/status/Change.d.ts.map +0 -1
- package/dist/src/arc/stage/status/Form.d.ts.map +0 -1
- package/dist/src/arc/stage/status/external.d.ts.map +0 -1
- package/dist/src/arc/stage/status/index.d.ts.map +0 -1
- package/dist/src/arc/stage/types/index.d.ts.map +0 -1
- package/dist/src/arc/stage/types/spec.d.ts.map +0 -1
- package/dist/src/flex/Select.d.ts +0 -7
- package/dist/src/flex/Select.d.ts.map +0 -1
- package/dist/src/flex/external.d.ts +0 -3
- package/dist/src/flex/external.d.ts.map +0 -1
- package/dist/src/override/factory.d.ts +0 -3
- package/dist/src/override/factory.d.ts.map +0 -1
- package/dist/src/override/index.d.ts +0 -2
- package/dist/src/override/index.d.ts.map +0 -1
- package/dist/src/status/CreateIcon.d.ts +0 -1
- package/dist/src/status/CreateIcon.d.ts.map +0 -1
- package/dist/src/status/core/SelectVariant.d.ts +0 -7
- package/dist/src/status/core/SelectVariant.d.ts.map +0 -1
- package/dist/units-gFJ6UvpU.cjs +0 -1
- package/dist/useKeysData-DXXVQfXZ.js +0 -18
- package/dist/useKeysData-Do63LaI0.cjs +0 -1
- /package/dist/src/arc/{stage → functions}/Base.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/constant/Constant.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/constant/Form.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/constant/external.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/constant/index.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/external.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/index.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/operator/Operator.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/operator/external.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/operator/index.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/read/Form.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/read/Read.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/read/external.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/read/index.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/registry.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/select/Select.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/select/external.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/select/index.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/sink/Form.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/sink/Sink.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/sink/external.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/sink/index.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/source/Form.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/source/Source.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/source/external.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/source/index.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/stable/Form.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/stable/StableFor.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/stable/external.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/stable/index.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/status/Change.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/status/Form.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/status/external.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/status/index.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/types/index.d.ts +0 -0
- /package/dist/src/arc/{stage → functions}/types/spec.d.ts +0 -0
|
@@ -0,0 +1,955 @@
|
|
|
1
|
+
import { j as h, i as C, Q as d, o as k, L as y, c as U, C as q } from "./css-D6ZBcSwh.js";
|
|
2
|
+
import { z as _ } from "zod";
|
|
3
|
+
import { j as x, C as z, B as K, k as W, l as H, L as V } from "./provider-C8In649C.js";
|
|
4
|
+
import { a as G } from "./dimensions-BFCMI7yN.js";
|
|
5
|
+
const Z = _.object({
|
|
6
|
+
include: _.string().array().optional(),
|
|
7
|
+
exclude: _.string().array().optional(),
|
|
8
|
+
level: _.enum(x.LOG_LEVELS).optional().default("info")
|
|
9
|
+
}), L = "alamos-provider";
|
|
10
|
+
class v extends z {
|
|
11
|
+
static TYPE = "alamos.Provider";
|
|
12
|
+
schema = Z;
|
|
13
|
+
afterUpdate(t) {
|
|
14
|
+
if (t.getOptional(L) != null) return;
|
|
15
|
+
const s = [], { include: i, exclude: r, level: a } = this.state;
|
|
16
|
+
(i != null || r != null) && s.push(x.logLevelKeyFiler({ include: i, exclude: r })), a != null && s.push(x.logThresholdFilter(a)), s.length === 0 && s.push(() => !1), this.internal.ins = new x.Instrumentation({
|
|
17
|
+
key: "aether",
|
|
18
|
+
logger: new x.Logger({ filters: s })
|
|
19
|
+
}), t.set(L, this.internal.ins);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const J = (l, t) => {
|
|
23
|
+
const e = l.get(L);
|
|
24
|
+
if (e == null) throw new Error("No instrumentation provider");
|
|
25
|
+
return t == null ? e : e.child(t);
|
|
26
|
+
}, pt = {
|
|
27
|
+
[v.TYPE]: v
|
|
28
|
+
}, T = (l, t) => h.construct(
|
|
29
|
+
h.left(l) - t.x,
|
|
30
|
+
h.top(l) - t.y,
|
|
31
|
+
h.width(l) + t.x * 2,
|
|
32
|
+
h.height(l) + t.y * 2
|
|
33
|
+
);
|
|
34
|
+
class R {
|
|
35
|
+
scale_;
|
|
36
|
+
wrapped;
|
|
37
|
+
atlasRegistry;
|
|
38
|
+
cachedFont = null;
|
|
39
|
+
cachedFillStyle = null;
|
|
40
|
+
cachedStrokeStyle = null;
|
|
41
|
+
cachedLineWidth = null;
|
|
42
|
+
cachedGlobalAlpha = null;
|
|
43
|
+
cachedTextAlign = null;
|
|
44
|
+
cachedTextBaseline = null;
|
|
45
|
+
cachedLineCap = null;
|
|
46
|
+
cachedLineJoin = null;
|
|
47
|
+
cachedMiterLimit = null;
|
|
48
|
+
dpr;
|
|
49
|
+
constructor(t, e, s, i = C.XY.IDENTITY) {
|
|
50
|
+
this.wrapped = t, this.scale_ = i, this.atlasRegistry = e, this.dpr = s;
|
|
51
|
+
}
|
|
52
|
+
get fontStretch() {
|
|
53
|
+
return this.wrapped.fontStretch;
|
|
54
|
+
}
|
|
55
|
+
set fontStretch(t) {
|
|
56
|
+
this.wrapped.fontStretch = t;
|
|
57
|
+
}
|
|
58
|
+
get fontVariantCaps() {
|
|
59
|
+
return this.wrapped.fontVariantCaps;
|
|
60
|
+
}
|
|
61
|
+
set fontVariantCaps(t) {
|
|
62
|
+
this.wrapped.fontVariantCaps = t;
|
|
63
|
+
}
|
|
64
|
+
isContextLost() {
|
|
65
|
+
return this.wrapped.isContextLost();
|
|
66
|
+
}
|
|
67
|
+
get wordSpacing() {
|
|
68
|
+
return this.wrapped.wordSpacing;
|
|
69
|
+
}
|
|
70
|
+
set wordSpacing(t) {
|
|
71
|
+
this.wrapped.wordSpacing = t;
|
|
72
|
+
}
|
|
73
|
+
get letterSpacing() {
|
|
74
|
+
return this.wrapped.letterSpacing;
|
|
75
|
+
}
|
|
76
|
+
set letterSpacing(t) {
|
|
77
|
+
this.wrapped.letterSpacing = t;
|
|
78
|
+
}
|
|
79
|
+
get textRendering() {
|
|
80
|
+
return this.wrapped.textRendering;
|
|
81
|
+
}
|
|
82
|
+
set textRendering(t) {
|
|
83
|
+
this.wrapped.textRendering = t;
|
|
84
|
+
}
|
|
85
|
+
checkAtlasFillStyle(t = !1) {
|
|
86
|
+
return t && typeof this.fillStyle == "string" ? [!0, this.fillStyle] : (t && console.warn(
|
|
87
|
+
"attempted to use a text atlas with a gradient fill style. This is not supported. Falling back to default canvas fill."
|
|
88
|
+
), [!1, null]);
|
|
89
|
+
}
|
|
90
|
+
reset() {
|
|
91
|
+
this.wrapped.reset();
|
|
92
|
+
}
|
|
93
|
+
applyScale(t) {
|
|
94
|
+
return new R(
|
|
95
|
+
this,
|
|
96
|
+
this.atlasRegistry,
|
|
97
|
+
this.dpr,
|
|
98
|
+
t
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
get canvas() {
|
|
102
|
+
return this.wrapped.canvas;
|
|
103
|
+
}
|
|
104
|
+
get miterLimit() {
|
|
105
|
+
return this.cachedMiterLimit ?? this.wrapped.miterLimit;
|
|
106
|
+
}
|
|
107
|
+
set miterLimit(t) {
|
|
108
|
+
const e = this.scale_.x.dim(t);
|
|
109
|
+
e !== this.cachedMiterLimit && (this.cachedMiterLimit = e, this.wrapped.miterLimit = e);
|
|
110
|
+
}
|
|
111
|
+
get globalAlpha() {
|
|
112
|
+
return this.cachedGlobalAlpha ?? this.wrapped.globalAlpha;
|
|
113
|
+
}
|
|
114
|
+
set globalAlpha(t) {
|
|
115
|
+
t !== this.cachedGlobalAlpha && (this.cachedGlobalAlpha = t, this.wrapped.globalAlpha = t);
|
|
116
|
+
}
|
|
117
|
+
get globalCompositeOperation() {
|
|
118
|
+
return this.wrapped.globalCompositeOperation;
|
|
119
|
+
}
|
|
120
|
+
set globalCompositeOperation(t) {
|
|
121
|
+
this.wrapped.globalCompositeOperation = t;
|
|
122
|
+
}
|
|
123
|
+
get fillStyle() {
|
|
124
|
+
return this.cachedFillStyle ?? this.wrapped.fillStyle;
|
|
125
|
+
}
|
|
126
|
+
set fillStyle(t) {
|
|
127
|
+
t !== this.cachedFillStyle && (this.cachedFillStyle = t, this.wrapped.fillStyle = t);
|
|
128
|
+
}
|
|
129
|
+
get strokeStyle() {
|
|
130
|
+
return this.cachedStrokeStyle ?? this.wrapped.strokeStyle;
|
|
131
|
+
}
|
|
132
|
+
set strokeStyle(t) {
|
|
133
|
+
t !== this.cachedStrokeStyle && (this.cachedStrokeStyle = t, this.wrapped.strokeStyle = t);
|
|
134
|
+
}
|
|
135
|
+
drawImage(t, e, s, i, r, a, n, o, p) {
|
|
136
|
+
this.wrapped.drawImage(
|
|
137
|
+
t,
|
|
138
|
+
e,
|
|
139
|
+
s,
|
|
140
|
+
i,
|
|
141
|
+
r,
|
|
142
|
+
a != null ? this.scale_.x.pos(a) : a,
|
|
143
|
+
n != null ? this.scale_.y.pos(n) : n,
|
|
144
|
+
o != null ? this.scale_.x.dim(o) : o,
|
|
145
|
+
p != null ? this.scale_.y.dim(p) : p
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
beginPath() {
|
|
149
|
+
this.wrapped.beginPath();
|
|
150
|
+
}
|
|
151
|
+
clip(t, e) {
|
|
152
|
+
this.wrapped.clip(t, e);
|
|
153
|
+
}
|
|
154
|
+
fill(t, e) {
|
|
155
|
+
if (t == null) return this.wrapped.fill();
|
|
156
|
+
this.wrapped.fill(t, e);
|
|
157
|
+
}
|
|
158
|
+
isPointInPath(t, e, s, i) {
|
|
159
|
+
return this.wrapped.isPointInPath(t, e, s, i);
|
|
160
|
+
}
|
|
161
|
+
isPointInStroke(t, e, s) {
|
|
162
|
+
return this.wrapped.isPointInStroke(t, e, s);
|
|
163
|
+
}
|
|
164
|
+
stroke(t) {
|
|
165
|
+
if (t == null) return this.wrapped.stroke();
|
|
166
|
+
this.wrapped.stroke(t);
|
|
167
|
+
}
|
|
168
|
+
createConicGradient(t, e, s) {
|
|
169
|
+
return this.wrapped.createConicGradient(t, e, s);
|
|
170
|
+
}
|
|
171
|
+
createLinearGradient(t, e, s, i) {
|
|
172
|
+
return this.wrapped.createLinearGradient(t, e, s, i);
|
|
173
|
+
}
|
|
174
|
+
createPattern(t, e) {
|
|
175
|
+
return this.wrapped.createPattern(t, e);
|
|
176
|
+
}
|
|
177
|
+
createRadialGradient(t, e, s, i, r, a) {
|
|
178
|
+
return this.wrapped.createRadialGradient(t, e, s, i, r, a);
|
|
179
|
+
}
|
|
180
|
+
get filter() {
|
|
181
|
+
return this.wrapped.filter;
|
|
182
|
+
}
|
|
183
|
+
set filter(t) {
|
|
184
|
+
this.wrapped.filter = t;
|
|
185
|
+
}
|
|
186
|
+
createImageData(t, e, s) {
|
|
187
|
+
return this.wrapped.createImageData(t, e, s);
|
|
188
|
+
}
|
|
189
|
+
getImageData(t, e, s, i, r) {
|
|
190
|
+
return this.wrapped.getImageData(t, e, s, i, r);
|
|
191
|
+
}
|
|
192
|
+
putImageData(t, e, s, i, r, a, n) {
|
|
193
|
+
this.wrapped.putImageData(
|
|
194
|
+
// @ts-expect-error - typescript overloads cause issues here
|
|
195
|
+
t,
|
|
196
|
+
e,
|
|
197
|
+
s,
|
|
198
|
+
i,
|
|
199
|
+
r,
|
|
200
|
+
a,
|
|
201
|
+
n
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
get imageSmoothingEnabled() {
|
|
205
|
+
return this.wrapped.imageSmoothingEnabled;
|
|
206
|
+
}
|
|
207
|
+
set imageSmoothingEnabled(t) {
|
|
208
|
+
this.wrapped.imageSmoothingEnabled = t;
|
|
209
|
+
}
|
|
210
|
+
get imageSmoothingQuality() {
|
|
211
|
+
return this.wrapped.imageSmoothingQuality;
|
|
212
|
+
}
|
|
213
|
+
set imageSmoothingQuality(t) {
|
|
214
|
+
this.wrapped.imageSmoothingQuality = t;
|
|
215
|
+
}
|
|
216
|
+
arc(t, e, s, i, r, a) {
|
|
217
|
+
this.wrapped.arc(
|
|
218
|
+
this.scale_.x.pos(t),
|
|
219
|
+
this.scale_.y.pos(e),
|
|
220
|
+
this.scale_.x.dim(s),
|
|
221
|
+
i,
|
|
222
|
+
r,
|
|
223
|
+
a
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
arcTo(t, e, s, i, r) {
|
|
227
|
+
this.wrapped.arcTo(
|
|
228
|
+
this.scale_.x.pos(t),
|
|
229
|
+
this.scale_.y.pos(e),
|
|
230
|
+
this.scale_.x.pos(s),
|
|
231
|
+
this.scale_.y.pos(i),
|
|
232
|
+
this.scale_.x.dim(r)
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
bezierCurveTo(t, e, s, i, r, a) {
|
|
236
|
+
this.wrapped.bezierCurveTo(
|
|
237
|
+
this.scale_.x.pos(t),
|
|
238
|
+
this.scale_.y.pos(e),
|
|
239
|
+
this.scale_.x.pos(s),
|
|
240
|
+
this.scale_.y.pos(i),
|
|
241
|
+
this.scale_.x.pos(r),
|
|
242
|
+
this.scale_.y.pos(a)
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
closePath() {
|
|
246
|
+
this.wrapped.closePath();
|
|
247
|
+
}
|
|
248
|
+
ellipse(t, e, s, i, r, a, n, o) {
|
|
249
|
+
this.wrapped.ellipse(
|
|
250
|
+
this.scale_.x.pos(t),
|
|
251
|
+
this.scale_.y.pos(e),
|
|
252
|
+
this.scale_.x.dim(s),
|
|
253
|
+
this.scale_.y.dim(i),
|
|
254
|
+
r,
|
|
255
|
+
a,
|
|
256
|
+
n,
|
|
257
|
+
o
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
lineTo(t, e) {
|
|
261
|
+
this.wrapped.lineTo(this.scale_.x.pos(t), this.scale_.y.pos(e));
|
|
262
|
+
}
|
|
263
|
+
moveTo(t, e) {
|
|
264
|
+
this.wrapped.moveTo(this.scale_.x.pos(t), this.scale_.y.pos(e));
|
|
265
|
+
}
|
|
266
|
+
quadraticCurveTo(t, e, s, i) {
|
|
267
|
+
this.wrapped.quadraticCurveTo(
|
|
268
|
+
this.scale_.x.pos(t),
|
|
269
|
+
this.scale_.y.pos(e),
|
|
270
|
+
this.scale_.x.pos(s),
|
|
271
|
+
this.scale_.y.pos(i)
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
rect(t, e, s, i) {
|
|
275
|
+
this.wrapped.rect(
|
|
276
|
+
this.scale_.x.pos(t),
|
|
277
|
+
this.scale_.y.pos(e),
|
|
278
|
+
this.scale_.x.dim(s),
|
|
279
|
+
this.scale_.y.dim(i)
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
roundRect(t, e, s, i, r) {
|
|
283
|
+
this.wrapped.roundRect(
|
|
284
|
+
this.scale_.x.pos(t),
|
|
285
|
+
this.scale_.y.pos(e),
|
|
286
|
+
this.scale_.x.dim(s),
|
|
287
|
+
this.scale_.y.dim(i),
|
|
288
|
+
typeof r == "number" ? this.scale_.x.dim(r) : r
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
get lineCap() {
|
|
292
|
+
return this.cachedLineCap ?? this.wrapped.lineCap;
|
|
293
|
+
}
|
|
294
|
+
set lineCap(t) {
|
|
295
|
+
t !== this.cachedLineCap && (this.cachedLineCap = t, this.wrapped.lineCap = t);
|
|
296
|
+
}
|
|
297
|
+
get lineDashOffset() {
|
|
298
|
+
return this.wrapped.lineDashOffset;
|
|
299
|
+
}
|
|
300
|
+
set lineDashOffset(t) {
|
|
301
|
+
this.wrapped.lineDashOffset = this.scale_.x.dim(t);
|
|
302
|
+
}
|
|
303
|
+
get lineJoin() {
|
|
304
|
+
return this.cachedLineJoin ?? this.wrapped.lineJoin;
|
|
305
|
+
}
|
|
306
|
+
set lineJoin(t) {
|
|
307
|
+
t !== this.cachedLineJoin && (this.cachedLineJoin = t, this.wrapped.lineJoin = t);
|
|
308
|
+
}
|
|
309
|
+
get lineWidth() {
|
|
310
|
+
return this.cachedLineWidth ?? this.wrapped.lineWidth;
|
|
311
|
+
}
|
|
312
|
+
set lineWidth(t) {
|
|
313
|
+
const e = this.scale_.x.dim(t);
|
|
314
|
+
e !== this.cachedLineWidth && (this.cachedLineWidth = e, this.wrapped.lineWidth = e);
|
|
315
|
+
}
|
|
316
|
+
getLineDash() {
|
|
317
|
+
return this.wrapped.getLineDash();
|
|
318
|
+
}
|
|
319
|
+
setLineDash(t) {
|
|
320
|
+
const e = Array.from(t).map((s) => this.scale_.x.dim(s));
|
|
321
|
+
this.wrapped.setLineDash(e);
|
|
322
|
+
}
|
|
323
|
+
clearRect(t, e, s, i) {
|
|
324
|
+
this.wrapped.clearRect(t, e, s, i);
|
|
325
|
+
}
|
|
326
|
+
fillRect(t, e, s, i) {
|
|
327
|
+
this.wrapped.fillRect(
|
|
328
|
+
this.scale_.x.pos(t),
|
|
329
|
+
this.scale_.y.pos(e),
|
|
330
|
+
this.scale_.x.dim(s),
|
|
331
|
+
this.scale_.y.dim(i)
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
strokeRect(t, e, s, i) {
|
|
335
|
+
this.wrapped.strokeRect(
|
|
336
|
+
this.scale_.x.pos(t),
|
|
337
|
+
this.scale_.y.pos(e),
|
|
338
|
+
this.scale_.x.dim(s),
|
|
339
|
+
this.scale_.y.dim(i)
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
get shadowBlur() {
|
|
343
|
+
return this.wrapped.shadowBlur;
|
|
344
|
+
}
|
|
345
|
+
set shadowBlur(t) {
|
|
346
|
+
this.wrapped.shadowBlur = t;
|
|
347
|
+
}
|
|
348
|
+
get shadowColor() {
|
|
349
|
+
return this.wrapped.shadowColor;
|
|
350
|
+
}
|
|
351
|
+
set shadowColor(t) {
|
|
352
|
+
this.wrapped.shadowColor = t;
|
|
353
|
+
}
|
|
354
|
+
get shadowOffsetX() {
|
|
355
|
+
return this.wrapped.shadowOffsetX;
|
|
356
|
+
}
|
|
357
|
+
set shadowOffsetX(t) {
|
|
358
|
+
this.wrapped.shadowOffsetX = t;
|
|
359
|
+
}
|
|
360
|
+
get shadowOffsetY() {
|
|
361
|
+
return this.wrapped.shadowOffsetY;
|
|
362
|
+
}
|
|
363
|
+
restore() {
|
|
364
|
+
this.cachedFillStyle = null, this.cachedStrokeStyle = null, this.cachedLineWidth = null, this.cachedGlobalAlpha = null, this.cachedTextAlign = null, this.cachedTextBaseline = null, this.cachedLineCap = null, this.cachedLineJoin = null, this.cachedMiterLimit = null, this.cachedFont = null, this.wrapped.restore();
|
|
365
|
+
}
|
|
366
|
+
save() {
|
|
367
|
+
this.wrapped.save();
|
|
368
|
+
}
|
|
369
|
+
fillText(t, e, s, i, r = {}) {
|
|
370
|
+
const [a, n] = this.checkAtlasFillStyle(r.useAtlas);
|
|
371
|
+
if (a) {
|
|
372
|
+
this.atlasRegistry.get({ font: this.font, textColor: n }).fillText(this, t, e, s);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
this.wrapped.fillText(
|
|
376
|
+
t,
|
|
377
|
+
this.scale_.x.pos(e),
|
|
378
|
+
this.scale_.y.pos(s),
|
|
379
|
+
i != null ? this.scale_.x.dim(i) : void 0
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
measureText(t) {
|
|
383
|
+
return this.wrapped.measureText(t);
|
|
384
|
+
}
|
|
385
|
+
textDimensions(t, e = {}) {
|
|
386
|
+
const [s, i] = this.checkAtlasFillStyle(e.useAtlas);
|
|
387
|
+
return s ? this.atlasRegistry.get({ font: this.font, textColor: i }).measureText(t) : G(this.measureText(t));
|
|
388
|
+
}
|
|
389
|
+
strokeText(t, e, s, i) {
|
|
390
|
+
this.wrapped.strokeText(
|
|
391
|
+
t,
|
|
392
|
+
this.scale_.x.pos(e),
|
|
393
|
+
this.scale_.y.pos(s),
|
|
394
|
+
i != null ? this.scale_.x.dim(i) : void 0
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
get direction() {
|
|
398
|
+
return this.wrapped.direction;
|
|
399
|
+
}
|
|
400
|
+
set direction(t) {
|
|
401
|
+
this.wrapped.direction = t;
|
|
402
|
+
}
|
|
403
|
+
get font() {
|
|
404
|
+
return this.cachedFont != null ? this.cachedFont : this.wrapped.font;
|
|
405
|
+
}
|
|
406
|
+
set font(t) {
|
|
407
|
+
t !== this.cachedFont && (this.cachedFont = t, this.wrapped.font = this.cachedFont);
|
|
408
|
+
}
|
|
409
|
+
get fontKerning() {
|
|
410
|
+
return this.wrapped.fontKerning;
|
|
411
|
+
}
|
|
412
|
+
set fontKerning(t) {
|
|
413
|
+
this.wrapped.fontKerning = t;
|
|
414
|
+
}
|
|
415
|
+
get textAlign() {
|
|
416
|
+
return this.cachedTextAlign ?? this.wrapped.textAlign;
|
|
417
|
+
}
|
|
418
|
+
set textAlign(t) {
|
|
419
|
+
t !== this.cachedTextAlign && (this.cachedTextAlign = t, this.wrapped.textAlign = t);
|
|
420
|
+
}
|
|
421
|
+
get textBaseline() {
|
|
422
|
+
return this.cachedTextBaseline ?? this.wrapped.textBaseline;
|
|
423
|
+
}
|
|
424
|
+
set textBaseline(t) {
|
|
425
|
+
t !== this.cachedTextBaseline && (this.cachedTextBaseline = t, this.wrapped.textBaseline = t);
|
|
426
|
+
}
|
|
427
|
+
getTransform() {
|
|
428
|
+
return this.wrapped.getTransform();
|
|
429
|
+
}
|
|
430
|
+
resetTransform() {
|
|
431
|
+
this.wrapped.resetTransform();
|
|
432
|
+
}
|
|
433
|
+
rotate(t) {
|
|
434
|
+
this.wrapped.rotate(t);
|
|
435
|
+
}
|
|
436
|
+
scale(t, e) {
|
|
437
|
+
this.wrapped.scale(t, e), this.dpr = t;
|
|
438
|
+
}
|
|
439
|
+
scissor(t, e = d.ZERO) {
|
|
440
|
+
const s = new $(this.scale_);
|
|
441
|
+
return t = T(t, e), s.rect(...d.couple(h.topLeft(t)), ...k.couple(h.dims(t))), this.save(), this.clip(s.getPath()), () => this.restore();
|
|
442
|
+
}
|
|
443
|
+
setTransform(t, e, s, i, r, a) {
|
|
444
|
+
this.wrapped.setTransform(t, e, s, i, r, a);
|
|
445
|
+
}
|
|
446
|
+
transform(t, e, s, i, r, a) {
|
|
447
|
+
this.wrapped.transform(t, e, s, i, r, a);
|
|
448
|
+
}
|
|
449
|
+
translate(t, e) {
|
|
450
|
+
this.wrapped.translate(t, e);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
class $ {
|
|
454
|
+
scale_;
|
|
455
|
+
path;
|
|
456
|
+
constructor(t = C.XY.IDENTITY, e) {
|
|
457
|
+
this.scale_ = t, e instanceof Path2D || typeof e == "string" ? this.path = new Path2D(e) : this.path = new Path2D();
|
|
458
|
+
}
|
|
459
|
+
addPath(t, e) {
|
|
460
|
+
this.path.addPath(t, e);
|
|
461
|
+
}
|
|
462
|
+
arc(t, e, s, i, r, a) {
|
|
463
|
+
this.path.arc(
|
|
464
|
+
this.scale_.x.pos(t),
|
|
465
|
+
this.scale_.y.pos(e),
|
|
466
|
+
this.scale_.x.dim(s),
|
|
467
|
+
i,
|
|
468
|
+
r,
|
|
469
|
+
a
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
arcTo(t, e, s, i, r) {
|
|
473
|
+
this.path.arcTo(
|
|
474
|
+
this.scale_.x.pos(t),
|
|
475
|
+
this.scale_.y.pos(e),
|
|
476
|
+
this.scale_.x.pos(s),
|
|
477
|
+
this.scale_.y.pos(i),
|
|
478
|
+
this.scale_.x.dim(r)
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
bezierCurveTo(t, e, s, i, r, a) {
|
|
482
|
+
this.path.bezierCurveTo(
|
|
483
|
+
this.scale_.x.pos(t),
|
|
484
|
+
this.scale_.y.pos(e),
|
|
485
|
+
this.scale_.x.pos(s),
|
|
486
|
+
this.scale_.y.pos(i),
|
|
487
|
+
this.scale_.x.pos(r),
|
|
488
|
+
this.scale_.y.pos(a)
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
closePath() {
|
|
492
|
+
this.path.closePath();
|
|
493
|
+
}
|
|
494
|
+
ellipse(t, e, s, i, r, a, n, o) {
|
|
495
|
+
this.path.ellipse(
|
|
496
|
+
this.scale_.x.pos(t),
|
|
497
|
+
this.scale_.y.pos(e),
|
|
498
|
+
this.scale_.x.dim(s),
|
|
499
|
+
this.scale_.y.dim(i),
|
|
500
|
+
r,
|
|
501
|
+
a,
|
|
502
|
+
n,
|
|
503
|
+
o
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
lineTo(t, e) {
|
|
507
|
+
this.path.lineTo(this.scale_.x.pos(t), this.scale_.y.pos(e));
|
|
508
|
+
}
|
|
509
|
+
moveTo(t, e) {
|
|
510
|
+
this.path.moveTo(this.scale_.x.pos(t), this.scale_.y.pos(e));
|
|
511
|
+
}
|
|
512
|
+
quadraticCurveTo(t, e, s, i) {
|
|
513
|
+
this.path.quadraticCurveTo(
|
|
514
|
+
this.scale_.x.pos(t),
|
|
515
|
+
this.scale_.y.pos(e),
|
|
516
|
+
this.scale_.x.pos(s),
|
|
517
|
+
this.scale_.y.pos(i)
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
rect(t, e, s, i) {
|
|
521
|
+
this.path.rect(
|
|
522
|
+
this.scale_.x.pos(t),
|
|
523
|
+
this.scale_.y.pos(e),
|
|
524
|
+
this.scale_.x.dim(s),
|
|
525
|
+
this.scale_.y.dim(i)
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
roundRect(t, e, s, i, r) {
|
|
529
|
+
const a = this.scaleRadii(r);
|
|
530
|
+
this.path.roundRect(
|
|
531
|
+
this.scale_.x.pos(t),
|
|
532
|
+
this.scale_.y.pos(e),
|
|
533
|
+
this.scale_.x.dim(s),
|
|
534
|
+
this.scale_.y.dim(i),
|
|
535
|
+
a
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
scaleRadii(t) {
|
|
539
|
+
return t == null ? t : typeof t == "number" ? this.scale_.x.dim(t) : Array.isArray(t) ? t.map((e) => this.scaleRadius(e)) : this.scaleRadius(t);
|
|
540
|
+
}
|
|
541
|
+
scaleRadius(t) {
|
|
542
|
+
return typeof t == "number" ? this.scale_.x.dim(t) : {
|
|
543
|
+
x: this.scale_.x.dim(t.x ?? 0),
|
|
544
|
+
y: this.scale_.y.dim(t.y ?? 0)
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
getPath() {
|
|
548
|
+
return this.path;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
const j = `precision mediump float;
|
|
552
|
+
|
|
553
|
+
void main(void) {
|
|
554
|
+
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
555
|
+
}
|
|
556
|
+
`, Q = `attribute vec4 a_position;
|
|
557
|
+
|
|
558
|
+
void main(void) {
|
|
559
|
+
gl_Position = a_position;
|
|
560
|
+
}
|
|
561
|
+
`, D = (l) => new Error(`failed to compile webgl program: ${l}`), tt = new Error("null shader encountered");
|
|
562
|
+
let et = class {
|
|
563
|
+
/** The render context used by this program. */
|
|
564
|
+
renderCtx;
|
|
565
|
+
/** The underlying webgl program. */
|
|
566
|
+
prog;
|
|
567
|
+
/** The code for the vertex shader. */
|
|
568
|
+
vertShader;
|
|
569
|
+
/** The code for the fragment shader. */
|
|
570
|
+
fragShader;
|
|
571
|
+
uniformLocCache = /* @__PURE__ */ new Map();
|
|
572
|
+
/**
|
|
573
|
+
* @constructor compiles the given vertex and fragment shaders under the given
|
|
574
|
+
* render context into a program.
|
|
575
|
+
*
|
|
576
|
+
* @param ctx - The render context to use.
|
|
577
|
+
* @param vertShader - The vertex shader code.
|
|
578
|
+
* @param fragShader - The fragment shader code.
|
|
579
|
+
*/
|
|
580
|
+
constructor(t, e, s) {
|
|
581
|
+
this.renderCtx = t;
|
|
582
|
+
const i = t.gl.createProgram();
|
|
583
|
+
if (i == null) throw D("failed to create program");
|
|
584
|
+
this.prog = i, this.vertShader = e, this.fragShader = s, this.compile();
|
|
585
|
+
}
|
|
586
|
+
/** Sets the current program as the active program used by the context. */
|
|
587
|
+
setAsActive() {
|
|
588
|
+
return this.renderCtx.gl.useProgram(this.prog), () => this.renderCtx.gl.useProgram(null);
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Sets a uniform XY coordinate value.
|
|
592
|
+
*
|
|
593
|
+
* @param name - The name of the uniform.
|
|
594
|
+
* @param value - The value to set.
|
|
595
|
+
*/
|
|
596
|
+
uniformXY(t, e) {
|
|
597
|
+
this.renderCtx.gl.uniform2fv(this.getUniformLoc(t), d.couple(e));
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Sets a uniform color value.
|
|
601
|
+
*
|
|
602
|
+
* @param name - The name of the uniform.
|
|
603
|
+
* @param value - The value to set.
|
|
604
|
+
*/
|
|
605
|
+
uniformColor(t, e) {
|
|
606
|
+
this.renderCtx.gl.uniform4fv(this.getUniformLoc(t), y.rgba1(e));
|
|
607
|
+
}
|
|
608
|
+
getUniformLoc(t) {
|
|
609
|
+
const e = this.uniformLocCache.get(t);
|
|
610
|
+
if (e != null) return e;
|
|
611
|
+
const s = this.renderCtx.gl.getUniformLocation(this.prog, t);
|
|
612
|
+
if (s == null) throw new Error(`unexpected missing uniform ${t}`);
|
|
613
|
+
return this.uniformLocCache.set(t, s), s;
|
|
614
|
+
}
|
|
615
|
+
compile() {
|
|
616
|
+
const t = this.renderCtx.gl;
|
|
617
|
+
this.compileShader(this.vertShader, t.VERTEX_SHADER), this.compileShader(this.fragShader, t.FRAGMENT_SHADER), t.linkProgram(this.prog);
|
|
618
|
+
}
|
|
619
|
+
compileShader(t, e) {
|
|
620
|
+
const s = this.renderCtx.gl, i = s.createShader(e);
|
|
621
|
+
if (i == null) throw tt;
|
|
622
|
+
if (s.shaderSource(i, t), s.compileShader(i), !s.getShaderParameter(i, s.COMPILE_STATUS)) {
|
|
623
|
+
const a = s.getShaderInfoLog(i);
|
|
624
|
+
throw s.deleteShader(i), D(a ?? "unknown");
|
|
625
|
+
}
|
|
626
|
+
s.attachShader(this.prog, i);
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
const st = new Float32Array([0, 0, 0, 0, 0, 0]);
|
|
630
|
+
class it extends et {
|
|
631
|
+
positionBuffer;
|
|
632
|
+
constructor(t) {
|
|
633
|
+
super(t, Q, j);
|
|
634
|
+
const e = t.gl.createBuffer();
|
|
635
|
+
if (e == null) throw new K("webgl: failed to create buffer");
|
|
636
|
+
this.positionBuffer = e, t.gl.bindBuffer(t.gl.ARRAY_BUFFER, this.positionBuffer), t.gl.bufferData(t.gl.ARRAY_BUFFER, st, t.gl.STATIC_DRAW);
|
|
637
|
+
}
|
|
638
|
+
exec() {
|
|
639
|
+
const { gl: t } = this.renderCtx, e = t.getAttribLocation(this.prog, "a_position");
|
|
640
|
+
t.bindBuffer(t.ARRAY_BUFFER, this.positionBuffer);
|
|
641
|
+
const s = t.createVertexArray();
|
|
642
|
+
t.bindVertexArray(s), t.enableVertexAttribArray(e), t.vertexAttribPointer(e, 2, t.FLOAT, !1, 0, 0), this.setAsActive(), t.drawArrays(t.TRIANGLES, 0, 3);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
const P = { high: 1, low: 0 };
|
|
646
|
+
class rt {
|
|
647
|
+
/** Stores the current requests for rendering. */
|
|
648
|
+
requests = /* @__PURE__ */ new Map();
|
|
649
|
+
/** Stores render cleanup functions for clearing canvases and other resources. */
|
|
650
|
+
cleanup = /* @__PURE__ */ new Map();
|
|
651
|
+
/** A callback to run after each render call. */
|
|
652
|
+
afterRender;
|
|
653
|
+
/** Instrumentation for logging, tracing, metrics, etc. */
|
|
654
|
+
instrumentation;
|
|
655
|
+
/** A function to add status to the status bar. */
|
|
656
|
+
handleError;
|
|
657
|
+
constructor({
|
|
658
|
+
afterRender: t,
|
|
659
|
+
instrumentation: e = x.Instrumentation.NOOP,
|
|
660
|
+
handleError: s
|
|
661
|
+
}) {
|
|
662
|
+
this.afterRender = t, this.instrumentation = e, this.handleError = s, this.start();
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Sets a new request in the queue according to a set of rules:
|
|
666
|
+
*
|
|
667
|
+
* 1. If no request with the same key exists, add the request to the queue.
|
|
668
|
+
* 2. If a request with the same key exists, replace it if the new request has a
|
|
669
|
+
* greater or equal priority and a greater or equal number of canvases that are
|
|
670
|
+
* being rendered to.
|
|
671
|
+
*
|
|
672
|
+
* @param req - The request to set.
|
|
673
|
+
*/
|
|
674
|
+
set(t) {
|
|
675
|
+
const e = this.requests.get(t.key);
|
|
676
|
+
if (e == null) this.requests.set(t.key, t);
|
|
677
|
+
else {
|
|
678
|
+
const s = P[t.priority] >= P[e.priority], i = t.canvases.length >= e.canvases.length;
|
|
679
|
+
s && i && this.requests.set(t.key, t);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
/** Execute the render. */
|
|
683
|
+
render() {
|
|
684
|
+
const { requests: t } = this;
|
|
685
|
+
t.size !== 0 && (this.runCleanupsSync(), this.renderSync(), this.requests.clear(), this.afterRender?.());
|
|
686
|
+
}
|
|
687
|
+
runCleanupsSync() {
|
|
688
|
+
const { cleanup: t, requests: e } = this;
|
|
689
|
+
t.forEach((s, i) => {
|
|
690
|
+
const r = e.get(i);
|
|
691
|
+
r != null && (s(r), t.delete(i));
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
renderSync() {
|
|
695
|
+
const { requests: t } = this;
|
|
696
|
+
t.forEach((e) => {
|
|
697
|
+
try {
|
|
698
|
+
const s = e.render();
|
|
699
|
+
s != null && this.cleanup.set(e.key, s);
|
|
700
|
+
} catch (s) {
|
|
701
|
+
this.handleError(s, "render loop failed");
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
/** Starts the rendering loop. */
|
|
706
|
+
start() {
|
|
707
|
+
const t = () => {
|
|
708
|
+
try {
|
|
709
|
+
this.render();
|
|
710
|
+
} catch (e) {
|
|
711
|
+
this.handleError(e, "render loop failed");
|
|
712
|
+
}
|
|
713
|
+
requestAnimationFrame(t);
|
|
714
|
+
};
|
|
715
|
+
requestAnimationFrame(t);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
const S = 2, g = 2;
|
|
719
|
+
class b {
|
|
720
|
+
// A canvas buffer that holds rendered characters.
|
|
721
|
+
atlas;
|
|
722
|
+
// Cached dimensions of a character.
|
|
723
|
+
charDims;
|
|
724
|
+
// A map of characters to their index in the atlas.
|
|
725
|
+
charMap;
|
|
726
|
+
// The default characters to include in the atlas.
|
|
727
|
+
static DEFAULT_CHARS = "0123456789.:-µmsNa∞ᴇABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz%";
|
|
728
|
+
constructor(t) {
|
|
729
|
+
const { font: e, characters: s = b.DEFAULT_CHARS, textColor: i } = t;
|
|
730
|
+
this.charMap = /* @__PURE__ */ new Map();
|
|
731
|
+
const r = U.unique(Array.from(s)), n = new OffscreenCanvas(1, 1).getContext("2d");
|
|
732
|
+
n.font = e;
|
|
733
|
+
const o = n.measureText("0");
|
|
734
|
+
this.charDims = G(o), this.charDims.width += S, this.charDims.height += S;
|
|
735
|
+
const p = r.length, u = this.charDims.width, m = this.charDims.height, c = Math.ceil(Math.sqrt(p)), E = Math.ceil(p / c);
|
|
736
|
+
this.atlas = new OffscreenCanvas(
|
|
737
|
+
u * c * g,
|
|
738
|
+
m * (E + 1) * g
|
|
739
|
+
);
|
|
740
|
+
const f = this.atlas.getContext("2d");
|
|
741
|
+
f.scale(g, g), f.font = e, f.textBaseline = "alphabetic", f.textAlign = "left", f.fillStyle = y.hex(i), f.clearRect(0, 0, this.atlas.width, this.atlas.height), r.forEach((O, A) => {
|
|
742
|
+
const M = A % c, Y = Math.floor(A / c), N = M * u, X = (Y + 1) * m;
|
|
743
|
+
f.fillText(O, N, X), this.charMap.set(O, A);
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
fillText(t, e, s, i) {
|
|
747
|
+
const { width: r, height: a } = this.charDims, n = Math.ceil(Math.sqrt(this.charMap.size));
|
|
748
|
+
t.textAlign === "center" && (s -= r * e.length / 2), t.textBaseline === "middle" && (i += a / 2);
|
|
749
|
+
for (let o = 0; o < e.length; o++) {
|
|
750
|
+
const p = e[o], u = this.charMap.get(p);
|
|
751
|
+
if (u === void 0) continue;
|
|
752
|
+
const m = u % n, c = Math.floor(u / n);
|
|
753
|
+
t.drawImage(
|
|
754
|
+
this.atlas,
|
|
755
|
+
m * r * g,
|
|
756
|
+
c * a * g + S,
|
|
757
|
+
r * g,
|
|
758
|
+
a * g,
|
|
759
|
+
s + o * r,
|
|
760
|
+
i - a - S / g,
|
|
761
|
+
r,
|
|
762
|
+
a
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
measureText(t) {
|
|
767
|
+
return { width: t.length * this.charDims.width, height: this.charDims.height };
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
class at {
|
|
771
|
+
atlases;
|
|
772
|
+
constructor() {
|
|
773
|
+
this.atlases = /* @__PURE__ */ new Map();
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* @returns at atlas from the registry compatible with the given props. If the
|
|
777
|
+
* atlas does not exist in the registry, it is created and added to the registry.
|
|
778
|
+
*/
|
|
779
|
+
get(t) {
|
|
780
|
+
const e = `${t.font}-${y.hex(t.textColor)}-${t.characters}`;
|
|
781
|
+
if (this.atlases.has(e)) return this.atlases.get(e);
|
|
782
|
+
const s = new b(t);
|
|
783
|
+
return this.atlases.set(e, s), s;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
const F = (l) => (l.textRendering = "optimizeSpeed", l.imageSmoothingEnabled = !1, l);
|
|
787
|
+
class w {
|
|
788
|
+
/* The canvas element used by WebGL. */
|
|
789
|
+
glCanvas;
|
|
790
|
+
/** The canvas element used by the 2D canvas. */
|
|
791
|
+
upper2dCanvas;
|
|
792
|
+
/** The canvas element used by the 2D canvas. */
|
|
793
|
+
lower2dCanvas;
|
|
794
|
+
/** The WebGL rendering context. */
|
|
795
|
+
gl;
|
|
796
|
+
/** A 2D canvas that sits below the WebGL canvas. */
|
|
797
|
+
lower2d;
|
|
798
|
+
/** A 2D canvas that sits above the WebGL canvas. */
|
|
799
|
+
upper2d;
|
|
800
|
+
/** The region the canvas occupies in pixel space */
|
|
801
|
+
region;
|
|
802
|
+
/** The device pixel ratio of the canvas */
|
|
803
|
+
dpr;
|
|
804
|
+
/** queue render transitions onto the stack */
|
|
805
|
+
loop;
|
|
806
|
+
/** See the @link{clear.Program} for why this is necessary. */
|
|
807
|
+
clearProgram;
|
|
808
|
+
os;
|
|
809
|
+
static CONTEXT_KEY = q.B("render-context");
|
|
810
|
+
instrumentation;
|
|
811
|
+
static create(t, e, s, i, r) {
|
|
812
|
+
const a = J(t, "render_context"), n = new w(
|
|
813
|
+
e,
|
|
814
|
+
s,
|
|
815
|
+
i,
|
|
816
|
+
r,
|
|
817
|
+
a,
|
|
818
|
+
W(t),
|
|
819
|
+
H(t)
|
|
820
|
+
);
|
|
821
|
+
return t.set(w.CONTEXT_KEY, n), n;
|
|
822
|
+
}
|
|
823
|
+
constructor(t, e, s, i, r, a, n) {
|
|
824
|
+
this.upper2dCanvas = s, this.lower2dCanvas = e, this.glCanvas = t, this.os = i, this.instrumentation = r, this.dpr = 1;
|
|
825
|
+
const o = this.lower2dCanvas.getContext("2d");
|
|
826
|
+
if (o == null) throw new Error("Could not get 2D context");
|
|
827
|
+
const p = new at();
|
|
828
|
+
this.lower2d = F(
|
|
829
|
+
new R(o, p, this.dpr)
|
|
830
|
+
);
|
|
831
|
+
const u = this.upper2dCanvas.getContext("2d");
|
|
832
|
+
if (u == null) throw new Error("Could not get 2D context");
|
|
833
|
+
this.upper2d = F(
|
|
834
|
+
new R(u, p, this.dpr)
|
|
835
|
+
);
|
|
836
|
+
const m = {
|
|
837
|
+
preserveDrawingBuffer: !0,
|
|
838
|
+
powerPreference: "high-performance",
|
|
839
|
+
stencil: !1,
|
|
840
|
+
depth: !1
|
|
841
|
+
}, c = this.glCanvas.getContext("webgl2", m);
|
|
842
|
+
if (c == null) throw new Error("Could not get WebGL context");
|
|
843
|
+
c.disable(c.DEPTH_TEST), c.disable(c.STENCIL_TEST), c.disable(c.CULL_FACE), c.disable(c.DITHER), this.gl = c, this.glCanvas.oncontextlost = () => a({
|
|
844
|
+
variant: "error",
|
|
845
|
+
message: "WebGL context lost"
|
|
846
|
+
});
|
|
847
|
+
const E = () => {
|
|
848
|
+
this.gl.flush(), this.gl.finish();
|
|
849
|
+
};
|
|
850
|
+
this.loop = new rt({
|
|
851
|
+
afterRender: E,
|
|
852
|
+
instrumentation: this.instrumentation,
|
|
853
|
+
handleError: n
|
|
854
|
+
}), this.region = h.ZERO, this.os === "Windows" && (this.clearProgram = new it(this));
|
|
855
|
+
}
|
|
856
|
+
static useOptional(t) {
|
|
857
|
+
return t.getOptional(w.CONTEXT_KEY);
|
|
858
|
+
}
|
|
859
|
+
static use(t) {
|
|
860
|
+
return t.get(w.CONTEXT_KEY);
|
|
861
|
+
}
|
|
862
|
+
update(t) {
|
|
863
|
+
t.set(w.CONTEXT_KEY, this);
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
* Resizes the canvas to the given region and device pixel ratio. Ensuring
|
|
867
|
+
* that all drawing operations and viewports are scaled correctly.
|
|
868
|
+
*/
|
|
869
|
+
resize(t, e) {
|
|
870
|
+
h.equals(this.region, t) && this.dpr === e || (this.region = t, this.dpr = e, this.resizeCanvas(this.glCanvas), this.resizeCanvas(this.upper2dCanvas), this.resizeCanvas(this.lower2dCanvas), this.lower2d.scale(this.dpr, this.dpr), this.upper2d.scale(this.dpr, this.dpr), this.gl.viewport(0, 0, h.width(t) * e, h.height(t) * e));
|
|
871
|
+
}
|
|
872
|
+
resizeCanvas(t) {
|
|
873
|
+
t.width = h.width(this.region) * this.dpr, t.height = h.height(this.region) * this.dpr;
|
|
874
|
+
}
|
|
875
|
+
/** @returns the aspect ratio of the canvas. */
|
|
876
|
+
get aspect() {
|
|
877
|
+
return h.aspect(this.region);
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Takes the given box in PIXEL space and produces a transform
|
|
881
|
+
* in CLIP space representing the sub-region represented by the box
|
|
882
|
+
* in the canvas.
|
|
883
|
+
*/
|
|
884
|
+
scaleRegion(t) {
|
|
885
|
+
return new C.XY(
|
|
886
|
+
// Accept a value in decimal.
|
|
887
|
+
C.Scale.scale(0, 1).scale(h.width(t)).translate(h.left(t)).reBound(h.width(this.region)).scale(-1, 1),
|
|
888
|
+
// Accept a value in decimal.
|
|
889
|
+
C.Scale.scale(0, 1).scale(h.height(t)).invert().translate(h.top(t)).reBound(h.height(this.region)).scale(-1, 1).invert()
|
|
890
|
+
);
|
|
891
|
+
}
|
|
892
|
+
scissor(t, e = d.ZERO, s) {
|
|
893
|
+
const i = [];
|
|
894
|
+
return s.includes("upper2d") && i.push(this.upper2d.scissor(t, e)), s.includes("lower2d") && i.push(this.lower2d.scissor(t, e)), s.includes("gl") && i.push(this.scissorGL(t, e)), () => i.forEach((r) => r());
|
|
895
|
+
}
|
|
896
|
+
scissorGL(t, e = d.ZERO) {
|
|
897
|
+
return this.gl.enable(this.gl.SCISSOR_TEST), t = T(t, e), this.gl.scissor(
|
|
898
|
+
h.left(t) * this.dpr,
|
|
899
|
+
(h.height(this.region) - h.bottom(t)) * this.dpr,
|
|
900
|
+
h.width(t) * this.dpr,
|
|
901
|
+
h.height(t) * this.dpr
|
|
902
|
+
), () => this.gl.disable(this.gl.SCISSOR_TEST);
|
|
903
|
+
}
|
|
904
|
+
erase(t, e = d.ZERO, ...s) {
|
|
905
|
+
e = d.construct(e), s.length === 0 && (s = ["upper2d", "lower2d", "gl"]), s.includes("upper2d") && this.eraseCanvas(this.upper2d, t, e), s.includes("lower2d") && this.eraseCanvas(this.lower2d, t, e), s.includes("gl") && this.eraseGL(t, e);
|
|
906
|
+
}
|
|
907
|
+
eraseGL(t, e = d.ZERO) {
|
|
908
|
+
const { gl: s } = this, i = this.scissorGL(T(t, e));
|
|
909
|
+
s.clearColor(...y.rgba1(y.ZERO)), s.clear(s.COLOR_BUFFER_BIT), this.os === "Windows" && this.clearProgram?.exec(), i();
|
|
910
|
+
}
|
|
911
|
+
eraseCanvas(t, e, s = d.ZERO) {
|
|
912
|
+
const i = T(e, s);
|
|
913
|
+
t.clearRect(...d.couple(h.topLeft(i)), ...k.couple(h.dims(i)));
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
const ht = _.object({
|
|
917
|
+
region: h.box,
|
|
918
|
+
enabled: _.boolean().optional().default(!1)
|
|
919
|
+
}), I = ["gl", "lower2d", "upper2d"];
|
|
920
|
+
class B extends V {
|
|
921
|
+
static TYPE = "eraser";
|
|
922
|
+
schema = ht;
|
|
923
|
+
afterUpdate(t) {
|
|
924
|
+
this.deleted || (this.internal.renderCtx = w.use(t), this.renderOnLifecycleChange());
|
|
925
|
+
}
|
|
926
|
+
afterDelete() {
|
|
927
|
+
this.renderOnLifecycleChange();
|
|
928
|
+
}
|
|
929
|
+
renderOnLifecycleChange() {
|
|
930
|
+
this.internal.renderCtx.loop.set({
|
|
931
|
+
key: `${this.type}-${this.key}`,
|
|
932
|
+
render: this.render.bind(this),
|
|
933
|
+
priority: "high",
|
|
934
|
+
canvases: I
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
render() {
|
|
938
|
+
this.deleted || !this.state.enabled || this.internal.renderCtx.erase(this.state.region, d.construct(0), ...I);
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
const ut = {
|
|
942
|
+
[B.TYPE]: B
|
|
943
|
+
};
|
|
944
|
+
export {
|
|
945
|
+
w as C,
|
|
946
|
+
B as E,
|
|
947
|
+
et as G,
|
|
948
|
+
rt as L,
|
|
949
|
+
v as P,
|
|
950
|
+
ut as R,
|
|
951
|
+
pt as a,
|
|
952
|
+
ht as e,
|
|
953
|
+
Z as p,
|
|
954
|
+
J as u
|
|
955
|
+
};
|