@macrostrat/column-components
Version:
React rendering primitives for stratigraphic columns
3 lines (2 loc) • 1.57 kB
JavaScript
import"./column-components.746beab7.js";import"./column-components.df0ea532.js";import"./column-components.9afb6b26.js";import"./column-components.511bed71.js";import{forwardRef as e,useContext as t}from"react";var o=globalThis,n={},r={},l=o.parcelRequirea149;null==l&&((l=function(e){if(e in n)return n[e].exports;if(e in r){var t=r[e];delete r[e];var o={id:e,exports:{}};return n[e]=o,t.call(o.exports,o,o.exports),o.exports}var l=Error("Cannot find module '"+e+"'");throw l.code="MODULE_NOT_FOUND",l}).register=function(e,t){r[e]=t},o.parcelRequirea149=l),l.register;var i=l("4bJ9d"),a=l("dl5CL"),f=l("d6XIX"),u=l("fwzVu");let s=e(function(e,o){let{offsetY:n,noteHeight:r,onClick:l,children:f}=e,{width:s,paddingLeft:d}=t(a.NoteLayoutContext);null==r&&(r=0);let c=n-r/2-5;return(0,i.default)(u.ForeignObject,{width:s-d+10,x:d-5,y:c,height:r+10,overflow:"visible",style:{overflowY:"visible"}},[(0,i.default)("div.note-inner",{ref:o,onClick:l,style:{margin:5}},f)])}),d=function(e){let{notes:o}=t(a.NoteLayoutContext);return o.indexOf(e)},c=function(e){let{note:o,node:n,deltaConnectorAttachment:r,index:l}=e;null==l&&(l=d(o));let{nodes:u,columnIndex:s,generatePath:c}=t(a.NoteLayoutContext),{height:p,top_height:h}=o;null==n&&(n=u[o.id]),null!=n&&null!=r&&(n.currentPos+=r);let m=5*(s[l]||0);return(0,i.default)([(0,i.default)(f.HeightRangeAnnotation,{offsetX:m,height:p,top_height:h}),(0,i.default)("path.link.col-note-link",{d:c(n,m),transform:`translate(${m})`})])};export{s as NotePositioner,c as NoteConnector};
//# sourceMappingURL=column-components.0f346a0e.js.map