ranui 0.2.1-alpha.1 → 0.2.1-alpha.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/dist/abnfDiagram-VRR7QNED-CH_pIv_l.cjs +1 -0
- package/dist/abnfDiagram-VRR7QNED-CTsqwzwi.js +95 -0
- package/dist/arc-D25LhgTs.cjs +1 -0
- package/dist/arc-DRPGof21.js +82 -0
- package/dist/architecture-TIHT7OUA-BbBd15_y.cjs +1 -0
- package/dist/architecture-TIHT7OUA-pbFO1xSx.js +5 -0
- package/dist/architectureDiagram-ZJ3FMSHR-8mjyXr-w.js +4279 -0
- package/dist/architectureDiagram-ZJ3FMSHR-D_jWFFZx.cjs +36 -0
- package/dist/array-By5736M5.js +7 -0
- package/dist/array-C3cbN3GY.cjs +1 -0
- package/dist/blockDiagram-677ZJIJ3-3F79MOSt.js +3321 -0
- package/dist/blockDiagram-677ZJIJ3-Cx35khWe.cjs +132 -0
- package/dist/builder.d.ts +2 -2
- package/dist/builder.js +39 -34
- package/dist/{builtin-D9djWkCE.js → builtin-BkM0LLof.js} +83 -76
- package/dist/button-D0zcnKnG.js +117 -0
- package/dist/button.js +1 -1
- package/dist/c4Diagram-LMCZKHZV-Cxn_gqu_.js +3064 -0
- package/dist/c4Diagram-LMCZKHZV-TRNb3Gvl.cjs +10 -0
- package/dist/{card-CqJa4Q_v.js → card-CygMndQS.js} +2 -2
- package/dist/card.js +1 -1
- package/dist/channel-C9WSNwcS.cjs +1 -0
- package/dist/channel-k5-UxdcV.js +5 -0
- package/dist/{checkbox-CThC9-vy.js → checkbox-D5om9aJO.js} +10 -10
- package/dist/checkbox.js +1 -1
- package/dist/chunk-2Q5K7J3B-CTMy5FII.cjs +1 -0
- package/dist/chunk-2Q5K7J3B-DlFVJRAn.js +15 -0
- package/dist/chunk-32BRIVSS-BXVdG_nV.cjs +1 -0
- package/dist/chunk-32BRIVSS-jAuAwMVV.js +68 -0
- package/dist/chunk-52WLFC77-BChUrU24.cjs +10 -0
- package/dist/chunk-52WLFC77-wpL7en7e.js +630 -0
- package/dist/chunk-5VM5RSS4-Cni2Ogq2.js +19 -0
- package/dist/chunk-5VM5RSS4-DudUFQ_Z.cjs +15 -0
- package/dist/chunk-7BUUIJ7U-9hiBbc7O.js +87 -0
- package/dist/chunk-7BUUIJ7U-DMv_UkjI.cjs +1 -0
- package/dist/chunk-C7G6YPKG-CA-DNpvI.js +71 -0
- package/dist/chunk-C7G6YPKG-CKEeW9TM.cjs +1 -0
- package/dist/chunk-EX3LRPZG-BCmf0iDq.js +2137 -0
- package/dist/chunk-EX3LRPZG-DbfbNdXo.cjs +231 -0
- package/dist/chunk-FWX5IMBZ-D11-gbhc.cjs +1 -0
- package/dist/chunk-FWX5IMBZ-DZ5VYvm5.js +60 -0
- package/dist/chunk-HOUHSVGY-BGB3dOvI.cjs +1 -0
- package/dist/chunk-HOUHSVGY-DRQcQeMT.js +268 -0
- package/dist/chunk-ICXQ74PX-BbT9JaEW.cjs +2 -0
- package/dist/chunk-ICXQ74PX-DR8rL-xF.js +1377 -0
- package/dist/chunk-JWPE2WC7-CGEmUMMZ.js +8 -0
- package/dist/chunk-JWPE2WC7-D8EnWK1B.cjs +1 -0
- package/dist/chunk-KEIR6QF5-B2Op7cFH.js +22155 -0
- package/dist/chunk-KEIR6QF5-C4fcHpY0.cjs +161 -0
- package/dist/chunk-MOJQB5TN-BC46HDyu.js +516 -0
- package/dist/chunk-MOJQB5TN-oOeq982_.cjs +88 -0
- package/dist/chunk-OGEWGWER-BV51ll2w.js +33 -0
- package/dist/chunk-OGEWGWER-DX8sW1dT.cjs +1 -0
- package/dist/chunk-PUDLZKDR-48YaqVoF.cjs +156 -0
- package/dist/chunk-PUDLZKDR-NdMR0Ft5.js +4282 -0
- package/dist/chunk-Q4XR5HBZ-3BHjjc9u.js +1709 -0
- package/dist/chunk-Q4XR5HBZ-aBnPq509.cjs +70 -0
- package/dist/chunk-RYQCIY6F-BER2T9t0.js +246 -0
- package/dist/chunk-RYQCIY6F-DVRzSnsI.cjs +1 -0
- package/dist/chunk-V7JOEXUC-Cr_hr02u.js +3467 -0
- package/dist/chunk-V7JOEXUC-DHizzTla.cjs +206 -0
- package/dist/chunk-VAUOI2AC-DfQf5L2_.cjs +1 -0
- package/dist/chunk-VAUOI2AC-izt0o4id.js +11 -0
- package/dist/chunk-VR4S4FIN-CJi5okl4.js +26 -0
- package/dist/chunk-VR4S4FIN-KiwnPF31.cjs +1 -0
- package/dist/chunk-WYO6CB5R-DDHkKowO.js +4535 -0
- package/dist/chunk-WYO6CB5R-u4mJNOcO.cjs +127 -0
- package/dist/chunk-XXDRQBXY-BB1i_53q.js +9 -0
- package/dist/chunk-XXDRQBXY-C8VGLZmt.cjs +1 -0
- package/dist/chunk-Y2CYZVJY-0JxdZxki.js +13 -0
- package/dist/chunk-Y2CYZVJY-DPaYLFFP.cjs +1 -0
- package/dist/chunk-ZGVPDNZ5-6uMbTJXy.js +3841 -0
- package/dist/chunk-ZGVPDNZ5-Cw5_HJba.cjs +62 -0
- package/dist/chunk-ZIRB5QZD-C7OH2FI2.js +1280 -0
- package/dist/chunk-ZIRB5QZD-aLu-4ITN.cjs +32 -0
- package/dist/classDiagram-OUVF2IWQ-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-OUVF2IWQ-Df0ghim9.js +30 -0
- package/dist/classDiagram-v2-EOCWNBFH-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-v2-EOCWNBFH-Df0ghim9.js +30 -0
- package/dist/{colorpicker-XNxDRcQ-.js → colorpicker-qWnaTlYX.js} +8 -8
- package/dist/colorpicker.js +1 -1
- package/dist/components/glass/index.d.ts +52 -0
- package/dist/components/icon/core-icons.d.ts +13 -0
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/mermaid/index.d.ts +52 -0
- package/dist/components/modal/index.d.ts +9 -0
- package/dist/content-Rry-U6ir.js +39 -0
- package/dist/content.js +5 -0
- package/dist/cose-bilkent-JH36ORCC-BUxFTdey.cjs +1 -0
- package/dist/cose-bilkent-JH36ORCC-DTwvJlGw.js +2353 -0
- package/dist/cynefin-VYW2F7L2-6c1GOGXW.cjs +1 -0
- package/dist/cynefin-VYW2F7L2-ALQKF7N6.js +5 -0
- package/dist/cynefinDiagram-TSTJHNR4-Bjt4QTVh.js +355 -0
- package/dist/cynefinDiagram-TSTJHNR4-ISDORSxO.cjs +62 -0
- package/dist/cytoscape.esm-CFq1_DTa.js +18906 -0
- package/dist/cytoscape.esm-pygMw4dR.cjs +321 -0
- package/dist/dagre-D1-W1tt6.cjs +1 -0
- package/dist/dagre-D8GLTwuf.js +1578 -0
- package/dist/dagre-VKFMJZFB-DXI69qAN.cjs +4 -0
- package/dist/dagre-VKFMJZFB-Dfku86Az.js +341 -0
- package/dist/defaultLocale-0M_kMcEH.js +184 -0
- package/dist/defaultLocale-DSqtvhxg.cjs +1 -0
- package/dist/diagram-FQU43EPY-BAiRt5eL.cjs +3 -0
- package/dist/diagram-FQU43EPY-BvQ5jmVn.js +452 -0
- package/dist/diagram-G47NLZAW-DGnmEa8u.cjs +24 -0
- package/dist/diagram-G47NLZAW-DT2BBA0T.js +498 -0
- package/dist/diagram-NH7WQ7WH-DxgkStA3.cjs +24 -0
- package/dist/diagram-NH7WQ7WH-W7jg4Vh8.js +135 -0
- package/dist/diagram-OA4YK3LP-DkvFII73.cjs +30 -0
- package/dist/diagram-OA4YK3LP-jU--aqQl.js +317 -0
- package/dist/diagram-WEI45ONY-C_Qhf4ny.js +215 -0
- package/dist/diagram-WEI45ONY-XvzRFmmY.cjs +41 -0
- package/dist/dist-C0Fwsvsq.js +70 -0
- package/dist/dist-C20XxSsP.cjs +1 -0
- package/dist/{dropdown-CCvsambb.js → dropdown-DzdAR1nI.js} +4 -4
- package/dist/dropdown.js +1 -1
- package/dist/ebnfDiagram-CCIWWBDH-Cu8bAlhC.cjs +1 -0
- package/dist/ebnfDiagram-CCIWWBDH-Gnr20Oc1.js +112 -0
- package/dist/erDiagram-Q63AITRT-CxLSa9Yv.cjs +85 -0
- package/dist/erDiagram-Q63AITRT-D0Hh9b-W.js +1822 -0
- package/dist/eventmodeling-45OFAUF4-C6VXxUn1.cjs +1 -0
- package/dist/eventmodeling-45OFAUF4-DMpGs2yI.js +5 -0
- package/dist/factory-BkvRcCOx.js +482 -0
- package/dist/flowDiagram-23GEKE2U-B6gASEYG.cjs +1 -0
- package/dist/flowDiagram-23GEKE2U-BY4wE2vw.js +19 -0
- package/dist/{form-Ceq3uJzz.js → form-CUJpeQ7Q.js} +5 -5
- package/dist/form.js +1 -1
- package/dist/ganttDiagram-NO4QXBWP-B40Eabk0.js +3125 -0
- package/dist/ganttDiagram-NO4QXBWP-DZT79qJr.cjs +292 -0
- package/dist/gitGraph-TEB2WS4Q-BbtF3MDr.cjs +1 -0
- package/dist/gitGraph-TEB2WS4Q-D6Ru11Cs.js +5 -0
- package/dist/gitGraphDiagram-IHSO6WYX-BUJNSssA.js +754 -0
- package/dist/gitGraphDiagram-IHSO6WYX-DW06165m.cjs +106 -0
- package/dist/glass-Bj1Zf8Hy.js +115 -0
- package/dist/glass.js +5 -0
- package/dist/graphlib-CCKThIKP.js +1104 -0
- package/dist/graphlib-Du-578Js.cjs +1 -0
- package/dist/{icon-C_ENrJ3F.js → icon-CtlZJISZ.js} +77 -25
- package/dist/icon.js +1 -1
- package/dist/icons.js +1 -1
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/card.iife.js +1 -1
- package/dist/iife/checkbox.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +2 -2
- package/dist/iife/content.iife.js +1 -0
- package/dist/iife/dropdown.iife.js +1 -1
- package/dist/iife/form.iife.js +1 -1
- package/dist/iife/glass.iife.js +1 -0
- package/dist/iife/icon.iife.js +1 -1
- package/dist/iife/image.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/loading.iife.js +1 -1
- package/dist/iife/math.iife.js +14 -14
- package/dist/iife/mermaid.iife.js +3535 -0
- package/dist/iife/message.iife.js +1 -1
- package/dist/iife/modal.iife.js +1 -1
- package/dist/iife/player.iife.js +8 -8
- package/dist/iife/popover.iife.js +1 -1
- package/dist/iife/progress.iife.js +1 -1
- package/dist/iife/radar.iife.js +1 -1
- package/dist/iife/route.iife.js +1 -1
- package/dist/iife/router.iife.js +1 -1
- package/dist/iife/scratch.iife.js +1 -1
- package/dist/iife/section.iife.js +1 -1
- package/dist/iife/select.iife.js +1 -1
- package/dist/iife/skeleton.iife.js +1 -1
- package/dist/iife/tab.iife.js +1 -1
- package/dist/iife/tabpane.iife.js +1 -1
- package/dist/{image-B7MBI5n_.js → image-ILZNlaGc.js} +4 -4
- package/dist/image.js +1 -1
- package/dist/index.cjs +38 -37
- package/dist/index.d.ts +8 -0
- package/dist/index.iife.js +3623 -88
- package/dist/index.js +88 -84
- package/dist/info-DKCQHKI2-DNOtUIin.cjs +1 -0
- package/dist/info-DKCQHKI2-Df7h9MSE.js +5 -0
- package/dist/infoDiagram-FWYZ7A6U-C8dZc-Ki.cjs +2 -0
- package/dist/infoDiagram-FWYZ7A6U-Dc0m9qAx.js +21 -0
- package/dist/init-1VpIn1S3.js +16 -0
- package/dist/init-CbDwVtpO.cjs +1 -0
- package/dist/{input-RNqdEHPf.js → input-CDH6zY9I.js} +6 -6
- package/dist/input.js +1 -1
- package/dist/ishikawaDiagram-FXEZZL3T-BugNyysB.cjs +70 -0
- package/dist/ishikawaDiagram-FXEZZL3T-DuFtHOmf.js +742 -0
- package/dist/journeyDiagram-5HDEW3XC-Bshelnhq.js +928 -0
- package/dist/journeyDiagram-5HDEW3XC-ItmURvA2.cjs +139 -0
- package/dist/kanban-definition-HUTT4EX6-BL512R2A.cjs +89 -0
- package/dist/kanban-definition-HUTT4EX6-Dogv2paU.js +1050 -0
- package/dist/katex-Cq3Y8cmK.cjs +257 -0
- package/dist/katex-Pg2EqTH0.js +23485 -0
- package/dist/line-BIPmUVxO.js +33 -0
- package/dist/line-CAB5QHC6.cjs +1 -0
- package/dist/linear-B2AM4ZBe.js +259 -0
- package/dist/linear-CSAfNEpl.cjs +1 -0
- package/dist/{link-DURZzd7u.js → link-BCrmHvXP.js} +3 -3
- package/dist/link.js +1 -1
- package/dist/{loading-B9MFI03l.js → loading-DJWGih1g.js} +4 -4
- package/dist/loading.js +1 -1
- package/dist/map-BC2bk_rV.cjs +1 -0
- package/dist/map-DMSWkcq6.js +208 -0
- package/dist/{math-CudIwEXZ.js → math-DRmkEDSQ.js} +4 -4
- package/dist/math.js +1 -1
- package/dist/mermaid-CMhm7npE.js +261 -0
- package/dist/mermaid-parser.core-DYumW1vq.cjs +6 -0
- package/dist/mermaid-parser.core-uIDZYuBu.js +654 -0
- package/dist/mermaid.core-B2d5lQW2.js +1085 -0
- package/dist/mermaid.core-a1hgpWfs.cjs +10 -0
- package/dist/mermaid.js +5 -0
- package/dist/{message-DW7qWpEm.js → message-BpYJBvYn.js} +6 -6
- package/dist/message.js +1 -1
- package/dist/mindmap-definition-LN4V7U3C-DYZgIZym.cjs +96 -0
- package/dist/mindmap-definition-LN4V7U3C-f7s5ZePP.js +1070 -0
- package/dist/{modal-CrvGKL2B.js → modal-BeQlDYDP.js} +40 -24
- package/dist/modal.js +1 -1
- package/dist/ordinal-BMN81JG2.js +64 -0
- package/dist/ordinal-BplLHIij.cjs +1 -0
- package/dist/packet-7NZHBO7P-4PLslLZJ.js +5 -0
- package/dist/packet-7NZHBO7P-DeyLCrSn.cjs +1 -0
- package/dist/path-Bja5PoYn.js +82 -0
- package/dist/path-DmfWsuKi.cjs +1 -0
- package/dist/pegDiagram-2B236MQR-B-Xeh55J.js +107 -0
- package/dist/pegDiagram-2B236MQR-Bo5Nj40u.cjs +1 -0
- package/dist/pie-RZYD4A2V-DBE9a8Kz.js +5 -0
- package/dist/pie-RZYD4A2V-pDNZ2ZyB.cjs +1 -0
- package/dist/pieDiagram-ENE6RG2P-BkSiP4iu.cjs +39 -0
- package/dist/pieDiagram-ENE6RG2P-CVSE95zc.js +207 -0
- package/dist/{player-BKQaaT7o.js → player-CQ4e3Yeo.js} +196 -195
- package/dist/player.js +1 -1
- package/dist/{popover-CvYIVgUS.js → popover-eZMnL1F3.js} +22 -54
- package/dist/popover.js +1 -1
- package/dist/{progress-C6jctsFH.js → progress-DyHgW4Ep.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/quadrantDiagram-ABIIQ3AL-BDmdDGsh.cjs +7 -0
- package/dist/quadrantDiagram-ABIIQ3AL-TJ8FmqES.js +2058 -0
- package/dist/{radar-BUb4EzmG.js → radar-D21Rccap.js} +5 -5
- package/dist/radar-I7S5WNFK-CY5ycn2a.cjs +1 -0
- package/dist/radar-I7S5WNFK-DFTxtd_t.js +5 -0
- package/dist/radar.js +1 -1
- package/dist/railroad-3IZDKUUU-DALJwv16.js +5 -0
- package/dist/railroad-3IZDKUUU-DGzXHqt7.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-BCIHdSw6.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-CntW2udQ.js +5 -0
- package/dist/railroad-ebnf-EBAXGLYW-4vFZrfHF.cjs +1 -0
- package/dist/railroad-ebnf-EBAXGLYW-s_1ZOb_9.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-CaM5A0Ml.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-D_oFW1Bo.cjs +1 -0
- package/dist/railroadDiagram-RFXS5EU6-0lS5wYI7.js +83 -0
- package/dist/railroadDiagram-RFXS5EU6-DJKAtnQk.cjs +1 -0
- package/dist/ranui.css +1 -1
- package/dist/requirementDiagram-TGXJPOKE-Bg701bNl.cjs +84 -0
- package/dist/requirementDiagram-TGXJPOKE-viCQLyJd.js +2301 -0
- package/dist/rolldown-runtime-9ZSF5uba.js +16 -0
- package/dist/rolldown-runtime-CAnuVJ4g.cjs +1 -0
- package/dist/rough.esm-BWe9E0Nz.js +1387 -0
- package/dist/rough.esm-BfSi6CZE.cjs +1 -0
- package/dist/{route-Djrf9UR_.js → route-pR5P4ann.js} +10 -10
- package/dist/route.js +1 -1
- package/dist/{router-BU2KhtxV.js → router-CewzSH7O.js} +5 -5
- package/dist/router.js +1 -1
- package/dist/sankeyDiagram-HTMAVEWB-CV6_AuMF.js +974 -0
- package/dist/sankeyDiagram-HTMAVEWB-K-nGMsuS.cjs +40 -0
- package/dist/{scratch-CO4I2dIa.js → scratch-BFVsgl-7.js} +2 -2
- package/dist/scratch.js +1 -1
- package/dist/{section-CsUkp8bv.js → section-DSPCsIxv.js} +2 -2
- package/dist/section.js +1 -1
- package/dist/{select-Dn26ajJZ.js → select-B58nMfB1.js} +13 -13
- package/dist/select.js +1 -1
- package/dist/sequenceDiagram-DBY2YBRQ-4GdkLnUr.cjs +162 -0
- package/dist/sequenceDiagram-DBY2YBRQ-B9WNesh2.js +4326 -0
- package/dist/sizeCapture-X5ZJPWSS-BUY3-n09.cjs +1 -0
- package/dist/sizeCapture-X5ZJPWSS-D7rGsqTl.js +48 -0
- package/dist/{skeleton-BuMLhvzQ.js → skeleton-DoHYMsTn.js} +5 -5
- package/dist/skeleton.js +1 -1
- package/dist/src-C9EhKhbk.cjs +1 -0
- package/dist/src-DtRLxcYO.js +2104 -0
- package/dist/stateDiagram-2N3HPSRC-B7VpgjJu.cjs +1 -0
- package/dist/stateDiagram-2N3HPSRC-DxH4BMSh.js +237 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CQv7GIaO.cjs +1 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CWfn6e7n.js +30 -0
- package/dist/swimlanes-5IMT3BWC-DcADNGpg.js +5258 -0
- package/dist/swimlanes-5IMT3BWC-o-MjdPlw.cjs +1 -0
- package/dist/swimlanesDiagram-G3AALYLV-D-rmAGky.cjs +8 -0
- package/dist/swimlanesDiagram-G3AALYLV-DDtDtl1L.js +31 -0
- package/dist/{tab-40fDkuox.js → tab-BRPdZ9Ws.js} +5 -5
- package/dist/tab.js +1 -1
- package/dist/{tabpane-F4Pd7JtC.js → tabpane-Owf72hw_.js} +5 -5
- package/dist/tabpane.js +1 -1
- package/dist/{theme-switch-B09egc6h.js → theme-switch-CZDIIonc.js} +4 -4
- package/dist/theme-switch.js +1 -1
- package/dist/timeline-definition-FHXFAJF6-C80VjPLh.js +1119 -0
- package/dist/timeline-definition-FHXFAJF6-DOwvOb3S.cjs +120 -0
- package/dist/treeView-QDETBFTQ-B1Ejxfpg.cjs +1 -0
- package/dist/treeView-QDETBFTQ-vTKOZls1.js +5 -0
- package/dist/treemap-6X3UGDF4-D0FeO_NX.cjs +1 -0
- package/dist/treemap-6X3UGDF4-Ddzv6Gqd.js +5 -0
- package/dist/utils/builder/core.d.ts +133 -3
- package/dist/utils/builder/index.d.ts +1 -1
- package/dist/{utils-DBfrRFoE.js → utils-D1iZnChu.js} +38 -31
- package/dist/vennDiagram-L72KCM5P-BYHB7OW8.js +1955 -0
- package/dist/vennDiagram-L72KCM5P-CidVJK6y.cjs +34 -0
- package/dist/wardley-OPB4EBWU-C1hXbbD4.cjs +1 -0
- package/dist/wardley-OPB4EBWU-DBgFLc64.js +5 -0
- package/dist/wardleyDiagram-EHGQE667--ubmCaWM.js +652 -0
- package/dist/wardleyDiagram-EHGQE667-K6ckkRZS.cjs +78 -0
- package/dist/xychartDiagram-FW5EYKEG-CzdokxrM.cjs +7 -0
- package/dist/xychartDiagram-FW5EYKEG-DLqWcTPt.js +2154 -0
- package/docs/BUILDER.md +155 -2
- package/package.json +7 -1
- package/dist/button-BfYw0fes.js +0 -117
- package/dist/factory-DCrO37si.js +0 -334
package/docs/BUILDER.md
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
SwiftUI/Solid-style fine-grained reactivity. No virtual DOM, no re-render of a
|
|
5
5
|
whole tree — a signal change updates only the exact node bound to it.
|
|
6
6
|
|
|
7
|
+
> **Principle: build once, update in place.** A view function runs once; state
|
|
8
|
+
> changes flow through fine-grained bindings, never by re-running the view. Pick
|
|
9
|
+
> the primitive that matches the shape — value → getter binding; conditional →
|
|
10
|
+
> [`Show`](#conditionals--show) / [`Switch`](#multi-branch--switch--match); list →
|
|
11
|
+
> [`For`](#keyed-lists--for) / [`Index`](#index-lists--index). A raw getter child
|
|
12
|
+
> is the coarse fallback (rebuilds its whole region on any read).
|
|
13
|
+
|
|
7
14
|
```ts
|
|
8
15
|
import {
|
|
9
16
|
View,
|
|
@@ -58,8 +65,9 @@ Factories: `View(tag)`, `Div`, `Span`, `Slot`, `ButtonBuilder`, `InputBuilder`,
|
|
|
58
65
|
| Refs/shadow | `ref(holder)`, `shadow(opts?)` → `ShadowBuilder` |
|
|
59
66
|
| Terminal | `build()`, `serialize()` (SSR HTML string) |
|
|
60
67
|
|
|
61
|
-
`children()` accepts elements, strings, other `ElementBuilder`s, arrays,
|
|
62
|
-
`null`/`undefined` (skipped)
|
|
68
|
+
`children()` accepts elements, strings, other `ElementBuilder`s, arrays,
|
|
69
|
+
`null`/`undefined` (skipped), **and getters `() => …`** (reactive regions, see
|
|
70
|
+
[Reactive children](#reactive-children)) — nest freely:
|
|
63
71
|
|
|
64
72
|
```ts
|
|
65
73
|
Ul()
|
|
@@ -79,6 +87,21 @@ Ul()
|
|
|
79
87
|
.delegate(manager, selector, type, handler) // event delegation on a container
|
|
80
88
|
```
|
|
81
89
|
|
|
90
|
+
### Refs (incl. imperative custom-element methods)
|
|
91
|
+
|
|
92
|
+
`createRef<T>()` + `.ref(holder)` capture the built element. For a custom
|
|
93
|
+
element with imperative methods, **type the ref with the component's element
|
|
94
|
+
class** (each component exports it) — then its methods are typed, no cast:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
import { Popover } from 'ranui'; // the element class
|
|
98
|
+
import { View, createRef } from 'ranui/builder';
|
|
99
|
+
|
|
100
|
+
const ref = createRef<Popover>();
|
|
101
|
+
View<Popover>('r-popover').attr('trigger', 'click').ref(ref).children(/* … */).build();
|
|
102
|
+
ref.current?.closePopover(); // typed method, no `as` cast
|
|
103
|
+
```
|
|
104
|
+
|
|
82
105
|
---
|
|
83
106
|
|
|
84
107
|
## 2. Reactivity
|
|
@@ -133,6 +156,136 @@ Div()
|
|
|
133
156
|
.build();
|
|
134
157
|
```
|
|
135
158
|
|
|
159
|
+
### Reactive children
|
|
160
|
+
|
|
161
|
+
`children()` / `replaceChildren()` also take a **getter** as any argument. The
|
|
162
|
+
getter marks a live region: it re-runs when a signal it reads changes, replacing
|
|
163
|
+
the region — no `createRef` + `createEffect` + `replaceChildren` boilerplate.
|
|
164
|
+
Return a node, a `null` (conditional), or an array (list). Static siblings around
|
|
165
|
+
the getter keep their position.
|
|
166
|
+
|
|
167
|
+
> **Semantics — this is a full rebuild, not a keyed diff.** On each change the
|
|
168
|
+
> whole region is torn down and re-created; there is no per-item keying, and it
|
|
169
|
+
> re-runs on **every** change the getter reads — even one that doesn't alter the
|
|
170
|
+
> result. It is the coarse escape hatch. Prefer the fine-grained primitives:
|
|
171
|
+
> [`Show`](#conditionals--show) for conditionals (rebuilds only when the branch
|
|
172
|
+
> flips) and [`For`](#keyed-lists--for) for lists (reuses nodes by key). Reach for
|
|
173
|
+
> a raw getter only for content whose shape genuinely changes on every update.
|
|
174
|
+
|
|
175
|
+
### Conditionals — `Show`
|
|
176
|
+
|
|
177
|
+
`Show` is a **fine-grained** conditional: it rebuilds a branch only when the
|
|
178
|
+
_truthiness_ of `when` flips, not on every change `when` reads. Content inside a
|
|
179
|
+
branch updates through its own bindings — the branch is built once. (A raw getter
|
|
180
|
+
child, by contrast, tears down and rebuilds on every dependency tick.)
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
import { Show } from 'ranui/builder';
|
|
184
|
+
|
|
185
|
+
Div().children(
|
|
186
|
+
Show({
|
|
187
|
+
when: () => user(), // reads a signal
|
|
188
|
+
children: (u) => Span().text(() => u().name), // built once; text updates in place
|
|
189
|
+
fallback: () => Span().text('Signed out'), // optional
|
|
190
|
+
}),
|
|
191
|
+
);
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
`children` gets an accessor to the narrowed truthy value — read it inside a
|
|
195
|
+
binding so it updates without rebuilding. `Show` returns a getter, so it slots
|
|
196
|
+
into `children()` anywhere.
|
|
197
|
+
|
|
198
|
+
### Multi-branch — `Switch` / `Match`
|
|
199
|
+
|
|
200
|
+
`Switch` is the n-way `Show`: it renders the **first** `Match` whose `when` is
|
|
201
|
+
truthy (else `fallback`), and is equally fine-grained — only the _index_ of the
|
|
202
|
+
winning branch is memoized, so it rebuilds only when the active branch changes.
|
|
203
|
+
Evaluation short-circuits at the first match.
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
import { Switch, Match } from 'ranui/builder';
|
|
207
|
+
|
|
208
|
+
Div().children(
|
|
209
|
+
Switch({
|
|
210
|
+
fallback: () => Span().text('idle'),
|
|
211
|
+
children: [
|
|
212
|
+
Match({ when: () => status() === 'loading', children: () => Spinner() }),
|
|
213
|
+
Match({ when: () => error(), children: (e) => ErrorView(e) }), // e: accessor to the truthy value
|
|
214
|
+
],
|
|
215
|
+
}),
|
|
216
|
+
);
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
// Conditional — toggles a node in/out between static siblings
|
|
221
|
+
Div().children(Header().text('H'), () => (open() ? Div().class('panel').text('body') : null), Footer().text('F'));
|
|
222
|
+
|
|
223
|
+
// List — reconciles as the array changes
|
|
224
|
+
Ul().children(() => rows().map((r) => Li().text(r.title)));
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
On **SSR** a getter is evaluated once (static snapshot); reactivity is a
|
|
228
|
+
client-only concern. Like all bindings, reactive children must be built inside a
|
|
229
|
+
`createRoot` so their effects are owned and disposed with the page (see §3 Ownership).
|
|
230
|
+
|
|
231
|
+
### Keyed lists — `For`
|
|
232
|
+
|
|
233
|
+
For lists that add/remove/reorder, `For` matches items by `key` and **reuses
|
|
234
|
+
their DOM nodes** — only changed items touch the DOM, so focus, scroll, input
|
|
235
|
+
values and transitions inside surviving rows are preserved (a plain getter child
|
|
236
|
+
would rebuild all of them). Pass the handle straight to `children()`.
|
|
237
|
+
|
|
238
|
+
```ts
|
|
239
|
+
import { For } from 'ranui/builder';
|
|
240
|
+
|
|
241
|
+
const [rows, setRows] = signal([{ id: 1, title: 'a' }]);
|
|
242
|
+
|
|
243
|
+
Ul().children(
|
|
244
|
+
For({
|
|
245
|
+
each: () => rows(), // reactive source array
|
|
246
|
+
key: (r) => r.id, // stable, UNIQUE identity per item
|
|
247
|
+
render: (r, index) => Li().text(() => `${index()}. ${r.title}`),
|
|
248
|
+
}),
|
|
249
|
+
);
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
- `key` **must be unique** — it is how a node is matched to its item across
|
|
253
|
+
updates. A duplicate key is ignored (only the first item with it renders) and
|
|
254
|
+
warned in dev. (Don't use the array index as the key — that defeats reuse on
|
|
255
|
+
reorder.)
|
|
256
|
+
- `each` reads a signal, so update it with a **new array** (`setRows([...])`).
|
|
257
|
+
Mutating the same array in place and re-setting it is skipped (`Object.is`
|
|
258
|
+
equality), and the list won't update.
|
|
259
|
+
- `render` runs **once per item**, not on every list change. Drive per-row
|
|
260
|
+
updates with signals (e.g. `.text(() => …)`); `index` is a **getter** so it
|
|
261
|
+
stays correct after reorders.
|
|
262
|
+
- Removing an item disposes that row's scope (its effects/cleanups). The whole
|
|
263
|
+
list is disposed with its owning `createRoot`.
|
|
264
|
+
- **SSR**: rendered once as a static snapshot (no reconciliation).
|
|
265
|
+
|
|
266
|
+
### Index lists — `Index`
|
|
267
|
+
|
|
268
|
+
`Index` is the position-keyed counterpart to `For`: the node at index `i` is
|
|
269
|
+
reused across updates and its **item is a signal** — when the value at that
|
|
270
|
+
position changes, it updates in place (the node is not rebuilt); nodes never
|
|
271
|
+
move. Use it when position is the identity (primitive arrays, fixed rows); use
|
|
272
|
+
`For` when items have a stable id and can reorder.
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
import { Index } from 'ranui/builder';
|
|
276
|
+
|
|
277
|
+
Ul().children(
|
|
278
|
+
Index({
|
|
279
|
+
each: () => nums(),
|
|
280
|
+
render: (n, i) => Li().text(() => `${i}: ${n()}`), // n is an accessor; i is a fixed number
|
|
281
|
+
}),
|
|
282
|
+
);
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Rule of thumb: **`Show`/`Switch` for conditionals; `For` (keyed by id) or `Index`
|
|
286
|
+
(keyed by position) for lists; a raw getter child only for content that changes
|
|
287
|
+
shape on every update.**
|
|
288
|
+
|
|
136
289
|
A getter binding creates an effect **owned by the current scope** (see below), so
|
|
137
290
|
it is cleaned up automatically when that scope is disposed. Reactivity applies to
|
|
138
291
|
the single-value forms — `style(prop, getter)`, not the `style({...})` /
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ranui",
|
|
3
|
-
"version": "0.2.1-alpha.
|
|
3
|
+
"version": "0.2.1-alpha.3",
|
|
4
4
|
"description": "A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -205,6 +205,11 @@
|
|
|
205
205
|
"import": "./dist/math.js",
|
|
206
206
|
"require": "./dist/index.cjs"
|
|
207
207
|
},
|
|
208
|
+
"./mermaid": {
|
|
209
|
+
"types": "./dist/index.d.ts",
|
|
210
|
+
"import": "./dist/mermaid.js",
|
|
211
|
+
"require": "./dist/index.cjs"
|
|
212
|
+
},
|
|
208
213
|
"./checkbox": {
|
|
209
214
|
"types": "./dist/index.d.ts",
|
|
210
215
|
"import": "./dist/checkbox.js",
|
|
@@ -282,6 +287,7 @@
|
|
|
282
287
|
"vitest": "^4.1.10"
|
|
283
288
|
},
|
|
284
289
|
"dependencies": {
|
|
290
|
+
"mermaid": "^11",
|
|
285
291
|
"ranuts": "^0.2.0-alpha.1"
|
|
286
292
|
},
|
|
287
293
|
"scripts": {
|
package/dist/button-BfYw0fes.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { _ as i, a as b, n as l, o as d, s as a, t as h } from "./utils-DBfrRFoE.js";
|
|
2
|
-
import { t as v } from "./events-C59wGdni.js";
|
|
3
|
-
import { _ as u, i as s, p as f } from "./factory-DCrO37si.js";
|
|
4
|
-
import { a as g, n as p } from "./ssr-DSGwPtEd.js";
|
|
5
|
-
var m = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{box-sizing:var(--ran-btn-box-sizing, border-box);position:var(--ran-btn-position, relative);display:var(--ran-btn-display, inline-flex);background-image:var(--ran-btn-background-image, none);box-shadow:var(--ran-btn-box-shadow, var(--ran-skin-raised-shadow, 0 2px #00000004));cursor:var(--ran-btn-cursor, pointer);-webkit-user-select:var(--ran-btn-user-select, none);user-select:var(--ran-btn-user-select, none);touch-action:var(--ran-btn-touch-action, manipulation);overflow:var(--ran-btn-overflow, hidden);pointer-events:var(--ran-btn-pointer-events, auto)}:host .ran-btn{box-sizing:var(--ran-btn-contain-box-sizing, border-box);position:var(--ran-btn-contain-position, relative);display:var(--ran-btn-contain-display, block);background-image:var(--ran-btn-contain-background-image, none);cursor:var(--ran-btn-contain-cursor, pointer);transition:var(--ran-btn-contain-transition, opacity var(--ran-motion-duration-base, .2s) cubic-bezier(.645, .045, .355, 1));-webkit-user-select:var(--ran-btn-contain-user-select, none);user-select:var(--ran-btn-contain-user-select, none);touch-action:var(--ran-btn-contain-touch-action, manipulation);border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));background:var(--ran-btn-contain-background, var(--ran-color-bg-elevated, #fff))}:host,:host(:active),:host(:focus){outline:0;-webkit-tap-highlight-color:transparent}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:var(--ran-btn-contain-outline, 0)}:host(:focus-visible){outline:var(--ran-btn-focus-outline, 2px solid var(--ran-color-primary));outline-offset:var(--ran-btn-focus-outline-offset, 2px)}:host([type="primary"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-primary, #006bff));background-image:var(--ran-btn-content-background-image, none);border-color:var(--ran-btn-content-border-color, var(--ran-color-primary, #006bff));color:var(--ran-btn-content-color, #fff)}:host([type="primary"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="primary"]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color, var(--ran-color-primary-active, #005ff2));border-color:var(--ran-btn-content-active-border-color, var(--ran-color-primary-active, #005ff2))}:host([type="contrast"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-contrast-bg, #171717));background-image:var(--ran-btn-content-background-image, none);border-color:var(--ran-btn-content-border-color, var(--ran-color-contrast-bg, #171717));color:var(--ran-btn-content-color, var(--ran-color-contrast-text, #fff))}:host([type="contrast"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, var(--ran-color-contrast-text, #fff) 10%, transparent 10.01%))}:host([type="contrast"]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color, var(--ran-color-contrast-bg-active, #4d4d4d));border-color:var(--ran-btn-content-active-border-color, var(--ran-color-contrast-bg-active, #4d4d4d))}@media(min-width:1024px){:host(:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-border-hover, #c9c9c9));color:var(--ran-btn-content-hover-color, var(--ran-color-text, #171717))}:host([type="primary"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, var(--ran-color-primary-hover, #0059ec));border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-primary-hover, #0059ec));color:var(--ran-btn-content-hover-color, #fff)}:host([type="contrast"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, var(--ran-color-contrast-bg-hover, #383838));border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-contrast-bg-hover, #383838));color:var(--ran-btn-content-hover-color, var(--ran-color-contrast-text, #fff))}:host([type="warning"]:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));color:var(--ran-btn-content-warning-color, #fff)}}:host([type="warning"]) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));background-image:var(--ran-btn-content-background-image, none);color:var(--ran-btn-content-warning-color, #fff)}:host([type="warning"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="text"]) .ran-btn-content{border:var(--ran-btn-content-text-border, none)}:host([disabled]){cursor:var(--ran-btn-disabled-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-pointer-events, all);opacity:var(--ran-btn-disabled-opacity, .6)}:host([disabled]) .ran-btn{cursor:var(--ran-btn-disabled-container-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-container-pointer-events, all);opacity:var(--ran-btn-disabled-container-opacity, .6)}:host(:not([disabled]):active) .ran-btn:after{transform:var(--ran-btn-after-transform, translate(-50%, -50%) scale(0));opacity:var(--ran-btn-after-opacity, .3);transition:var(--ran-btn-after-transition, 0s)}@media(min-width:1024px){:host(:not([disabled],[effect])) .ran-btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--ran-x, 0);top:var(--ran-y, 0);pointer-events:none;background-image:radial-gradient(circle,var(--ran-gray-alpha-400, #00000014) 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}}:host .slot{display:var(--ran-btn-slot-display, block)}.ran-btn-content{display:var(--ran-btn-content-display, flex);justify-content:var(--ran-btn-content-display, space-between);align-items:var(--ran-btn-content-align-items, center);padding:var(--ran-btn-content-padding, 4px 15px);border:var(--ran-btn-content-border, 1px solid transparent);border-image-source:var(--ran-btn-content-border-image-source, none);border-image-slice:var(--ran-btn-content-border-image-slice, 8);border-image-width:var(--ran-btn-content-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));border-color:var(--ran-btn-content-border-color, var(--ran-color-border, #eaeaea));color:var(--ran-btn-content-color, var(--ran-color-text, #000000d9));line-height:var(--ran-btn-content-line-height, 22px);font-size:var(--ran-btn-content-font-size, 14px);font-weight:var(--ran-btn-content-font-weight, 400);font-family:var(--ran-btn-content-font-family, var(--ran-skin-font-family, inherit));white-space:var(--ran-btn-content-white-space, nowrap);text-align:var(--ran-btn-content-text-align, center);box-sizing:var(--ran-btn-content-box-sizing, border-box)}.ran-btn-content .icon{margin-right:var(--ran-btn-icon-margin-right, 2px)}', y = class extends p {
|
|
6
|
-
_btn;
|
|
7
|
-
_btnContent;
|
|
8
|
-
_iconElement;
|
|
9
|
-
_slot;
|
|
10
|
-
_shadowDom;
|
|
11
|
-
_events = new v();
|
|
12
|
-
debounceTimeId;
|
|
13
|
-
static get observedAttributes() {
|
|
14
|
-
return [
|
|
15
|
-
"disabled",
|
|
16
|
-
"icon",
|
|
17
|
-
"effect",
|
|
18
|
-
"iconSize",
|
|
19
|
-
"type",
|
|
20
|
-
"sheet"
|
|
21
|
-
];
|
|
22
|
-
}
|
|
23
|
-
constructor() {
|
|
24
|
-
super(), this._shadowDom = l(this, m);
|
|
25
|
-
const t = h(this._shadowDom, ".ran-btn", () => s().class("ran-btn").attr("part", "button").role("button").tabIndex(0).children(s().class("ran-btn-content").attr("part", "content").children(f().class("slot"))).build());
|
|
26
|
-
this._btn = t, this._btnContent = t.querySelector(".ran-btn-content"), this._slot = t.querySelector("slot");
|
|
27
|
-
}
|
|
28
|
-
get sheet() {
|
|
29
|
-
return this.getAttribute("sheet") || "";
|
|
30
|
-
}
|
|
31
|
-
set sheet(t) {
|
|
32
|
-
this.setAttribute("sheet", t || ""), this.handlerExternalCss();
|
|
33
|
-
}
|
|
34
|
-
get disabled() {
|
|
35
|
-
return a(this);
|
|
36
|
-
}
|
|
37
|
-
set disabled(t) {
|
|
38
|
-
!t || t === "false" ? (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")) : (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true"));
|
|
39
|
-
}
|
|
40
|
-
get iconSize() {
|
|
41
|
-
return this.getAttribute("iconSize") || "";
|
|
42
|
-
}
|
|
43
|
-
set iconSize(t) {
|
|
44
|
-
!t || t === "false" ? this.removeAttribute("iconSize") : (this.setAttribute("iconSize", t), this.setIcon());
|
|
45
|
-
}
|
|
46
|
-
get icon() {
|
|
47
|
-
return this.getAttribute("icon") || "";
|
|
48
|
-
}
|
|
49
|
-
set icon(t) {
|
|
50
|
-
!t || t === "false" ? this.removeAttribute("icon") : (this.setAttribute("icon", t), this.setIcon());
|
|
51
|
-
}
|
|
52
|
-
get effect() {
|
|
53
|
-
return this.getAttribute("effect") || "";
|
|
54
|
-
}
|
|
55
|
-
set effect(t) {
|
|
56
|
-
d.includes(t) || !t ? this.removeAttribute("effect") : this.setAttribute("effect", t);
|
|
57
|
-
}
|
|
58
|
-
get type() {
|
|
59
|
-
return this.getAttribute("type") || "";
|
|
60
|
-
}
|
|
61
|
-
set type(t) {
|
|
62
|
-
t ? this.setAttribute("type", t) : this.removeAttribute("type");
|
|
63
|
-
}
|
|
64
|
-
setIcon = () => {
|
|
65
|
-
if (typeof document > "u" || !this._slot) return;
|
|
66
|
-
const t = this.icon;
|
|
67
|
-
if (!t) {
|
|
68
|
-
this._iconElement && (this._iconElement.remove(), this._iconElement = void 0);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (this._iconElement) this._iconElement.setAttribute("name", t);
|
|
72
|
-
else {
|
|
73
|
-
let e = this._shadowDom.querySelector("r-icon");
|
|
74
|
-
e || (e = u("r-icon").attr("color", "currentColor").class("icon").build(), this._slot.insertAdjacentElement("beforebegin", e)), this._iconElement = e, this._iconElement.setAttribute("name", t);
|
|
75
|
-
}
|
|
76
|
-
const { width: n, height: r } = this._slot.getBoundingClientRect(), o = Math.min(n, r) || 16, c = this.iconSize || `${o > 5 ? o - 5 : o}`;
|
|
77
|
-
this._iconElement.setAttribute("size", String(c));
|
|
78
|
-
};
|
|
79
|
-
mousedown = (t) => {
|
|
80
|
-
if (i() === "pc" && !this.disabled) {
|
|
81
|
-
this.debounceMouseEvent();
|
|
82
|
-
const { left: n, top: r } = this.getBoundingClientRect();
|
|
83
|
-
this._btn.style.setProperty("--ran-x", `${t.clientX - n}px`), this._btn.style.setProperty("--ran-y", `${t.clientY - r}px`);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
mouseup = () => {
|
|
87
|
-
i() === "pc" && (this.debounceTimeId || (this.debounceTimeId = setTimeout(() => {
|
|
88
|
-
this._btn.style.removeProperty("--ran-x"), this._btn.style.removeProperty("--ran-y"), this.debounceMouseEvent();
|
|
89
|
-
}, 600)));
|
|
90
|
-
};
|
|
91
|
-
keydown = (t) => {
|
|
92
|
-
a(this) || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.click());
|
|
93
|
-
};
|
|
94
|
-
debounceMouseEvent = () => {
|
|
95
|
-
this.debounceTimeId && (clearTimeout(this.debounceTimeId), this.debounceTimeId = void 0);
|
|
96
|
-
};
|
|
97
|
-
handlerExternalCss = () => {
|
|
98
|
-
b(this, this._shadowDom, "sheet", null, this.sheet);
|
|
99
|
-
};
|
|
100
|
-
syncA11yState = () => {
|
|
101
|
-
const t = a(this);
|
|
102
|
-
this._btn.setAttribute("aria-disabled", t ? "true" : "false"), this._btn.tabIndex = t ? -1 : 0, t ? (this.setAttribute("aria-disabled", "true"), this._btnContent.setAttribute("disabled", "true")) : (this.removeAttribute("aria-disabled"), this._btnContent.removeAttribute("disabled"));
|
|
103
|
-
};
|
|
104
|
-
connectedCallback() {
|
|
105
|
-
this.handlerExternalCss(), this.setIcon(), this.syncA11yState(), this._events.on(this._btn, "mousedown", this.mousedown).on(this._btn, "mouseup", this.mouseup).on(this._btn, "keydown", this.keydown);
|
|
106
|
-
}
|
|
107
|
-
disconnectedCallback() {
|
|
108
|
-
this.debounceMouseEvent(), this._events.abort();
|
|
109
|
-
}
|
|
110
|
-
attributeChangedCallback(t, n, r) {
|
|
111
|
-
n !== r && (t === "disabled" && this._btnContent && this.syncA11yState(), (t === "icon" || t === "iconSize") && this.setIcon(), t === "sheet" && this.handlerExternalCss());
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
g("r-button", y);
|
|
115
|
-
export {
|
|
116
|
-
y as t
|
|
117
|
-
};
|
package/dist/factory-DCrO37si.js
DELETED
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
import { c as u, n as H } from "./mocks-CMGoftIc.js";
|
|
2
|
-
var f = 0, C = 1, d = 2, o = null, i = null, c = 0, h = /* @__PURE__ */ new Set(), v = !1;
|
|
3
|
-
function T(e, t) {
|
|
4
|
-
const r = t?.equals ?? Object.is, s = {
|
|
5
|
-
value: e,
|
|
6
|
-
observers: /* @__PURE__ */ new Set()
|
|
7
|
-
};
|
|
8
|
-
return [() => (m(s), s.value), (p) => {
|
|
9
|
-
const w = typeof p == "function" ? p(s.value) : p;
|
|
10
|
-
if (!r(s.value, w)) {
|
|
11
|
-
s.value = w;
|
|
12
|
-
for (const z of s.observers) b(z, d);
|
|
13
|
-
c === 0 && O();
|
|
14
|
-
}
|
|
15
|
-
}];
|
|
16
|
-
}
|
|
17
|
-
function j(e, t) {
|
|
18
|
-
const r = g(e, !1, t?.equals);
|
|
19
|
-
return E(r), () => (r.disposed || (y(r), m(r)), r.value);
|
|
20
|
-
}
|
|
21
|
-
function k(e) {
|
|
22
|
-
const t = g(e, !0);
|
|
23
|
-
return E(t), A(t), () => S(t);
|
|
24
|
-
}
|
|
25
|
-
function I(e) {
|
|
26
|
-
c++;
|
|
27
|
-
try {
|
|
28
|
-
e();
|
|
29
|
-
} finally {
|
|
30
|
-
c--, c === 0 && O();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function R(e) {
|
|
34
|
-
const t = o;
|
|
35
|
-
o = null;
|
|
36
|
-
try {
|
|
37
|
-
return e();
|
|
38
|
-
} finally {
|
|
39
|
-
o = t;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function M(e) {
|
|
43
|
-
const t = {
|
|
44
|
-
owned: [],
|
|
45
|
-
cleanups: [],
|
|
46
|
-
owner: i
|
|
47
|
-
}, r = i, s = o;
|
|
48
|
-
i = t, o = null;
|
|
49
|
-
try {
|
|
50
|
-
return e(() => q(t));
|
|
51
|
-
} finally {
|
|
52
|
-
i = r, o = s;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function $(e) {
|
|
56
|
-
i && i.cleanups.push(e);
|
|
57
|
-
}
|
|
58
|
-
function P() {
|
|
59
|
-
return i;
|
|
60
|
-
}
|
|
61
|
-
function V(e, t) {
|
|
62
|
-
const r = i, s = o;
|
|
63
|
-
i = e, o = null;
|
|
64
|
-
try {
|
|
65
|
-
return t();
|
|
66
|
-
} finally {
|
|
67
|
-
i = r, o = s;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function g(e, t, r) {
|
|
71
|
-
return {
|
|
72
|
-
fn: e,
|
|
73
|
-
sources: /* @__PURE__ */ new Set(),
|
|
74
|
-
isEffect: t,
|
|
75
|
-
running: !1,
|
|
76
|
-
disposed: !1,
|
|
77
|
-
state: d,
|
|
78
|
-
observers: /* @__PURE__ */ new Set(),
|
|
79
|
-
value: void 0,
|
|
80
|
-
equals: r ?? Object.is,
|
|
81
|
-
owned: [],
|
|
82
|
-
cleanups: [],
|
|
83
|
-
owner: i
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function E(e) {
|
|
87
|
-
i && i.owned.push(e);
|
|
88
|
-
}
|
|
89
|
-
function m(e) {
|
|
90
|
-
o && (o.sources.add(e), e.observers.add(o));
|
|
91
|
-
}
|
|
92
|
-
function b(e, t) {
|
|
93
|
-
if (e.disposed || e.state >= t) return;
|
|
94
|
-
const r = e.state === f;
|
|
95
|
-
if (e.state = t, e.isEffect) h.add(e);
|
|
96
|
-
else if (r) for (const s of e.observers) b(s, C);
|
|
97
|
-
}
|
|
98
|
-
function O() {
|
|
99
|
-
if (!(c > 0 || v)) {
|
|
100
|
-
v = !0;
|
|
101
|
-
try {
|
|
102
|
-
for (; h.size > 0; ) {
|
|
103
|
-
const e = [...h];
|
|
104
|
-
h.clear();
|
|
105
|
-
for (const t of e) t.disposed || y(t);
|
|
106
|
-
}
|
|
107
|
-
} finally {
|
|
108
|
-
v = !1;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
function y(e) {
|
|
113
|
-
if (!(e.disposed || e.state === f)) {
|
|
114
|
-
if (e.state === C)
|
|
115
|
-
for (const t of e.sources) "fn" in t && y(t);
|
|
116
|
-
e.state === d && A(e), e.state = f;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
function A(e) {
|
|
120
|
-
if (e.running) throw new Error("ranui reactivity: cyclic dependency detected (a computation triggered itself).");
|
|
121
|
-
L(e);
|
|
122
|
-
const t = o, r = i;
|
|
123
|
-
o = e, i = e, e.running = !0, e.state = f;
|
|
124
|
-
try {
|
|
125
|
-
const s = e.fn();
|
|
126
|
-
if (e.isEffect)
|
|
127
|
-
typeof s == "function" && e.cleanups.push(s);
|
|
128
|
-
else {
|
|
129
|
-
const n = e.value;
|
|
130
|
-
if (e.value = s, e.observers.size > 0 && !e.equals(n, s)) for (const l of e.observers) b(l, d);
|
|
131
|
-
}
|
|
132
|
-
} finally {
|
|
133
|
-
e.running = !1, o = t, i = r;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function L(e) {
|
|
137
|
-
for (const t of e.owned) S(t);
|
|
138
|
-
e.owned.length = 0;
|
|
139
|
-
for (const t of e.cleanups) t();
|
|
140
|
-
e.cleanups.length = 0;
|
|
141
|
-
for (const t of e.sources) t.observers.delete(e);
|
|
142
|
-
e.sources.clear();
|
|
143
|
-
}
|
|
144
|
-
function S(e) {
|
|
145
|
-
e.disposed || (e.disposed = !0, L(e), e.observers.clear());
|
|
146
|
-
}
|
|
147
|
-
function q(e) {
|
|
148
|
-
for (const t of e.owned) S(t);
|
|
149
|
-
e.owned.length = 0;
|
|
150
|
-
for (const t of e.cleanups) t();
|
|
151
|
-
e.cleanups.length = 0;
|
|
152
|
-
}
|
|
153
|
-
var W = () => ({ current: null }), B = class N {
|
|
154
|
-
el;
|
|
155
|
-
constructor(t) {
|
|
156
|
-
this.el = u ? new H(t) : document.createElement(t);
|
|
157
|
-
}
|
|
158
|
-
id(t) {
|
|
159
|
-
return this.el.setAttribute("id", t), this;
|
|
160
|
-
}
|
|
161
|
-
bind(t, r) {
|
|
162
|
-
typeof t == "function" ? k(() => r(t())) : r(t);
|
|
163
|
-
}
|
|
164
|
-
class(t) {
|
|
165
|
-
return this.bind(t, (r) => {
|
|
166
|
-
u ? this.el.attributes.set("class", r) : this.el.className = r;
|
|
167
|
-
}), this;
|
|
168
|
-
}
|
|
169
|
-
addClass(...t) {
|
|
170
|
-
return t.forEach((r) => this.el.classList.add(r)), this;
|
|
171
|
-
}
|
|
172
|
-
removeClass(...t) {
|
|
173
|
-
return t.forEach((r) => this.el.classList.remove(r)), this;
|
|
174
|
-
}
|
|
175
|
-
attr(t, r) {
|
|
176
|
-
return this.bind(r, (s) => this.el.setAttribute(t, s)), this;
|
|
177
|
-
}
|
|
178
|
-
attrs(t) {
|
|
179
|
-
return Object.entries(t).forEach(([r, s]) => {
|
|
180
|
-
s != null && this.el.setAttribute(r, String(s));
|
|
181
|
-
}), this;
|
|
182
|
-
}
|
|
183
|
-
boolAttr(t, r, s = "") {
|
|
184
|
-
return this.bind(r, (n) => {
|
|
185
|
-
n ? this.el.setAttribute(t, s) : this.el.removeAttribute(t);
|
|
186
|
-
}), this;
|
|
187
|
-
}
|
|
188
|
-
part(t) {
|
|
189
|
-
return this.attr("part", t);
|
|
190
|
-
}
|
|
191
|
-
data(t, r) {
|
|
192
|
-
return this.attr(`data-${t}`, r);
|
|
193
|
-
}
|
|
194
|
-
style(t, r) {
|
|
195
|
-
return typeof t == "string" ? this.bind(r ?? "", (s) => this.el.style.setProperty(t, s)) : Object.entries(t).forEach(([s, n]) => this.el.style.setProperty(s, n)), this;
|
|
196
|
-
}
|
|
197
|
-
cssVar(t, r) {
|
|
198
|
-
const s = t.startsWith("--") ? t : `--${t}`;
|
|
199
|
-
return this.style(s, r);
|
|
200
|
-
}
|
|
201
|
-
aria(t, r) {
|
|
202
|
-
return this.attr(`aria-${t}`, r);
|
|
203
|
-
}
|
|
204
|
-
role(t) {
|
|
205
|
-
return this.attr("role", t);
|
|
206
|
-
}
|
|
207
|
-
tabIndex(t) {
|
|
208
|
-
return this.attr("tabindex", String(t));
|
|
209
|
-
}
|
|
210
|
-
label(t) {
|
|
211
|
-
return this.aria("label", t);
|
|
212
|
-
}
|
|
213
|
-
labelledBy(t) {
|
|
214
|
-
return this.aria("labelledby", t);
|
|
215
|
-
}
|
|
216
|
-
describedBy(t) {
|
|
217
|
-
return this.aria("describedby", t);
|
|
218
|
-
}
|
|
219
|
-
ariaHidden(t = !0) {
|
|
220
|
-
return this.aria("hidden", String(t));
|
|
221
|
-
}
|
|
222
|
-
on(t, r, s) {
|
|
223
|
-
return this.el.addEventListener(t, r, s), this;
|
|
224
|
-
}
|
|
225
|
-
listen(t, r, s, n) {
|
|
226
|
-
return t.on(this.el, r, s, n), this;
|
|
227
|
-
}
|
|
228
|
-
delegate(t, r, s, n, l) {
|
|
229
|
-
return t.delegate(this.el, r, s, n, l), this;
|
|
230
|
-
}
|
|
231
|
-
children(...t) {
|
|
232
|
-
const r = (s) => s.reduce((n, l) => Array.isArray(l) ? n.concat(r(l)) : n.concat(l), []);
|
|
233
|
-
return r(t).forEach((s) => {
|
|
234
|
-
s != null && (s instanceof N ? this.el.appendChild(s.build()) : typeof s == "string" ? u ? this.el.appendChild(s) : this.el.appendChild(document.createTextNode(s)) : this.el.appendChild(s));
|
|
235
|
-
}), this;
|
|
236
|
-
}
|
|
237
|
-
replaceChildren(...t) {
|
|
238
|
-
if (u) {
|
|
239
|
-
const r = this.el;
|
|
240
|
-
r.childrenList = [];
|
|
241
|
-
} else this.el.replaceChildren();
|
|
242
|
-
return this.children(...t);
|
|
243
|
-
}
|
|
244
|
-
text(t) {
|
|
245
|
-
return this.bind(t, (r) => {
|
|
246
|
-
this.el.textContent = r;
|
|
247
|
-
}), this;
|
|
248
|
-
}
|
|
249
|
-
ref(t) {
|
|
250
|
-
return t.current = this.el, this;
|
|
251
|
-
}
|
|
252
|
-
shadow(t = { mode: "closed" }) {
|
|
253
|
-
const r = this.el.attachShadow(t);
|
|
254
|
-
return new x(this.el, r, t);
|
|
255
|
-
}
|
|
256
|
-
build() {
|
|
257
|
-
return this.el;
|
|
258
|
-
}
|
|
259
|
-
serialize() {
|
|
260
|
-
if (u) return this.el.serialize();
|
|
261
|
-
const t = document.createElement("div");
|
|
262
|
-
return t.appendChild(this.el.cloneNode(!0)), t.innerHTML;
|
|
263
|
-
}
|
|
264
|
-
}, x = class {
|
|
265
|
-
root;
|
|
266
|
-
hostEl;
|
|
267
|
-
options;
|
|
268
|
-
constructor(e, t, r) {
|
|
269
|
-
this.hostEl = e, this.root = t, this.options = r;
|
|
270
|
-
}
|
|
271
|
-
children(...e) {
|
|
272
|
-
const t = (r) => r.reduce((s, n) => Array.isArray(n) ? s.concat(t(n)) : s.concat(n), []);
|
|
273
|
-
return t(e).forEach((r) => {
|
|
274
|
-
r != null && (r instanceof B ? this.root.appendChild(r.build()) : typeof r == "string" ? u ? this.root.appendChild(r) : this.root.appendChild(document.createTextNode(r)) : this.root.appendChild(r));
|
|
275
|
-
}), this;
|
|
276
|
-
}
|
|
277
|
-
adoptSheet(...e) {
|
|
278
|
-
return this.root.adoptedStyleSheets = [...this.root.adoptedStyleSheets, ...e], this;
|
|
279
|
-
}
|
|
280
|
-
css(e) {
|
|
281
|
-
if (u)
|
|
282
|
-
return this.root.adoptedStyleSheets.push(e), this;
|
|
283
|
-
if (typeof CSSStyleSheet < "u") try {
|
|
284
|
-
const r = new CSSStyleSheet();
|
|
285
|
-
return r.replaceSync(e), this.root.adoptedStyleSheets = [...this.root.adoptedStyleSheets, r], this;
|
|
286
|
-
} catch {
|
|
287
|
-
}
|
|
288
|
-
const t = document.createElement("style");
|
|
289
|
-
return t.textContent = e, this.root.appendChild(t), this;
|
|
290
|
-
}
|
|
291
|
-
done() {
|
|
292
|
-
return {
|
|
293
|
-
host: this.hostEl,
|
|
294
|
-
shadow: this.root
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
serialize() {
|
|
298
|
-
return u ? this.root.serialize() : this.root.innerHTML;
|
|
299
|
-
}
|
|
300
|
-
}, a = (e) => new B(e), F = () => a("div"), K = () => a("span"), U = () => a("slot"), Y = () => a("button"), G = () => a("input"), J = () => a("style"), Q = () => a("label"), X = () => a("ul"), Z = () => a("li"), _ = () => a("section"), tt = () => a("article"), et = () => a("nav"), rt = () => a("header"), st = () => a("footer"), nt = () => a("main"), it = (e = "open", t = !1) => {
|
|
301
|
-
const r = a("template");
|
|
302
|
-
return r.attr("shadowrootmode", e), t && r.attr("shadowrootdelegatesfocus", ""), r;
|
|
303
|
-
};
|
|
304
|
-
export {
|
|
305
|
-
k as C,
|
|
306
|
-
V as D,
|
|
307
|
-
$ as E,
|
|
308
|
-
T as O,
|
|
309
|
-
j as S,
|
|
310
|
-
P as T,
|
|
311
|
-
a as _,
|
|
312
|
-
st as a,
|
|
313
|
-
W as b,
|
|
314
|
-
Q as c,
|
|
315
|
-
et as d,
|
|
316
|
-
_ as f,
|
|
317
|
-
X as g,
|
|
318
|
-
J as h,
|
|
319
|
-
F as i,
|
|
320
|
-
R as k,
|
|
321
|
-
Z as l,
|
|
322
|
-
K as m,
|
|
323
|
-
Y as n,
|
|
324
|
-
rt as o,
|
|
325
|
-
U as p,
|
|
326
|
-
it as r,
|
|
327
|
-
G as s,
|
|
328
|
-
tt as t,
|
|
329
|
-
nt as u,
|
|
330
|
-
B as v,
|
|
331
|
-
M as w,
|
|
332
|
-
I as x,
|
|
333
|
-
x as y
|
|
334
|
-
};
|