1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102 |
- /**
- * https://github.com/sunag/flow
- */
- function __flow__addCSS( css ) {
- try {
- const style = document.createElement( 'style' );
- style.setAttribute( 'type', 'text/css' );
- style.innerHTML = css;
- document.head.appendChild( style );
- } catch ( e ) {}
- }
- __flow__addCSS( `@keyframes f-animation-open { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; }}f-canvas,f-canvas canvas { position: absolute; top: 0; left: 0; margin: 0; padding: 0; width: 100%; height: 100%; -webkit-touch-callout: none; }f-canvas { overflow: auto; cursor: grab;}f-canvas canvas.front { z-index: 10;}body.dragging *:not(.drag) { pointer-events: none !important;}f-canvas.grabbing * { cursor: grabbing; user-select: none;}f-canvas canvas { position: fixed; overflow: hidden; pointer-events: none;}f-canvas::-webkit-scrollbar { width: 8px; height: 8px;}f-canvas::-webkit-scrollbar-thumb:hover{ background: #014fc5;}f-canvas::-webkit-scrollbar-track { background: #363636;}f-canvas::-webkit-scrollbar-thumb { background-color: #666666; border-radius: 10px; border: 0;}f-canvas f-content,f-canvas f-area { position: absolute; display: block;}f-node { position: absolute; margin: 0; padding: 0; user-select: none; width: 320px; z-index: 1; cursor: auto; filter: drop-shadow(0 0 10px #00000061); backdrop-filter: blur(4px);}f-node.selected { z-index: 2;}f-node.selected,f-canvas.dragging-rio f-node:hover,f-canvas.dragging-lio f-node:hover { filter: drop-shadow(0 0 10px #00000061) drop-shadow(0 0 8px #4444dd);}f-node.closed f-element:not(:first-child) { display: none;}f-node.center { top: 50%; left: 50%; transform: translate( -50%, -50% );}f-node.top-right { top: 0; right: 0;}f-node.top-center { top: 0; left: 50%; transform: translateX( -50% );}f-node.top-left { top: 0; left: 0;}f-node { transition: filter 0.2s ease;}f-node { animation: .2s f-animation-open 1 alternate ease-out;}f-tips,f-drop,f-menu,f-menu input,f-menu button,f-element,f-element input,f-element select,f-element button,f-element textarea { font-family: 'Open Sans', sans-serif; font-size: 13px; text-transform: capitalize; color: #eeeeee; outline: solid 0px #000; margin: 0; padding: 0; border: 0; user-select: none; -webkit-tap-highlight-color: transparent; transition: background 0.2s ease, filter 0.2s ease;}f-element input:read-only { color: #666;}f-element input,f-element textarea { text-transform: initial;}f-element input { transition: background 0.1s ease;}f-element input,f-element select,f-element button,f-element textarea { background-color: #232324d1;}f-element { position: relative; width: calc( 100% - 14px ); background: rgba(45, 45, 48, 0.95); pointer-events: auto; border-bottom: 2px solid #232323; display: flex; padding-left: 7px; padding-right: 7px; padding-top: 2px; padding-bottom: 2px;}f-element:after,f-element:before { transition: opacity .17s; opacity: 0; content: '';}f-element[tooltip]:hover:after,f-element[tooltip]:focus-within:after { font-size: 14px !important; display: flex; justify-content: center; position: fixed; margin-left: -7px; width: calc( 100% ); background: #1d1d1de8; border: 1px solid #444444a1; border-radius: 6px; color: #dadada; content: attr( tooltip ); margin-top: -41px; font-size: 16px; padding-top: 3px; padding-bottom: 3px; z-index: 10; opacity: 1; backdrop-filter: blur(4px); white-space: nowrap; overflow: hidden; text-shadow: 1px 1px 0px #0007;}f-element[tooltip]:hover:before,f-element[tooltip]:focus-within:before { border: solid; border-color: #1d1d1de8 transparent; border-width: 12px 6px 0 6px; left: calc( 50% - 6px ); bottom: 30px; position: absolute; opacity: 1; z-index: 11;}f-element[error] { background-color: #ff0000;}f-element[error]:hover:after,f-element[error]:focus-within:after { border: none; background-color: #ff0000bb; filter: drop-shadow( 2px 2px 5px #000 ); color: #fff;}f-element[error]:hover:before,f-element[error]:focus-within:before { border-color: #ff0000bb transparent;}f-element { height: 24px;}f-element input { margin-top: 2px; margin-bottom: 2px; box-shadow: inset 0px 1px 1px rgb(0 0 0 / 20%), 0px 1px 0px rgb(255 255 255 / 5%); margin-left: 2px; margin-right: 2px; width: 100%; padding-left: 4px; padding-right: 4px;}f-element input.number { cursor: col-resize;}f-element input:focus[type='text'], f-element input:focus[type='range'], f-element input:focus[type='color'] { background: rgba( 0, 0, 0, 0.6 ); outline: solid 1px rgba( 0, 80, 200, 0.98 );}f-element input[type='color'] { appearance: none; padding: 0; margin-left: 2px; margin-right: 2px; height: calc( 100% - 4px ); margin-top: 2px; border: none;}f-element input[type='color']::-webkit-color-swatch-wrapper { padding: 2px;}f-element input[type='color']::-webkit-color-swatch { border: none; cursor: alias;}f-element input[type='range'] { appearance: none; width: 100%; overflow: hidden; padding: 0; cursor: ew-resize;}f-element input[type='range']::-webkit-slider-runnable-track { appearance: none; height: 10px; color: #13bba4; margin: 0;}f-element input[type='range']::-webkit-slider-thumb { appearance: none; width: 0; background: #434343; box-shadow: -500px 0 0 500px rgba( 0, 120, 255, 0.98 ); border-radius: 50%; border: 0 !important;}f-element input[type='range']::-webkit-slider-runnable-track { margin-left: -4px; margin-right: -5px;}f-element input[type='checkbox'] { appearance: none; cursor: pointer;}f-element input[type='checkbox'].toggle { height: 20px; width: 45px; border-radius: 16px; display: inline-block; position: relative; margin: 0; margin-top: 2px; background: linear-gradient( 0deg, #292929 0%, #0a0a0ac2 100% ); transition: all 0.2s ease;}f-element input[type='checkbox'].toggle:after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 2px rgba(44, 44, 44, 0.2); transition: all 0.2s cubic-bezier(0.5, 0.1, 0.75, 1.35);}f-element input[type='checkbox'].toggle:checked { background: linear-gradient( 0deg, #0177fb 0%, #0177fb 100% );}f-element input[type='checkbox'].toggle:checked:after { transform: translatex(25px);}f-element.auto-height { display: table;}f-element textarea { width: calc( 100% - 18px ); padding-top: 1px; padding-bottom: 3px; padding-left: 3px; padding-right: 8px; margin-top: 2px; margin-left: 2px; height: calc( 100% - 8px ); max-height: 300px; border-radius: 2px; resize: none; box-shadow: inset 0px 1px 1px rgb(0 0 0 / 20%), 0px 1px 0px rgb(255 255 255 / 5%);}f-element.auto-height textarea { resize: auto;}f-element select { width: 100%; margin-top: 2px; margin-bottom: 2px; margin-left: 2px; margin-right: 2px; cursor: pointer; box-shadow: inset 0px 1px 1px rgb(0 0 0 / 20%), 0px 1px 0px rgb(255 255 255 / 5%);}f-element f-toolbar { position: absolute; display: flex; top: 0; width: 100%; height: 100%; align-content: space-around;}f-element.input-right f-toolbar { right: 7px; float: right; justify-content: end;}f-element f-toolbar { margin-top: auto; margin-bottom: auto; margin-left: 3px; margin-right: 3px; font-size: 18px; line-height: 18px;}f-element f-toolbar button { opacity: .7; cursor: pointer; font-size: 14px; width: unset; height: unset; border-radius: unset; border: unset; outline: 0; background-color: unset; box-shadow: unset;}f-element f-toolbar button:hover,f-element f-toolbar button:active { opacity: 1; border: 0; background-color: unset;}f-element input.range-value { width: 60px; text-align: center;}f-menu.context button,f-element button { width: 100%; height: calc( 100% - 4px ); margin-left: 2px; margin-right: 2px; margin-top: 2px; border-radius: 3px; cursor: pointer;}f-element button { box-shadow: inset 1px 1px 1px 0 rgb(255 255 255 / 17%), inset -2px -2px 2px 0 rgb(0 0 0 / 26%);}f-element button:hover { color: #fff; background-color: #2a2a2a;}f-element button:active { border: 1px solid rgba( 0, 120, 255, 0.98 );}f-element f-inputs,f-element f-subinputs { display: flex; justify-content: flex-end; width: 100%;}f-element f-inputs { left: 100px; top: 50%; transform: translateY(-50%); position: absolute; width: calc( 100% - 106px ); height: calc( 100% - 4px ); z-index: 1;}f-element.inputs-disable f-inputs { filter: grayscale(100%); opacity: .5;}f-element.inputs-disable f-inputs input { pointer-events: none;}f-element f-label,f-element span { margin: auto; text-shadow: 1px 1px 0px #0007;}f-element f-label { padding-left: 4px; white-space: nowrap; position: absolute; top: 50%; transform: translateY(-50%); width: calc( 100% - 20px );}f-element.right f-label { text-align: right;}f-element.center f-label { text-align: center;}f-element f-label i { float: left; font-size: 18px; margin-right: 6px;}f-element f-label.center { width: 100%; text-align: center; display: block;}f-element.title { height: 29px; background-color: #3a3a3ab0; background-color: #3b3b43ed; cursor: all-scroll; border-top-left-radius: 6px; border-top-right-radius: 6px;}f-element.blue { background-color: #014fc5;}f-element.red { background-color: #bd0b0b;}f-element.green { background-color: #148d05;}f-element.yellow { background-color: #d6b100;}f-element.title.left { text-align: left; display: inline-grid; justify-content: start;}f-element.title span { text-align: center; font-size: 15px; padding-top: 2px;}f-element.title i { font-size: 18px; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); opacity: .5;}f-element.title f-toolbar i { font-size: 20px; right: unset; left: 0px;}f-element.input-right.title i { left: 10px; right: unset;}f-element.title.left span { text-align: left;}f-element f-io { border: 2px solid #dadada; width: 7px; height: 7px; position: absolute; background: #242427; border-radius: 8px; float: left; left: -7px; top: calc( 50% - 5px ); cursor: alias; box-shadow: 0 0 3px 2px #0000005e; z-index: 1;}f-element f-io.connect,f-canvas.dragging-rio f-element:hover f-io.lio,f-canvas.dragging-lio f-element:hover f-io.rio { zoom: 1.4;}f-node.io-connect f-io:not(.connect) { border: 2px solid #dadada !important; zoom: 1 !important;}f-element f-io.rio { float: right; right: -7px; left: unset;}f-element f-disconnect { position: absolute; left: -35px; top: 50%; font-size: 22px; transform: translateY( -50% ); filter: drop-shadow(0 0 5px #000); text-shadow: 0px 0px 5px black; cursor: pointer; transition: all .2s;}f-element.input-right f-disconnect { right: -35px; left: unset;}f-element f-disconnect:hover { color: #ff3300;}f-element textarea::-webkit-scrollbar { width: 6px;}f-element textarea::-webkit-scrollbar-track { background: #111; } f-element textarea::-webkit-scrollbar-thumb { background: #0177fb; }f-element textarea::-webkit-scrollbar-thumb:hover { background: #1187ff; }f-element.small { height: 18px;}f-element.large { height: 36px;}body.connecting f-node:not(.io-connect) f-element:hover,f-element.select { background-color: rgba(61, 70, 82, 0.98);}f-element.invalid > f-io { zoom: 1 !important;}f-element.invalid::after { font-size: 14px !important; display: flex; justify-content: center; align-items:center; margin: auto; position: absolute; width: 100%; height: 100%; background: #bd0b0b77; vertical-align: middle; color: #fff; content: 'Not Compatible'; opacity: .95; backdrop-filter: grayscale(100%); white-space: nowrap; overflow: hidden; left: 0; top: 0; text-transform: initial;}f-element.invalid > f-inputs,f-element.invalid > f-label { opacity: .1;}f-drop { width: 100%; height: 100%; position: sticky; left: 0; top: 0; background: #02358417; text-align: center; justify-content: center; align-items: center; display: flex; box-shadow: inset 0 0 20px 10px #464ace17; pointer-events: none; transition: all .07s; opacity: 0; visibility: hidden;}f-drop.visible { visibility: unset; opacity: unset; transition: all .23s;}f-drop span { opacity: .5; font-size: 40px; text-shadow: 0px 0px 5px #000; font-weight: bold;}f-tooltip { pointer-events: none;}f-tooltip { position: absolute; left: 0; top: 0; background: rgba(0,0,0,.8); backdrop-filter: blur(4px); font-size: 14px; padding: 7px; left: 50%; border-radius: 10px; transform: translateX(-50%); visibility: hidden; pointer-events: none; opacity: 0; transition: all 0.3s ease; z-index: 150; white-space: nowrap;}f-menu.context,f-menu.search { position: absolute;}f-menu.context { width: 170px; z-index: 110;}f-menu.search { bottom: 85px; left: 50%; transform: translateX(-50%); z-index: 10; width: 300px;}f-menu.context f-list { display: block; margin: 0; background: #171717e6; font-size: 12px; border-radius: 6px; backdrop-filter: blur(6px); border: 1px solid #7e7e7e45; box-shadow: 3px 3px 6px rgba(0,0,0,.2); transition: opacity 0.2s ease, transform 0.1s ease;}f-menu.search f-list { margin: 0 6px 0 6px; display: flex; flex-direction: column-reverse; margin-bottom: 5px;}f-menu.context.hidden { visibility: hidden; opacity: 0;}f-menu.context f-item,f-menu.search f-item { display: block; position: relative; margin: 0; padding: 0; white-space: nowrap;}f-menu.search f-item { opacity: 0;}f-menu.context f-item.submenu::after { content: ""; position: absolute; right: 6px; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); border: 5px solid transparent; border-left-color: #808080;}f-menu.context f-item:hover > f-menu,f-menu.context f-item.active > f-menu { visibility: unset; transform: unset; opacity: unset;}f-menu.context f-menu { top: 0px; left: calc( 100% - 4px );}f-menu.context f-item button,f-menu.search f-item button { overflow: visible; display: block; width: calc( 100% - 6px ); text-align: left; cursor: pointer; white-space: nowrap; padding: 6px 8px; border-radius: 3px; background: rgba(45, 45, 48, 0.95); border: 0; color: #ddd; margin: 3px; text-shadow: 1px 1px 0px #0007;}f-menu.context f-item button i,f-menu.search f-item button i { float: left; font-size: 16px;}f-menu.context f-item button span,f-menu.search f-item button span { margin-left: 6px;}f-menu.context f-item:hover > button,f-menu.search f-item:hover > button,f-menu.search f-item.active > button { color: #fff; background-color: rgba(61, 70, 82, 0.98);}f-menu.search f-item:hover,f-menu.search f-item.active { opacity: 1 !important;}f-menu.context f-item button:active { outline: solid 1px rgba( 0, 80, 200, 0.98 );}f-menu.context f-item f-tooltip { margin-left: 85px; top: -50px;}f-menu.search f-item { display: none;}f-menu.search f-item:nth-child(1) { opacity: 1; display: unset;}f-menu.search f-item:nth-child(2) { opacity: .8; display: unset;}f-menu.search f-item:nth-child(3) { opacity: .6; display: unset;}f-menu.search f-item:nth-child(4) { opacity: .4; display: unset;}f-menu.search f-item button { border-radius: 14px;}f-tips { right: 10px; top: 10px; position: absolute; z-index: 100; pointer-events: none; display: flex; flex-direction: column;}f-tips f-tip { width: 450px; font-size: 13px; border-radius: 6px; text-align: center; display: block; height: auto; color: #ffffffe0; margin: 4px; padding: 4px; background: #17171794; border: 1px solid #7e7e7e38; line-height: 100%; backdrop-filter: blur(6px); transition: all 0.2s ease; text-transform: initial; opacity: 0;}f-tips f-tip:nth-child(1) { opacity: 1;}f-tips f-tip:nth-child(2) { opacity: .75;}f-tips f-tip:nth-child(3) { opacity: .25;}f-tips f-tip:nth-child(4) { opacity: .1;}f-tips f-tip.error { background: #b900005e;}f-menu.search input { width: calc( 100% - 28px ); height: 41px; position: absolute; z-index: 10; border-radius: 20px; padding-left: 14px; padding-right: 14px; font-size: 15px; background-color: #17171794; border: 1px solid #7e7e7e45; backdrop-filter: blur(6px); box-shadow: 3px 3px 6px rgb(0 0 0 / 20%); text-transform: initial;}f-menu.circle { position: absolute; left: 40px; bottom: 40px; z-index: 100;}f-menu.circle f-item { align-content: space-around; margin-right: 20px;}f-menu.circle f-item button { width: 47px; height: 47px; font-size: 22px; background: #17171794; border-radius: 50%; backdrop-filter: blur(6px); border: 1px solid #7e7e7e45; line-height: 100%; cursor: pointer; box-shadow: 3px 3px 6px rgba(0,0,0,.2);}f-menu.circle f-item f-tooltip { margin-top: -60px;}.f-rounded f-node f-element,.f-rounded f-node f-element.title.left { border-radius: 10px 5px 10px 5px;}.f-rounded f-node f-element input, .f-rounded f-node f-element select,.f-rounded f-node f-element button,.f-rounded f-node f-element textarea,.f-rounded f-node f-element input[type='checkbox'].toggle,.f-rounded f-node f-element input[type='checkbox'].toggle:after { border-radius: 20px 10px;}.f-rounded f-node f-element input { padding-left: 7px; padding-right: 7px;}.f-rounded f-menu.context,.f-rounded f-menu.context f-item button { border-radius: 20px 10px;}@media (hover: hover) and (pointer: fine) { f-node:not(.selected):hover { filter: drop-shadow(0 0 6px #66666630); } f-element f-toolbar { visibility: hidden; opacity: 0; transition: opacity 0.2s ease; } f-node:hover > f-element f-toolbar { visibility: visible; opacity: 1; } f-element f-io:hover { zoom: 1.4; } f-menu.circle f-item button:hover { background-color: #2a2a2a; } f-menu.search input:hover, f-menu.search input:focus { background-color: #1a1a1a; filter: drop-shadow(0 0 6px #66666630); } f-menu.search input:focus { filter: drop-shadow(0 0 8px #4444dd); } f-menu.circle f-item button:hover > f-tooltip, f-menu.context f-item button:hover > f-tooltip { visibility: visible; opacity: 1; } f-menu.circle f-item button:hover > f-tooltip { margin-top: -50px; } f-menu.context f-item button:hover > f-tooltip { top: -30px; } f-menu.circle f-item button:focus > f-tooltip, f-menu.context f-item button:focus > f-tooltip { visibility: hidden; opacity: 0; }}@media (hover: none) and (pointer: coarse) { body.dragging f-canvas, body.connecting f-canvas { overflow: hidden !important; }}f-canvas { will-change: top, left;}f-node { will-change: transform !important;}` );
- const REVISION = '1';
- const Styles = {
- icons: {
- close: '',
- unlink: ''
- }
- };
- let _id = 0;
- class Serializer extends EventTarget {
- constructor() {
- super();
- this._id = _id ++;
- this._serializable = true;
- }
- get id() {
- return this._id;
- }
- setSerializable( value ) {
- this._serializable = value;
- return this;
- }
- getSerializable() {
- return this._serializable;
- }
- serialize( /*data*/ ) {
- console.warn( 'Serializer: Abstract function.' );
- }
- deserialize( /*data*/ ) {
- console.warn( 'Serializer: Abstract function.' );
- }
- toJSON( data = null ) {
- let object = null;
- const id = this.id;
- if ( data !== null ) {
- const objects = data.objects;
- object = objects[ id ];
- if ( object === undefined ) {
- object = { objects };
- this.serialize( object );
- delete object.objects;
- objects[ id ] = object;
- }
- } else {
- object = { objects: {} };
- this.serialize( object );
- }
- object.id = id;
- object.type = this.constructor.name;
- return object;
- }
- }
- class PointerMonitor {
- started = false;
- constructor() {
- this.x = 0;
- this.y = 0;
- this._onMoveEvent = ( e ) => {
- const event = e.touches ? e.touches[ 0 ] : e;
- this.x = event.x;
- this.y = event.y;
- };
- }
- start() {
- if ( this.started ) return;
- this.started = true;
- window.addEventListener( 'wheel', this._onMoveEvent, true );
- window.addEventListener( 'mousedown', this._onMoveEvent, true );
- window.addEventListener( 'touchstart', this._onMoveEvent, true );
- window.addEventListener( 'mousemove', this._onMoveEvent, true );
- window.addEventListener( 'touchmove', this._onMoveEvent, true );
- window.addEventListener( 'dragover', this._onMoveEvent, true );
- return this;
- }
- }
- const pointer = new PointerMonitor().start();
- const draggableDOM = ( dom, callback = null, className = 'dragging' ) => {
- let dragData = null;
- const getZoom = () => {
- let zoomDOM = dom;
- while ( zoomDOM && zoomDOM !== document ) {
- const zoom = zoomDOM.style.zoom;
- if ( zoom ) {
- return Number( zoom );
- }
- zoomDOM = zoomDOM.parentNode;
- }
- return 1;
- };
- const onMouseDown = ( e ) => {
- const event = e.touches ? e.touches[ 0 ] : e;
- e.stopImmediatePropagation();
- dragData = {
- client: { x: event.clientX, y: event.clientY },
- delta: { x: 0, y: 0 },
- start: { x: dom.offsetLeft, y: dom.offsetTop },
- dragging: false,
- isTouch: !! e.touches
- };
- window.addEventListener( 'mousemove', onGlobalMouseMove );
- window.addEventListener( 'mouseup', onGlobalMouseUp );
- window.addEventListener( 'touchmove', onGlobalMouseMove );
- window.addEventListener( 'touchend', onGlobalMouseUp );
- };
- const onGlobalMouseMove = ( e ) => {
- const { start, delta, client } = dragData;
- const event = e.touches ? e.touches[ 0 ] : e;
- const zoom = getZoom();
- delta.x = ( event.clientX - client.x ) / zoom;
- delta.y = ( event.clientY - client.y ) / zoom;
- dragData.x = start.x + delta.x;
- dragData.y = start.y + delta.y;
- if ( dragData.dragging === true ) {
- if ( callback !== null ) {
- callback( dragData );
- } else {
- dom.style.cssText += `; left: ${ dragData.x }px; top: ${ dragData.y }px;`;
- }
- e.stopImmediatePropagation();
- } else {
- if ( Math.abs( delta.x ) > 2 || Math.abs( delta.y ) > 2 ) {
- dragData.dragging = true;
- dom.classList.add( 'drag' );
- if ( className ) document.body.classList.add( className );
- e.stopImmediatePropagation();
- }
- }
- };
- const onGlobalMouseUp = ( e ) => {
- e.stopImmediatePropagation();
- dom.classList.remove( 'drag' );
- if ( className ) document.body.classList.remove( className );
- window.removeEventListener( 'mousemove', onGlobalMouseMove );
- window.removeEventListener( 'mouseup', onGlobalMouseUp );
- window.removeEventListener( 'touchmove', onGlobalMouseMove );
- window.removeEventListener( 'touchend', onGlobalMouseUp );
- if ( callback === null ) {
- dom.removeEventListener( 'mousedown', onMouseDown );
- dom.removeEventListener( 'touchstart', onMouseDown );
- }
- dragData.dragging = false;
- if ( callback !== null ) {
- callback( dragData );
- }
- };
- if ( dom instanceof Event ) {
- const e = dom;
- dom = e.target;
- onMouseDown( e );
- } else {
- dom.addEventListener( 'mousedown', onMouseDown );
- dom.addEventListener( 'touchstart', onMouseDown );
- }
- };
- const dispatchEventList = ( list, ...params ) => {
- for ( const callback of list ) {
- if ( callback( ...params ) === false ) {
- return false;
- }
- }
- return true;
- };
- const toPX = ( val ) => {
- if ( isNaN( val ) === false ) {
- val = `${ val }px`;
- }
- return val;
- };
- const toHex = ( val ) => {
- if ( isNaN( val ) === false ) {
- val = `#${ val.toString( 16 ).padStart( 6, '0' ) }`;
- }
- return val;
- };
- var Utils = /*#__PURE__*/Object.freeze( {
- __proto__: null,
- pointer: pointer,
- draggableDOM: draggableDOM,
- dispatchEventList: dispatchEventList,
- toPX: toPX,
- toHex: toHex
- } );
- class Link {
- constructor( inputElement = null, outputElement = null ) {
- this.inputElement = inputElement;
- this.outputElement = outputElement;
- }
- get lioElement() {
- if ( Link.InputDirection === 'left' ) {
- return this.outputElement;
- } else {
- return this.inputElement;
- }
- }
- get rioElement() {
- if ( Link.InputDirection === 'left' ) {
- return this.inputElement;
- } else {
- return this.outputElement;
- }
- }
- }
- //Link.InputDirection = 'right';
- Link.InputDirection = 'left';
- let selected = null;
- class Element extends Serializer {
- constructor( draggable = false ) {
- super();
- this.isElement = true;
- const dom = document.createElement( 'f-element' );
- dom.element = this;
- const onSelect = ( e ) => {
- let element = this;
- if ( e.changedTouches && e.changedTouches.length > 0 ) {
- const touch = e.changedTouches[ 0 ];
- let overDOM = document.elementFromPoint( touch.clientX, touch.clientY );
- while ( overDOM && ( ! overDOM.element || ! overDOM.element.isElement ) ) {
- overDOM = overDOM.parentNode;
- }
- element = overDOM ? overDOM.element : null;
- }
- const type = e.type;
- if ( ( type === 'mouseout' ) && selected === element ) {
- selected = null;
- } else {
- selected = element;
- }
- };
- if ( draggable === false ) {
- dom.ontouchstart = dom.onmousedown = ( e ) => {
- e.stopPropagation();
- };
- }
- dom.addEventListener( 'mouseup', onSelect, true );
- dom.addEventListener( 'mouseover', onSelect );
- dom.addEventListener( 'mouseout', onSelect );
- dom.addEventListener( 'touchmove', onSelect );
- dom.addEventListener( 'touchend', onSelect );
- this.inputs = [];
- this.links = [];
- this.dom = dom;
- this.lioLength = 0;
- this.rioLength = 0;
- this.events = {
- 'connect': [],
- 'connectChildren': [],
- 'valid': []
- };
- this.node = null;
- this.style = '';
- this.objectCallback = null;
- this.enabledInputs = true;
- this.visible = true;
- this.inputsDOM = dom;
- this.disconnectDOM = null;
- this.lioDOM = this._createIO( 'lio' );
- this.rioDOM = this._createIO( 'rio' );
- this.dom.classList.add( `input-${ Link.InputDirection }` );
- this.dom.append( this.lioDOM );
- this.dom.append( this.rioDOM );
- this.addEventListener( 'connect', ( ) => {
- dispatchEventList( this.events.connect, this );
- } );
- this.addEventListener( 'connectChildren', ( ) => {
- dispatchEventList( this.events.connectChildren, this );
- } );
- }
- setAttribute( name, value ) {
- this.dom.setAttribute( name, value );
- return this;
- }
- onValid( callback ) {
- this.events.valid.push( callback );
- return this;
- }
- onConnect( callback, childrens = false ) {
- this.events.connect.push( callback );
- if ( childrens ) {
- this.events.connectChildren.push( callback );
- }
- return this;
- }
- setObjectCallback( callback ) {
- this.objectCallback = callback;
- return this;
- }
- getObject( output = null ) {
- return this.objectCallback ? this.objectCallback( output ) : null;
- }
- setVisible( value ) {
- this.visible = value;
- this.dom.style.display = value ? '' : 'none';
- return this;
- }
- getVisible() {
- return this.visible;
- }
- setEnabledInputs( value ) {
- const dom = this.dom;
- if ( ! this.enabledInputs ) dom.classList.remove( 'inputs-disable' );
- if ( ! value ) dom.classList.add( 'inputs-disable' );
- this.enabledInputs = value;
- return this;
- }
- getEnabledInputs() {
- return this.enabledInputs;
- }
- setColor( color ) {
- this.dom.style[ 'background-color' ] = toHex( color );
- return this;
- }
- setStyle( style ) {
- const dom = this.dom;
- if ( this.style ) dom.classList.remove( this.style );
- if ( style ) dom.classList.add( style );
- this.style = style;
- return this;
- }
- setInput( length ) {
- if ( Link.InputDirection === 'left' ) {
- return this.setLIO( length );
- } else {
- return this.setRIO( length );
- }
- }
- setInputColor( color ) {
- if ( Link.InputDirection === 'left' ) {
- return this.setLIOColor( color );
- } else {
- return this.setRIOColor( color );
- }
- }
- setOutput( length ) {
- if ( Link.InputDirection === 'left' ) {
- return this.setRIO( length );
- } else {
- return this.setLIO( length );
- }
- }
- setOutputColor( color ) {
- if ( Link.InputDirection === 'left' ) {
- return this.setRIOColor( color );
- } else {
- return this.setLIOColor( color );
- }
- }
- get inputLength() {
- if ( Link.InputDirection === 'left' ) {
- return this.lioLength;
- } else {
- return this.rioLength;
- }
- }
- get outputLength() {
- if ( Link.InputDirection === 'left' ) {
- return this.rioLength;
- } else {
- return this.lioLength;
- }
- }
- setLIOColor( color ) {
- this.lioDOM.style[ 'border-color' ] = toHex( color );
- return this;
- }
- setLIO( length ) {
- this.lioLength = length;
- this.lioDOM.style.visibility = length > 0 ? '' : 'hidden';
- return this;
- }
- getLIOColor() {
- return this.lioDOM.style[ 'border-color' ];
- }
- setRIOColor( color ) {
- this.rioDOM.style[ 'border-color' ] = toHex( color );
- return this;
- }
- getRIOColor() {
- return this.rioDOM.style[ 'border-color' ];
- }
- setRIO( length ) {
- this.rioLength = length;
- this.rioDOM.style.visibility = length > 0 ? '' : 'hidden';
- return this;
- }
- add( input ) {
- this.inputs.push( input );
- input.element = this;
- this.inputsDOM.append( input.dom );
- return this;
- }
- setHeight( val ) {
- this.dom.style.height = toPX( val );
- return this;
- }
- getHeight() {
- return this.dom.style.height;
- }
- connect( element = null ) {
- if ( this.disconnectDOM !== null ) {
- // remove the current input
- this.disconnectDOM.dispatchEvent( new Event( 'disconnect' ) );
- }
- if ( element !== null ) {
- if ( dispatchEventList( this.events.valid, this, element, 'connect' ) === false ) {
- return false;
- }
- const link = new Link( this, element );
- this.links.push( link );
- if ( this.disconnectDOM === null ) {
- this.disconnectDOM = document.createElement( 'f-disconnect' );
- this.disconnectDOM.innerHTML = Styles.icons.unlink ? `<i class='${ Styles.icons.unlink }'></i>` : '✖';
- this.dom.append( this.disconnectDOM );
- const onDisconnect = () => {
- this.links = [];
- this.dom.removeChild( this.disconnectDOM );
- this.disconnectDOM.removeEventListener( 'mousedown', onClick, true );
- this.disconnectDOM.removeEventListener( 'touchstart', onClick, true );
- this.disconnectDOM.removeEventListener( 'disconnect', onDisconnect, true );
- element.removeEventListener( 'connect', onConnect );
- element.removeEventListener( 'connectChildren', onConnect );
- element.removeEventListener( 'nodeConnect', onConnect );
- element.removeEventListener( 'nodeConnectChildren', onConnect );
- element.removeEventListener( 'dispose', onDispose );
- this.disconnectDOM = null;
- };
- const onConnect = () => {
- this.dispatchEvent( new Event( 'connectChildren' ) );
- };
- const onDispose = () => {
- this.connect();
- };
- const onClick = ( e ) => {
- e.stopPropagation();
- this.connect();
- };
- this.disconnectDOM.addEventListener( 'mousedown', onClick, true );
- this.disconnectDOM.addEventListener( 'touchstart', onClick, true );
- this.disconnectDOM.addEventListener( 'disconnect', onDisconnect, true );
- element.addEventListener( 'connect', onConnect );
- element.addEventListener( 'connectChildren', onConnect );
- element.addEventListener( 'nodeConnect', onConnect );
- element.addEventListener( 'nodeConnectChildren', onConnect );
- element.addEventListener( 'dispose', onDispose );
- }
- }
- this.dispatchEvent( new Event( 'connect' ) );
- return true;
- }
- dispose() {
- this.dispatchEvent( new Event( 'dispose' ) );
- }
- serialize( data ) {
- const height = this.getHeight();
- const inputs = [];
- const links = [];
- for ( const input of this.inputs ) {
- inputs.push( input.toJSON( data ).id );
- }
- for ( const link of this.links ) {
- if ( link.inputElement !== null && link.outputElement !== null ) {
- links.push( link.outputElement.toJSON( data ).id );
- }
- }
- if ( this.inputLength > 0 ) data.inputLength = this.inputLength;
- if ( this.outputLength > 0 ) data.outputLength = this.outputLength;
- if ( inputs.length > 0 ) data.inputs = inputs;
- if ( links.length > 0 ) data.links = links;
- if ( this.style !== '' ) {
- data.style = this.style;
- }
- if ( height !== '' ) {
- data.height = height;
- }
- }
- deserialize( data ) {
- if ( data.inputLength !== undefined ) this.setInput( data.inputLength );
- if ( data.outputLength !== undefined ) this.setOutput( data.outputLength );
- if ( data.inputs !== undefined ) {
- const inputs = this.inputs;
- if ( inputs.length > 0 ) {
- let index = 0;
- for ( const id of data.inputs ) {
- data.objects[ id ] = inputs[ index ++ ];
- }
- } else {
- for ( const id of data.inputs ) {
- this.add( data.objects[ id ] );
- }
- }
- }
- if ( data.links !== undefined ) {
- for ( const id of data.links ) {
- this.connect( data.objects[ id ] );
- }
- }
- if ( data.style !== undefined ) {
- this.setStyle( data.style );
- }
- if ( data.height !== undefined ) {
- this.setHeight( data.height );
- }
- }
- getLinkedObject( output = null ) {
- const linkedElement = this.getLinkedElement();
- return linkedElement ? linkedElement.getObject( output ) : null;
- }
- getLinkedElement() {
- const link = this.getLink();
- return link ? link.outputElement : null;
- }
- getLink() {
- return this.links[ 0 ];
- }
- _createIO( type ) {
- const { dom } = this;
- const ioDOM = document.createElement( 'f-io' );
- ioDOM.style.visibility = 'hidden';
- ioDOM.className = type;
- const onConnectEvent = ( e ) => {
- e.preventDefault();
- e.stopPropagation();
- selected = null;
- const nodeDOM = this.node.dom;
- nodeDOM.classList.add( 'io-connect' );
- ioDOM.classList.add( 'connect' );
- dom.classList.add( 'select' );
- const defaultOutput = Link.InputDirection === 'left' ? 'lio' : 'rio';
- const link = type === defaultOutput ? new Link( this ) : new Link( null, this );
- const previewLink = new Link( link.inputElement, link.outputElement );
- this.links.push( link );
- draggableDOM( e, ( data ) => {
- if ( previewLink.outputElement )
- previewLink.outputElement.dom.classList.remove( 'invalid' );
- if ( previewLink.inputElement )
- previewLink.inputElement.dom.classList.remove( 'invalid' );
- previewLink.inputElement = link.inputElement;
- previewLink.outputElement = link.outputElement;
- if ( type === defaultOutput ) {
- previewLink.outputElement = selected;
- } else {
- previewLink.inputElement = selected;
- }
- const isInvalid = previewLink.inputElement !== null && previewLink.outputElement !== null &&
- previewLink.inputElement.inputLength > 0 && previewLink.outputElement.outputLength > 0 &&
- dispatchEventList( previewLink.inputElement.events.valid, previewLink.inputElement, previewLink.outputElement, data.dragging ? 'dragging' : 'dragged' ) === false;
- if ( data.dragging && isInvalid ) {
- if ( type === defaultOutput ) {
- if ( previewLink.outputElement )
- previewLink.outputElement.dom.classList.add( 'invalid' );
- } else {
- if ( previewLink.inputElement )
- previewLink.inputElement.dom.classList.add( 'invalid' );
- }
- return;
- }
- if ( ! data.dragging ) {
- nodeDOM.classList.remove( 'io-connect' );
- ioDOM.classList.remove( 'connect' );
- dom.classList.remove( 'select' );
- this.links.splice( this.links.indexOf( link ), 1 );
- if ( selected !== null && ! isInvalid ) {
- link.inputElement = previewLink.inputElement;
- link.outputElement = previewLink.outputElement;
- // check if is an is circular link
- if ( link.outputElement.node.isCircular( link.inputElement.node ) ) {
- return;
- }
- //
- if ( link.inputElement.inputLength > 0 && link.outputElement.outputLength > 0 ) {
- link.inputElement.connect( link.outputElement );
- }
- }
- }
- }, 'connecting' );
- };
- ioDOM.addEventListener( 'mousedown', onConnectEvent, true );
- ioDOM.addEventListener( 'touchstart', onConnectEvent, true );
- return ioDOM;
- }
- }
- class Input extends Serializer {
- constructor( dom ) {
- super();
- this.isInput = true;
- this.dom = dom;
- this.element = null;
- this.extra = null;
- this.tagColor = null;
- this.events = {
- 'change': [],
- 'click': []
- };
- this.addEventListener( 'change', ( ) => {
- dispatchEventList( this.events.change, this );
- } );
- this.addEventListener( 'click', ( ) => {
- dispatchEventList( this.events.click, this );
- } );
- }
- setExtra( value ) {
- this.extra = value;
- return this;
- }
- getExtra() {
- return this.extra;
- }
- setTagColor( color ) {
- this.tagColor = color;
- this.dom.style[ 'border-left' ] = `2px solid ${color}`;
- return this;
- }
- getTagColor() {
- return this.tagColor;
- }
- setToolTip( text ) {
- const div = document.createElement( 'f-tooltip' );
- div.innerText = text;
- this.dom.append( div );
- return this;
- }
- onChange( callback ) {
- this.events.change.push( callback );
- return this;
- }
- onClick( callback ) {
- this.events.click.push( callback );
- return this;
- }
- setReadOnly( value ) {
- this.dom.readOnly = value;
- return this;
- }
- getReadOnly() {
- return this.dom.readOnly;
- }
- setValue( value, dispatch = true ) {
- this.dom.value = value;
- if ( dispatch ) this.dispatchEvent( new Event( 'change' ) );
- return this;
- }
- getValue() {
- return this.dom.value;
- }
- serialize( data ) {
- data.value = this.getValue();
- }
- deserialize( data ) {
- this.setValue( data.value );
- }
- }
- class Node extends Serializer {
- constructor() {
- super();
- this.isNode = true;
- const dom = document.createElement( 'f-node' );
- const onDown = () => {
- const canvas = this.canvas;
- if ( canvas !== null ) {
- canvas.select( this );
- }
- };
- dom.addEventListener( 'mousedown', onDown, true );
- dom.addEventListener( 'touchstart', onDown, true );
- this._onConnect = ( e ) => {
- const { target } = e;
- for ( const element of this.elements ) {
- if ( element !== target ) {
- element.dispatchEvent( new Event( 'nodeConnect' ) );
- }
- }
- };
- this._onConnectChildren = ( e ) => {
- const { target } = e;
- for ( const element of this.elements ) {
- if ( element !== target ) {
- element.dispatchEvent( new Event( 'nodeConnectChildren' ) );
- }
- }
- };
- this.dom = dom;
- this.style = '';
- this.canvas = null;
- this.elements = [];
- this.events = {
- 'focus': [],
- 'blur': []
- };
- this.setWidth( 300 ).setPosition( 0, 0 );
- }
- onFocus( callback ) {
- this.events.focus.push( callback );
- return this;
- }
- onBlur( callback ) {
- this.events.blur.push( callback );
- return this;
- }
- setStyle( style ) {
- const dom = this.dom;
- if ( this.style ) dom.classList.remove( this.style );
- if ( style ) dom.classList.add( style );
- this.style = style;
- return this;
- }
- setPosition( x, y ) {
- const dom = this.dom;
- dom.style.left = toPX( x );
- dom.style.top = toPX( y );
- return this;
- }
- getPosition() {
- const dom = this.dom;
- return {
- x: parseInt( dom.style.left ),
- y: parseInt( dom.style.top )
- };
- }
- setWidth( val ) {
- this.dom.style.width = toPX( val );
- return this;
- }
- getWidth() {
- return parseInt( this.dom.style.width );
- }
- add( element ) {
- this.elements.push( element );
- element.node = this;
- element.addEventListener( 'connect', this._onConnect );
- element.addEventListener( 'connectChildren', this._onConnectChildren );
- this.dom.append( element.dom );
- return this;
- }
- remove( element ) {
- this.elements.splice( this.elements.indexOf( element ), 1 );
- element.node = null;
- element.removeEventListener( 'connect', this._onConnect );
- element.removeEventListener( 'connectChildren', this._onConnectChildren );
- this.dom.removeChild( element.dom );
- return this;
- }
- dispose() {
- const canvas = this.canvas;
- if ( canvas !== null ) canvas.remove( this );
- for ( const element of this.elements ) {
- element.dispose();
- }
- this.dispatchEvent( new Event( 'dispose' ) );
- }
- isCircular( node ) {
- if ( node === this ) return true;
- const links = this.getLinks();
- for ( const link of links ) {
- if ( link.outputElement.node.isCircular( node ) ) {
- return true;
- }
- }
- return false;
- }
- getLinks() {
- const links = [];
- for ( const element of this.elements ) {
- links.push( ...element.links );
- }
- return links;
- }
- serialize( data ) {
- const { x, y } = this.getPosition();
- const elements = [];
- for ( const element of this.elements ) {
- elements.push( element.toJSON( data ).id );
- }
- data.x = x;
- data.y = y;
- data.width = this.getWidth();
- data.elements = elements;
- if ( this.style !== '' ) {
- data.style = this.style;
- }
- }
- deserialize( data ) {
- this.setPosition( data.x, data.y );
- this.setWidth( data.width );
- if ( data.style !== undefined ) {
- this.setStyle( data.style );
- }
- const elements = this.elements;
- if ( elements.length > 0 ) {
- let index = 0;
- for ( const id of data.elements ) {
- data.objects[ id ] = elements[ index ++ ];
- }
- } else {
- for ( const id of data.elements ) {
- this.add( data.objects[ id ] );
- }
- }
- }
- }
- class DraggableElement extends Element {
- constructor( draggable = true ) {
- super( true );
- this.draggable = draggable;
- const onDrag = ( e ) => {
- e.preventDefault();
- if ( this.draggable === true ) {
- draggableDOM( this.node.dom );
- }
- };
- const { dom } = this;
- dom.addEventListener( 'mousedown', onDrag, true );
- dom.addEventListener( 'touchstart', onDrag, true );
- }
- }
- class TitleElement extends DraggableElement {
- constructor( title, draggable = true ) {
- super( draggable );
- const { dom } = this;
- dom.className = 'title';
- const spanDOM = document.createElement( 'span' );
- spanDOM.innerText = title;
- const iconDOM = document.createElement( 'i' );
- const toolbarDOM = document.createElement( 'f-toolbar' );
- this.buttons = [];
- this.spanDOM = spanDOM;
- this.iconDOM = iconDOM;
- this.toolbarDOM = toolbarDOM;
- dom.append( spanDOM );
- dom.append( iconDOM );
- dom.append( toolbarDOM );
- }
- setIcon( value ) {
- this.iconDOM.className = value;
- return this;
- }
- getIcon() {
- return this.iconDOM.className;
- }
- setTitle( value ) {
- this.spanDOM.innerText = value;
- return this;
- }
- getTitle() {
- return this.spanDOM.innerText;
- }
- addButton( button ) {
- this.buttons.push( button );
- this.toolbarDOM.append( button.dom );
- return this;
- }
- serialize( data ) {
- super.serialize( data );
- const title = this.getTitle();
- const icon = this.getIcon();
- data.title = title;
- if ( icon !== '' ) {
- data.icon = icon;
- }
- }
- deserialize( data ) {
- super.deserialize( data );
- this.setTitle( data.title );
- if ( data.icon !== undefined ) {
- this.setIcon( data.icon );
- }
- }
- }
- const drawLine = ( p1x, p1y, p2x, p2y, invert, size, colorA, ctx, colorB = null ) => {
- const dx = p2x - p1x;
- const dy = p2y - p1y;
- const offset = Math.sqrt( ( dx * dx ) + ( dy * dy ) ) * ( invert ? - .3 : .3 );
- ctx.beginPath();
- ctx.moveTo( p1x, p1y );
- ctx.bezierCurveTo(
- p1x + offset, p1y,
- p2x - offset, p2y,
- p2x, p2y
- );
- if ( colorB !== null && colorA !== colorB ) {
- const gradient = ctx.createLinearGradient( p1x, p1y, p2x, p2y );
- gradient.addColorStop( 0, colorA );
- gradient.addColorStop( 1, colorB );
- ctx.strokeStyle = gradient;
- } else {
- ctx.strokeStyle = colorA;
- }
- ctx.lineWidth = size;
- ctx.stroke();
- };
- const colors = [
- '#ff4444',
- '#44ff44',
- '#4444ff'
- ];
- const dropNode = new Node().add( new TitleElement( 'File' ) ).setWidth( 250 );
- class Canvas extends Serializer {
- constructor() {
- super();
- const dom = document.createElement( 'f-canvas' );
- const contentDOM = document.createElement( 'f-content' );
- const areaDOM = document.createElement( 'f-area' );
- const dropDOM = document.createElement( 'f-drop' );
- const canvas = document.createElement( 'canvas' );
- const frontCanvas = document.createElement( 'canvas' );
- const context = canvas.getContext( '2d' );
- const frontContext = frontCanvas.getContext( '2d' );
- this.dom = dom;
- this.contentDOM = contentDOM;
- this.areaDOM = areaDOM;
- this.dropDOM = dropDOM;
- this.canvas = canvas;
- this.frontCanvas = frontCanvas;
- this.context = context;
- this.frontContext = frontContext;
- this.width = 10000;
- this.height = 10000;
- this.clientX = 0;
- this.clientY = 0;
- this.relativeClientX = 0;
- this.relativeClientY = 0;
- this.zoom = 1;
- this.nodes = [];
- this.selected = null;
- this.updating = false;
- this.droppedItems = [];
- this.events = {
- 'drop': []
- };
- frontCanvas.className = 'front';
- contentDOM.style.left = toPX( this.centerX );
- contentDOM.style.top = toPX( this.centerY );
- areaDOM.style.width = `calc( 100% + ${ this.width }px )`;
- areaDOM.style.height = `calc( 100% + ${ this.height }px )`;
- dropDOM.innerHTML = '<span>drop your file</span>';
- dom.append( dropDOM );
- dom.append( canvas );
- dom.append( frontCanvas );
- dom.append( contentDOM );
- dom.append( areaDOM );
- /*
- let zoomTouchData = null;
- const onZoomStart = () => {
- zoomTouchData = null;
- };
- */
- const onZoom = ( e ) => {
- if ( e.touches ) {
- if ( e.touches.length === 2 ) {
- e.preventDefault();
- e.stopImmediatePropagation();
- /*
- const clientX = ( e.touches[ 0 ].clientX + e.touches[ 1 ].clientX ) / 2;
- const clientY = ( e.touches[ 0 ].clientY + e.touches[ 1 ].clientY ) / 2;
- const distance = Math.hypot(
- e.touches[ 0 ].clientX - e.touches[ 1 ].clientX,
- e.touches[ 0 ].clientY - e.touches[ 1 ].clientY
- );
- if ( zoomTouchData === null ) {
- zoomTouchData = {
- distance
- };
- }
- const delta = ( zoomTouchData.distance - distance );
- zoomTouchData.distance = distance;
- let zoom = Math.min( Math.max( this.zoom - delta * .01, .5 ), 1.2 );
- if ( zoom < .52 ) zoom = .5;
- else if ( zoom > .98 ) zoom = 1;
- contentDOM.style.left = toPX( this.centerX / zoom );
- contentDOM.style.top = toPX( this.centerY / zoom );
- contentDOM.style.zoom = this.zoom = zoom;
- */
- }
- } else {
- e.preventDefault();
- e.stopImmediatePropagation();
- /*
- const delta = e.deltaY / 100;
- const zoom = Math.min( Math.max( this.zoom - delta * .1, .5 ), 1 );
- contentDOM.style.left = toPX( this.centerX / zoom );
- contentDOM.style.top = toPX( this.centerY / zoom );
- contentDOM.style.zoom = this.zoom = zoom;
- */
- }
- };
- dom.addEventListener( 'wheel', onZoom );
- dom.addEventListener( 'touchmove', onZoom );
- //dom.addEventListener( 'touchstart', onZoomStart );
- let dropEnterCount = 0;
- const dragState = ( enter ) => {
- if ( enter ) {
- if ( dropEnterCount ++ === 0 ) {
- this.droppedItems = [];
- dropDOM.classList.add( 'visible' );
- this.add( dropNode );
- }
- } else if ( -- dropEnterCount === 0 ) {
- dropDOM.classList.remove( 'visible' );
- this.remove( dropNode );
- }
- };
- dom.addEventListener( 'dragenter', () => {
- dragState( true );
- } );
- dom.addEventListener( 'dragleave', () => {
- dragState( false );
- } );
- dom.addEventListener( 'dragover', ( e ) => {
- e.preventDefault();
- const { relativeClientX, relativeClientY } = this;
- const centerNodeX = dropNode.getWidth() / 2;
- dropNode.setPosition( relativeClientX - centerNodeX, relativeClientY - 20 );
- } );
- dom.addEventListener( 'drop', ( e ) => {
- e.preventDefault();
- dragState( false );
- this.droppedItems = e.dataTransfer.items;
- dispatchEventList( this.events.drop, this );
- } );
- draggableDOM( dom, ( data ) => {
- const { delta, isTouch } = data;
- if ( ! isTouch ) {
- if ( data.scrollTop === undefined ) {
- data.scrollLeft = dom.scrollLeft;
- data.scrollTop = dom.scrollTop;
- }
- dom.scrollLeft = data.scrollLeft - delta.x;
- dom.scrollTop = data.scrollTop - delta.y;
- }
- if ( data.dragging ) {
- dom.classList.add( 'grabbing' );
- } else {
- dom.classList.remove( 'grabbing' );
- }
- }, 'dragging-canvas' );
- this._onMoveEvent = ( e ) => {
- const event = e.touches ? e.touches[ 0 ] : e;
- const { zoom, rect } = this;
- this.clientX = event.clientX;
- this.clientY = event.clientY;
- this.relativeClientX = ( ( ( dom.scrollLeft - this.centerX ) + event.clientX ) - rect.left ) / zoom;
- this.relativeClientY = ( ( ( dom.scrollTop - this.centerY ) + event.clientY ) - rect.top ) / zoom;
- };
- this._onContentLoaded = () => {
- this.centralize();
- };
- this._onUpdate = () => {
- this.update();
- };
- this.start();
- }
- get rect() {
- return this.dom.getBoundingClientRect();
- }
- get relativeX() {
- return this.dom.scrollLeft - this.centerX;
- }
- get relativeY() {
- return this.dom.scrollTop - this.centerY;
- }
- get centerX() {
- return this.width / 2;
- }
- get centerY() {
- return this.height / 2;
- }
- onDrop( callback ) {
- this.events.drop.push( callback );
- return this;
- }
- start() {
- this.updating = true;
- document.addEventListener( 'wheel', this._onMoveEvent, true );
- document.addEventListener( 'mousedown', this._onMoveEvent, true );
- document.addEventListener( 'touchstart', this._onMoveEvent, true );
- document.addEventListener( 'mousemove', this._onMoveEvent, true );
- document.addEventListener( 'touchmove', this._onMoveEvent, true );
- document.addEventListener( 'dragover', this._onMoveEvent, true );
- document.addEventListener( 'DOMContentLoaded', this._onContentLoaded );
- requestAnimationFrame( this._onUpdate );
- }
- stop() {
- this.updating = false;
- document.removeEventListener( 'wheel', this._onMoveEvent, true );
- document.removeEventListener( 'mousedown', this._onMoveEvent, true );
- document.removeEventListener( 'touchstart', this._onMoveEvent, true );
- document.removeEventListener( 'mousemove', this._onMoveEvent, true );
- document.removeEventListener( 'touchmove', this._onMoveEvent, true );
- document.removeEventListener( 'dragover', this._onMoveEvent, true );
- document.removeEventListener( 'DOMContentLoaded', this._onContentLoaded );
- }
- add( node ) {
- if ( node.canvas === this ) return;
- this.nodes.push( node );
- node.canvas = this;
- this.contentDOM.append( node.dom );
- return this;
- }
- remove( node ) {
- if ( node === this.selected ) {
- this.select();
- }
- this.unlink( node );
- const nodes = this.nodes;
- nodes.splice( nodes.indexOf( node ), 1 );
- node.canvas = null;
- this.contentDOM.removeChild( node.dom );
- node.dispatchEvent( new Event( 'remove' ) );
- return this;
- }
- clear() {
- const nodes = this.nodes;
- while ( nodes.length > 0 ) {
- this.remove( nodes[ 0 ] );
- }
- return this;
- }
- unlink( node ) {
- const links = this.getLinks();
- for ( const link of links ) {
- if ( link.inputElement && link.outputElement ) {
- if ( link.inputElement.node === node ) {
- link.inputElement.connect();
- } else if ( link.outputElement.node === node ) {
- link.inputElement.connect();
- }
- }
- }
- }
- getLinks() {
- const links = [];
- for ( const node of this.nodes ) {
- links.push( ...node.getLinks() );
- }
- return links;
- }
- centralize() {
- this.dom.scroll( this.centerX, this.centerY );
- return this;
- }
- select( node = null ) {
- if ( node === this.selected ) return;
- const previousNode = this.selected;
- if ( previousNode !== null ) {
- previousNode.dom.classList.remove( 'selected' );
- this.selected = null;
- dispatchEventList( previousNode.events.blur, previousNode );
- }
- if ( node !== null ) {
- node.dom.classList.add( 'selected' );
- this.selected = node;
- dispatchEventList( node.events.focus, node );
- }
- }
- update() {
- if ( this.updating === false ) return;
- requestAnimationFrame( this._onUpdate );
- const { dom, zoom, canvas, frontCanvas, frontContext, context } = this;
- const width = window.innerWidth;
- const height = window.innerHeight;
- const domRect = this.rect;
- if ( canvas.width !== width || canvas.height !== height ) {
- canvas.width = width;
- canvas.height = height;
- frontCanvas.width = width;
- frontCanvas.height = height;
- }
- context.clearRect( 0, 0, width, height );
- frontContext.clearRect( 0, 0, width, height );
- context.globalCompositeOperation = 'lighter';
- frontContext.globalCompositeOperation = 'source-over';
- const links = this.getLinks();
- const aPos = { x: 0, y: 0 };
- const bPos = { x: 0, y: 0 };
- const offsetIORadius = 10;
- let dragging = '';
- for ( const link of links ) {
- const { lioElement, rioElement } = link;
- let draggingLink = '';
- let length = 0;
- if ( lioElement !== null ) {
- const rect = lioElement.dom.getBoundingClientRect();
- length = Math.max( length, lioElement.rioLength );
- aPos.x = rect.x + rect.width;
- aPos.y = rect.y + ( rect.height / 2 );
- } else {
- aPos.x = this.clientX;
- aPos.y = this.clientY;
- draggingLink = 'lio';
- }
- if ( rioElement !== null ) {
- const rect = rioElement.dom.getBoundingClientRect();
- length = Math.max( length, rioElement.lioLength );
- bPos.x = rect.x;
- bPos.y = rect.y + ( rect.height / 2 );
- } else {
- bPos.x = this.clientX;
- bPos.y = this.clientY;
- draggingLink = 'rio';
- }
- dragging = dragging || draggingLink;
- const drawContext = draggingLink ? frontContext : context;
- if ( draggingLink || length === 1 ) {
- let colorA = null,
- colorB = null;
- if ( draggingLink === 'rio' ) {
- colorA = colorB = lioElement.getRIOColor();
- aPos.x += offsetIORadius;
- bPos.x /= zoom;
- bPos.y /= zoom;
- } else if ( draggingLink === 'lio' ) {
- colorA = colorB = rioElement.getLIOColor();
- bPos.x -= offsetIORadius;
- aPos.x /= zoom;
- aPos.y /= zoom;
- } else {
- colorA = lioElement.getRIOColor();
- colorB = rioElement.getLIOColor();
- }
- drawLine(
- aPos.x * zoom, aPos.y * zoom,
- bPos.x * zoom, bPos.y * zoom,
- false, 2, colorA || '#ffffff', drawContext, colorB || '#ffffff'
- );
- } else {
- length = Math.min( length, 4 );
- for ( let i = 0; i < length; i ++ ) {
- const color = colors[ i ] || '#ffffff';
- const marginY = 4;
- const rioLength = Math.min( lioElement.rioLength, length );
- const lioLength = Math.min( rioElement.lioLength, length );
- const colorA = lioElement.getRIOColor() || color;
- const colorB = rioElement.getLIOColor() || color;
- const aCenterY = ( ( rioLength * marginY ) * .5 ) - ( marginY / 2 );
- const bCenterY = ( ( lioLength * marginY ) * .5 ) - ( marginY / 2 );
- const aIndex = Math.min( i, rioLength - 1 );
- const bIndex = Math.min( i, lioLength - 1 );
- const aPosY = ( aIndex * marginY ) - 1;
- const bPosY = ( bIndex * marginY ) - 1;
- drawLine(
- aPos.x * zoom, ( ( aPos.y + aPosY ) - aCenterY ) * zoom,
- bPos.x * zoom, ( ( bPos.y + bPosY ) - bCenterY ) * zoom,
- false, 2, colorA, drawContext, colorB
- );
- }
- }
- }
- context.globalCompositeOperation = 'destination-in';
- context.fillRect( domRect.x, domRect.y, domRect.width, domRect.height );
- if ( dragging !== '' ) {
- dom.classList.add( 'dragging-' + dragging );
- } else {
- dom.classList.remove( 'dragging-lio' );
- dom.classList.remove( 'dragging-rio' );
- }
- }
- serialize( data ) {
- const nodes = [];
- for ( const node of this.nodes ) {
- nodes.push( node.toJSON( data ).id );
- }
- data.nodes = nodes;
- }
- deserialize( data ) {
- for ( const id of data.nodes ) {
- this.add( data.objects[ id ] );
- }
- }
- }
- class ButtonInput extends Input {
- constructor( innterText = '' ) {
- const dom = document.createElement( 'button' );
- const spanDOM = document.createElement( 'span' );
- dom.append( spanDOM );
- const iconDOM = document.createElement( 'i' );
- dom.append( iconDOM );
- super( dom );
- this.spanDOM = spanDOM;
- this.iconDOM = iconDOM;
- spanDOM.innerText = innterText;
- dom.onmouseover = () => {
- this.dispatchEvent( new Event( 'mouseover' ) );
- };
- dom.onclick = dom.ontouchstart = ( e ) => {
- e.preventDefault();
- e.stopPropagation();
- this.dispatchEvent( new Event( 'click' ) );
- };
- }
- setIcon( className ) {
- this.iconDOM.className = className;
- return this;
- }
- setValue( val ) {
- this.spanDOM.innerText = val;
- return this;
- }
- getValue() {
- return this.spanDOM.innerText;
- }
- }
- class ObjectNode extends Node {
- constructor( name, inputLength, callback = null, width = 300 ) {
- super();
- this.setWidth( width );
- const title = new TitleElement( name )
- .setObjectCallback( callback )
- .setSerializable( false )
- .setOutput( inputLength );
- const closeButton = new ButtonInput( Styles.icons.close || '✕' ).onClick( () => {
- this.dispose();
- } ).setIcon( Styles.icons.close );
- title.addButton( closeButton );
- this.add( title );
- this.title = title;
- this.closeButton = closeButton;
- }
- setName( value ) {
- this.title.setTitle( value );
- return this;
- }
- getName() {
- return this.title.getTitle();
- }
- setObjectCallback( callback ) {
- this.title.setObjectCallback( callback );
- return this;
- }
- getObject( callback ) {
- return this.title.getObject( callback );
- }
- setColor( color ) {
- return this.title.setColor( color );
- }
- setOutputColor( color ) {
- return this.title.setOutputColor( color );
- }
- invalidate() {
- this.title.dispatchEvent( new Event( 'connect' ) );
- }
- }
- const ENTER_KEY$1 = 13;
- class StringInput extends Input {
- constructor( value = '' ) {
- const dom = document.createElement( 'input' );
- super( dom );
- dom.type = 'text';
- dom.value = value;
- dom.spellcheck = false;
- dom.autocomplete = 'off';
- dom.onblur = () => {
- this.dispatchEvent( new Event( 'blur' ) );
- };
- dom.onchange = () => {
- this.dispatchEvent( new Event( 'change' ) );
- };
- dom.onkeyup = ( e ) => {
- if ( e.keyCode === ENTER_KEY$1 ) {
- e.target.blur();
- }
- e.stopPropagation();
- this.dispatchEvent( new Event( 'change' ) );
- };
- }
- }
- const ENTER_KEY = 13;
- class NumberInput extends Input {
- constructor( value = 0, min = - Infinity, max = Infinity, step = .01 ) {
- const dom = document.createElement( 'input' );
- super( dom );
- this.min = min;
- this.max = max;
- this.step = step;
- this.integer = false;
- dom.type = 'text';
- dom.className = 'number';
- dom.value = this._getString( value );
- dom.spellcheck = false;
- dom.autocomplete = 'off';
- dom.ondragstart = dom.oncontextmenu = ( e ) => {
- e.preventDefault();
- e.stopPropagation();
- };
- dom.onfocus = dom.onclick = () => {
- dom.select();
- };
- dom.onblur = () => {
- this.dispatchEvent( new Event( 'blur' ) );
- };
- dom.onchange = () => {
- this.dispatchEvent( new Event( 'change' ) );
- };
- dom.onkeydown = ( e ) => {
- if ( e.key.length === 1 && /\d|\./.test( e.key ) !== true ) {
- return false;
- }
- if ( e.keyCode === ENTER_KEY ) {
- e.target.blur();
- }
- e.stopPropagation();
- };
- draggableDOM( dom, ( data ) => {
- const { delta } = data;
- if ( data.value === undefined ) {
- data.value = this.getValue();
- }
- const diff = delta.x - delta.y;
- const value = data.value + ( diff * this.step );
- this.dom.value = this._getString( value.toFixed( this.precision ) );
- this.dispatchEvent( new Event( 'change' ) );
- } );
- }
- setStep( step ) {
- this.step = step;
- return this;
- }
- setRange( min, max, step ) {
- this.min = min;
- this.max = max;
- this.step = step;
- this.dispatchEvent( new Event( 'range' ) );
- return this.setValue( this.getValue() );
- }
- get precision() {
- if ( this.integer === true ) return 0;
- const fract = this.step % 1;
- return fract !== 0 ? fract.toString().split( '.' )[ 1 ].length : 1;
- }
- setValue( val, dispatch = true ) {
- return super.setValue( this._getString( val ), dispatch );
- }
- getValue() {
- return Number( this.dom.value );
- }
- serialize( data ) {
- const { min, max } = this;
- if ( min !== - Infinity && max !== Infinity ) {
- data.min = this.min;
- data.max = this.max;
- data.step = this.step;
- }
- super.serialize( data );
- }
- deserialize( data ) {
- if ( data.min !== undefined ) {
- const { min, max, step } = this;
- this.setRange( min, max, step );
- }
- super.deserialize( data );
- }
- _getString( value ) {
- const num = Math.min( Math.max( Number( value ), this.min ), this.max );
- if ( this.integer === true ) {
- return Math.floor( num );
- } else {
- return num + ( num % 1 ? '' : '.0' );
- }
- }
- }
- const getStep = ( min, max ) => {
- const sensibility = .001;
- return ( max - min ) * sensibility;
- };
- class SliderInput extends Input {
- constructor( value = 0, min = 0, max = 100 ) {
- const dom = document.createElement( 'f-subinputs' );
- super( dom );
- value = Math.min( Math.max( value, min ), max );
- const step = getStep( min, max );
- const rangeDOM = document.createElement( 'input' );
- rangeDOM.type = 'range';
- rangeDOM.min = min;
- rangeDOM.max = max;
- rangeDOM.step = step;
- rangeDOM.value = value;
- const field = new NumberInput( value, min, max, step );
- field.dom.className = 'range-value';
- field.onChange( () => {
- rangeDOM.value = field.getValue();
- } );
- field.addEventListener( 'range', () => {
- rangeDOM.min = field.min;
- rangeDOM.max = field.max;
- rangeDOM.step = field.step;
- rangeDOM.value = field.getValue();
- } );
- dom.append( rangeDOM );
- dom.append( field.dom );
- this.rangeDOM = rangeDOM;
- this.field = field;
- const updateRangeValue = () => {
- let value = Number( rangeDOM.value );
- if ( value !== this.max && value + this.step >= this.max ) {
- // fix not end range fraction
- rangeDOM.value = value = this.max;
- }
- this.field.setValue( value );
- };
- draggableDOM( rangeDOM, () => {
- updateRangeValue();
- this.dispatchEvent( new Event( 'change' ) );
- }, '' );
- }
- get min() {
- return this.field.min;
- }
- get max() {
- return this.field.max;
- }
- get step() {
- return this.field.step;
- }
- setRange( min, max ) {
- this.field.setRange( min, max, getStep( min, max ) );
- this.dispatchEvent( new Event( 'range' ) );
- this.dispatchEvent( new Event( 'change' ) );
- return this;
- }
- setValue( val, dispatch = true ) {
- this.field.setValue( val );
- this.rangeDOM.value = val;
- if ( dispatch ) this.dispatchEvent( new Event( 'change' ) );
- return this;
- }
- getValue() {
- return this.field.getValue();
- }
- serialize( data ) {
- data.min = this.min;
- data.max = this.max;
- super.serialize( data );
- }
- deserialize( data ) {
- const { min, max } = data;
- this.setRange( min, max );
- super.deserialize( data );
- }
- }
- class ColorInput extends Input {
- constructor( value = 0x0099ff ) {
- const dom = document.createElement( 'input' );
- super( dom );
- dom.type = 'color';
- dom.value = toHex( value );
- dom.oninput = () => {
- this.dispatchEvent( new Event( 'change' ) );
- };
- }
- setValue( value, dispatch = true ) {
- return super.setValue( toHex( value ), dispatch );
- }
- getValue() {
- return parseInt( super.getValue().slice( 1 ), 16 );
- }
- }
- class TextInput extends Input {
- constructor( innerText = '' ) {
- const dom = document.createElement( 'textarea' );
- super( dom );
- dom.innerText = innerText;
- }
- setValue( val ) {
- this.dom.innerText = val;
- return this;
- }
- getValue() {
- return this.dom.innerText;
- }
- }
- class LabelElement extends Element {
- constructor( label = '', align = '' ) {
- super();
- this.labelDOM = document.createElement( 'f-label' );
- this.inputsDOM = document.createElement( 'f-inputs' );
- const spanDOM = document.createElement( 'span' );
- const iconDOM = document.createElement( 'i' );
- this.spanDOM = spanDOM;
- this.iconDOM = iconDOM;
- this.labelDOM.append( this.spanDOM );
- this.labelDOM.append( this.iconDOM );
- this.dom.append( this.labelDOM );
- this.dom.append( this.inputsDOM );
- this.serializeLabel = false;
- this.setLabel( label );
- this.setAlign( align );
- }
- setIcon( value ) {
- this.iconDOM.className = value;
- return this;
- }
- getIcon() {
- return this.iconDOM.className;
- }
- setAlign( align ) {
- this.labelDOM.className = align;
- }
- setLabel( val ) {
- this.spanDOM.innerText = val;
- }
- getLabel() {
- return this.spanDOM.innerText;
- }
- serialize( data ) {
- super.serialize( data );
- if ( this.serializeLabel ) {
- const label = this.getLabel();
- const icon = this.getIcon();
- data.label = label;
- if ( icon !== '' ) {
- data.icon = icon;
- }
- }
- }
- deserialize( data ) {
- super.deserialize( data );
- if ( this.serializeLabel ) {
- this.setLabel( data.label );
- if ( data.icon !== undefined ) {
- this.setIcon( data.icon );
- }
- }
- }
- }
- class PanelNode extends Node {
- constructor( title = 'Panel', align = 'top-right' ) {
- super();
- const titleElement = new TitleElement( title );
- this.add( titleElement );
- const collapseButton = new ButtonInput( '🗕' );
- collapseButton.onClick( () => {
- this.setCollapse( ! this.collapsed );
- } );
- titleElement.addButton( collapseButton );
- this.collapseButton = collapseButton;
- this.titleElement = titleElement;
- this.align = align;
- this.collapsed = false;
- this.setAlign( align );
- this.setStyle( 'rouded' );
- }
- setCollapse( value ) {
- const cssClass = 'closed';
- this.dom.classList.remove( cssClass );
- this.collapsed = value;
- this.collapseButton.value = value ? '🗖' : '🗕';
- if ( value === true ) {
- this.dom.classList.add( cssClass );
- }
- return this;
- }
- setAlign( align ) {
- if ( this.align ) this.dom.classList.remove( this.align );
- this.dom.classList.add( align );
- this.align = align;
- return this;
- }
- addInput( inputClass, object, property, ...params ) {
- const value = object[ property ];
- const input = new inputClass( value, ...params );
- input.onChange( () => {
- object[ property ] = input.value;
- } );
- this.add( new LabelElement( property ).add( input ) );
- return input;
- }
- addSlider( object, property, min, max ) {
- return this.addInput( SliderInput, object, property, min, max );
- }
- addNumber( object, property ) {
- return this.addInput( NumberInput, object, property );
- }
- addColor( object, property ) {
- return this.addInput( ColorInput, object, property );
- }
- addString( object, property ) {
- return this.addInput( StringInput, object, property );
- }
- addText( object, property ) {
- const input = this.addInput( TextInput, object, property );
- input.element.setHeight( 70 );
- return input;
- }
- addButton( name ) {
- const input = new ButtonInput( name );
- this.add( new Element().setHeight( 34 ).add( input ) );
- return input;
- }
- }
- class Menu extends EventTarget {
- constructor( className ) {
- super();
- const dom = document.createElement( 'f-menu' );
- dom.className = className + ' hidden';
- const listDOM = document.createElement( 'f-list' );
- dom.append( listDOM );
- this.dom = dom;
- this.listDOM = listDOM;
- this.visible = false;
- this.subMenus = new WeakMap();
- this.domButtons = new WeakMap();
- this.buttons = [];
- this.events = {};
- }
- onContext( callback ) {
- this.events.context.push( callback );
- return this;
- }
- show() {
- this.dom.classList.remove( 'hidden' );
- this.visible = true;
- this.dispatchEvent( new Event( 'show' ) );
- return this;
- }
- hide() {
- this.dom.classList.add( 'hidden' );
- this.dispatchEvent( new Event( 'hide' ) );
- this.visible = false;
- }
- add( button, submenu = null ) {
- const liDOM = document.createElement( 'f-item' );
- if ( submenu !== null ) {
- liDOM.classList.add( 'submenu' );
- liDOM.append( submenu.dom );
- this.subMenus.set( button, submenu );
- button.dom.addEventListener( 'mouseover', () => submenu.show() );
- button.dom.addEventListener( 'mouseout', () => submenu.hide() );
- }
- liDOM.append( button.dom );
- this.buttons.push( button );
- this.listDOM.append( liDOM );
- this.domButtons.set( button, liDOM );
- return this;
- }
- clear() {
- this.buttons = [];
- this.subMenus = new WeakMap();
- this.domButtons = new WeakMap();
- while ( this.listDOM.firstChild ) {
- this.listDOM.firstChild.remove();
- }
- }
- }
- let lastContext = null;
- const onCloseLastContext = ( e ) => {
- if ( lastContext && lastContext.visible === true && e.target.closest( 'f-menu.context' ) === null ) {
- lastContext.hide();
- }
- };
- document.body.addEventListener( 'mousedown', onCloseLastContext, true );
- document.body.addEventListener( 'touchstart', onCloseLastContext, true );
- class ContextMenu extends Menu {
- constructor( target = null ) {
- super( 'context', target );
- this.events.context = [];
- this._lastButtonClick = null;
- this._onButtonClick = ( e = null ) => {
- const button = e ? e.target : null;
- if ( this._lastButtonClick ) {
- this._lastButtonClick.dom.parentElement.classList.remove( 'active' );
- }
- this._lastButtonClick = button;
- if ( button ) {
- if ( this.subMenus.has( button ) ) {
- this.subMenus.get( button )._onButtonClick();
- }
- button.dom.parentElement.classList.add( 'active' );
- }
- };
- this._onButtonMouseOver = ( e ) => {
- const button = e.target;
- if ( this.subMenus.has( button ) && this._lastButtonClick !== button ) {
- this._onButtonClick();
- }
- };
- this.addEventListener( 'context', ( ) => {
- dispatchEventList( this.events.context, this );
- } );
- this.setTarget( target );
- }
- openFrom( dom ) {
- const rect = dom.getBoundingClientRect();
- return this.open( rect.x + ( rect.width / 2 ), rect.y + ( rect.height / 2 ) );
- }
- open( x = pointer.x, y = pointer.y ) {
- if ( lastContext !== null ) {
- lastContext.hide();
- }
- lastContext = this;
- this.setPosition( x, y );
- document.body.append( this.dom );
- return this.show();
- }
- setPosition( x, y ) {
- const dom = this.dom;
- dom.style.left = toPX( x );
- dom.style.top = toPX( y );
- return this;
- }
- setTarget( target = null ) {
- if ( target !== null ) {
- const onContextMenu = ( e ) => {
- e.preventDefault();
- if ( e.pointerType !== 'mouse' || ( e.pageX === 0 && e.pageY === 0 ) ) return;
- this.dispatchEvent( new Event( 'context' ) );
- this.open();
- };
- this.target = target;
- target.addEventListener( 'contextmenu', onContextMenu, false );
- }
- return this;
- }
- show() {
- if ( ! this.opened ) {
- this.dom.style.left = '';
- this.dom.style.transform = '';
- }
- const domRect = this.dom.getBoundingClientRect();
- let offsetX = Math.min( window.innerWidth - ( domRect.x + domRect.width + 10 ), 0 );
- let offsetY = Math.min( window.innerHeight - ( domRect.y + domRect.height + 10 ), 0 );
- if ( this.opened ) {
- if ( offsetX < 0 ) offsetX = - domRect.width;
- if ( offsetY < 0 ) offsetY = - domRect.height;
- this.setPosition( domRect.x + offsetX, domRect.y + offsetY );
- } else {
- // flip submenus
- if ( offsetX < 0 ) this.dom.style.left = '-100%';
- if ( offsetY < 0 ) this.dom.style.transform = 'translateY( calc( 32px - 100% ) )';
- }
- return super.show();
- }
- hide() {
- if ( this.opened ) {
- lastContext = null;
- }
- return super.hide();
- }
- add( button, submenu = null ) {
- button.addEventListener( 'click', this._onButtonClick );
- button.addEventListener( 'mouseover', this._onButtonMouseOver );
- return super.add( button, submenu );
- }
- get opened() {
- return lastContext === this;
- }
- }
- class CircleMenu extends Menu {
- constructor( target = null ) {
- super( 'circle', target );
- }
- }
- class Tips extends EventTarget {
- constructor() {
- super();
- const dom = document.createElement( 'f-tips' );
- this.dom = dom;
- this.time = 0;
- this.duration = 3000;
- }
- message( str ) {
- return this.tip( str );
- }
- error( str ) {
- return this.tip( str, 'error' );
- }
- tip( html, className = '' ) {
- const dom = document.createElement( 'f-tip' );
- dom.className = className;
- dom.innerHTML = html;
- this.dom.prepend( dom );
- //requestAnimationFrame( () => dom.style.opacity = 1 );
- this.time = Math.min( this.time + this.duration, this.duration );
- setTimeout( () => {
- this.time -= this.duration;
- dom.style.opacity = 0;
- setTimeout( () => dom.remove(), 250 );
- }, this.time );
- return this;
- }
- }
- const filterString = ( str ) => {
- return str.trim().toLowerCase().replace( /\s\s+/g, ' ' );
- };
- class Search extends Menu {
- constructor() {
- super( 'search' );
- this.events.submit = [];
- this.events.filter = [];
- const inputDOM = document.createElement( 'input' );
- inputDOM.placeholder = 'Type here';
- let filter = true;
- let filterNeedUpdate = true;
- inputDOM.addEventListener( 'focusout', () => {
- filterNeedUpdate = true;
- this.setValue( '' );
- } );
- inputDOM.onkeydown = ( e ) => {
- const keyCode = e.keyCode;
- if ( keyCode === 38 ) {
- const index = this.filteredIndex;
- if ( this.forceAutoComplete ) {
- this.filteredIndex = index !== null ? ( index + 1 ) % ( this.filtered.length || 1 ) : 0;
- } else {
- this.filteredIndex = index !== null ? Math.min( index + 1, this.filtered.length - 1 ) : 0;
- }
- e.preventDefault();
- filter = false;
- } else if ( keyCode === 40 ) {
- const index = this.filteredIndex;
- if ( this.forceAutoComplete ) {
- this.filteredIndex = index - 1;
- if ( this.filteredIndex === null ) this.filteredIndex = this.filtered.length - 1;
- } else {
- this.filteredIndex = index !== null ? index - 1 : null;
- }
- e.preventDefault();
- filter = false;
- } else if ( keyCode === 13 ) {
- this.value = this.currentFiltered ? this.currentFiltered.button.getValue() : inputDOM.value;
- this.submit();
- e.preventDefault();
- filter = false;
- } else {
- filter = true;
- }
- };
- inputDOM.onkeyup = () => {
- if ( filter ) {
- if ( filterNeedUpdate ) {
- this.dispatchEvent( new Event( 'filter' ) );
- filterNeedUpdate = false;
- }
- this.filter( inputDOM.value );
- }
- };
- this.filtered = [];
- this.currentFiltered = null;
- this.value = '';
- this.forceAutoComplete = false;
- this.dom.append( inputDOM );
- this.inputDOM = inputDOM;
- this.addEventListener( 'filter', ( ) => {
- dispatchEventList( this.events.filter, this );
- } );
- this.addEventListener( 'submit', ( ) => {
- dispatchEventList( this.events.submit, this );
- } );
- }
- submit() {
- this.dispatchEvent( new Event( 'submit' ) );
- return this.setValue( '' );
- }
- setValue( value ) {
- this.inputDOM.value = value;
- this.filter( value );
- return this;
- }
- getValue() {
- return this.value;
- }
- onFilter( callback ) {
- this.events.filter.push( callback );
- return this;
- }
- onSubmit( callback ) {
- this.events.submit.push( callback );
- return this;
- }
- getFilterByButton( button ) {
- for ( const filter of this.filtered ) {
- if ( filter.button === button ) {
- return filter;
- }
- }
- return null;
- }
- add( button ) {
- super.add( button );
- const onDown = () => {
- const filter = this.getFilterByButton( button );
- this.filteredIndex = this.filtered.indexOf( filter );
- this.value = button.getValue();
- this.submit();
- };
- button.dom.addEventListener( 'mousedown', onDown );
- button.dom.addEventListener( 'touchstart', onDown );
- this.domButtons.get( button ).remove();
- return this;
- }
- set filteredIndex( index ) {
- if ( this.currentFiltered ) {
- const buttonDOM = this.domButtons.get( this.currentFiltered.button );
- buttonDOM.classList.remove( 'active' );
- this.currentFiltered = null;
- }
- const filteredItem = this.filtered[ index ];
- if ( filteredItem ) {
- const buttonDOM = this.domButtons.get( filteredItem.button );
- buttonDOM.classList.add( 'active' );
- this.currentFiltered = filteredItem;
- }
- this.updateFilter();
- }
- get filteredIndex() {
- return this.currentFiltered ? this.filtered.indexOf( this.currentFiltered ) : null;
- }
- filter( text ) {
- text = filterString( text );
- const filtered = [];
- for ( const button of this.buttons ) {
- const buttonDOM = this.domButtons.get( button );
- buttonDOM.remove();
- const label = filterString( button.getValue() );
- if ( text && label.includes( text ) === true ) {
- const score = text.length / label.length;
- filtered.push( {
- button,
- score
- } );
- }
- }
- filtered.sort( ( a, b ) => b.score - a.score );
- this.filtered = filtered;
- this.filteredIndex = this.forceAutoComplete ? 0 : null;
- }
- updateFilter() {
- const filteredIndex = Math.min( this.filteredIndex, this.filteredIndex - 3 );
- for ( let i = 0; i < this.filtered.length; i ++ ) {
- const button = this.filtered[ i ].button;
- const buttonDOM = this.domButtons.get( button );
- buttonDOM.remove();
- if ( i >= filteredIndex ) {
- this.listDOM.append( buttonDOM );
- }
- }
- }
- }
- class SelectInput extends Input {
- constructor( options = [], value = null ) {
- const dom = document.createElement( 'select' );
- super( dom );
- dom.onchange = () => {
- this.dispatchEvent( new Event( 'change' ) );
- };
- dom.onmousedown = dom.ontouchstart = () => {
- this.dispatchEvent( new Event( 'click' ) );
- };
- this.setOptions( options, value );
- }
- setOptions( options, value = null ) {
- const dom = this.dom;
- const defaultValue = dom.value;
- let containsDefaultValue = false;
- this.options = options;
- dom.innerHTML = '';
- for ( let index = 0; index < options.length; index ++ ) {
- let opt = options[ index ];
- if ( typeof opt === 'string' ) {
- opt = { name: opt, value: index };
- }
- const option = document.createElement( 'option' );
- option.innerText = opt.name;
- option.value = opt.value;
- if ( containsDefaultValue === false && defaultValue === opt.value ) {
- containsDefaultValue = true;
- }
- dom.append( option );
- }
- dom.value = value !== null ? value : containsDefaultValue ? defaultValue : '';
- return this;
- }
- getOptions() {
- return this._options;
- }
- serialize( data ) {
- data.options = [ ...this.options ];
- super.serialize( data );
- }
- deserialize( data ) {
- const currentOptions = this.options;
- if ( currentOptions.length === 0 ) {
- this.setOptions( data.options );
- }
- super.deserialize( data );
- }
- }
- class ToggleInput extends Input {
- constructor( value = false ) {
- const dom = document.createElement( 'input' );
- super( dom );
- dom.type = 'checkbox';
- dom.className = 'toggle';
- dom.checked = value;
- dom.onclick = () => this.dispatchEvent( new Event( 'click' ) );
- dom.onchange = () => this.dispatchEvent( new Event( 'change' ) );
- }
- setValue( val ) {
- this.dom.checked = val;
- this.dispatchEvent( new Event( 'change' ) );
- return this;
- }
- getValue() {
- return this.dom.checked;
- }
- }
- var Flow = /*#__PURE__*/Object.freeze( {
- __proto__: null,
- Element: Element,
- Input: Input,
- Node: Node,
- Canvas: Canvas,
- Serializer: Serializer,
- Styles: Styles,
- ObjectNode: ObjectNode,
- PanelNode: PanelNode,
- Menu: Menu,
- ContextMenu: ContextMenu,
- CircleMenu: CircleMenu,
- Tips: Tips,
- Search: Search,
- DraggableElement: DraggableElement,
- LabelElement: LabelElement,
- TitleElement: TitleElement,
- ButtonInput: ButtonInput,
- ColorInput: ColorInput,
- NumberInput: NumberInput,
- SelectInput: SelectInput,
- SliderInput: SliderInput,
- StringInput: StringInput,
- TextInput: TextInput,
- ToggleInput: ToggleInput
- } );
- class Loader extends EventTarget {
- constructor( parseType = Loader.DEFAULT ) {
- super();
- this.parseType = parseType;
- this.events = {
- 'load': []
- };
- }
- setParseType( type ) {
- this.parseType = type;
- return this;
- }
- getParseType() {
- return this.parseType;
- }
- onLoad( callback ) {
- this.events.load.push( callback );
- return this;
- }
- async load( url, lib = null ) {
- return await fetch( url )
- .then( response => response.json() )
- .then( result => {
- this.data = this.parse( result, lib );
- dispatchEventList( this.events.load, this );
- return this.data;
- } )
- .catch( err => {
- console.error( 'Loader:', err );
- } );
- }
- parse( json, lib = null ) {
- json = this._parseObjects( json, lib );
- const parseType = this.parseType;
- if ( parseType === Loader.DEFAULT ) {
- const flowObj = new Flow[ json.type ]();
- if ( flowObj.getSerializable() ) {
- flowObj.deserialize( json );
- }
- return flowObj;
- } else if ( parseType === Loader.OBJECTS ) {
- return json;
- }
- }
- _parseObjects( json, lib = null ) {
- json = { ...json };
- const objects = {};
- for ( const id in json.objects ) {
- const obj = json.objects[ id ];
- obj.objects = objects;
- const Class = lib && lib[ obj.type ] ? lib[ obj.type ] : Flow[ obj.type ];
- if ( ! Class ) {
- console.error( `Class "${ obj.type }" not found!` );
- }
- objects[ id ] = new Class();
- }
- const ref = new WeakMap();
- const deserializePass = ( prop = null ) => {
- for ( const id in json.objects ) {
- const newObject = objects[ id ];
- if ( ref.has( newObject ) === false && ( prop === null || newObject[ prop ] === true ) ) {
- ref.set( newObject, true );
- if ( newObject.getSerializable() ) {
- newObject.deserialize( json.objects[ id ] );
- }
- }
- }
- };
- deserializePass( 'isNode' );
- deserializePass( 'isElement' );
- deserializePass( 'isInput' );
- deserializePass();
- json.objects = objects;
- return json;
- }
- }
- Loader.DEFAULT = 'default';
- Loader.OBJECTS = 'objects';
- export { ButtonInput, Canvas, CircleMenu, ColorInput, ContextMenu, DraggableElement, Element, Input, LabelElement, Loader, Menu, Node, NumberInput, ObjectNode, PanelNode, REVISION, Search, SelectInput, Serializer, SliderInput, StringInput, Styles, TextInput, Tips, TitleElement, ToggleInput, Utils };
|