From 2911d3843c9ad5b96ca0fa37048d4f0313581f90 Mon Sep 17 00:00:00 2001 From: Jolie Rabideau Date: Fri, 12 Jan 2024 17:29:17 -0500 Subject: [PATCH 1/4] remove rexports --- src/shared/services/papi-core.service.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/shared/services/papi-core.service.ts b/src/shared/services/papi-core.service.ts index 6075fc66b1..9307b645ce 100644 --- a/src/shared/services/papi-core.service.ts +++ b/src/shared/services/papi-core.service.ts @@ -8,7 +8,6 @@ export type { ExecutionToken } from '@node/models/execution-token.model'; export type { DialogTypes } from '@renderer/components/dialogs/dialog-definition.model'; export type { UseDialogCallbackOptions } from '@renderer/hooks/papi-hooks/use-dialog-callback.hook'; -export type { UsePromiseOptions } from 'platform-bible-react'; export type { default as IDataProvider } from '@shared/models/data-provider.interface'; export type { @@ -19,12 +18,6 @@ export type { export type { WithNotifyUpdate } from '@shared/models/data-provider-engine.model'; export type { default as IDataProviderEngine } from '@shared/models/data-provider-engine.model'; export type { DialogOptions } from '@shared/models/dialog-options.model'; -export type { - Unsubscriber, - UnsubscriberAsync, - PlatformEvent, - default as PlatformEventEmitter, -} from 'platform-bible-utils'; export type { ExtensionDataScope, MandatoryProjectDataType, From 59354a794cc346e0baf4f8d4c7c920f75182e9e9 Mon Sep 17 00:00:00 2001 From: Jolie Rabideau Date: Tue, 16 Jan 2024 12:26:05 -0500 Subject: [PATCH 2/4] fix uses of removed re exports --- .../project-notes-data-provider/index.d.ts | 3 +- extensions/src/usfm-data-provider/index.d.ts | 2 +- lib/papi-dts/papi.d.ts | 7 - lib/platform-bible-react/dist/index.cjs.js | 214 +++++++++--------- lib/platform-bible-react/dist/index.es.js | 214 +++++++++--------- .../services/extension.service.ts | 3 +- 6 files changed, 218 insertions(+), 225 deletions(-) diff --git a/extensions/src/project-notes-data-provider/index.d.ts b/extensions/src/project-notes-data-provider/index.d.ts index 5bdfa353ad..b1b1a174ad 100644 --- a/extensions/src/project-notes-data-provider/index.d.ts +++ b/extensions/src/project-notes-data-provider/index.d.ts @@ -2,10 +2,9 @@ import { VerseRef } from '@sillsdev/scripture'; import type { DataProviderDataType, DataProviderSubscriberOptions, - Unsubscriber, IDataProvider, } from '@papi/core'; -import { PlatformEvent } from 'platform-bible-utils'; +import { PlatformEvent, Unsubscriber } from 'platform-bible-utils'; declare module 'project-notes-data-provider' { export type ProjectNotesProviderDataTypes = { diff --git a/extensions/src/usfm-data-provider/index.d.ts b/extensions/src/usfm-data-provider/index.d.ts index ffc712e00a..9674a19900 100644 --- a/extensions/src/usfm-data-provider/index.d.ts +++ b/extensions/src/usfm-data-provider/index.d.ts @@ -7,8 +7,8 @@ declare module 'usfm-data-provider' { ExtensionDataScope, IDataProvider, MandatoryProjectDataType, - Unsubscriber, } from '@papi/core'; + import { Unsubscriber } from 'platform-bible-utils'; export type UsfmProviderDataTypes = { BookNames: DataProviderDataType; diff --git a/lib/papi-dts/papi.d.ts b/lib/papi-dts/papi.d.ts index cb0d52ac7d..9c28c44eb2 100644 --- a/lib/papi-dts/papi.d.ts +++ b/lib/papi-dts/papi.d.ts @@ -4631,7 +4631,6 @@ declare module '@papi/core' { export type { ExecutionToken } from 'node/models/execution-token.model'; export type { DialogTypes } from 'renderer/components/dialogs/dialog-definition.model'; export type { UseDialogCallbackOptions } from 'renderer/hooks/papi-hooks/use-dialog-callback.hook'; - export type { UsePromiseOptions } from 'platform-bible-react'; export type { default as IDataProvider } from 'shared/models/data-provider.interface'; export type { DataProviderUpdateInstructions, @@ -4641,12 +4640,6 @@ declare module '@papi/core' { export type { WithNotifyUpdate } from 'shared/models/data-provider-engine.model'; export type { default as IDataProviderEngine } from 'shared/models/data-provider-engine.model'; export type { DialogOptions } from 'shared/models/dialog-options.model'; - export type { - Unsubscriber, - UnsubscriberAsync, - PlatformEvent, - default as PlatformEventEmitter, - } from 'platform-bible-utils'; export type { ExtensionDataScope, MandatoryProjectDataType, diff --git a/lib/platform-bible-react/dist/index.cjs.js b/lib/platform-bible-react/dist/index.cjs.js index b9614e728c..5e877e8e8b 100644 --- a/lib/platform-bible-react/dist/index.cjs.js +++ b/lib/platform-bible-react/dist/index.cjs.js @@ -55,31 +55,22 @@ const theme2 = createTheme({ palette: { primary: { main: green[500] }, } });`:je(12,f?` (${f})`:"",JSON.stringify(h.main)));return ir(h,"light",Y,t),ir(h,"dark",j,t),h.contrastText||(h.contrastText=p(h.main)),h},v={dark:mn,light:or};return process.env.NODE_ENV!=="production"&&(v[n]||console.error(`MUI: The palette mode \`${n}\` is not supported.`)),be(A({common:A({},Ge),mode:n,primary:d({color:i,name:"primary"}),secondary:d({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:u,name:"error"}),warning:d({color:l,name:"warning"}),info:d({color:c,name:"info"}),success:d({color:s,name:"success"}),grey:Uo,contrastThreshold:r,getContrastText:p,augmentColor:d,tonalOffset:t},v[n]),o)}const oi=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function ii(e){return Math.round(e*1e5)/1e5}const ar={textTransform:"uppercase"},sr='"Roboto", "Helvetica", "Arial", sans-serif';function ai(e,n){const r=typeof n=="function"?n(e):n,{fontFamily:t=sr,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:u=500,fontWeightBold:c=700,htmlFontSize:s=16,allVariants:l,pxToRem:p}=r,d=ve(r,oi);process.env.NODE_ENV!=="production"&&(typeof o!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof s!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const v=o/14,b=p||(E=>`${E/s*v}rem`),h=(E,Y,j,N,g)=>A({fontFamily:t,fontWeight:E,fontSize:b(Y),lineHeight:j},t===sr?{letterSpacing:`${ii(N/Y)}em`}:{},g,l),f={h1:h(i,96,1.167,-1.5),h2:h(i,60,1.2,-.5),h3:h(a,48,1.167,0),h4:h(a,34,1.235,.25),h5:h(a,24,1.334,0),h6:h(u,20,1.6,.15),subtitle1:h(a,16,1.75,.15),subtitle2:h(u,14,1.57,.1),body1:h(a,16,1.5,.15),body2:h(a,14,1.43,.15),button:h(u,14,1.75,.4,ar),caption:h(a,12,1.66,.4),overline:h(a,12,2.66,1,ar),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return be(A({htmlFontSize:s,pxToRem:b,fontFamily:t,fontSize:o,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:u,fontWeightBold:c},f),d,{clone:!1})}const si=.2,ci=.14,li=.12;function G(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${si})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${ci})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${li})`].join(",")}const ui=["none",G(0,2,1,-1,0,1,1,0,0,1,3,0),G(0,3,1,-2,0,2,2,0,0,1,5,0),G(0,3,3,-2,0,3,4,0,0,1,8,0),G(0,2,4,-1,0,4,5,0,0,1,10,0),G(0,3,5,-1,0,5,8,0,0,1,14,0),G(0,3,5,-1,0,6,10,0,0,1,18,0),G(0,4,5,-2,0,7,10,1,0,2,16,1),G(0,5,5,-3,0,8,10,1,0,3,14,2),G(0,5,6,-3,0,9,12,1,0,3,16,2),G(0,6,6,-3,0,10,14,1,0,4,18,3),G(0,6,7,-4,0,11,15,1,0,4,20,3),G(0,7,8,-4,0,12,17,2,0,5,22,4),G(0,7,8,-4,0,13,19,2,0,5,24,4),G(0,7,9,-4,0,14,21,2,0,5,26,4),G(0,8,9,-5,0,15,22,2,0,6,28,5),G(0,8,10,-5,0,16,24,2,0,6,30,5),G(0,8,11,-5,0,17,26,2,0,6,32,5),G(0,9,11,-5,0,18,28,2,0,7,34,6),G(0,9,12,-6,0,19,29,2,0,7,36,6),G(0,10,13,-6,0,20,31,3,0,8,38,7),G(0,10,13,-6,0,21,33,3,0,8,40,7),G(0,10,14,-6,0,22,35,3,0,8,42,7),G(0,11,14,-7,0,23,36,3,0,9,44,8),G(0,11,15,-7,0,24,38,3,0,9,46,8)],di=ui,fi=["duration","easing","delay"],pi={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},hi={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function cr(e){return`${Math.round(e)}ms`}function gi(e){if(!e)return 0;const n=e/36;return Math.round((4+15*n**.25+n/5)*10)}function mi(e){const n=A({},pi,e.easing),r=A({},hi,e.duration);return A({getAutoHeightDuration:gi,create:(o=["all"],i={})=>{const{duration:a=r.standard,easing:u=n.easeInOut,delay:c=0}=i,s=ve(i,fi);if(process.env.NODE_ENV!=="production"){const l=d=>typeof d=="string",p=d=>!isNaN(parseFloat(d));!l(o)&&!Array.isArray(o)&&console.error('MUI: Argument "props" must be a string or Array.'),!p(a)&&!l(a)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${a}.`),l(u)||console.error('MUI: Argument "easing" must be a string.'),!p(c)&&!l(c)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof i!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(` `)),Object.keys(s).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(s).join(",")}].`)}return(Array.isArray(o)?o:[o]).map(l=>`${l} ${typeof a=="string"?a:cr(a)} ${u} ${typeof c=="string"?c:cr(c)}`).join(",")}},e,{easing:n,duration:r})}const bi={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},yi=bi,vi=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function xi(e={},...n){const{mixins:r={},palette:t={},transitions:o={},typography:i={}}=e,a=ve(e,vi);if(e.vars)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name.":je(18));const u=ti(t),c=Rn(e);let s=be(c,{mixins:Vo(c.breakpoints,r),palette:u,shadows:di.slice(),typography:ai(u,i),transitions:mi(o),zIndex:A({},yi)});if(s=be(s,a),s=n.reduce((l,p)=>be(l,p),s),process.env.NODE_ENV!=="production"){const l=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],p=(d,v)=>{let b;for(b in d){const h=d[b];if(l.indexOf(b)!==-1&&Object.keys(h).length>0){if(process.env.NODE_ENV!=="production"){const f=Tn("",b);console.error([`MUI: The \`${v}\` component increases the CSS specificity of the \`${b}\` internal state.`,"You can not override it like this: ",JSON.stringify(d,null,2),"",`Instead, you need to use the '&.${f}' syntax:`,JSON.stringify({root:{[`&.${f}`]:h}},null,2),"","https://mui.com/r/state-classes-guide"].join(` -`))}d[b]={}}}};Object.keys(s.components).forEach(d=>{const v=s.components[d].styleOverrides;v&&d.indexOf("Mui")===0&&p(v,d)})}return s.unstable_sxConfig=A({},On,a==null?void 0:a.unstable_sxConfig),s.unstable_sx=function(p){return $n({sx:p,theme:this})},s}const ki=xi(),Rr=ki,Nr="$$material";function Si({props:e,name:n}){return Mo({props:e,name:n,defaultTheme:Rr,themeId:Nr})}const Ei=e=>Ye(e)&&e!=="classes",wi=Po({themeId:Nr,defaultTheme:Rr,rootShouldForwardProp:Ei}),Ti=wi;function Ci(e){return Tn("MuiSvgIcon",e)}St("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const _i=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Oi=e=>{const{color:n,fontSize:r,classes:t}=e,o={root:["root",n!=="inherit"&&`color${he(n)}`,`fontSize${he(r)}`]};return bt(o,Ci,t)},$i=Ti("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,n)=>{const{ownerState:r}=e;return[n.root,r.color!=="inherit"&&n[`color${he(r.color)}`],n[`fontSize${he(r.fontSize)}`]]}})(({theme:e,ownerState:n})=>{var r,t,o,i,a,u,c,s,l,p,d,v,b;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:n.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(r=e.transitions)==null||(t=r.create)==null?void 0:t.call(r,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((i=e.typography)==null||(a=i.pxToRem)==null?void 0:a.call(i,20))||"1.25rem",medium:((u=e.typography)==null||(c=u.pxToRem)==null?void 0:c.call(u,24))||"1.5rem",large:((s=e.typography)==null||(l=s.pxToRem)==null?void 0:l.call(s,35))||"2.1875rem"}[n.fontSize],color:(p=(d=(e.vars||e).palette)==null||(d=d[n.color])==null?void 0:d.main)!=null?p:{action:(v=(e.vars||e).palette)==null||(v=v.action)==null?void 0:v.active,disabled:(b=(e.vars||e).palette)==null||(b=b.action)==null?void 0:b.disabled,inherit:void 0}[n.color]}}),An=Ue.forwardRef(function(n,r){const t=Si({props:n,name:"MuiSvgIcon"}),{children:o,className:i,color:a="inherit",component:u="svg",fontSize:c="medium",htmlColor:s,inheritViewBox:l=!1,titleAccess:p,viewBox:d="0 0 24 24"}=t,v=ve(t,_i),b=Ue.isValidElement(o)&&o.type==="svg",h=A({},t,{color:a,component:u,fontSize:c,instanceFontSize:n.fontSize,inheritViewBox:l,viewBox:d,hasSvgAsChild:b}),f={};l||(f.viewBox=d);const E=Oi(h);return S.jsxs($i,A({as:u,className:Et(E.root,i),focusable:"false",color:s,"aria-hidden":p?void 0:!0,role:p?"img":void 0,ref:r},f,v,b&&o.props,{ownerState:h,children:[b?o.props.children:o,p?S.jsx("title",{children:p}):null]}))});process.env.NODE_ENV!=="production"&&(An.propTypes={children:q.node,classes:q.object,className:q.string,color:q.oneOfType([q.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),q.string]),component:q.elementType,fontSize:q.oneOfType([q.oneOf(["inherit","large","medium","small"]),q.string]),htmlColor:q.string,inheritViewBox:q.bool,shapeRendering:q.string,sx:q.oneOfType([q.arrayOf(q.oneOfType([q.func,q.object,q.bool])),q.func,q.object]),titleAccess:q.string,viewBox:q.string});An.muiName="SvgIcon";const lr=An;function Ri(e,n){function r(t,o){return S.jsx(lr,A({"data-testid":`${n}Icon`,ref:o},t,{children:e}))}return process.env.NODE_ENV!=="production"&&(r.displayName=`${n}Icon`),r.muiName=lr.muiName,Ue.memo(Ue.forwardRef(r))}const Ni=Ri(S.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");function Ai({menu:e,dataHandler:n,commandHandler:r,className:t,id:o,children:i}){const[a,u]=K.useState(!1),[c,s]=K.useState(!1),l=K.useCallback(()=>{a&&u(!1),s(!1)},[a]),p=K.useCallback(E=>{E.stopPropagation(),u(Y=>{const j=!Y;return j&&E.shiftKey?s(!0):j||s(!1),j})},[]),d=K.useRef(void 0),[v,b]=K.useState(0);K.useEffect(()=>{a&&d.current&&b(d.current.clientHeight)},[a]);const h=K.useCallback(E=>(l(),r(E)),[r,l]);let f=e;return!f&&n&&(f=n(c)),S.jsx("div",{ref:d,style:{position:"relative"},children:S.jsx(J.AppBar,{position:"static",id:o,children:S.jsxs(J.Toolbar,{className:`papi-toolbar ${t??""}`,variant:"dense",children:[f?S.jsx(J.IconButton,{edge:"start",className:`papi-menuButton ${t??""}`,color:"inherit","aria-label":"open drawer",onClick:p,children:S.jsx(Ni,{})}):void 0,i?S.jsx("div",{className:"papi-menu-children",children:i}):void 0,f?S.jsx(J.Drawer,{className:`papi-menu-drawer ${t??""}`,anchor:"left",variant:"persistent",open:a,onClose:l,PaperProps:{className:"papi-menu-drawer-paper",style:{top:v}},children:S.jsx(fr,{commandHandler:h,columns:f.columns})}):void 0]})})})}const Pi=(e,n)=>{K.useEffect(()=>{if(!e)return()=>{};const r=e(n);return()=>{r()}},[e,n])};function Ii(e){return{preserveValue:!0,...e}}const Ar=(e,n,r={})=>{const t=K.useRef(n);t.current=n;const o=K.useRef(r);o.current=Ii(o.current);const[i,a]=K.useState(()=>t.current),[u,c]=K.useState(!0);return K.useEffect(()=>{let s=!0;return c(!!e),(async()=>{if(e){const l=await e();s&&(a(()=>l),c(!1))}})(),()=>{s=!1,o.current.preserveValue||a(()=>t.current)}},[e]),[i,u]},bn=()=>!1,Mi=(e,n)=>{const[r]=Ar(K.useCallback(async()=>{if(!e)return bn;const t=await Promise.resolve(e(n));return async()=>t()},[n,e]),bn,{preserveValue:!1});K.useEffect(()=>()=>{r!==bn&&r()},[r])};exports.Button=Ee;exports.ChapterRangeSelector=Ir;exports.Checkbox=ur;exports.ComboBox=Je;exports.GridMenu=fr;exports.IconButton=jr;exports.LabelPosition=Te;exports.MenuItem=dr;exports.RefSelector=Kr;exports.SearchBar=Yr;exports.Slider=Jr;exports.Snackbar=Zr;exports.Switch=Qr;exports.Table=nt;exports.TextField=qe;exports.Toolbar=Ai;exports.useEvent=Pi;exports.useEventAsync=Mi;exports.usePromise=Ar;function ji(e,n="top"){if(!e||typeof document>"u")return;const r=document.head||document.querySelector("head"),t=r.querySelector(":first-child"),o=document.createElement("style");o.appendChild(document.createTextNode(e)),n==="top"&&t?r.insertBefore(o,t):r.appendChild(o)}ji(`.papi-icon-button { - border: 0; - border-radius: 3em; - cursor: pointer; - display: inline-block; -} - -.papi-icon-button.primary { - background-color: #1ea7fd; - color: white; -} - -.papi-icon-button.secondary { - background-color: transparent; - color: #333; -} - -.papi-icon-button.paratext { - background-color: darkgreen; - color: greenyellow; +`))}d[b]={}}}};Object.keys(s.components).forEach(d=>{const v=s.components[d].styleOverrides;v&&d.indexOf("Mui")===0&&p(v,d)})}return s.unstable_sxConfig=A({},On,a==null?void 0:a.unstable_sxConfig),s.unstable_sx=function(p){return $n({sx:p,theme:this})},s}const ki=xi(),Rr=ki,Nr="$$material";function Si({props:e,name:n}){return Mo({props:e,name:n,defaultTheme:Rr,themeId:Nr})}const Ei=e=>Ye(e)&&e!=="classes",wi=Po({themeId:Nr,defaultTheme:Rr,rootShouldForwardProp:Ei}),Ti=wi;function Ci(e){return Tn("MuiSvgIcon",e)}St("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const _i=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Oi=e=>{const{color:n,fontSize:r,classes:t}=e,o={root:["root",n!=="inherit"&&`color${he(n)}`,`fontSize${he(r)}`]};return bt(o,Ci,t)},$i=Ti("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,n)=>{const{ownerState:r}=e;return[n.root,r.color!=="inherit"&&n[`color${he(r.color)}`],n[`fontSize${he(r.fontSize)}`]]}})(({theme:e,ownerState:n})=>{var r,t,o,i,a,u,c,s,l,p,d,v,b;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:n.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(r=e.transitions)==null||(t=r.create)==null?void 0:t.call(r,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((i=e.typography)==null||(a=i.pxToRem)==null?void 0:a.call(i,20))||"1.25rem",medium:((u=e.typography)==null||(c=u.pxToRem)==null?void 0:c.call(u,24))||"1.5rem",large:((s=e.typography)==null||(l=s.pxToRem)==null?void 0:l.call(s,35))||"2.1875rem"}[n.fontSize],color:(p=(d=(e.vars||e).palette)==null||(d=d[n.color])==null?void 0:d.main)!=null?p:{action:(v=(e.vars||e).palette)==null||(v=v.action)==null?void 0:v.active,disabled:(b=(e.vars||e).palette)==null||(b=b.action)==null?void 0:b.disabled,inherit:void 0}[n.color]}}),An=Ue.forwardRef(function(n,r){const t=Si({props:n,name:"MuiSvgIcon"}),{children:o,className:i,color:a="inherit",component:u="svg",fontSize:c="medium",htmlColor:s,inheritViewBox:l=!1,titleAccess:p,viewBox:d="0 0 24 24"}=t,v=ve(t,_i),b=Ue.isValidElement(o)&&o.type==="svg",h=A({},t,{color:a,component:u,fontSize:c,instanceFontSize:n.fontSize,inheritViewBox:l,viewBox:d,hasSvgAsChild:b}),f={};l||(f.viewBox=d);const E=Oi(h);return S.jsxs($i,A({as:u,className:Et(E.root,i),focusable:"false",color:s,"aria-hidden":p?void 0:!0,role:p?"img":void 0,ref:r},f,v,b&&o.props,{ownerState:h,children:[b?o.props.children:o,p?S.jsx("title",{children:p}):null]}))});process.env.NODE_ENV!=="production"&&(An.propTypes={children:q.node,classes:q.object,className:q.string,color:q.oneOfType([q.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),q.string]),component:q.elementType,fontSize:q.oneOfType([q.oneOf(["inherit","large","medium","small"]),q.string]),htmlColor:q.string,inheritViewBox:q.bool,shapeRendering:q.string,sx:q.oneOfType([q.arrayOf(q.oneOfType([q.func,q.object,q.bool])),q.func,q.object]),titleAccess:q.string,viewBox:q.string});An.muiName="SvgIcon";const lr=An;function Ri(e,n){function r(t,o){return S.jsx(lr,A({"data-testid":`${n}Icon`,ref:o},t,{children:e}))}return process.env.NODE_ENV!=="production"&&(r.displayName=`${n}Icon`),r.muiName=lr.muiName,Ue.memo(Ue.forwardRef(r))}const Ni=Ri(S.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");function Ai({menu:e,dataHandler:n,commandHandler:r,className:t,id:o,children:i}){const[a,u]=K.useState(!1),[c,s]=K.useState(!1),l=K.useCallback(()=>{a&&u(!1),s(!1)},[a]),p=K.useCallback(E=>{E.stopPropagation(),u(Y=>{const j=!Y;return j&&E.shiftKey?s(!0):j||s(!1),j})},[]),d=K.useRef(void 0),[v,b]=K.useState(0);K.useEffect(()=>{a&&d.current&&b(d.current.clientHeight)},[a]);const h=K.useCallback(E=>(l(),r(E)),[r,l]);let f=e;return!f&&n&&(f=n(c)),S.jsx("div",{ref:d,style:{position:"relative"},children:S.jsx(J.AppBar,{position:"static",id:o,children:S.jsxs(J.Toolbar,{className:`papi-toolbar ${t??""}`,variant:"dense",children:[f?S.jsx(J.IconButton,{edge:"start",className:`papi-menuButton ${t??""}`,color:"inherit","aria-label":"open drawer",onClick:p,children:S.jsx(Ni,{})}):void 0,i?S.jsx("div",{className:"papi-menu-children",children:i}):void 0,f?S.jsx(J.Drawer,{className:`papi-menu-drawer ${t??""}`,anchor:"left",variant:"persistent",open:a,onClose:l,PaperProps:{className:"papi-menu-drawer-paper",style:{top:v}},children:S.jsx(fr,{commandHandler:h,columns:f.columns})}):void 0]})})})}const Pi=(e,n)=>{K.useEffect(()=>{if(!e)return()=>{};const r=e(n);return()=>{r()}},[e,n])};function Ii(e){return{preserveValue:!0,...e}}const Ar=(e,n,r={})=>{const t=K.useRef(n);t.current=n;const o=K.useRef(r);o.current=Ii(o.current);const[i,a]=K.useState(()=>t.current),[u,c]=K.useState(!0);return K.useEffect(()=>{let s=!0;return c(!!e),(async()=>{if(e){const l=await e();s&&(a(()=>l),c(!1))}})(),()=>{s=!1,o.current.preserveValue||a(()=>t.current)}},[e]),[i,u]},bn=()=>!1,Mi=(e,n)=>{const[r]=Ar(K.useCallback(async()=>{if(!e)return bn;const t=await Promise.resolve(e(n));return async()=>t()},[n,e]),bn,{preserveValue:!1});K.useEffect(()=>()=>{r!==bn&&r()},[r])};exports.Button=Ee;exports.ChapterRangeSelector=Ir;exports.Checkbox=ur;exports.ComboBox=Je;exports.GridMenu=fr;exports.IconButton=jr;exports.LabelPosition=Te;exports.MenuItem=dr;exports.RefSelector=Kr;exports.SearchBar=Yr;exports.Slider=Jr;exports.Snackbar=Zr;exports.Switch=Qr;exports.Table=nt;exports.TextField=qe;exports.Toolbar=Ai;exports.useEvent=Pi;exports.useEventAsync=Mi;exports.usePromise=Ar;function ji(e,n="top"){if(!e||typeof document>"u")return;const r=document.head||document.querySelector("head"),t=r.querySelector(":first-child"),o=document.createElement("style");o.appendChild(document.createTextNode(e)),n==="top"&&t?r.insertBefore(o,t):r.appendChild(o)}ji(`.papi-multi-column-menu { + background-color: lightgray; + display: flex; + flex-direction: column; + padding-left: 3px; + padding-right: 3px; } -.papi-icon-button.paratext.bright { - background-color: greenyellow; - color: darkgreen; +.papi-menu { + background-color: rgb(145, 145, 145); + font-size: 11pt; + font-weight: 600; + margin-top: 1px; + padding-bottom: 2px; + padding-left: 24px; + padding-top: 2px; } .papi-button { border: 0; @@ -127,23 +118,6 @@ const theme2 = createTheme({ palette: { color: white; text-decoration: underline; } -.papi-multi-column-menu { - background-color: lightgray; - display: flex; - flex-direction: column; - padding-left: 3px; - padding-right: 3px; -} - -.papi-menu { - background-color: rgb(145, 145, 145); - font-size: 11pt; - font-weight: 600; - margin-top: 1px; - padding-bottom: 2px; - padding-left: 24px; - padding-top: 2px; -} .papi-combo-box { background-color: transparent; } @@ -165,13 +139,79 @@ const theme2 = createTheme({ palette: { background-color: greenyellow; color: darkgreen; } -.papi-ref-selector.book { - display: inline-block; - vertical-align: middle; +.papi-slider { + background-color: transparent; + color: #1ea7fd; } -.papi-ref-selector.chapter-verse { - width: 75px; +.papi-slider.vertical { + min-height: 200px; +} + +.papi-slider.paratext { + background-color: darkgreen; + color: greenyellow; +} + +.papi-slider.paratext.bright { + background-color: greenyellow; + color: darkgreen; +} +.papi-menu-item { + line-height: 0.8; +} + +.papi-menu-item.paratext { + background-color: darkgreen; + color: greenyellow; +} + +.papi-menu-item.paratext.bright { + background-color: greenyellow; + color: darkgreen; +} +.papi-snackbar { + font-family: Arial, Helvetica, sans-serif; +} + +.papi-snackbar.primary { + background: #1ea7fd; + color: white; +} + +.papi-snackbar.external { + background-color: lightsteelblue; + border-color: white; + border-style: dotted; + padding: 2%; + width: 30%; +} + +.papi-snackbar.secondary { + background: transparent; + color: #333; +} + +.papi-snackbar.alert { + background: lightcoral; +} + +.papi-snackbar.paratext { + background: darkgreen; + color: greenyellow; +} + +.papi-snackbar.bright { + background: greenyellow; + color: darkgreen; +} +.search-bar-paper { + display: flex; + align-items: center; +} + +.search-button { + padding: 10px; } .papi-checkbox { background-color: transparent; @@ -213,37 +253,6 @@ const theme2 = createTheme({ palette: { .papi-checkbox.above { text-align: center; } -.papi-menu-item { - line-height: 0.8; -} - -.papi-menu-item.paratext { - background-color: darkgreen; - color: greenyellow; -} - -.papi-menu-item.paratext.bright { - background-color: greenyellow; - color: darkgreen; -} -.papi-slider { - background-color: transparent; - color: #1ea7fd; -} - -.papi-slider.vertical { - min-height: 200px; -} - -.papi-slider.paratext { - background-color: darkgreen; - color: greenyellow; -} - -.papi-slider.paratext.bright { - background-color: greenyellow; - color: darkgreen; -} .papi-switch { background-color: transparent; } @@ -269,52 +278,39 @@ const theme2 = createTheme({ palette: { background-color: greenyellow; color: darkgreen; } -.papi-snackbar { - font-family: Arial, Helvetica, sans-serif; +.papi-icon-button { + border: 0; + border-radius: 3em; + cursor: pointer; + display: inline-block; } -.papi-snackbar.primary { - background: #1ea7fd; +.papi-icon-button.primary { + background-color: #1ea7fd; color: white; } -.papi-snackbar.external { - background-color: lightsteelblue; - border-color: white; - border-style: dotted; - padding: 2%; - width: 30%; -} - -.papi-snackbar.secondary { - background: transparent; +.papi-icon-button.secondary { + background-color: transparent; color: #333; } -.papi-snackbar.alert { - background: lightcoral; -} - -.papi-snackbar.paratext { - background: darkgreen; +.papi-icon-button.paratext { + background-color: darkgreen; color: greenyellow; } -.papi-snackbar.bright { - background: greenyellow; +.papi-icon-button.paratext.bright { + background-color: greenyellow; color: darkgreen; } -.search-bar-paper { - display: flex; - align-items: center; +.papi-ref-selector.book { + display: inline-block; + vertical-align: middle; } -.search-button { - padding: 10px; -} -.paratext { - background-color: darkgreen; - color: greenyellow; +.papi-ref-selector.chapter-verse { + width: 75px; } .papi-toolbar { background-color: #eee; @@ -340,6 +336,10 @@ const theme2 = createTheme({ palette: { padding: 10px; position: relative; } +.paratext { + background-color: darkgreen; + color: greenyellow; +} @layer rdg.MeasuringCell {.m1l09lto7-0-0-beta-34 { contain: strict; grid-row: 1; diff --git a/lib/platform-bible-react/dist/index.es.js b/lib/platform-bible-react/dist/index.es.js index b81754e2d4..72fd98ec2d 100644 --- a/lib/platform-bible-react/dist/index.es.js +++ b/lib/platform-bible-react/dist/index.es.js @@ -4250,31 +4250,22 @@ function ea(e, n = "top") { const r = document.head || document.querySelector("head"), t = r.querySelector(":first-child"), o = document.createElement("style"); o.appendChild(document.createTextNode(e)), n === "top" && t ? r.insertBefore(o, t) : r.appendChild(o); } -ea(`.papi-icon-button { - border: 0; - border-radius: 3em; - cursor: pointer; - display: inline-block; -} - -.papi-icon-button.primary { - background-color: #1ea7fd; - color: white; -} - -.papi-icon-button.secondary { - background-color: transparent; - color: #333; -} - -.papi-icon-button.paratext { - background-color: darkgreen; - color: greenyellow; +ea(`.papi-multi-column-menu { + background-color: lightgray; + display: flex; + flex-direction: column; + padding-left: 3px; + padding-right: 3px; } -.papi-icon-button.paratext.bright { - background-color: greenyellow; - color: darkgreen; +.papi-menu { + background-color: rgb(145, 145, 145); + font-size: 11pt; + font-weight: 600; + margin-top: 1px; + padding-bottom: 2px; + padding-left: 24px; + padding-top: 2px; } .papi-button { border: 0; @@ -4322,23 +4313,6 @@ ea(`.papi-icon-button { color: white; text-decoration: underline; } -.papi-multi-column-menu { - background-color: lightgray; - display: flex; - flex-direction: column; - padding-left: 3px; - padding-right: 3px; -} - -.papi-menu { - background-color: rgb(145, 145, 145); - font-size: 11pt; - font-weight: 600; - margin-top: 1px; - padding-bottom: 2px; - padding-left: 24px; - padding-top: 2px; -} .papi-combo-box { background-color: transparent; } @@ -4360,13 +4334,79 @@ ea(`.papi-icon-button { background-color: greenyellow; color: darkgreen; } -.papi-ref-selector.book { - display: inline-block; - vertical-align: middle; +.papi-slider { + background-color: transparent; + color: #1ea7fd; } -.papi-ref-selector.chapter-verse { - width: 75px; +.papi-slider.vertical { + min-height: 200px; +} + +.papi-slider.paratext { + background-color: darkgreen; + color: greenyellow; +} + +.papi-slider.paratext.bright { + background-color: greenyellow; + color: darkgreen; +} +.papi-menu-item { + line-height: 0.8; +} + +.papi-menu-item.paratext { + background-color: darkgreen; + color: greenyellow; +} + +.papi-menu-item.paratext.bright { + background-color: greenyellow; + color: darkgreen; +} +.papi-snackbar { + font-family: Arial, Helvetica, sans-serif; +} + +.papi-snackbar.primary { + background: #1ea7fd; + color: white; +} + +.papi-snackbar.external { + background-color: lightsteelblue; + border-color: white; + border-style: dotted; + padding: 2%; + width: 30%; +} + +.papi-snackbar.secondary { + background: transparent; + color: #333; +} + +.papi-snackbar.alert { + background: lightcoral; +} + +.papi-snackbar.paratext { + background: darkgreen; + color: greenyellow; +} + +.papi-snackbar.bright { + background: greenyellow; + color: darkgreen; +} +.search-bar-paper { + display: flex; + align-items: center; +} + +.search-button { + padding: 10px; } .papi-checkbox { background-color: transparent; @@ -4408,37 +4448,6 @@ ea(`.papi-icon-button { .papi-checkbox.above { text-align: center; } -.papi-menu-item { - line-height: 0.8; -} - -.papi-menu-item.paratext { - background-color: darkgreen; - color: greenyellow; -} - -.papi-menu-item.paratext.bright { - background-color: greenyellow; - color: darkgreen; -} -.papi-slider { - background-color: transparent; - color: #1ea7fd; -} - -.papi-slider.vertical { - min-height: 200px; -} - -.papi-slider.paratext { - background-color: darkgreen; - color: greenyellow; -} - -.papi-slider.paratext.bright { - background-color: greenyellow; - color: darkgreen; -} .papi-switch { background-color: transparent; } @@ -4464,52 +4473,39 @@ ea(`.papi-icon-button { background-color: greenyellow; color: darkgreen; } -.papi-snackbar { - font-family: Arial, Helvetica, sans-serif; +.papi-icon-button { + border: 0; + border-radius: 3em; + cursor: pointer; + display: inline-block; } -.papi-snackbar.primary { - background: #1ea7fd; +.papi-icon-button.primary { + background-color: #1ea7fd; color: white; } -.papi-snackbar.external { - background-color: lightsteelblue; - border-color: white; - border-style: dotted; - padding: 2%; - width: 30%; -} - -.papi-snackbar.secondary { - background: transparent; +.papi-icon-button.secondary { + background-color: transparent; color: #333; } -.papi-snackbar.alert { - background: lightcoral; -} - -.papi-snackbar.paratext { - background: darkgreen; +.papi-icon-button.paratext { + background-color: darkgreen; color: greenyellow; } -.papi-snackbar.bright { - background: greenyellow; +.papi-icon-button.paratext.bright { + background-color: greenyellow; color: darkgreen; } -.search-bar-paper { - display: flex; - align-items: center; +.papi-ref-selector.book { + display: inline-block; + vertical-align: middle; } -.search-button { - padding: 10px; -} -.paratext { - background-color: darkgreen; - color: greenyellow; +.papi-ref-selector.chapter-verse { + width: 75px; } .papi-toolbar { background-color: #eee; @@ -4535,6 +4531,10 @@ ea(`.papi-icon-button { padding: 10px; position: relative; } +.paratext { + background-color: darkgreen; + color: greenyellow; +} @layer rdg.MeasuringCell {.m1l09lto7-0-0-beta-34 { contain: strict; grid-row: 1; diff --git a/src/extension-host/services/extension.service.ts b/src/extension-host/services/extension.service.ts index 953bcf8948..0a61e90128 100644 --- a/src/extension-host/services/extension.service.ts +++ b/src/extension-host/services/extension.service.ts @@ -20,9 +20,10 @@ import { setExtensionUris } from '@extension-host/services/extension-storage.ser import papi, { fetch as papiFetch } from '@extension-host/services/papi-backend.service'; import executionTokenService from '@node/services/execution-token.service'; import { ExecutionActivationContext } from '@extension-host/extension-types/extension-activation-context.model'; -import UnsubscriberAsyncList, { +import { debounce, UnsubscriberAsync, + UnsubscriberAsyncList, deserialize, } from 'platform-bible-utils'; import LogError from '@shared/log-error.model'; From 4eff04b85aa9ec441a6d3cad525f843594c9ccde Mon Sep 17 00:00:00 2001 From: Jolie Rabideau Date: Wed, 17 Jan 2024 09:09:49 -0500 Subject: [PATCH 3/4] adjust vite config and webViewRequire --- extensions/package-lock.json | 32 +-- .../src/hello-someone.web-view.html | 27 ++- lib/papi-dts/package-lock.json | 43 ++++ .../dist/{index.cjs.js => index.cjs} | 196 +++++++++--------- .../dist/index.cjs.js.map | 1 - lib/platform-bible-react/dist/index.cjs.map | 1 + lib/platform-bible-react/dist/index.es.js.map | 1 - .../dist/{index.es.js => index.js} | 196 +++++++++--------- lib/platform-bible-react/dist/index.js.map | 1 + lib/platform-bible-react/package.json | 4 +- lib/platform-bible-react/vite.config.ts | 2 +- .../dist/{index.cjs.js => index.cjs} | 2 +- .../dist/index.cjs.js.map | 1 - lib/platform-bible-utils/dist/index.cjs.map | 1 + lib/platform-bible-utils/dist/index.es.js.map | 1 - .../dist/{index.es.js => index.js} | 2 +- lib/platform-bible-utils/dist/index.js.map | 1 + lib/platform-bible-utils/package.json | 4 +- lib/platform-bible-utils/vite.config.ts | 2 +- src/renderer/global-this.model.ts | 4 + 20 files changed, 275 insertions(+), 247 deletions(-) rename lib/platform-bible-react/dist/{index.cjs.js => index.cjs} (99%) delete mode 100644 lib/platform-bible-react/dist/index.cjs.js.map create mode 100644 lib/platform-bible-react/dist/index.cjs.map delete mode 100644 lib/platform-bible-react/dist/index.es.js.map rename lib/platform-bible-react/dist/{index.es.js => index.js} (99%) create mode 100644 lib/platform-bible-react/dist/index.js.map rename lib/platform-bible-utils/dist/{index.cjs.js => index.cjs} (99%) delete mode 100644 lib/platform-bible-utils/dist/index.cjs.js.map create mode 100644 lib/platform-bible-utils/dist/index.cjs.map delete mode 100644 lib/platform-bible-utils/dist/index.es.js.map rename lib/platform-bible-utils/dist/{index.es.js => index.js} (99%) create mode 100644 lib/platform-bible-utils/dist/index.js.map diff --git a/extensions/package-lock.json b/extensions/package-lock.json index c2a313c573..da1d4aeae2 100644 --- a/extensions/package-lock.json +++ b/extensions/package-lock.json @@ -53,6 +53,9 @@ "version": "0.0.1", "dev": true, "license": "MIT", + "dependencies": { + "platform-bible-utils": "file:../platform-bible-utils" + }, "devDependencies": { "escape-string-regexp": "^5.0.0", "rimraf": "^5.0.1", @@ -64,6 +67,9 @@ "dev": true, "hasInstallScript": true, "license": "MIT", + "dependencies": { + "platform-bible-utils": "file:../platform-bible-utils" + }, "devDependencies": { "@mui/icons-material": "^5.13.7", "@senojs/rollup-plugin-style-inject": "^0.2.3", @@ -101,34 +107,18 @@ "hasInstallScript": true, "license": "MIT", "devDependencies": { - "@mui/icons-material": "^5.13.7", - "@senojs/rollup-plugin-style-inject": "^0.2.3", - "@types/react": "^18.2.15", - "@types/react-dom": "^18.2.7", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", - "@vitejs/plugin-react": "^4.0.3", "dts-bundle-generator": "^8.0.1", "eslint": "^8.45.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", "prettier": "^2.8.8", "prettier-plugin-jsdoc": "^0.4.2", - "stylelint": "^15.10.2", - "stylelint-config-recommended": "^13.0.0", - "stylelint-config-sass-guidelines": "^10.0.0", "ts-node": "^10.9.1", "tslib": "^2.6.0", "typescript": "^5.1.6", "vite": "^4.4.12" - }, - "peerDependencies": { - "@emotion/react": ">=11.11.1", - "@emotion/styled": ">=11.11.0", - "@mui/material": ">=5.14.1", - "react": ">=18.2.0", - "react-data-grid": ">=7.0.0-beta.34", - "react-dom": ">=18.2.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -10027,6 +10017,7 @@ "version": "file:../lib/papi-dts", "requires": { "escape-string-regexp": "^5.0.0", + "platform-bible-utils": "file:../platform-bible-utils", "rimraf": "^5.0.1", "typescript": "^5.1.6" } @@ -10174,6 +10165,7 @@ "eslint": "^8.45.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", + "platform-bible-utils": "file:../platform-bible-utils", "prettier": "^2.8.8", "prettier-plugin-jsdoc": "^0.4.2", "stylelint": "^15.10.2", @@ -10188,22 +10180,14 @@ "platform-bible-utils": { "version": "file:../lib/platform-bible-utils", "requires": { - "@mui/icons-material": "^5.13.7", - "@senojs/rollup-plugin-style-inject": "^0.2.3", - "@types/react": "^18.2.15", - "@types/react-dom": "^18.2.7", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", - "@vitejs/plugin-react": "^4.0.3", "dts-bundle-generator": "^8.0.1", "eslint": "^8.45.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", "prettier": "^2.8.8", "prettier-plugin-jsdoc": "^0.4.2", - "stylelint": "^15.10.2", - "stylelint-config-recommended": "^13.0.0", - "stylelint-config-sass-guidelines": "^10.0.0", "ts-node": "^10.9.1", "tslib": "^2.6.0", "typescript": "^5.1.6", diff --git a/extensions/src/hello-someone/src/hello-someone.web-view.html b/extensions/src/hello-someone/src/hello-someone.web-view.html index c1e18edaff..7df2e8bdfb 100644 --- a/extensions/src/hello-someone/src/hello-someone.web-view.html +++ b/extensions/src/hello-someone/src/hello-someone.web-view.html @@ -34,6 +34,7 @@