@jointhedots/core 2.0.21 → 2.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/export.react.js CHANGED
@@ -1,4 +1,4 @@
1
- import{h as g,i as U,m as k}from"./chunk.3AAAY44Q.js";import{a as v,c as y,d as L}from"./chunk.YVZWYQZG.js";import"./chunk.H26D4GQC.js";import{z as a}from"zod";function Ie(r){let e=r||a.record(a.string(),a.any());return{$spec:"spec://jointhedots.org/view.react",version:"0.0",properties:a.object({props:e,requirements:a.object({servicePoints:a.record(a.string(),a.object({service:a.string().optional(),cardinality:a.number().optional()})).optional()}).optional()}),isAssignable(t){return t.$spec=this.$spec}}}var q=v.subservice("react"),Ve=v.subservice("webc");import{useEffect as z,useState as _}from"react";function ke(r,e,t){let[i,o]=_(e);return z(()=>{r().then(o,console.error)},t),i}import w from"react";import{jsx as f}from"react/jsx-runtime";var x=class{constructor(e,t){this.value=e;this.updateTimeout=t}promise=null;dispatch=null;updateTimer=null;shallUpdate=!0;updater;deps;use(e,t){if(this.updater=e,t!==this.deps){let i=this.deps;if(this.deps=t,t?.length===i?.length){if(t){for(let o=0;o<t.length;o++)if(t[o]!==i[o])return this.update()}}else return this.update()}}initiate(e){this.dispatch=e,this.dispatch(this.value)}cancelAutoUpdate(){this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)}scheduleAutoUpdate(){this.cancelAutoUpdate(),this.shallUpdate?this.update():this.updateTimeout>0&&(this.updateTimer=setTimeout(()=>{this.updateTimer=null,this.update()},this.updateTimeout))}get isWaiting(){return this.promise!==null}get hasState(){return this.value!==void 0}get autoUpdate(){return this.updateTimeout}set autoUpdate(e){this.updateTimeout=e,this.cancelAutoUpdate(),this.update()}set(e){this.value!==e&&(this.value=e,this.dispatch&&this.dispatch(e))}get(){return this.value}update(){try{if(this.promise)this.shallUpdate=!0,this.cancelAutoUpdate();else{let e=this.updater();this.shallUpdate=!1,e instanceof Promise?(this.promise=e,e.then(t=>{this.promise=null,this.set(t),this.scheduleAutoUpdate()},t=>{this.promise=null,this.scheduleAutoUpdate(),console.log(t)})):this.scheduleAutoUpdate()}}catch(e){this.scheduleAutoUpdate(),console.log(e)}}cancel(){this.dispatch=null,this.promise=null,this.updateTimeout=0,this.cancelAutoUpdate()}waiting(e){return this.isWaiting==!0?f(h,{}):e(this.value)}using(e){return this.hasState==!1?f(h,{}):e(this.value)}};function Ne(r,e,t,i){let[o]=w.useState(()=>new x(t,i)),[s,n]=w.useState(t);return o.use(r,e),w.useEffect(()=>(o.initiate(n),()=>o.cancel()),null),o}function Ae(r,...e){for(let t of e)if(t.isWaiting==!0)return f(h,{});return r()}function Me(r,...e){for(let t of e)if(t.hasState==!1)return f(h,{});return r()}function h(){return f("div",{children:"..."})}import I,{useContext as ee,useEffect as H,useMemo as te,useState as re}from"react";import{Spinner as O}from"react-lightning-design-system";import P,{createContext as X}from"react";var Q=`.JDT-ErrorBoundary {
1
+ import{h as y,i as U,m as L}from"./chunk.3AAAY44Q.js";import{a as v,c as w,d as q}from"./chunk.YVZWYQZG.js";import"./chunk.H26D4GQC.js";import{z as a}from"zod";function Ve(t){let e=t||a.record(a.string(),a.any());return{$spec:"spec://jointhedots.org/view.react",version:"0.0",properties:a.object({props:e,requirements:a.object({servicePoints:a.record(a.string(),a.object({service:a.string().optional(),cardinality:a.number().optional()})).optional()}).optional()}),isAssignable(r){return r.$spec=this.$spec}}}var N=v.subservice("react"),ke=v.subservice("webc");import{useEffect as K,useState as z}from"react";function qe(t,e,r){let[o,i]=z(e);return K(()=>{t().then(i,console.error)},r),o}import T from"react";import{jsx as f}from"react/jsx-runtime";var x=class{constructor(e,r){this.value=e;this.updateTimeout=r}promise=null;dispatch=null;updateTimer=null;shallUpdate=!0;updater;deps;use(e,r){if(this.updater=e,r!==this.deps){let o=this.deps;if(this.deps=r,r?.length===o?.length){if(r){for(let i=0;i<r.length;i++)if(r[i]!==o[i])return this.update()}}else return this.update()}}initiate(e){this.dispatch=e,this.dispatch(this.value)}cancelAutoUpdate(){this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)}scheduleAutoUpdate(){this.cancelAutoUpdate(),this.shallUpdate?this.update():this.updateTimeout>0&&(this.updateTimer=setTimeout(()=>{this.updateTimer=null,this.update()},this.updateTimeout))}get isWaiting(){return this.promise!==null}get hasState(){return this.value!==void 0}get autoUpdate(){return this.updateTimeout}set autoUpdate(e){this.updateTimeout=e,this.cancelAutoUpdate(),this.update()}set(e){this.value!==e&&(this.value=e,this.dispatch&&this.dispatch(e))}get(){return this.value}update(){try{if(this.promise)this.shallUpdate=!0,this.cancelAutoUpdate();else{let e=this.updater();this.shallUpdate=!1,e instanceof Promise?(this.promise=e,e.then(r=>{this.promise=null,this.set(r),this.scheduleAutoUpdate()},r=>{this.promise=null,this.scheduleAutoUpdate(),console.log(r)})):this.scheduleAutoUpdate()}}catch(e){this.scheduleAutoUpdate(),console.log(e)}}cancel(){this.dispatch=null,this.promise=null,this.updateTimeout=0,this.cancelAutoUpdate()}waiting(e){return this.isWaiting==!0?f(m,{}):e(this.value)}using(e){return this.hasState==!1?f(m,{}):e(this.value)}};function Me(t,e,r,o){let[i]=T.useState(()=>new x(r,o)),[s,n]=T.useState(r);return i.use(t,e),T.useEffect(()=>(i.initiate(n),()=>i.cancel()),null),i}function Ae(t,...e){for(let r of e)if(r.isWaiting==!0)return f(m,{});return t()}function _e(t,...e){for(let r of e)if(r.hasState==!1)return f(m,{});return t()}function m(){return f("div",{children:"..."})}import D,{useContext as ie,useEffect as A,useMemo as oe,useState as ne}from"react";import G,{createContext as X,useContext as Y,useMemo as ee}from"react";var Q=`.JDT-ErrorBoundary {
2
2
  background-color: rgb(216, 59, 59);
3
3
  padding: 5px;
4
4
  overflow: hidden;
@@ -14,4 +14,39 @@ import{h as g,i as U,m as k}from"./chunk.3AAAY44Q.js";import{a as v,c as y,d as
14
14
  }
15
15
  .JDT-ErrorBoundary > .btn:hover {
16
16
  background-color: rgb(255, 142, 142);
17
- }`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(Q));import{jsx as T,jsxs as G}from"react/jsx-runtime";var p=class extends P.Component{render(){let{error:e,onRetry:t}=this.props,i=`${e.name}: ${e.message}`;return G("div",{className:"JDT-ErrorBoundary",title:i,children:[T("pre",{className:"msg",children:i}),t&&T("button",{className:"btn",onClick:t,children:"Retry"})]})}},M=X(null),N=class extends P.Component{static contextType=M;state={};componentDidCatch(e){let{context:t}=this,i=t?.getErrorDisplayer(e)||Y(e);this.setState({error:e,displayer:i})}render(){let{error:e}=this.state;if(e){let t=this.state.displayer;return T(t,{error:e,onRetry:()=>this.setState({error:void 0})})}else return this.props.children||null}},A=class extends P.Component{static contextType=M;getErrorDisplayer(e){for(let t=e;t;t=Object.getPrototypeOf(t)){let i=t.constructor;for(let o=this;o;o=o.context)if(o.props.errorClass===i)return o.props.errorDisplayer}return null}render(){return this.props.children||null}};function Y(r){for(let e=r;e;e=Object.getPrototypeOf(e)){let t=e.constructor,i=C.get(t);if(i)return i}return null}var C=new Map;C.set(Error,p);function Ze(r,e){C.set(r,e)}import{jsx as m,jsxs as ce}from"react/jsx-runtime";var oe=(o=>(o[o.NotReady=0]="NotReady",o[o.Loading=1]="Loading",o[o.Ready=2]="Ready",o[o.Failed=3]="Failed",o))(oe||{}),d=class extends Error{constructor(t,i){super(`Missing service point: ${t.map(o=>o.id).join(", ")}`);this.missings=t;this.requireds=i}},R=class{consumers=new Set;getService(e){return e.services}addController(e){this.consumers.add(e)}removeController(e){return this.consumers.delete(e)}onServiceChangeHandler=e=>{for(let t of this.consumers)t.notifyChange(e)}},b=class{constructor(e){this.controller=e}getService(e){return this.controller.getService(e)}},E=class{constructor(e,t,i,o){this.support=e;this.requireds=t;this.requirements=i;this.onUpdate=o;e.addController(this)}services=new Map;provider=null;state=null;get status(){return this.state instanceof Promise?1:this.state instanceof d?3:this.state===null?0:2}get error(){if(this.state instanceof d)return this.state}getService(e){let t=this.services.get(e);return!t&&this.support&&(t=this.support.getService(e),this.services.set(e,this.support.getService(e))),e.services}notifyChange(e){this.services.has(e)&&this.update()}updateState(e){let t=this.state;t!==e&&(this.state=e,this.onUpdate?.(e,t,this))}update(){let{requireds:e,requirements:t}=this,i=[],o=null;function s(n){o||(o=new d([])),o.missings.includes(n)||o.missings.push(n)}if(e)for(let n of e)if(n.ready){let c=n.services;c&&this.services.set(n,c)}else i.push(n.fetch());if(t){let{servicePoints:n}=t;for(let c in n){let u=k(c);if(u.ready){let D=u.services,S=n[c];S.service&&u.service!==S.service||D.length<(S.cardinality||1)?s(u):this.services.set(u,D)}else i.push(u.fetch())}}if(i.length>0){let n=Promise.all(i).then(()=>this.update());return this.updateState(n),n}else o?this.updateState(o):(this.provider=new b(this),this.updateState(this.provider));return null}dispose(){this.support&&(this.support.removeController(this),this.support=null)}},V=new R;g(V.onServiceChangeHandler);var ie=I.createContext(V),J=I.createContext(V);function Xe(r){H(()=>{let e=g(r);return()=>U(e)},[r])}function ne(r,e){let t=I.useContext(J);if(!t)return console.error("Wrap in <MountServicePoints> before using service point:",r.id),null;let i=t.getService(r);if(i.length<(e===void 0?1:e))throw new d([r],[r]);return i}function Ye(r,e){return ne(r,e?0:1)[0]}function se(r,e){let t=ee(ie),[,i]=re(null),o=te(()=>new E(t,r,e,i),[r,e]);return H(()=>(o.update(),()=>o?.dispose()),[o]),o}function W(r){let{requireds:e,requirements:t,children:i}=r,o=se(e,t),{provider:s,error:n}=o;if(n){let c=r.configurator;return c?m(c,{services:n.missings}):m(p,{error:n})}else return s?ce(J.Provider,{value:s,children:[i,o.status===1&&m(O,{})]}):m(O,{})}import{useState as F,useEffect as Z}from"react";function rt(){let[r,e]=F(window.location);return Z(()=>{let t=()=>{e(window.location)};return window.addEventListener("popstate",t),window.addEventListener("hashchange",t),()=>{window.removeEventListener("popstate",t),window.removeEventListener("hashchange",t)}},[]),r}function $(){let[r,e]=F(window.location.hash);return Z(()=>{let t=()=>{e(window.location.hash)};return window.addEventListener("hashchange",t),()=>{window.removeEventListener("hashchange",t)}},[]),r}function ot(){let{search:r}=window.location,e={};if(r.startsWith("?"))for(let t of r.slice(1).split("&")){let i=t.split("=");e[i[0]]=decodeURIComponent(i[1])}return e}import{useCallback as ae,useState as le}from"react";function ue(r,e){try{let t=window.localStorage.getItem(r);if(typeof t=="string")return JSON.parse(t)}catch{}return e instanceof Function?e():e}function pe(r,e){return e===void 0?window.localStorage.removeItem(r):window.localStorage.setItem(r,JSON.stringify(e)),e}function st(r,e){let[t,i]=le(ue(r,e)),o=ae(s=>i(pe(r,s)),[r]);return[t,o]}import{useCallback as de,useState as ve}from"react";function fe(r,e){try{let t=window.sessionStorage.getItem(r);if(typeof t=="string")return JSON.parse(t)}catch{}return e instanceof Function?e():e}function he(r,e){return e===void 0?window.sessionStorage.removeItem(r):window.sessionStorage.setItem(r,JSON.stringify(e)),e}function lt(r,e){let[t,i]=ve(fe(r,e)),o=de(s=>i(he(r,s)),[r]);return[t,o]}import{useState as me,useCallback as Se}from"react";function dt(){let[,r]=me(0);return Se(()=>{r(t=>t+1)},[])}import ge,{useContext as ye,useEffect as we,useMemo as j,useState as xe}from"react";import{jsx as l}from"react/jsx-runtime";var K=ge.createContext(null);async function Te(r,e,t){if(r)try{let{component:i,properties:o}=await L(r,e),s=v.spec(i),n=await q.fetch(i);if(!n)throw new Error(`Component '${r.name}' has no 'view.react' service`);let c=l(K.Provider,{value:r,children:l(n,{...o})});return s?.requirements&&(c=l(W,{requirements:s?.requirements,configurator:null,children:c})),c}catch(i){return l(p,{error:i})}return t}function Pe(){return ye(K)}function B(r){let{view:e,origin:t,fallback:i}=r,[o,s]=xe(null),n=j(()=>typeof e!="string"?e:y(e),[e]);return we(()=>{Te(n,t,i).then(s)},[n]),o||null}function Ce(r){let{hash:e,fallback:t}=r,i=j(()=>y(e),[e]);return l(B,{view:i,origin:"url",fallback:t})}function Re(r){let e=$();return l(Ce,{hash:e,fallback:r.fallback})}function wt(r){let e=Pe();return e?e?.nested?l(B,{view:e?.nested,origin:"url",fallback:r.fallback}):r.fallback||null:l(Re,{fallback:r.fallback})}export{x as AsyncState,N as ErrorBoundary,p as ErrorDisplayer,A as ErrorReconcilier,wt as InvokeNestedView,Re as InvokeURLView,Ce as InvokeUrlHashView,B as InvokeView,d as MissingServiceError,Ie as ReactComponentSchema,J as ServicePointsProviderContext,ie as ServicePointsSupportContext,oe as ServiceStatus,W as UseServicePoints,q as ViewReactKey,Ve as ViewWebComponentKey,ot as getLocationQuery,Ze as registerErrorDisplayer,ke as useAsyncMemo,Ne as useAsyncState,Pe as useCurrentView,dt as useForceUpdate,st as useLocalStorage,rt as useLocation,$ as useLocationHash,Ye as useService,ne as useServices,se as useServicesController,Xe as useServicesListener,lt as useSessionStorage,Me as using,Ae as waiting};
17
+ }
18
+
19
+ .JDT-Spinner {
20
+ display: inline-flex;
21
+ align-items: center;
22
+ gap: 6px;
23
+ padding: 8px 0;
24
+ justify-content: center;
25
+ width: 100%;
26
+ }
27
+
28
+ .JDT-Spinner__dot {
29
+ width: 8px;
30
+ height: 8px;
31
+ border-radius: 50%;
32
+ background-color: currentColor;
33
+ opacity: 0.6;
34
+ animation: JDT-SpinnerBounce 1.4s ease-in-out infinite both;
35
+ }
36
+ .JDT-Spinner__dot:nth-child(1) {
37
+ animation-delay: -0.32s;
38
+ }
39
+ .JDT-Spinner__dot:nth-child(2) {
40
+ animation-delay: -0.16s;
41
+ }
42
+
43
+ @keyframes JDT-SpinnerBounce {
44
+ 0%, 80%, 100% {
45
+ transform: scale(0.4);
46
+ opacity: 0.4;
47
+ }
48
+ 40% {
49
+ transform: scale(1);
50
+ opacity: 1;
51
+ }
52
+ }`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(Q));import{jsx as S,jsxs as re}from"react/jsx-runtime";function h({error:t,onRetry:e}){let r=`${t.name}: ${t.message}`;return re("div",{className:"JDT-ErrorBoundary",title:r,children:[S("pre",{className:"msg",children:r}),e&&S("button",{className:"btn",onClick:e,children:"Retry"})]})}var P=X(null),R=class extends G.Component{},J=class extends R{static contextType=P;state={};componentDidCatch(e){let{context:r}=this,o=r?.getErrorDisplayer(e)||te(e);this.setState({error:e,displayer:o})}render(){let{error:e}=this.state;if(e){let r=this.state.displayer;return S(r,{error:e,onRetry:()=>this.setState({error:void 0})})}return this.props.children||null}};function Ze({errorClass:t,errorDisplayer:e,children:r}){let o=Y(P),i=ee(()=>({getErrorDisplayer(s){for(let n=s;n;n=Object.getPrototypeOf(n))if(n.constructor===t)return e;return o?.getErrorDisplayer(s)??null}}),[o,t,e]);return S(P.Provider,{value:i,children:r})}function te(t){for(let e=t;e;e=Object.getPrototypeOf(e)){let r=e.constructor,o=b.get(r);if(o)return o}return null}var b=new Map;b.set(Error,h);function $e(t,e){b.set(t,e)}import{jsx as p,jsxs as H}from"react/jsx-runtime";function M(){return H("div",{className:"JDT-Spinner",children:[p("div",{className:"JDT-Spinner__dot"}),p("div",{className:"JDT-Spinner__dot"}),p("div",{className:"JDT-Spinner__dot"})]})}var se=(i=>(i[i.NotReady=0]="NotReady",i[i.Loading=1]="Loading",i[i.Ready=2]="Ready",i[i.Failed=3]="Failed",i))(se||{}),d=class extends Error{constructor(r,o){super(`Missing service point: ${r.map(i=>i.id).join(", ")}`);this.missings=r;this.requireds=o}},C=class{consumers=new Set;getService(e){return e.services}addController(e){this.consumers.add(e)}removeController(e){return this.consumers.delete(e)}onServiceChangeHandler=e=>{for(let r of this.consumers)r.notifyChange(e)}},E=class{constructor(e){this.controller=e}getService(e){return this.controller.getService(e)}},I=class{constructor(e,r,o,i){this.support=e;this.requireds=r;this.requirements=o;this.onUpdate=i;e.addController(this)}services=new Map;provider=null;state=null;get status(){return this.state instanceof Promise?1:this.state instanceof d?3:this.state===null?0:2}get error(){if(this.state instanceof d)return this.state}getService(e){let r=this.services.get(e);return!r&&this.support&&(r=this.support.getService(e),this.services.set(e,this.support.getService(e))),e.services}notifyChange(e){this.services.has(e)&&this.update()}updateState(e){let r=this.state;r!==e&&(this.state=e,this.onUpdate?.(e,r,this))}update(){let{requireds:e,requirements:r}=this,o=[],i=null;function s(n){i||(i=new d([])),i.missings.includes(n)||i.missings.push(n)}if(e)for(let n of e)if(n.ready){let c=n.services;c&&this.services.set(n,c)}else o.push(n.fetch());if(r){let{servicePoints:n}=r;for(let c in n){let u=L(c);if(u.ready){let k=u.services,g=n[c];g.service&&u.service!==g.service||k.length<(g.cardinality||1)?s(u):this.services.set(u,k)}else o.push(u.fetch())}}if(o.length>0){let n=Promise.all(o).then(()=>this.update());return this.updateState(n),n}else i?this.updateState(i):(this.provider=new E(this),this.updateState(this.provider));return null}dispose(){this.support&&(this.support.removeController(this),this.support=null)}},V=new C;y(V.onServiceChangeHandler);var ce=D.createContext(V),_=D.createContext(V);function Ye(t){A(()=>{let e=y(t);return()=>U(e)},[t])}function ae(t,e){let r=D.useContext(_);if(!r)return console.error("Wrap in <MountServicePoints> before using service point:",t.id),null;let o=r.getService(t);if(o.length<(e===void 0?1:e))throw new d([t],[t]);return o}function et(t,e){return ae(t,e?0:1)[0]}function le(t,e){let r=ie(ce),[,o]=ne(null),i=oe(()=>new I(r,t,e,o),[t,e]);return A(()=>(i.update(),()=>i?.dispose()),[i]),i}function O(t){let{requireds:e,requirements:r,children:o}=t,i=le(e,r),{provider:s,error:n}=i;if(n){let c=t.configurator;return c?p(c,{services:n.missings}):p(h,{error:n})}else return s?H(_.Provider,{value:s,children:[o,i.status===1&&p(M,{})]}):p(M,{})}import{useState as W,useEffect as j}from"react";function ot(){let[t,e]=W(window.location);return j(()=>{let r=()=>{e(window.location)};return window.addEventListener("popstate",r),window.addEventListener("hashchange",r),()=>{window.removeEventListener("popstate",r),window.removeEventListener("hashchange",r)}},[]),t}function F(){let[t,e]=W(window.location.hash);return j(()=>{let r=()=>{e(window.location.hash)};return window.addEventListener("hashchange",r),()=>{window.removeEventListener("hashchange",r)}},[]),t}function nt(){let{search:t}=window.location,e={};if(t.startsWith("?"))for(let r of t.slice(1).split("&")){let o=r.split("=");e[o[0]]=decodeURIComponent(o[1])}return e}import{useCallback as ue,useState as pe}from"react";function de(t,e){try{let r=window.localStorage.getItem(t);if(typeof r=="string")return JSON.parse(r)}catch{}return e instanceof Function?e():e}function ve(t,e){return e===void 0?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e)),e}function at(t,e){let[r,o]=pe(de(t,e)),i=ue(s=>o(ve(t,s)),[t]);return[r,i]}import{useCallback as fe,useState as he}from"react";function me(t,e){try{let r=window.sessionStorage.getItem(t);if(typeof r=="string")return JSON.parse(r)}catch{}return e instanceof Function?e():e}function Se(t,e){return e===void 0?window.sessionStorage.removeItem(t):window.sessionStorage.setItem(t,JSON.stringify(e)),e}function pt(t,e){let[r,o]=he(me(t,e)),i=fe(s=>o(Se(t,s)),[t]);return[r,i]}import{useState as ge,useCallback as ye}from"react";function ft(){let[,t]=ge(0);return ye(()=>{t(r=>r+1)},[])}import we,{useContext as Te,useEffect as xe,useMemo as Z,useState as Pe}from"react";import{jsx as l}from"react/jsx-runtime";var $=we.createContext(null);async function Re(t,e,r){if(t)try{let{component:o,properties:i}=await q(t,e),s=v.spec(o),n=await N.fetch(o);if(!n)throw new Error(`Component '${t.name}' has no 'view.react' service`);let c=l($.Provider,{value:t,children:l(n,{...i})});return s?.requirements&&(c=l(O,{requirements:s?.requirements,configurator:null,children:c})),c}catch(o){return l(h,{error:o})}return r}function be(){return Te($)}function B(t){let{view:e,origin:r,fallback:o}=t,[i,s]=Pe(null),n=Z(()=>typeof e!="string"?e:w(e),[e]);return xe(()=>{Re(n,r,o).then(s)},[n]),i||null}function Ce(t){let{hash:e,fallback:r}=t,o=Z(()=>w(e),[e]);return l(B,{view:o,origin:"url",fallback:r})}function Ee(t){let e=F();return l(Ce,{hash:e,fallback:t.fallback})}function xt(t){let e=be();return e?e?.nested?l(B,{view:e?.nested,origin:"url",fallback:t.fallback}):t.fallback||null:l(Ee,{fallback:t.fallback})}export{x as AsyncState,J as ErrorBoundary,h as ErrorDisplayer,Ze as ErrorReconcilier,xt as InvokeNestedView,Ee as InvokeURLView,Ce as InvokeUrlHashView,B as InvokeView,d as MissingServiceError,Ve as ReactComponentSchema,_ as ServicePointsProviderContext,ce as ServicePointsSupportContext,se as ServiceStatus,O as UseServicePoints,N as ViewReactKey,ke as ViewWebComponentKey,nt as getLocationQuery,$e as registerErrorDisplayer,qe as useAsyncMemo,Me as useAsyncState,be as useCurrentView,ft as useForceUpdate,at as useLocalStorage,ot as useLocation,F as useLocationHash,et as useService,ae as useServices,le as useServicesController,Ye as useServicesListener,pt as useSessionStorage,_e as using,Ae as waiting};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@jointhedots/core",
3
- "version": "2.0.21",
3
+ "version": "2.0.23",
4
4
  "type": "module",
5
- "license": "MIT",
5
+ "singleton": true,
6
6
  "exports": {
7
7
  ".": {
8
8
  "import": "./export.js",
@@ -34,7 +34,6 @@
34
34
  "astring": "^1.9.0",
35
35
  "json-schema": "^0.4.0",
36
36
  "query-string": "^9.1.0",
37
- "react-lightning-design-system": "^5.9.1",
38
37
  "vscode-uri": "^3.1.0",
39
38
  "yaml": "^2.8.2",
40
39
  "zod": "^4.2.1"
@@ -42,10 +41,5 @@
42
41
  "peerDependencies": {
43
42
  "react": "^18.2.0",
44
43
  "react-dom": "^18.2.0"
45
- },
46
- "overrides": {
47
- "react-lightning-design-system": {
48
- "react-relative-portal": "../../deps/react-relative-portal-1.3.1.tgz"
49
- }
50
44
  }
51
45
  }
package/types.d.ts CHANGED
@@ -409,6 +409,7 @@ declare module '@jointhedots/core/src/components/components' {
409
409
  import type { DocumentationSchema, JSONSchema, ResourceEntry } from '@jointhedots/core/src/schema/schema';
410
410
  import type { ComponentEntry } from '@jointhedots/core/src/components/manifold';
411
411
  import { ServiceEntry, type ServiceType } from '@jointhedots/core/src/services/service-entry';
412
+ import React from 'react';
412
413
  export type ComponentID = string;
413
414
  export interface ComponentPublication {
414
415
  id: ComponentID;
@@ -1549,35 +1550,38 @@ declare module '@jointhedots/core/src/interfaces/react/ErrorBoundary' {
1549
1550
  error: E;
1550
1551
  onRetry?: () => void;
1551
1552
  }>;
1552
- export class ErrorDisplayer extends React.Component<{
1553
+ export function ErrorDisplayer({ error, onRetry }: {
1553
1554
  error: Error;
1554
1555
  onRetry?: () => void;
1555
- }> {
1556
- render(): import( 'react/jsx-runtime').JSX.Element;
1557
- }
1558
- export class ErrorBoundary extends React.Component<{
1556
+ }): any;
1557
+ interface IErrorReconcilier {
1558
+ getErrorDisplayer(error: Error): ErrorDisplayerType | null;
1559
+ } class Component<P = {}, S = {}> extends React.Component<P, S> {
1560
+ props: Readonly<P>;
1561
+ setState: React.Component<P, S>['setState'];
1562
+ }
1563
+ export class ErrorBoundary extends Component<{
1559
1564
  children: React.ReactNode;
1565
+ }, {
1566
+ error?: Error;
1567
+ displayer?: ErrorDisplayerType;
1560
1568
  }> {
1561
- static contextType: React.Context<ErrorReconcilier>;
1562
- context: ErrorReconcilier;
1569
+ static contextType: any;
1570
+ context: IErrorReconcilier;
1563
1571
  state: {
1564
1572
  error?: Error;
1565
1573
  displayer?: ErrorDisplayerType;
1566
1574
  };
1567
1575
  componentDidCatch(error: Error): void;
1568
- render(): string | number | true | Iterable<React.ReactNode> | import( 'react/jsx-runtime').JSX.Element;
1576
+ render(): any;
1569
1577
  }
1570
- export class ErrorReconcilier extends React.Component<{
1578
+ export function ErrorReconcilier({ errorClass, errorDisplayer, children }: {
1571
1579
  errorClass: new () => Error;
1572
1580
  errorDisplayer: ErrorDisplayerType;
1573
1581
  children: React.ReactNode;
1574
- }> {
1575
- static contextType: React.Context<ErrorReconcilier>;
1576
- context: ErrorReconcilier;
1577
- getErrorDisplayer(error: Error): ErrorDisplayerType<Error>;
1578
- render(): string | number | true | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>;
1579
- }
1582
+ }): any;
1580
1583
  export function registerErrorDisplayer<E extends Error>(errorClass: new (...args: any[]) => E, displayer: ErrorDisplayerType<E>): void;
1584
+ export {};
1581
1585
  }
1582
1586
 
1583
1587
  declare module '@jointhedots/core/view' {
@@ -1611,7 +1615,8 @@ declare module '@jointhedots/core/src/interfaces/react/useLocation' {
1611
1615
 
1612
1616
  declare module '@jointhedots/core/src/interfaces/react/interface' {
1613
1617
  import { z, type ZodObject, type ZodRawShape } from 'zod';
1614
- import { ServiceEntry, type ServiceDefinition, type ServiceInterface } from 'src/services';
1618
+ import { type ServiceDefinition, type ServiceInterface } from 'src/services';
1619
+ import React from 'react';
1615
1620
  export type ViewServicePoint = {
1616
1621
  service?: string;
1617
1622
  cardinality?: number;
@@ -1710,9 +1715,9 @@ declare module '@jointhedots/core/src/interfaces/react/interface' {
1710
1715
  requirements?: ViewRequirements;
1711
1716
  };
1712
1717
  export type ViewReactService<T = any> = React.ComponentType<T>;
1713
- export const ViewReactKey: ServiceEntry<ViewReactService<any>, any>;
1718
+ export const ViewReactKey: import( '@jointhedots/core').ServiceEntry<React.ComponentType<T>, any>;
1714
1719
  export type ViewWebComponentService = new (...props: any[]) => HTMLElement;
1715
- export const ViewWebComponentKey: ServiceEntry<ViewWebComponentService, any>;
1720
+ export const ViewWebComponentKey: import( '@jointhedots/core').ServiceEntry<ViewWebComponentService, any>;
1716
1721
  }
1717
1722
 
1718
1723
  declare module '@jointhedots/core/src/interfaces/react/useServices' {
@@ -1760,28 +1765,28 @@ declare module '@jointhedots/core/src/interfaces/react/useServices' {
1760
1765
  requirements?: ViewRequirements;
1761
1766
  configurator: ServiceConfiguratorComponent;
1762
1767
  children: any;
1763
- }): import( 'react/jsx-runtime').JSX.Element;
1768
+ }): any;
1764
1769
  }
1765
1770
 
1766
1771
  declare module '@jointhedots/core/src/interfaces/react/ViewUrl' {
1767
- import React, { type ReactElement } from 'react';
1772
+ import { type ReactElement } from 'react';
1768
1773
  import { type ViewInfos } from '@jointhedots/core/view';
1769
- export function useCurrentView(): ViewInfos;
1774
+ export function useCurrentView(): any;
1770
1775
  export function InvokeView(props: {
1771
1776
  view: string | ViewInfos;
1772
1777
  origin?: string;
1773
1778
  fallback?: ReactElement;
1774
- }): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
1779
+ }): any;
1775
1780
  export function InvokeUrlHashView(props: {
1776
1781
  hash: string;
1777
1782
  fallback?: ReactElement;
1778
- }): import( 'react/jsx-runtime').JSX.Element;
1783
+ }): any;
1779
1784
  export function InvokeURLView(props: {
1780
1785
  fallback?: ReactElement;
1781
- }): import( 'react/jsx-runtime').JSX.Element;
1786
+ }): any;
1782
1787
  export function InvokeNestedView(props: {
1783
1788
  fallback?: ReactElement;
1784
- }): import( 'react/jsx-runtime').JSX.Element;
1789
+ }): any;
1785
1790
  }
1786
1791
 
1787
1792
  declare module '@jointhedots/core/src/interfaces/react/useAsyncMemo' {
@@ -1833,7 +1838,7 @@ declare module '@jointhedots/core/src/interfaces/react/useSessionStorage' {
1833
1838
  }
1834
1839
 
1835
1840
  declare module '@jointhedots/core/src/interfaces/react/useForceUpdate' {
1836
- export function useForceUpdate(): () => void;
1841
+ export function useForceUpdate(): any;
1837
1842
  }
1838
1843
 
1839
1844
  declare module '@jointhedots/core/react' {
@@ -1964,6 +1969,7 @@ declare module '@jointhedots/core/src/scripting/graph/log' {
1964
1969
  declare module '@jointhedots/core/src/scripting/graph/uses' {
1965
1970
  import type { AST } from '@jointhedots/core/src/scripting/ast/api';
1966
1971
  import { type Node, type ContextInstance, type FeatureID } from '@jointhedots/core/src/scripting/graph/model';
1972
+ import React from 'react';
1967
1973
  export type ValueRecast = (x: any) => any;
1968
1974
  export class ValueType {
1969
1975
  accept(ty: ValueType): boolean;