diff --git a/pkg/arvo/app/chat.hoon b/pkg/arvo/app/chat.hoon index 01f18e885..76eebb4fc 100644 --- a/pkg/arvo/app/chat.hoon +++ b/pkg/arvo/app/chat.hoon @@ -69,8 +69,6 @@ :- [ost.bol %poke /chat [our.bol %launch] launcha]~ this(sta u.old) :: -:: -:: ++ construct-tile-json |= str=streams ^- json @@ -101,7 +99,6 @@ ++ peer-primary |= wir=wire ^- (quip move _this) - ~& (lent (prey:pubsub:userlib /primary bol)) =* messages messages.str.sta =/ lismov/(list move) %+ murn ~(tap by messages) @@ -152,10 +149,11 @@ |= [=bone *] [bone %diff %chat-update upd] :: + =/ jon/json (construct-tile-json str) =/ tile-updates/(list move) %+ turn (prey:pubsub:userlib /chattile bol) |= [=bone *] - [bone %diff %json (construct-tile-json str)] + [bone %diff %json jon] :: %+ weld updates @@ -263,7 +261,6 @@ |= [shp=@p stat=status:hall] shp (~(put by acc) cir newset) - ~& nes.piz =/ str %= str.sta messages (~(put by messages) circle nes.piz) @@ -452,7 +449,6 @@ (send-chat-update [[%delete affectedcir] str]) :: if we get a delete from another ship, delete our fake circle copy :: - ~& %deletefake =/ deletefake/poke :- %hall-action [%delete nom.fakecir ~] @@ -464,6 +460,18 @@ %+ weld (send-chat-update [[%inbox newinbox] str]) (send-chat-update [[%delete affectedcir] str]) + :: + :: %remove: remove a circle + :: + %remove + =/ str + %= str.sta + configs (~(del by configs.str.sta) circ) + messages (~(del by messages.str.sta) circ) + peers (~(del by peers.str.sta) circ) + == + :- (send-chat-update [[%delete circ] str]) + this(str.sta str) :: == :: end of branching on dif.sto type diff --git a/pkg/arvo/app/chat/js/index.js b/pkg/arvo/app/chat/js/index.js index 0f91a8ec0..9ef78ba2f 100644 --- a/pkg/arvo/app/chat/js/index.js +++ b/pkg/arvo/app/chat/js/index.js @@ -1 +1 @@ -!function(e){"function"==typeof define&&define.amd?define("index",e):e()}(function(){"use strict";var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e,t){return e(t={exports:{}},t.exports),t.exports}var a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;var l=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s2?n-2:0),a=2;a1?t-1:0),r=1;r2?n-2:0),a=2;a8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!e){if("undefined"!=typeof console){var i=r.map(function(e){return""+e});i.unshift("Warning: "+t),Function.prototype.apply.call(console.error,console,i)}try{var o=0,l="Warning: "+t.replace(/%s/g,function(){return r[o++]});throw new Error(l)}catch(e){}}},D={};function E(e,t){var n=e.constructor,r=n&&(n.displayName||n.name)||"ReactClass",a=r+"."+t;D[a]||(C(!1,"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,r),D[a]=!0)}var T={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){E(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,r){E(e,"replaceState")},enqueueSetState:function(e,t,n,r){E(e,"setState")}},N={};function M(e,t,n){this.props=e,this.context=t,this.refs=N,this.updater=n||T}Object.freeze(N),M.prototype.isReactComponent={},M.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&x(!1,"setState(...): takes an object of state variables to update or a function which returns an object of state variables."),this.updater.enqueueSetState(this,e,t,"setState")},M.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var S={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},I=function(e,t){Object.defineProperty(M.prototype,e,{get:function(){k(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var R in S)S.hasOwnProperty(R)&&I(R,S[R]);function O(){}function P(e,t,n){this.props=e,this.context=t,this.refs=N,this.updater=n||T}O.prototype=M.prototype;var L=P.prototype=new O;L.constructor=P,t(L,M.prototype),L.isPureReactComponent=!0;var B={current:null,currentDispatcher:null},A=/^(.*)[\\\/]/,j=1;function U(e){if(null==e)return null;if("number"==typeof e.tag&&C(!1,"Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case d:return"ConcurrentMode";case o:return"Fragment";case i:return"Portal";case u:return"Profiler";case s:return"StrictMode";case h:return"Suspense"}if("object"==typeof e)switch(e.$$typeof){case f:return"Context.Consumer";case c:return"Context.Provider";case p:return r=e,a=e.render,l="ForwardRef",g=a.displayName||a.name||"",r.displayName||(""!==g?l+"("+g+")":l);case m:return U(e.type);case b:var t=(n=e)._status===j?n._result:null;if(t)return U(t)}var n,r,a,l,g;return null}var z={},F=null;function W(e){F=e}z.getCurrentStack=null,z.getStackAddendum=function(){var e="";if(F){var t=U(F.type),n=F._owner;e+=function(e,t,n){var r="";if(t){var a=t.fileName,i=a.replace(A,"");if(/^index\./.test(i)){var o=a.match(A);if(o){var l=o[1];l&&(i=l.replace(A,"")+"/"+i)}}r=" (at "+i+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(t,F._source,n&&U(n.type))}var r=z.getCurrentStack;return r&&(e+=r()||""),e};var Z={ReactCurrentOwner:B,assign:t};t(Z,{ReactDebugCurrentFrame:z,ReactComponentTreeHook:{}});var H=function(e,t){if(!e){for(var n=Z.ReactDebugCurrentFrame.getStackAddendum(),r=arguments.length,a=Array(r>2?r-2:0),i=2;i1){for(var c=Array(u),f=0;f.")}return t}(t);if(!ge[n]){ge[n]=!0;var r="";e&&e._owner&&e._owner!==B.current&&(r=" It was passed a child from "+U(e._owner.type)+"."),W(e),H(!1,'Each child in an array or iterator should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',n,r),W(null)}}}function ye(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n",i=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,H(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,i)}var u=X.apply(this,arguments);if(null==u)return u;if(r)for(var c=2;c is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Provider},set:function(e){n.Provider=e}},_currentValue:{get:function(){return n._currentValue},set:function(e){n._currentValue=e}},_currentValue2:{get:function(){return n._currentValue2},set:function(e){n._currentValue2=e}},_threadCount:{get:function(){return n._threadCount},set:function(e){n._threadCount=e}},Consumer:{get:function(){return r||(r=!0,H(!1,"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Consumer}}}),n.Consumer=i,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(e){return null!=e&&e.$$typeof===m?C(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?C(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&C(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null!=e.defaultProps||null!=e.propTypes)&&C(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:p,render:e}},lazy:function(e){return{$$typeof:b,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return he(e)||C(!1,"memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:m,type:e,compare:void 0===t?null:t}},Fragment:o,StrictMode:s,Suspense:h,createElement:we,cloneElement:function(e,n,r){for(var a=function(e,n,r){null==e&&x(!1,"React.cloneElement(...): The argument must be a React element, but you passed %s.",e);var a=void 0,i=t({},e.props),o=e.key,l=e.ref,s=e._self,u=e._source,c=e._owner;if(null!=n){q(n)&&(l=n.ref,c=B.current),Q(n)&&(o=""+n.key);var f=void 0;for(a in e.type&&e.type.defaultProps&&(f=e.type.defaultProps),n)G.call(n,a)&&!Y.hasOwnProperty(a)&&(void 0===n[a]&&void 0!==f?i[a]=f[a]:i[a]=n[a])}var d=arguments.length-2;if(1===d)i.children=r;else if(d>1){for(var p=Array(d),h=0;h=t){n=e;break}e=e.next}while(e!==r);null===n?n=r:n===r&&(r=s,c()),(t=n.previous).next=n.previous=s,s.next=n,s.previous=t}}function d(){if(-1===o&&null!==r&&1===r.priorityLevel){s=!0;try{do{f()}while(null!==r&&1===r.priorityLevel)}finally{s=!1,null!==r?c():u=!1}}}function p(e){s=!0;var t=a;a=e;try{if(e)for(;null!==r;){var i=n.unstable_now();if(!(r.expirationTime<=i))break;do{f()}while(null!==r&&r.expirationTime<=i)}else if(null!==r)do{f()}while(null!==r&&!D())}finally{s=!1,a=t,null!==r?c():u=!1,d()}}var h,m,b=Date,g="function"==typeof setTimeout?setTimeout:void 0,v="function"==typeof clearTimeout?clearTimeout:void 0,y="function"==typeof requestAnimationFrame?requestAnimationFrame:void 0,_="function"==typeof cancelAnimationFrame?cancelAnimationFrame:void 0;function w(e){h=y(function(t){v(m),e(t)}),m=g(function(){_(h),e(n.unstable_now())},100)}if("object"==typeof performance&&"function"==typeof performance.now){var x=performance;n.unstable_now=function(){return x.now()}}else n.unstable_now=function(){return b.now()};var k,C,D,E=null;if("undefined"!=typeof window?E=window:void 0!==e&&(E=e),E&&E._schedMock){var T=E._schedMock;k=T[0],C=T[1],D=T[2],n.unstable_now=T[3]}else if("undefined"==typeof window||"function"!=typeof MessageChannel){var N=null,M=function(e){if(null!==N)try{N(e)}finally{N=null}};k=function(e){null!==N?setTimeout(k,0,e):(N=e,setTimeout(M,0,!1))},C=function(){N=null},D=function(){return!1}}else{"undefined"!=typeof console&&("function"!=typeof y&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof _&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var S=null,I=!1,R=-1,O=!1,P=!1,L=0,B=33,A=33;D=function(){return L<=n.unstable_now()};var j=new MessageChannel,U=j.port2;j.port1.onmessage=function(){I=!1;var e=S,t=R;S=null,R=-1;var r=n.unstable_now(),a=!1;if(0>=L-r){if(!(-1!==t&&t<=r))return O||(O=!0,w(z)),S=e,void(R=t);a=!0}if(null!==e){P=!0;try{e(a)}finally{P=!1}}};var z=function(e){if(null!==S){w(z);var t=e-L+A;tt&&(t=8),A=tt?U.postMessage(void 0):O||(O=!0,w(z))},C=function(){S=null,I=!1,R=-1}}n.unstable_ImmediatePriority=1,n.unstable_UserBlockingPriority=2,n.unstable_NormalPriority=3,n.unstable_IdlePriority=5,n.unstable_LowPriority=4,n.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=i,a=o;i=e,o=n.unstable_now();try{return t()}finally{i=r,o=a,d()}},n.unstable_next=function(e){switch(i){case 1:case 2:case 3:var t=3;break;default:t=i}var r=i,a=o;i=t,o=n.unstable_now();try{return e()}finally{i=r,o=a,d()}},n.unstable_scheduleCallback=function(e,t){var a=-1!==o?o:n.unstable_now();if("object"==typeof t&&null!==t&&"number"==typeof t.timeout)t=a+t.timeout;else switch(i){case 1:t=a+-1;break;case 2:t=a+250;break;case 5:t=a+1073741823;break;case 4:t=a+1e4;break;default:t=a+5e3}if(e={callback:e,priorityLevel:i,expirationTime:t,next:null,previous:null},null===r)r=e.next=e.previous=e,c();else{a=null;var l=r;do{if(l.expirationTime>t){a=l;break}l=l.next}while(l!==r);null===a?a=r:a===r&&(r=e,c()),(t=a.previous).next=a.previous=e,e.next=a,e.previous=t}return e},n.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(t===e)r=null;else{e===r&&(r=t);var n=e.previous;n.next=t,t.previous=n}e.next=e.previous=null}},n.unstable_wrapCallback=function(e){var t=i;return function(){var r=i,a=o;i=t,o=n.unstable_now();try{return e.apply(this,arguments)}finally{i=r,o=a,d()}}},n.unstable_getCurrentPriorityLevel=function(){return i},n.unstable_shouldYield=function(){return!a&&(null!==r&&r.expirationTime=i){c=f;break}f=f.next}while(f!==p);null===c?c=p:c===p&&(p=u,w());var d=c.previous;d.next=c.previous=u,u.next=c,u.previous=d}}}function k(){if(-1===b&&null!==p&&p.priorityLevel===r){v=!0;try{do{x()}while(null!==p&&p.priorityLevel===r)}finally{v=!1,null!==p?w():y=!1}}}function C(e){v=!0;var r=h;h=e;try{if(e)for(;null!==p&&!t;){var a=n.unstable_now();if(!(p.expirationTime<=a))break;do{x()}while(null!==p&&p.expirationTime<=a&&!t)}else if(null!==p)do{x()}while(null!==p&&!M())}finally{v=!1,h=r,null!==p?w():y=!1,k()}}var D,E,T,N,M,S=Date,I="function"==typeof setTimeout?setTimeout:void 0,R="function"==typeof clearTimeout?clearTimeout:void 0,O="function"==typeof requestAnimationFrame?requestAnimationFrame:void 0,P="function"==typeof cancelAnimationFrame?cancelAnimationFrame:void 0,L=function(e){D=O(function(t){R(E),e(t)}),E=I(function(){P(D),e(n.unstable_now())},100)};if(_){var B=performance;n.unstable_now=function(){return B.now()}}else n.unstable_now=function(){return S.now()};var A=null;if("undefined"!=typeof window?A=window:void 0!==e&&(A=e),A&&A._schedMock){var j=A._schedMock;T=j[0],N=j[1],M=j[2],n.unstable_now=j[3]}else if("undefined"==typeof window||"function"!=typeof MessageChannel){var U=null,z=function(e){if(null!==U)try{U(e)}finally{U=null}};T=function(e,t){null!==U?setTimeout(T,0,e):(U=e,setTimeout(z,0,!1))},N=function(){U=null},M=function(){return!1}}else{"undefined"!=typeof console&&("function"!=typeof O&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof P&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var F=null,W=!1,Z=-1,H=!1,G=!1,Y=0,V=33,$=33;M=function(){return Y<=n.unstable_now()};var q=new MessageChannel,Q=q.port2;q.port1.onmessage=function(e){W=!1;var t=F,r=Z;F=null,Z=-1;var a=n.unstable_now(),i=!1;if(Y-a<=0){if(!(-1!==r&&r<=a))return H||(H=!0,L(K)),F=t,void(Z=r);i=!0}if(null!==t){G=!0;try{t(i)}finally{G=!1}}};var K=function(e){if(null!==F){L(K);var t=e-Y+$;t<$&&V<$?(t<8&&(t=8),$=th){y=_;break}_=_.next}while(_!==p);null===y?y=p:y===p&&(p=v,w());var x=y.previous;x.next=y.previous=v,v.next=y,v.previous=x}return v},n.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(t===e)p=null;else{e===p&&(p=t);var n=e.previous;n.next=t,t.previous=n}e.next=e.previous=null}},n.unstable_wrapCallback=function(e){var t=m;return function(){var r=m,a=b;m=t,b=n.unstable_now();try{return e.apply(this,arguments)}finally{m=r,b=a,k()}}},n.unstable_getCurrentPriorityLevel=function(){return m},n.unstable_shouldYield=function(){return!h&&(null!==p&&p.expirationTimethis.eventPool.length&&this.eventPool.push(e)}function Se(e){e.eventPool=[],e.getPooled=Ne,e.release=Me}l(Te.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=De)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=De)},persist:function(){this.isPersistent=De},isPersistent:Ee,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Ee,this._dispatchInstances=this._dispatchListeners=null}}),Te.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Te.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var a=new t;return l(a,n.prototype),n.prototype=a,n.prototype.constructor=n,n.Interface=l({},r.Interface,e),n.extend=r.extend,Se(n),n},Se(Te);var Ie=Te.extend({data:null}),Re=Te.extend({data:null}),Oe=[9,13,27,32],Pe=ce&&"CompositionEvent"in window,Le=null;ce&&"documentMode"in document&&(Le=document.documentMode);var Be=ce&&"TextEvent"in window&&!Le,Ae=ce&&(!Pe||Le&&8=Le),je=String.fromCharCode(32),Ue={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},ze=!1;function Fe(e,t){switch(e){case"keyup":return-1!==Oe.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function We(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ze=!1;var He={eventTypes:Ue,extractEvents:function(e,t,n,r){var a=void 0,i=void 0;if(Pe)e:{switch(e){case"compositionstart":a=Ue.compositionStart;break e;case"compositionend":a=Ue.compositionEnd;break e;case"compositionupdate":a=Ue.compositionUpdate;break e}a=void 0}else Ze?Fe(e,n)&&(a=Ue.compositionEnd):"keydown"===e&&229===n.keyCode&&(a=Ue.compositionStart);return a?(Ae&&"ko"!==n.locale&&(Ze||a!==Ue.compositionStart?a===Ue.compositionEnd&&Ze&&(i=Ce()):(xe="value"in(we=r)?we.value:we.textContent,Ze=!0)),a=Ie.getPooled(a,t,n,r),i?a.data=i:null!==(i=We(n))&&(a.data=i),ue(a),i=a):i=null,(e=Be?function(e,t){switch(e){case"compositionend":return We(t);case"keypress":return 32!==t.which?null:(ze=!0,je);case"textInput":return(e=t.data)===je&&ze?null:e;default:return null}}(e,n):function(e,t){if(Ze)return"compositionend"===e||!Pe&&Fe(e,t)?(e=Ce(),ke=xe=we=null,Ze=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1