piral-modals 1.9.0-beta.8196 → 1.9.0-beta.8210

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/lib/Modals.js CHANGED
@@ -29,7 +29,8 @@ export const Modals = () => {
29
29
  return (Component && (React.createElement(PiralModalsDialog, { ...n, options: options, defaults: reg.defaults, layout: reg.layout, key: n.name },
30
30
  React.createElement(Component, { onClose: n.close, options: options }))));
31
31
  })
32
- .filter(Boolean);
32
+ .filter(Boolean)
33
+ .reverse();
33
34
  const open = children.length > 0;
34
35
  return (React.createElement(PiralModalsHost, { open: open, close: close }, children));
35
36
  };
package/lib/Modals.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Modals.js","sourceRoot":"","sources":["../src/Modals.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGlE,SAAS,QAAQ,CAAC,MAA8B;IAC9C,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,SAAS,CAAC,MAAyC,EAAE,IAAY;IACxE,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;aAChC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC;aACtC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAEzB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,CAAC,MAAM,M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AM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;QAC/D,MAAM,SAAS,GAAG,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC;QACvC,MAAM,QAAQ,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC;QACrC,MAAM,OAAO,GAAG;YACd,GAAG,QAAQ;YACX,GAAG,CAAC,CAAC,OAAO;SACb,CAAC;QACF,OAAO,CACL,SAAS,IAAI,CACX,oBAAC,iBAAiB,OAAK,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI;YACjG,oBAAC,SAAS,IAAC,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,CAC/B,CACrB,CACF,CAAC;IACJ,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAC;SACf,OAAO,EAAE,CAAC;IACb,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAEjC,OAAO,CACL,oBAAC,eAAe,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,IACtC,QAAQ,CACO,CACnB,CAAC;AACJ,CAAC,CAAC;AACF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-modals",
3
- "version": "1.9.0-beta.8196",
3
+ "version": "1.9.0-beta.8210",
4
4
  "description": "Plugin for the display of modal dialogs in Piral.",
5
5
  "keywords": [
6
6
  "piral",
@@ -51,8 +51,8 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/react": "^18.0.0",
54
- "piral-core": "1.9.0-beta.8196",
54
+ "piral-core": "1.9.0-beta.8210",
55
55
  "react": "^18.0.0"
56
56
  },
57
- "gitHead": "73f7d0d90884d0b1dc1cc5ed7965f0cb0bc48a20"
57
+ "gitHead": "3fec5d65f1e1aac0e425ed852402afda4af3cae9"
58
58
  }
@@ -1 +1 @@
1
- var piralModals=(()=>{var v=Object.create;var M=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var m=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(t,a)=>(typeof require<"u"?require:t)[a]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var R=(o,t)=>{for(var a in t)M(o,a,{get:t[a],enumerable:!0})},b=(o,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of I(t))!F.call(o,r)&&r!==a&&M(o,r,{get:()=>t[r],enumerable:!(l=w(t,r))||l.enumerable});return o};var A=(o,t,a)=>(a=o!=null?v(B(o)):{},b(t||!o||!o.__esModule?M(a,"default",{value:o,enumerable:!0}):a,o)),N=o=>b(M({},"__esModule",{value:!0}),o);var J={};R(J,{Modals:()=>u,PiralModalsDialog:()=>x,PiralModalsHost:()=>P,createModalsApi:()=>z});var y={};R(y,{closeModal:()=>k,openModal:()=>$,registerModal:()=>E,unregisterModal:()=>K});var d=m("piral-core");function $(o,t){o.dispatch(a=>({...a,modals:(0,d.prependItem)(a.modals,t)}))}function k(o,t){o.dispatch(a=>({...a,modals:(0,d.excludeOn)(a.modals,l=>l.id===t.id)}))}function E(o,t,a){o.dispatch(l=>({...l,registry:{...l.registry,modals:(0,d.withKey)(l.registry.modals,t,a)}}))}function K(o,t){o.dispatch(a=>({...a,registry:{...a.registry,modals:(0,d.withoutKey)(a.registry.modals,t)}}))}var n=m("piral-core");var D=A(m("react")),G=m("piral-core"),H=o=>D.createElement("div",{className:"piral-modals-host"},o.open&&D.createElement("div",{className:"piral-modals-overlay"},o.children)),O=o=>(0,G.defaultRender)(o.children);var f=A(m("react")),C=m("piral-core");var h=m("piral-core"),P=(0,h.getPiralComponent)("ModalsHost"),x=(0,h.getPiralComponent)("ModalsDialog");function L(o){o.forEach(t=>t.close())}function T(o,t){if(t){let[a]=Object.keys(o).filter(l=>o[l].name===t).map(l=>o[l]);return a}}var u=()=>{let o=(0,C.useGlobalState)(e=>e.registry.modals),t=(0,C.useGlobalState)(e=>e.modals),a=()=>L(t),l=t.map(e=>{let i=o[e.name]||T(o,e.alternative),s=i&&i.component,p={...i&&i.defaults,...e.options};return s&&f.createElement(x,{...e,options:p,defaults:i.defaults,layout:i.layout,key:e.name},f.createElement(s,{onClose:e.close,options:p}))}).filter(Boolean),r=l.length>0;return f.createElement(P,{open:r,close:a},l)};u.displayName="Modals";function j(o){let t={};for(let{name:a,component:l,defaults:r,layout:e={}}of o)t[`global-${a}`]={pilet:void 0,name:a,component:l,defaults:r,layout:e};return t}function q(o){return t=>({...t,components:{ModalsHost:H,ModalsDialog:O,...t.components},registry:{...t.registry,modals:o},modals:[]})}function z(o={}){let{dialogs:t=[],selectId:a=l=>`${l}-${~~(Math.random()*1e4)}`}=o;return l=>(l.defineActions(y),l.dispatch((0,n.withAll)(q(j(t)),(0,n.withRootExtension)("piral-modals",u))),(r,e)=>{let i=e.name;return{showModal(s,c){let p=(0,n.buildName)(i,s),g={id:a(p),name:p,alternative:s,options:c,close(){l.closeModal(g)}};return l.openModal(g),g.close},registerModal(s,c,p,g={}){let S=(0,n.buildName)(i,s);return l.registerModal(S,{pilet:i,name:s,component:(0,n.withApi)(l,c,r,"modal"),defaults:p,layout:g}),()=>r.unregisterModal(s)},unregisterModal(s){let c=(0,n.buildName)(i,s);l.unregisterModal(c)}}})}return N(J);})();
1
+ var piralModals=(()=>{var v=Object.create;var M=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var m=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(t,a)=>(typeof require<"u"?require:t)[a]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var R=(o,t)=>{for(var a in t)M(o,a,{get:t[a],enumerable:!0})},b=(o,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of I(t))!F.call(o,r)&&r!==a&&M(o,r,{get:()=>t[r],enumerable:!(l=w(t,r))||l.enumerable});return o};var A=(o,t,a)=>(a=o!=null?v(B(o)):{},b(t||!o||!o.__esModule?M(a,"default",{value:o,enumerable:!0}):a,o)),N=o=>b(M({},"__esModule",{value:!0}),o);var J={};R(J,{Modals:()=>u,PiralModalsDialog:()=>x,PiralModalsHost:()=>P,createModalsApi:()=>z});var y={};R(y,{closeModal:()=>k,openModal:()=>$,registerModal:()=>E,unregisterModal:()=>K});var d=m("piral-core");function $(o,t){o.dispatch(a=>({...a,modals:(0,d.prependItem)(a.modals,t)}))}function k(o,t){o.dispatch(a=>({...a,modals:(0,d.excludeOn)(a.modals,l=>l.id===t.id)}))}function E(o,t,a){o.dispatch(l=>({...l,registry:{...l.registry,modals:(0,d.withKey)(l.registry.modals,t,a)}}))}function K(o,t){o.dispatch(a=>({...a,registry:{...a.registry,modals:(0,d.withoutKey)(a.registry.modals,t)}}))}var n=m("piral-core");var D=A(m("react")),G=m("piral-core"),H=o=>D.createElement("div",{className:"piral-modals-host"},o.open&&D.createElement("div",{className:"piral-modals-overlay"},o.children)),O=o=>(0,G.defaultRender)(o.children);var f=A(m("react")),C=m("piral-core");var h=m("piral-core"),P=(0,h.getPiralComponent)("ModalsHost"),x=(0,h.getPiralComponent)("ModalsDialog");function L(o){o.forEach(t=>t.close())}function T(o,t){if(t){let[a]=Object.keys(o).filter(l=>o[l].name===t).map(l=>o[l]);return a}}var u=()=>{let o=(0,C.useGlobalState)(e=>e.registry.modals),t=(0,C.useGlobalState)(e=>e.modals),a=()=>L(t),l=t.map(e=>{let i=o[e.name]||T(o,e.alternative),s=i&&i.component,p={...i&&i.defaults,...e.options};return s&&f.createElement(x,{...e,options:p,defaults:i.defaults,layout:i.layout,key:e.name},f.createElement(s,{onClose:e.close,options:p}))}).filter(Boolean).reverse(),r=l.length>0;return f.createElement(P,{open:r,close:a},l)};u.displayName="Modals";function j(o){let t={};for(let{name:a,component:l,defaults:r,layout:e={}}of o)t[`global-${a}`]={pilet:void 0,name:a,component:l,defaults:r,layout:e};return t}function q(o){return t=>({...t,components:{ModalsHost:H,ModalsDialog:O,...t.components},registry:{...t.registry,modals:o},modals:[]})}function z(o={}){let{dialogs:t=[],selectId:a=l=>`${l}-${~~(Math.random()*1e4)}`}=o;return l=>(l.defineActions(y),l.dispatch((0,n.withAll)(q(j(t)),(0,n.withRootExtension)("piral-modals",u))),(r,e)=>{let i=e.name;return{showModal(s,c){let p=(0,n.buildName)(i,s),g={id:a(p),name:p,alternative:s,options:c,close(){l.closeModal(g)}};return l.openModal(g),g.close},registerModal(s,c,p,g={}){let S=(0,n.buildName)(i,s);return l.registerModal(S,{pilet:i,name:s,component:(0,n.withApi)(l,c,r,"modal"),defaults:p,layout:g}),()=>r.unregisterModal(s)},unregisterModal(s){let c=(0,n.buildName)(i,s);l.unregisterModal(c)}}})}return N(J);})();
package/src/Modals.tsx CHANGED
@@ -40,7 +40,8 @@ export const Modals: React.FC = () => {
40
40
  )
41
41
  );
42
42
  })
43
- .filter(Boolean);
43
+ .filter(Boolean)
44
+ .reverse();
44
45
  const open = children.length > 0;
45
46
 
46
47
  return (