diff --git a/pkg/arvo/app/link-view.hoon b/pkg/arvo/app/link-view.hoon index 8da8502e5..2cb87b4a0 100644 --- a/pkg/arvo/app/link-view.hoon +++ b/pkg/arvo/app/link-view.hoon @@ -7,6 +7,7 @@ :: /json/[p]/submissions pages for all groups :: /json/[p]/submissions/[some-group] page for one group :: /json/[p]/discussions/[wood-url]/[some-group] page for url in group +:: /json/[n]/submission/[wood-url]/[some-group] nth matching submission :: /+ *link, *server, default-agent, verb :: @@ -83,6 +84,10 @@ [%submissions ^] :_ this (give-initial-submissions:do p t.t.t.path) + :: + [%submission @ ^] + :_ this + (give-specific-submission:do p (break-discussion-path t.t.t.path)) :: [%discussions @ ^] :_ this @@ -258,6 +263,28 @@ :- %discussions (build-discussion-path path url.submission) :: +++ give-specific-submission + |= [n=@ud =path =url] + :_ [%give %kick ~ ~]~ + =; =json + [%give %fact ~ %json !>(json)] + %+ frond:enjs:format 'submission' + ^- json + =; sub=(unit submission) + ?~ sub ~ + (submission:en-json u.sub) + =/ =submissions + =- (~(got by -) path) + %+ scry-for (map ^path submissions) + [%submissions path] + |- + ?~ submissions ~ + =* sub i.submissions + ?. =(url.sub url) + $(submissions t.submissions) + ?: =(0 n) `sub + $(n (dec n), submissions t.submissions) +:: ++ give-initial-discussions |= [p=@ud =path =url] ^- (list card) diff --git a/pkg/arvo/app/link/js/index.js b/pkg/arvo/app/link/js/index.js index 245cfbc95..0dbaf3608 100644 --- a/pkg/arvo/app/link/js/index.js +++ b/pkg/arvo/app/link/js/index.js @@ -1 +1,60068 @@ -!function(e){"function"==typeof define&&define.amd?define("index",e):e()}(function(){"use strict";var e=("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}).performance||{},t=(e.now||e.mozNow||e.msNow||e.oNow||e.webkitNow,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{});function n(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e,t){return e(t={exports:{}},t.exports),t.exports}var a=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;var u=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,i=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;u2?n-2:0),i=2;i1?t-1:0),r=1;r2?n-2:0),i=2;i8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!e){if("undefined"!=typeof console){var a=r.map(function(e){return""+e});a.unshift("Warning: "+t),Function.prototype.apply.call(console.error,console,a)}try{var l=0,o="Warning: "+t.replace(/%s/g,function(){return r[l++]});throw new Error(o)}catch(e){}}},T={};function P(e,t){var n=e.constructor,r=n&&(n.displayName||n.name)||"ReactClass",i=r+"."+t;T[i]||(E(!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),T[i]=!0)}var L={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){P(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,r){P(e,"replaceState")},enqueueSetState:function(e,t,n,r){P(e,"setState")}},N={};function R(e,t,n){this.props=e,this.context=t,this.refs=N,this.updater=n||L}Object.freeze(N),R.prototype.isReactComponent={},R.prototype.setState=function(e,t){!function(){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw M(Error("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")},R.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var O={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)."]},D=function(e,t){Object.defineProperty(R.prototype,e,{get:function(){S(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var I in O)O.hasOwnProperty(I)&&D(I,O[I]);function U(){}function A(e,t,n){this.props=e,this.context=t,this.refs=N,this.updater=n||L}U.prototype=R.prototype;var j=A.prototype=new U;j.constructor=A,t(j,R.prototype),j.isPureReactComponent=!0;var z={current:null},H={suspense:null},F={current:null},Z=/^(.*)[\\\/]/,V=1;function W(e){if(null==e)return null;if("number"==typeof e.tag&&E(!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 l:return"Fragment";case a:return"Portal";case s:return"Profiler";case o:return"StrictMode";case p:return"Suspense";case m:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case f:return"Context.Consumer";case c:return"Context.Provider";case h:return r=e,i=e.render,u="ForwardRef",d=i.displayName||i.name||"",r.displayName||(""!==d?u+"("+d+")":u);case v:return W(e.type);case b:var t=(n=e)._status===V?n._result:null;if(t)return W(t)}var n,r,i,u,d;return null}var Y={},q=null;function $(e){q=e}Y.getCurrentStack=null,Y.getStackAddendum=function(){var e="";if(q){var t=W(q.type),n=q._owner;e+=function(e,t,n){var r="";if(t){var i=t.fileName,a=i.replace(Z,"");if(/^index\./.test(a)){var l=i.match(Z);if(l){var o=l[1];o&&(a=o.replace(Z,"")+"/"+a)}}r=" (at "+a+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(t,q._source,n&&W(n.type))}var r=Y.getCurrentStack;return r&&(e+=r()||""),e};var B={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:H,ReactCurrentOwner:F,IsSomeRendererActing:{current:!1},assign:t};t(B,{ReactDebugCurrentFrame:Y,ReactComponentTreeHook:{}});var Q,G,K=function(e,t){if(!e){for(var n=B.ReactDebugCurrentFrame.getStackAddendum(),r=arguments.length,i=new Array(r>2?r-2:0),a=2;a1){for(var c=Array(s),f=0;f.")}return t}(t);if(!_e[n]){_e[n]=!0;var r="";e&&e._owner&&e._owner!==F.current&&(r=" It was passed a child from "+W(e._owner.type)+"."),$(e),K(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',n,r),$(null)}}}function Me(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n",u=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,K(!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,u)}var f=re.apply(this,arguments);if(null==f)return f;if(o)for(var d=2;d 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,K(!1,"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Consumer}}}),n.Consumer=a,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(e){return null!=e&&e.$$typeof===v?E(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?E(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&E(!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)&&E(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:h,render:e}},lazy:function(e){var t,n,r={$$typeof:b,_ctor:e,_status:-1,_result:null};return Object.defineProperties(r,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){K(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(r,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){K(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(r,"propTypes",{enumerable:!0})}}}),r},memo:function(e,t){return ke(e)||E(!1,"memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:v,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return we().useCallback(e,t)},useContext:function(e,t){var n=we();if(void 0!==t&&K(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?K(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&K(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e,t)},useEffect:function(e,t){return we().useEffect(e,t)},useImperativeHandle:function(e,t,n){return we().useImperativeHandle(e,t,n)},useDebugValue:function(e,t){return we().useDebugValue(e,t)},useLayoutEffect:function(e,t){return we().useLayoutEffect(e,t)},useMemo:function(e,t){return we().useMemo(e,t)},useReducer:function(e,t,n){return we().useReducer(e,t,n)},useRef:function(e){return we().useRef(e)},useState:function(e){return we().useState(e)},Fragment:l,Profiler:s,StrictMode:o,Suspense:p,unstable_SuspenseList:m,createElement:Ee,cloneElement:function(e,n,r){for(var i=function(e,n,r){var i;!function(){if(null==e)throw M(Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+"."))}();var a,l=t({},e.props),o=e.key,u=e.ref,s=e._self,c=e._source,f=e._owner;if(null!=n)for(i in ee(n)&&(u=n.ref,f=F.current),te(n)&&(o=""+n.key),e.type&&e.type.defaultProps&&(a=e.type.defaultProps),n)X.call(n,i)&&!J.hasOwnProperty(i)&&(void 0===n[i]&&void 0!==a?l[i]=a[i]:l[i]=n[i]);var d=arguments.length-2;if(1===d)l.children=r;else if(d>1){for(var h=Array(d),p=0;p=x},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125T(l,n))void 0!==u&&0>T(u,l)?(e[r]=u,e[o]=n,r=o):(e[r]=l,e[a]=n,r=a);else{if(!(void 0!==u&&0>T(u,n)))break e;e[r]=u,e[o]=n,r=o}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var P=[],L=[],N=1,R=null,O=3,D=!1,I=!1,U=!1;function A(e){for(var t=S(L);null!==t;){if(null===t.callback)E(L);else{if(!(t.startTime<=e))break;E(L),t.sortIndex=t.expirationTime,M(P,t)}t=S(L)}}function j(e){if(U=!1,A(e),!I)if(null!==S(P))I=!0,n(z);else{var t=S(L);null!==t&&r(j,t.startTime-e)}}function z(e,n){I=!1,U&&(U=!1,i()),D=!0;var l=O;try{for(A(n),R=S(P);null!==R&&(!(R.expirationTime>n)||e&&!a());){var o=R.callback;if(null!==o){R.callback=null,O=R.priorityLevel;var u=o(R.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?R.callback=u:R===S(P)&&E(P),A(n)}else E(P);R=S(P)}if(null!==R)var s=!0;else{var c=S(L);null!==c&&r(j,c.startTime-n),s=!1}return s}finally{R=null,O=l,D=!1}}function H(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var F=l;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=O;O=e;try{return t()}finally{O=n}},t.unstable_next=function(e){switch(O){case 1:case 2:case 3:var t=3;break;default:t=O}var n=O;O=t;try{return e()}finally{O=n}},t.unstable_scheduleCallback=function(e,a,l){var o=t.unstable_now();if("object"==typeof l&&null!==l){var u=l.delay;u="number"==typeof u&&0o?(e.sortIndex=u,M(L,e),null===S(P)&&e===S(L)&&(U?i():U=!0,r(j,u-o))):(e.sortIndex=l,M(P,e),I||D||(I=!0,n(z))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=O;return function(){var n=O;O=t;try{return e.apply(this,arguments)}finally{O=n}}},t.unstable_getCurrentPriorityLevel=function(){return O},t.unstable_shouldYield=function(){var e=t.unstable_now();A(e);var n=S(P);return n!==R&&null!==R&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime=_},a=function(){},t.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):x=e>0?Math.floor(1e3/e):33.33};var C=new MessageChannel,M=C.port2;C.port1.onmessage=function(){if(null!==k){var e=t.unstable_now();_=e+x;try{k(!0,e)?M.postMessage(null):(g=!1,k=null)}catch(e){throw M.postMessage(null),e}}else g=!1},e=function(e){k=e,g||(g=!0,M.postMessage(null))},n=function(e,n){w=p(function(){e(t.unstable_now())},n)},r=function(){m(w),w=-1}}function S(e,t){var n=e.length;e.push(t),function(e,t,n){var r=n;for(;;){var i=Math.floor((r-1)/2),a=e[i];if(!(void 0!==a&&P(a,t)>0))return;e[i]=t,e[r]=a,r=i}}(e,t,n)}function E(e){var t=e[0];return void 0===t?null:t}function T(e){var t=e[0];if(void 0!==t){var n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){var r=n,i=e.length;for(;rq){if((q*=2)>Y)return console.error("Scheduler Profiling: Event log exceeded maximum size. Don't forget to call `stopLoggingProfilingEvents()`."),void ae();var n=new Int32Array(4*q);n.set(B),$=n.buffer,B=n}B.set(e,t)}}function ae(){var e=$;return q=0,$=null,B=null,Q=0,e}function le(e,t){z[V]++,null!==B&&ie([G,t,e.id,e.priorityLevel])}function oe(e,t){z[H]=L,z[F]=0,z[V]--,null!==B&&ie([K,t,e.id])}function ue(e,t){z[H]=L,z[F]=0,z[Z]=0,null!==B&&ie([te,t,e.id,U])}var se=-1,ce=250,fe=5e3,de=1e4,he=1073741823,pe=[],me=[],ve=1,be=null,ye=O,ge=!1,ke=!1,we=!1;function xe(e){for(var t=E(me);null!==t;){if(null===t.callback)T(me);else{if(!(t.startTime<=e))return;T(me),t.sortIndex=t.expirationTime,S(pe,t),le(t,e),t.isQueued=!0}t=E(me)}}function _e(t){if(we=!1,xe(t),!ke)if(null!==E(pe))ke=!0,e(Ce);else{var r=E(me);null!==r&&n(_e,r.startTime-t)}}function Ce(e,n){var i;i=n,null!==B&&ie([re,i,A]),ke=!1,we&&(we=!1,r()),ge=!0;var a=ye;try{if(!o)return Me(e,n);try{return Me(e,n)}catch(e){if(null!==be){var l=t.unstable_now();!function(e,t){z[H]=L,z[F]=0,z[V]--,null!==B&&ie([X,t,e.id])}(be,l),be.isQueued=!1}throw e}}finally{be=null,ye=a,ge=!1,function(e){A++,null!==B&&ie([ne,e,A])}(t.unstable_now())}}function Me(e,r){var a,o,u=r;for(xe(u),be=E(pe);null!==be&&!l&&(!(be.expirationTime>u)||e&&!i());){var s=be.callback;if(null!==s){be.callback=null,ye=be.priorityLevel;var c=be.expirationTime<=u;a=be,o=u,U++,z[H]=a.priorityLevel,z[F]=a.id,z[Z]=U,null!==B&&ie([ee,o,a.id,U]);var f=s(c);u=t.unstable_now(),"function"==typeof f?(be.callback=f,ue(be,u)):(oe(be,u),be.isQueued=!1,be===E(pe)&&T(pe)),xe(u)}else T(pe);be=E(pe)}if(null!==be)return!0;var d=E(me);return null!==d&&n(_e,d.startTime-u),!1}function Se(e){switch(e){case N:return se;case R:return ce;case I:return he;case D:return de;case O:default:return fe}}var Ee=a,Te={startLoggingProfilingEvents:function(){q=W,$=new ArrayBuffer(4*q),B=new Int32Array($),Q=0},stopLoggingProfilingEvents:ae,sharedProfilingBuffer:j};t.unstable_ImmediatePriority=N,t.unstable_UserBlockingPriority=R,t.unstable_NormalPriority=O,t.unstable_IdlePriority=I,t.unstable_LowPriority=D,t.unstable_runWithPriority=function(e,t){switch(e){case N:case R:case O:case D:case I:break;default:e=O}var n=ye;ye=e;try{return t()}finally{ye=n}},t.unstable_next=function(e){var t;switch(ye){case N:case R:case O:t=O;break;default:t=ye}var n=ye;ye=t;try{return e()}finally{ye=n}},t.unstable_scheduleCallback=function(i,a,l){var o,u,s=t.unstable_now();if("object"==typeof l&&null!==l){var c=l.delay;o="number"==typeof c&&c>0?s+c:s,u="number"==typeof l.timeout?l.timeout:Se(i)}else u=Se(i),o=s;var f=o+u,d={id:ve++,callback:a,priorityLevel:i,startTime:o,expirationTime:f,sortIndex:-1,isQueued:!1};return o>s?(d.sortIndex=o,S(me,d),null===E(pe)&&d===E(me)&&(we?r():we=!0,n(_e,o-s))):(d.sortIndex=f,S(pe,d),le(d,s),d.isQueued=!0,ke||ge||(ke=!0,e(Ce))),d},t.unstable_cancelCallback=function(e){e.isQueued&&(function(e,t){z[V]--,null!==B&&ie([J,t,e.id])}(e,t.unstable_now()),e.isQueued=!1),e.callback=null},t.unstable_wrapCallback=function(e){var t=ye;return function(){var n=ye;ye=t;try{return e.apply(this,arguments)}finally{ye=n}}},t.unstable_getCurrentPriorityLevel=function(){return ye},t.unstable_shouldYield=function(){var e=t.unstable_now();xe(e);var n=E(pe);return n!==be&&null!==be&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime