buckyos 0.7.175 → 0.7.180
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/cli/dist/cli.mjs +147 -41
- package/cli/dist/cli.mjs.map +1 -1
- package/cli/modules/pikg.ts +193 -51
- package/cli/runtime/fs_retry.ts +26 -0
- package/cli/runtime/host_deno.ts +17 -2
- package/cli/runtime/host_node.ts +16 -2
- package/cli/version.ts +1 -1
- package/dist/aiworkspace_client.d.ts +36 -2
- package/dist/aiworkspace_client.d.ts.map +1 -1
- package/dist/app-frame.cjs +1 -1
- package/dist/app-frame.cjs.map +1 -1
- package/dist/app-frame.d.ts +57 -1
- package/dist/app-frame.d.ts.map +1 -1
- package/dist/app-frame.mjs +291 -6
- package/dist/app-frame.mjs.map +1 -1
- package/dist/browser.cjs +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +2 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.mjs +16 -2
- package/dist/browser.mjs.map +1 -1
- package/dist/content.cjs +1 -1
- package/dist/content.cjs.map +1 -1
- package/dist/content.d.ts +77 -0
- package/dist/content.d.ts.map +1 -1
- package/dist/content.mjs +65 -0
- package/dist/content.mjs.map +1 -1
- package/dist/content_objid-1aff74b6.js +2 -0
- package/dist/content_objid-1aff74b6.js.map +1 -0
- package/dist/content_objid-9232bcaf.mjs +29 -0
- package/dist/content_objid-9232bcaf.mjs.map +1 -0
- package/dist/content_objid.d.ts +15 -0
- package/dist/content_objid.d.ts.map +1 -0
- package/dist/executor_client-7ce0ddc7.js +13 -0
- package/dist/executor_client-7ce0ddc7.js.map +1 -0
- package/dist/{executor_client-c620d25c.mjs → executor_client-bfc8a1e1.mjs} +77 -6
- package/dist/executor_client-bfc8a1e1.mjs.map +1 -0
- package/dist/executor_client.d.ts +1 -1
- package/dist/executor_client.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +12 -3
- package/dist/index.mjs.map +1 -1
- package/dist/nfsp.cjs.map +1 -1
- package/dist/nfsp.d.ts +2 -1
- package/dist/nfsp.d.ts.map +1 -1
- package/dist/nfsp.mjs.map +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.mjs +2 -2
- package/dist/provision.cjs +1 -1
- package/dist/provision.cjs.map +1 -1
- package/dist/provision.mjs +48 -16
- package/dist/provision.mjs.map +1 -1
- package/dist/provision_activate.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/executor_client-c620d25c.mjs.map +0 -1
- package/dist/executor_client-d4439d54.js +0 -13
- package/dist/executor_client-d4439d54.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiworkspace_client.d.ts","sourceRoot":"","sources":["../src/aiworkspace_client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,eAAO,MAAM,wBAAwB,gBAAgB,CAAA;AAErD,2HAA2H;AAC3H,MAAM,WAAW,SAAS;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE;AAClH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,CAAC,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAA;AAEhF,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;gBACX,KAAK,EAAE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AO,CAAC,EAAE,eAAe,EAAE,MAAM;IAGxG,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAG9E,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAG9D,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBACzE,MAAM;iBAAW,MAAM;mBAAa,MAAM;qBAAe,MAAM;kBAAY,MAAM;;IAE9G,YAAY,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAGtG,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa;IACrD,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;IAGvF,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAC/C"}
|
package/dist/app-frame.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./content.cjs");require("./content_mime-dc80d960.js");const t=(e,t,i={})=>({protocol:"buckyos.app-frame",version:1,type:e,payload:t,...i}),i=e=>{if(!e||"object"!=typeof e)return!1;const t=e;return"buckyos.app-frame"===t.protocol&&1===t.version&&"string"==typeof t.type&&!!t.payload&&"object"==typeof t.payload};const s="buckyos.preview-embed",n=(e,t)=>({protocol:s,version:1,type:e,payload:t}),o=e=>{const t=e;return!!t&&t.protocol===s&&1===t.version&&"string"==typeof t.type&&!!t.payload&&"object"==typeof t.payload},r="/embed/preview";exports.AppFrameClient=class{constructor(e){if(this.options=e,this.listener=e=>{this.receive(e)},this.origin=new URL(e.shellOrigin).origin,this.nonce=new URLSearchParams(window.location.hash.slice(1)).get("bfp"),window.addEventListener("message",this.listener),window.parent!==window&&this.nonce){const i=()=>window.parent.postMessage(t("frame.hello",{nonce:this.nonce,appCapabilities:[...e.onOpen?["open"]:[],...e.onBeforeClose?["beforeClose"]:[],...e.onBack?["back"]:[]]}),this.origin);i(),this.helloTimer=setInterval(i,250),this.helloDeadline=setTimeout((()=>clearInterval(this.helloTimer)),1500)}}async receive(s){var n,o,r,a,l,p,c,d,h,u,f,m,w,y;if(s.source!==window.parent||s.origin!==this.origin||!i(s.data))return;const g=s.data,v=g.payload;if("frame.init"===g.type){if(!this.nonce||v.nonce!==this.nonce||"string"!=typeof v.locale||!v.theme||"string"!=typeof v.windowId||v.launch&&!e.isOpenRequest(v.launch))return;return clearInterval(this.helloTimer),clearTimeout(this.helloDeadline),this.init=v,this.title=void 0,this.focused=void 0,void(null==(o=(n=this.options).onInit)||o.call(n,this.init))}if(!this.init)return;const b=e=>window.parent.postMessage(t(g.type+"Result",e,{replyTo:g.id}),this.origin);try{"frame.open"===g.type&&e.isOpenRequest(v.request)&&b(await(null==(a=(r=this.options).onOpen)?void 0:a.call(r,v.request))??{accepted:!1}),"frame.beforeClose"===g.type&&b({decision:await(null==(p=(l=this.options).onBeforeClose)?void 0:p.call(l,v.reason))??"allow"}),"frame.back"===g.type&&b({handled:await(null==(d=(c=this.options).onBack)?void 0:d.call(c))??!1}),"frame.themeChanged"!==g.type||"dark"!==v.mode&&"light"!==v.mode||null==(u=(h=this.options).onTheme)||u.call(h,v),"frame.localeChanged"===g.type&&"string"==typeof v.locale&&(null==(m=(f=this.options).onLocale)||m.call(f,v.locale)),"frame.focusChanged"===g.type&&this.focused!==(!0===v.focused)&&(this.focused=!0===v.focused,null==(y=(w=this.options).onFocus)||y.call(w,this.focused))}catch{"frame.open"===g.type&&b({accepted:!1,fallback:"preview"}),"frame.beforeClose"===g.type&&b({decision:"deny"})}}send(e,i){this.init&&window.parent.postMessage(t(e,i),this.origin)}setTitle(e,t=!1){const i=JSON.stringify([e,t]);this.init&&i!==this.title&&(this.title=i,this.send("window.setTitle",{title:e,dirty:t}))}requestClose(){this.send("window.requestClose",{})}openContent(t,i="default",s={}){const n=s.hints??{};return this.init?(this.send("content.open",{request:t,target:i,newWindow:!0===s.newWindow,hints:n}),!0):!!this.options.systemOrigin&&(window.open(e.systemOpenUrl(this.options.systemOrigin,{request:t,target:i,hints:n,from:this.options.appId}),"_blank","noopener"),!0)}dispose(){clearInterval(this.helloTimer),clearTimeout(this.helloDeadline),window.removeEventListener("message",this.listener)}},exports.AppFrameHost=class{constructor(e){this.options=e,this.ready=!1,this.capabilities=[],this.pending=new Map,this.listener=e=>this.receive(e),this.opens=[],window.addEventListener("message",this.listener)}receive(t){var s,n,o,r,a,l,p,c;if(t.source!==this.options.target()||t.origin!==this.options.origin||!i(t.data))return;const d=t.data,h=d.payload;if("frame.hello"===d.type){if(h.nonce!==this.options.init.nonce||!Array.isArray(h.appCapabilities))return;return this.ready=!0,this.capabilities=h.appCapabilities.filter((e=>"string"==typeof e)),this.send("frame.init",this.options.init),void 0!==this.focused&&this.send("frame.focusChanged",{focused:this.focused}),void(null==(n=(s=this.options).onReady)||n.call(s))}if(this.ready)if(d.replyTo){const e=this.pending.get(d.replyTo);e&&d.type===e.type+"Result"&&(clearTimeout(e.timer),this.pending.delete(d.replyTo),e.resolve(d.payload))}else if("window.setTitle"===d.type&&"string"==typeof h.title&&(null==(r=(o=this.options).onTitle)||r.call(o,h.title.slice(0,256),!0===h.dirty)),"window.requestClose"===d.type&&(null==(l=(a=this.options).onRequestClose)||l.call(a)),"content.open"===d.type&&("default"===h.target||"preview"===h.target||"chooser"===h.target)){const t={...h.request,requestId:crypto.randomUUID()};if(!e.isOpenRequest(t))return;if(this.opens=this.opens.filter((e=>e>Date.now()-1e4)),this.opens.length>=5)return;this.opens.push(Date.now()),null==(c=(p=this.options).onContentOpen)||c.call(p,t,h.target,{newWindow:!0===h.newWindow,hints:e.readContentHints(h.hints)})}}update(e){this.options.init={...this.options.init,...e}}setFocused(e){this.focused!==e&&(this.focused=e,this.send("frame.focusChanged",{focused:e}))}send(e,i){var s;this.ready&&(null==(s=this.options.target())||s.postMessage(t(e,i),this.options.origin))}request(e,i,s=3e3){if(!this.ready)return Promise.reject(new Error("App frame is not ready"));const n=crypto.randomUUID();return new Promise(((o,r)=>{var a;const l=setTimeout((()=>{this.pending.delete(n),r(new Error("App frame timed out"))}),s);this.pending.set(n,{resolve:o,reject:r,timer:l,type:e}),null==(a=this.options.target())||a.postMessage(t(e,i,{id:n}),this.options.origin)}))}async open(e){return this.capabilities.includes("open")?await this.request("frame.open",{request:e}):{accepted:!1}}async beforeClose(e="user"){if(!this.ready||!this.capabilities.includes("beforeClose"))return"allow";const t=await this.request("frame.beforeClose",{reason:e});return"allow"===t.decision||"pending"===t.decision?t.decision:"deny"}async back(){return!!this.capabilities.includes("back")&&!0===(await this.request("frame.back",{})).handled}dispose(){window.removeEventListener("message",this.listener),this.pending.forEach((e=>{clearTimeout(e.timer),e.reject(new Error("App frame disposed"))})),this.pending.clear(),this.ready=!1}},exports.PREVIEW_EMBED_PATH=r,exports.PreviewEmbed=class{constructor(e){this.options=e,this.nonce=crypto.randomUUID(),this.listener=e=>this.receive(e),this.origin=new URL(e.systemOrigin).origin,this.init=e.init,this.url=`${this.origin}${r}#bpe=${this.nonce}&po=${encodeURIComponent(window.location.origin)}`,window.addEventListener("message",this.listener)}post(e,t){var i,s;null==(s=null==(i=this.options.frame())?void 0:i.contentWindow)||s.postMessage(n(e,t),this.origin)}receive(t){var i,s,n,r,a,l,p;if(t.origin!==this.origin||t.source!==(null==(i=this.options.frame())?void 0:i.contentWindow)||!o(t.data))return;const{type:c,payload:d}=t.data;if("embed.hello"!==c){if("embed.state"===c&&("loading"===d.status||"ready"===d.status||"error"===d.status)){const e=d.error;null==(n=(s=this.options).onState)||n.call(s,{status:d.status,error:e&&"string"==typeof e.kind&&"string"==typeof e.code?{kind:e.kind,code:e.code}:void 0,title:"string"==typeof d.title?d.title.slice(0,256):void 0,mediaType:"string"==typeof d.mediaType?d.mediaType.slice(0,128):void 0})}if("embed.openWith"===c){const t=d.request;t&&e.isTransferableRef(t.source)&&(void 0===t.session||e.isTransferableSession(t.session))&&(null==(a=(r=this.options).onOpenWith)||a.call(r,{request:{source:t.source,session:t.session},hints:e.readContentHints(d.hints)}))}"embed.exit"===c&&(null==(p=(l=this.options).onExit)||p.call(l))}else d.nonce===this.nonce&&this.post("embed.init",{...this.init,nonce:this.nonce})}update(e){this.init={...this.init,...e},this.post("embed.update",e)}dispose(){window.removeEventListener("message",this.listener)}},exports.PreviewEmbedHost=class{constructor(e){this.options=e,this.ready=!1,this.listener=e=>this.receive(e);const t=new URLSearchParams(window.location.hash.slice(1));this.nonce=t.get("bpe");let i=null;try{i=new URL(t.get("po")??"").origin}catch{}if(this.parentOrigin=window.parent!==window&&this.nonce&&i&&e.accept(i)?i:null,!this.parentOrigin)return;window.addEventListener("message",this.listener);const s=()=>window.parent.postMessage(n("embed.hello",{nonce:this.nonce}),this.parentOrigin);s(),this.hello=setInterval((()=>{this.ready||s()}),250)}receive(t){var i,s;if(t.source!==window.parent||t.origin!==this.parentOrigin||!o(t.data))return;const{type:n,payload:r}=t.data;if("embed.init"===n){if(r.nonce!==this.nonce||(a=r.source,!(e.isTransferableRef(a)||a&&"object"==typeof a&&"blob"===a.kind&&"undefined"!=typeof Blob&&a.blob instanceof Blob&&"string"==typeof a.name))||void 0!==r.session&&!e.isTransferableSession(r.session)||"string"!=typeof r.locale)return;return this.ready=!0,clearInterval(this.hello),void this.options.onInit({nonce:String(r.nonce),source:r.source,session:r.session,theme:"dark"===r.theme?"dark":"light",locale:r.locale})}var a;if("embed.update"===n&&this.ready){const e={};"dark"!==r.theme&&"light"!==r.theme||(e.theme=r.theme),"string"==typeof r.locale&&(e.locale=r.locale),null==(s=(i=this.options).onUpdate)||s.call(i,e)}}post(e,t){this.ready&&this.parentOrigin&&window.parent.postMessage(n(e,t),this.parentOrigin)}state(e){this.post("embed.state",e)}openWith(e){this.post("embed.openWith",e)}exit(){this.post("embed.exit",{})}dispose(){clearInterval(this.hello),window.removeEventListener("message",this.listener)}},exports.embedderOrigin=function(e){var t;if(window.parent===window)return null;const i=[null==(t=window.location.ancestorOrigins)?void 0:t[0],document.referrer];for(const s of i)if(s)try{const t=new URL(s).origin;if(e(t))return t}catch{}return null},exports.originInZone=(e,t)=>{try{const i=new URL(e);return i.protocol===window.location.protocol&&(i.hostname===t||i.hostname.endsWith(`.${t}`))}catch{return!1}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./content.cjs");require("./content_mime-dc80d960.js");const t=t=>e.SYSTEM_DIALOG_ERROR_CODES.includes(t)?t:"protocol",i=(e,t,i={})=>({protocol:"buckyos.app-frame",version:1,type:e,payload:t,...i}),o=e=>{if(!e||"object"!=typeof e)return!1;const t=e;return"buckyos.app-frame"===t.protocol&&1===t.version&&"string"==typeof t.type&&!!t.payload&&"object"==typeof t.payload};const n="buckyos.preview-embed",s=(e,t,i=n)=>({protocol:i,version:1,type:e,payload:t}),r=(e,t=n)=>{const i=e;return!!i&&i.protocol===t&&1===i.version&&"string"==typeof i.type&&!!i.payload&&"object"==typeof i.payload},a="/embed/preview";const l="buckyos.sysdlg-embed",d="/embed/sysdlg/select";let c=!1;function p(i,o,n={}){var a,p;if(null==(a=n.signal)?void 0:a.aborted)return Promise.reject(new e.SystemDialogError("closed"));if(c)return Promise.reject(new e.SystemDialogError("busy"));c=!0;const h=new URL(i).origin,u=n.locale??navigator.language??"en",m=n.theme??((null==(p=window.matchMedia)?void 0:p.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light"),g=u.toLowerCase().startsWith("zh");return new Promise(((i,a)=>{var p;const y=document.body,f=document.documentElement,w=document.activeElement instanceof HTMLElement?document.activeElement:null,b={x:window.scrollX,y:window.scrollY},v={body:y.getAttribute("style"),html:f.getAttribute("style")},E=Array.from(y.children).filter((e=>e instanceof HTMLElement)).map((e=>({el:e,inert:e.inert,hidden:e.getAttribute("aria-hidden")}))),T=document.createElement("div");let L;T.setAttribute("data-buckyos-sysdlg","select"),T.setAttribute("role","dialog"),T.setAttribute("aria-modal","true"),T.setAttribute("aria-label",g?"文件选择器":"File picker"),T.style.cssText="position:fixed;inset:0;height:100vh;height:100dvh;z-index:2147483647;background:rgba(0,0,0,.32);display:flex;align-items:center;justify-content:center";let k,x="",C=!1;const O=e=>{T.contains(e.target)||(e.stopPropagation(),e.preventDefault())},A=["keydown","pointerdown","mousedown","touchstart","wheel"],S=()=>{var e;return!C&&(C=!0,c=!1,clearTimeout(k),window.removeEventListener("message",M),null==(e=n.signal)||e.removeEventListener("abort",R),"inert"in HTMLElement.prototype||A.forEach((e=>document.removeEventListener(e,O,!0))),T.remove(),E.forEach((({el:e,inert:t,hidden:i})=>{e.inert=t,null===i?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",i)})),null===v.body?y.removeAttribute("style"):y.setAttribute("style",v.body),null===v.html?f.removeAttribute("style"):f.setAttribute("style",v.html),window.scrollTo(b.x,b.y),null==w||w.focus({preventScroll:!0}),!0)},D=t=>{S()&&a(new e.SystemDialogError(t))},R=()=>D("closed"),I=()=>{null==L||L.remove(),L=void 0;const e=document.createElement("div");e.setAttribute("role","alert"),e.style.cssText=`max-width:22rem;margin:1rem;padding:1.25rem;border-radius:16px;font:14px/1.6 system-ui,sans-serif;background:${"dark"===m?"#1f2329":"#fff"};color:${"dark"===m?"#f2f3f5":"#1f2329"};box-shadow:0 24px 64px rgba(0,0,0,.24)`;const t=document.createElement("p");t.style.margin="0 0 1rem",t.textContent=g?"无法加载文件选择器":"Unable to load the file picker";const i=document.createElement("div");i.style.cssText="display:flex;gap:.5rem;justify-content:flex-end";const o=(e,t)=>{const o=document.createElement("button");return o.type="button",o.textContent=e,o.style.cssText="min-height:2.25rem;padding:0 1rem;font:inherit;border-radius:999px;border:1px solid currentColor;background:transparent;color:inherit;cursor:pointer",o.addEventListener("click",t),i.append(o),o};o(g?"取消":"Cancel",(()=>D("load_failed")));const n=o(g?"重试":"Retry",(()=>{e.remove(),U()}));e.append(t,i),T.append(e),n.focus()},U=()=>{x=crypto.randomUUID(),L=document.createElement("iframe"),L.title=g?"文件选择器":"File picker",L.style.cssText="position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent;color-scheme:normal",L.setAttribute("allowtransparency","true"),L.addEventListener("error",I),L.src=`${h}${d}#bse=${x}&po=${encodeURIComponent(window.location.origin)}`,T.append(L),k=setTimeout(I,1e4)},M=n=>{var a;if(!L||n.origin!==h||n.source!==L.contentWindow||!r(n.data,l))return;const{type:d,payload:c}=n.data;if("embed.hello"===d){if(c.nonce!==x)return;clearTimeout(k),null==(a=L.contentWindow)||a.postMessage(s("embed.init",{nonce:x,params:o,theme:m,locale:u},l),h),L.focus()}if("embed.error"===d&&D(t(c.code)),"embed.result"===d){const t=e.readSelectDialogResult(c.result,{allowLocal:!0===o.allowLocal});t?(e=>{S()&&i(e)})(t):D("protocol")}};window.addEventListener("message",M),null==(p=n.signal)||p.addEventListener("abort",R,{once:!0}),"inert"in HTMLElement.prototype?E.forEach((({el:e})=>{e.inert=!0})):(E.forEach((({el:e})=>e.setAttribute("aria-hidden","true"))),A.forEach((e=>document.addEventListener(e,O,!0)))),f.style.overflow="hidden",y.style.position="fixed",y.style.top=-b.y+"px",y.style.left=-b.x+"px",y.style.right="0",y.style.overflow="hidden",y.append(T),U()}))}exports.AppFrameClient=class{constructor(e){if(this.options=e,this.listener=e=>{this.receive(e)},this.dialogs=new Map,this.origin=new URL(e.shellOrigin).origin,this.nonce=new URLSearchParams(window.location.hash.slice(1)).get("bfp"),window.addEventListener("message",this.listener),window.parent!==window&&this.nonce){const t=()=>window.parent.postMessage(i("frame.hello",{nonce:this.nonce,appCapabilities:[...e.onOpen?["open"]:[],...e.onBeforeClose?["beforeClose"]:[],...e.onBack?["back"]:[]]}),this.origin);t(),this.helloTimer=setInterval(t,250),this.helloDeadline=setTimeout((()=>clearInterval(this.helloTimer)),1500)}}async receive(n){var s,r,a,l,d,c,p,h,u,m,g,y,f,w;if(n.source!==window.parent||n.origin!==this.origin||!o(n.data))return;const b=n.data,v=b.payload;if("frame.init"===b.type){if(!this.nonce||v.nonce!==this.nonce||"string"!=typeof v.locale||!v.theme||"string"!=typeof v.windowId||v.launch&&!e.isOpenRequest(v.launch))return;return clearInterval(this.helloTimer),clearTimeout(this.helloDeadline),this.init=v,this.title=void 0,this.focused=void 0,void(null==(r=(s=this.options).onInit)||r.call(s,this.init))}if(!this.init)return;if("sysdlg.openResult"===b.type){const i=b.replyTo?this.dialogs.get(b.replyTo):void 0;if(!i)return;if(this.dialogs.delete(b.replyTo),!0!==v.ok)return i.reject(new e.SystemDialogError(t(v.code)));const o=e.readSelectDialogResult(v.result,{allowLocal:i.allowLocal});return void(o?i.resolve(o):i.reject(new e.SystemDialogError("protocol")))}const E=e=>window.parent.postMessage(i(b.type+"Result",e,{replyTo:b.id}),this.origin);try{"frame.open"===b.type&&e.isOpenRequest(v.request)&&E(await(null==(l=(a=this.options).onOpen)?void 0:l.call(a,v.request))??{accepted:!1}),"frame.beforeClose"===b.type&&E({decision:await(null==(c=(d=this.options).onBeforeClose)?void 0:c.call(d,v.reason))??"allow"}),"frame.back"===b.type&&E({handled:await(null==(h=(p=this.options).onBack)?void 0:h.call(p))??!1}),"frame.themeChanged"!==b.type||"dark"!==v.mode&&"light"!==v.mode||null==(m=(u=this.options).onTheme)||m.call(u,v),"frame.localeChanged"===b.type&&"string"==typeof v.locale&&(null==(y=(g=this.options).onLocale)||y.call(g,v.locale)),"frame.focusChanged"===b.type&&this.focused!==(!0===v.focused)&&(this.focused=!0===v.focused,null==(w=(f=this.options).onFocus)||w.call(f,this.focused))}catch{"frame.open"===b.type&&E({accepted:!1,fallback:"preview"}),"frame.beforeClose"===b.type&&E({decision:"deny"})}}send(e,t){this.init&&window.parent.postMessage(i(e,t),this.origin)}setTitle(e,t=!1){const i=JSON.stringify([e,t]);this.init&&i!==this.title&&(this.title=i,this.send("window.setTitle",{title:e,dirty:t}))}requestClose(){this.send("window.requestClose",{})}openContent(t,i="default",o={}){const n=o.hints??{};return this.init?(this.send("content.open",{request:t,target:i,newWindow:!0===o.newWindow,hints:n}),!0):!!this.options.systemOrigin&&(window.open(e.systemOpenUrl(this.options.systemOrigin,{request:t,target:i,hints:n,from:this.options.appId}),"_blank","noopener"),!0)}selectContent(t={},o={}){var n,s;if(this.init){if(!this.init.shellCapabilities.includes(e.SELECT_DIALOG_PATH))return Promise.reject(new e.SystemDialogError("unsupported"));if(this.dialogs.size)return Promise.reject(new e.SystemDialogError("busy"));const o=crypto.randomUUID();return new Promise(((n,s)=>{this.dialogs.set(o,{resolve:n,reject:s,allowLocal:!0===t.allowLocal}),window.parent.postMessage(i("sysdlg.open",{path:e.SELECT_DIALOG_PATH,params:t},{id:o}),this.origin)}))}if(!this.options.systemOrigin)return Promise.reject(new e.SystemDialogError("unsupported"));const r=this.embedAbort=new AbortController;return null==(n=o.signal)||n.addEventListener("abort",(()=>r.abort()),{once:!0}),(null==(s=o.signal)?void 0:s.aborted)&&r.abort(),p(this.options.systemOrigin,t,{...o,signal:r.signal})}dispose(){var t;clearInterval(this.helloTimer),clearTimeout(this.helloDeadline),window.removeEventListener("message",this.listener),this.dialogs.forEach((t=>t.reject(new e.SystemDialogError("closed")))),this.dialogs.clear(),null==(t=this.embedAbort)||t.abort()}},exports.AppFrameHost=class{constructor(e){this.options=e,this.ready=!1,this.capabilities=[],this.pending=new Map,this.listener=e=>this.receive(e),this.opens=[],this.dialogOpen=!1,window.addEventListener("message",this.listener)}async systemDialog(t,o,n){const s=e=>{var o;this.ready&&(null==(o=this.options.target())||o.postMessage(i("sysdlg.openResult",e,{replyTo:t}),this.options.origin))};if(!this.options.onSystemDialog||"string"!=typeof o)return s({ok:!1,code:"unsupported"});if(this.dialogOpen)return s({ok:!1,code:"busy"});this.dialogOpen=!0;try{s(await this.options.onSystemDialog(o,n))}catch(r){s({ok:!1,code:r instanceof e.SystemDialogError?r.code:"closed"})}finally{this.dialogOpen=!1}}receive(t){var i,n,s,r,a,l,d,c;if(t.source!==this.options.target()||t.origin!==this.options.origin||!o(t.data))return;const p=t.data,h=p.payload;if("frame.hello"===p.type){if(h.nonce!==this.options.init.nonce||!Array.isArray(h.appCapabilities))return;return this.ready=!0,this.capabilities=h.appCapabilities.filter((e=>"string"==typeof e)),this.send("frame.init",this.options.init),void 0!==this.focused&&this.send("frame.focusChanged",{focused:this.focused}),void(null==(n=(i=this.options).onReady)||n.call(i))}if(this.ready)if(p.replyTo){const e=this.pending.get(p.replyTo);e&&p.type===e.type+"Result"&&(clearTimeout(e.timer),this.pending.delete(p.replyTo),e.resolve(p.payload))}else if("window.setTitle"===p.type&&"string"==typeof h.title&&(null==(r=(s=this.options).onTitle)||r.call(s,h.title.slice(0,256),!0===h.dirty)),"window.requestClose"===p.type&&(null==(l=(a=this.options).onRequestClose)||l.call(a)),"sysdlg.open"===p.type&&"string"==typeof p.id&&this.systemDialog(p.id,h.path,h.params),"content.open"===p.type&&("default"===h.target||"preview"===h.target||"chooser"===h.target)){const t={...h.request,requestId:crypto.randomUUID()};if(!e.isOpenRequest(t))return;if(this.opens=this.opens.filter((e=>e>Date.now()-1e4)),this.opens.length>=5)return;this.opens.push(Date.now()),null==(c=(d=this.options).onContentOpen)||c.call(d,t,h.target,{newWindow:!0===h.newWindow,hints:e.readContentHints(h.hints)})}}update(e){this.options.init={...this.options.init,...e}}setFocused(e){this.focused!==e&&(this.focused=e,this.send("frame.focusChanged",{focused:e}))}send(e,t){var o;this.ready&&(null==(o=this.options.target())||o.postMessage(i(e,t),this.options.origin))}request(e,t,o=3e3){if(!this.ready)return Promise.reject(new Error("App frame is not ready"));const n=crypto.randomUUID();return new Promise(((s,r)=>{var a;const l=setTimeout((()=>{this.pending.delete(n),r(new Error("App frame timed out"))}),o);this.pending.set(n,{resolve:s,reject:r,timer:l,type:e}),null==(a=this.options.target())||a.postMessage(i(e,t,{id:n}),this.options.origin)}))}async open(e){return this.capabilities.includes("open")?await this.request("frame.open",{request:e}):{accepted:!1}}async beforeClose(e="user"){if(!this.ready||!this.capabilities.includes("beforeClose"))return"allow";const t=await this.request("frame.beforeClose",{reason:e});return"allow"===t.decision||"pending"===t.decision?t.decision:"deny"}async back(){return!!this.capabilities.includes("back")&&!0===(await this.request("frame.back",{})).handled}dispose(){window.removeEventListener("message",this.listener),this.pending.forEach((e=>{clearTimeout(e.timer),e.reject(new Error("App frame disposed"))})),this.pending.clear(),this.ready=!1}},exports.PREVIEW_EMBED_PATH=a,exports.PreviewEmbed=class{constructor(e){this.options=e,this.nonce=crypto.randomUUID(),this.listener=e=>this.receive(e),this.ready=!1,this.origin=new URL(e.systemOrigin).origin,this.init=e.init,this.url=`${this.origin}${a}#bpe=${this.nonce}&po=${encodeURIComponent(window.location.origin)}`,window.addEventListener("message",this.listener)}post(e,t){var i,o;null==(o=null==(i=this.options.frame())?void 0:i.contentWindow)||o.postMessage(s(e,t),this.origin)}receive(t){var i,o,n,s,a,l,d;if(t.origin!==this.origin||t.source!==(null==(i=this.options.frame())?void 0:i.contentWindow)||!r(t.data))return;const{type:c,payload:p}=t.data;if("embed.hello"!==c){if("embed.state"===c&&("loading"===p.status||"ready"===p.status||"error"===p.status)){const e=p.error;null==(n=(o=this.options).onState)||n.call(o,{status:p.status,error:e&&"string"==typeof e.kind&&"string"==typeof e.code?{kind:e.kind,code:e.code}:void 0,title:"string"==typeof p.title?p.title.slice(0,256):void 0,mediaType:"string"==typeof p.mediaType?p.mediaType.slice(0,128):void 0})}if("embed.openWith"===c){const t=p.request;t&&e.isTransferableRef(t.source)&&(void 0===t.session||e.isTransferableSession(t.session))&&(null==(a=(s=this.options).onOpenWith)||a.call(s,{request:{source:t.source,session:t.session},hints:e.readContentHints(p.hints)}))}"embed.exit"===c&&(null==(d=(l=this.options).onExit)||d.call(l))}else p.nonce===this.nonce&&(this.ready=!0,this.post("embed.init",{...this.init,nonce:this.nonce}))}update(e){this.init={...this.init,...e},this.ready&&this.post("embed.update",e)}dispose(){window.removeEventListener("message",this.listener)}},exports.PreviewEmbedHost=class{constructor(e){this.options=e,this.ready=!1,this.listener=e=>this.receive(e);const t=new URLSearchParams(window.location.hash.slice(1));this.nonce=t.get("bpe");let i=null;try{i=new URL(t.get("po")??"").origin}catch{}if(this.parentOrigin=window.parent!==window&&this.nonce&&i&&e.accept(i)?i:null,!this.parentOrigin)return;window.addEventListener("message",this.listener);const o=()=>window.parent.postMessage(s("embed.hello",{nonce:this.nonce}),this.parentOrigin);o(),this.hello=setInterval((()=>{this.ready||o()}),250)}receive(t){var i,o;if(t.source!==window.parent||t.origin!==this.parentOrigin||!r(t.data))return;const{type:n,payload:s}=t.data;if("embed.init"===n){if(s.nonce!==this.nonce||(a=s.source,!(e.isTransferableRef(a)||a&&"object"==typeof a&&"blob"===a.kind&&"undefined"!=typeof Blob&&a.blob instanceof Blob&&"string"==typeof a.name))||void 0!==s.session&&!e.isTransferableSession(s.session)||"string"!=typeof s.locale)return;return this.ready=!0,clearInterval(this.hello),void this.options.onInit({nonce:String(s.nonce),source:s.source,session:s.session,theme:"dark"===s.theme?"dark":"light",locale:s.locale})}var a;if("embed.update"===n&&this.ready){const e={};"dark"!==s.theme&&"light"!==s.theme||(e.theme=s.theme),"string"==typeof s.locale&&(e.locale=s.locale),null==(o=(i=this.options).onUpdate)||o.call(i,e)}}post(e,t){this.ready&&this.parentOrigin&&window.parent.postMessage(s(e,t),this.parentOrigin)}state(e){this.post("embed.state",e)}openWith(e){this.post("embed.openWith",e)}exit(){this.post("embed.exit",{})}dispose(){clearInterval(this.hello),window.removeEventListener("message",this.listener)}},exports.SELECT_EMBED_PATH=d,exports.SelectEmbedHost=class{constructor(e){this.options=e,this.ready=!1,this.listener=e=>this.receive(e);const t=new URLSearchParams(window.location.hash.slice(1));this.nonce=t.get("bse");let i=null;try{i=new URL(t.get("po")??"").origin}catch{}if(this.parentOrigin=window.parent!==window&&this.nonce&&i&&e.accept(i)?i:null,!this.parentOrigin)return;window.addEventListener("message",this.listener);const o=()=>window.parent.postMessage(s("embed.hello",{nonce:this.nonce},l),this.parentOrigin);o(),this.hello=setInterval((()=>{this.ready||o()}),250)}receive(e){if(e.source!==window.parent||e.origin!==this.parentOrigin||!r(e.data,l))return;const{type:t,payload:i}=e.data;"embed.init"!==t||this.ready||i.nonce!==this.nonce||"string"!=typeof i.locale||(this.ready=!0,clearInterval(this.hello),this.options.onInit({nonce:String(i.nonce),params:i.params,theme:"dark"===i.theme?"dark":"light",locale:i.locale}))}post(e,t){this.ready&&this.parentOrigin&&window.parent.postMessage(s(e,t,l),this.parentOrigin)}result(e){this.post("embed.result",{result:e})}error(e){this.post("embed.error",{code:e})}dispose(){clearInterval(this.hello),window.removeEventListener("message",this.listener)}},exports.embedderOrigin=function(e){var t;if(window.parent===window)return null;const i=[null==(t=window.location.ancestorOrigins)?void 0:t[0],document.referrer];for(const o of i)if(o)try{const t=new URL(o).origin;if(e(t))return t}catch{}return null},exports.openSelectEmbed=p,exports.originInZone=(e,t)=>{try{const i=new URL(e);return i.protocol===window.location.protocol&&(i.hostname===t||i.hostname.endsWith(`.${t}`))}catch{return!1}};
|
|
2
2
|
//# sourceMappingURL=app-frame.cjs.map
|
package/dist/app-frame.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-frame.cjs","sources":["../src/app-frame.ts"],"sourcesContent":["import { isOpenRequest, isTransferableRef, isTransferableSession, readContentHints, systemOpenUrl, type ContentHints, type ContentOpenTarget, type OpenRequest, type TransferableContentRef, type TransferableSessionContext } from './content'\nexport interface AppFrameMessage<T extends string = string, P = unknown> {\n protocol: 'buckyos.app-frame'; version: 1; type: T; id?: string; replyTo?: string; payload: P\n}\nexport interface FrameInit {\n nonce: string\n windowId: string\n formFactor: 'desktop' | 'mobile'\n theme: { mode: 'light' | 'dark'; accent?: string }\n locale: string\n launch?: OpenRequest\n shellCapabilities: string[]\n}\nexport type CloseDecision = 'allow' | 'deny' | 'pending'\nconst envelope = (type: string, payload: unknown, extra: { id?: string; replyTo?: string } = {}): AppFrameMessage =>\n ({ protocol: 'buckyos.app-frame', version: 1, type, payload, ...extra })\nconst isMessage = (value: unknown): value is AppFrameMessage => {\n if (!value || typeof value !== 'object') return false\n const v = value as AppFrameMessage\n return v.protocol === 'buckyos.app-frame' && v.version === 1 && typeof v.type === 'string' && !!v.payload && typeof v.payload === 'object'\n}\nexport class AppFrameHost {\n ready = false\n capabilities: string[] = []\n private pending = new Map<string, { resolve: (v: unknown) => void; reject: (e: Error) => void; timer: ReturnType<typeof setTimeout>; type: string }>()\n private listener = (event: MessageEvent) => this.receive(event)\n private opens: number[] = []\n constructor(private options: {\n target: () => Window | null; origin: string; init: FrameInit\n onReady?: () => void\n onTitle?: (title: string, dirty: boolean) => void\n onRequestClose?: () => void\n onContentOpen?: (request: OpenRequest, target: ContentOpenTarget, options: { newWindow: boolean; hints: ContentHints }) => void\n }) { window.addEventListener('message', this.listener) }\n private focused?: boolean\n private receive(event: MessageEvent): void {\n if (event.source !== this.options.target() || event.origin !== this.options.origin || !isMessage(event.data)) return\n const m = event.data\n const p = m.payload as Record<string, unknown>\n if (m.type === 'frame.hello') {\n if (p.nonce !== this.options.init.nonce || !Array.isArray(p.appCapabilities)) return\n this.ready = true\n this.capabilities = p.appCapabilities.filter((c): c is string => typeof c === 'string')\n this.send('frame.init', this.options.init)\n if (this.focused !== undefined) this.send('frame.focusChanged', { focused: this.focused })\n this.options.onReady?.()\n return\n }\n if (!this.ready) return\n if (m.replyTo) {\n const pending = this.pending.get(m.replyTo)\n if (pending && m.type === pending.type + 'Result') {\n clearTimeout(pending.timer); this.pending.delete(m.replyTo); pending.resolve(m.payload)\n }\n return\n }\n if (m.type === 'window.setTitle' && typeof p.title === 'string') this.options.onTitle?.(p.title.slice(0, 256), p.dirty === true)\n if (m.type === 'window.requestClose') this.options.onRequestClose?.()\n if (m.type === 'content.open' && (p.target === 'default' || p.target === 'preview' || p.target === 'chooser')) {\n const request = { ...(p.request as object), requestId: crypto.randomUUID() }\n if (!isOpenRequest(request)) return\n this.opens = this.opens.filter(t => t > Date.now() - 10000)\n if (this.opens.length >= 5) return\n this.opens.push(Date.now())\n this.options.onContentOpen?.(request, p.target, { newWindow: p.newWindow === true, hints: readContentHints(p.hints) })\n }\n }\n update(init: Partial<FrameInit>): void { this.options.init = { ...this.options.init, ...init } }\n /** Reports whether the App's window is the focused one; only a change is sent. */\n setFocused(focused: boolean): void {\n if (this.focused === focused) return\n this.focused = focused\n this.send('frame.focusChanged', { focused })\n }\n send(type: string, payload: unknown): void {\n if (this.ready) this.options.target()?.postMessage(envelope(type, payload), this.options.origin)\n }\n request(type: string, payload: unknown, timeout = 3000): Promise<unknown> {\n if (!this.ready) return Promise.reject(new Error('App frame is not ready'))\n const id = crypto.randomUUID()\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => { this.pending.delete(id); reject(new Error('App frame timed out')) }, timeout)\n this.pending.set(id, { resolve, reject, timer, type })\n this.options.target()?.postMessage(envelope(type, payload, { id }), this.options.origin)\n })\n }\n async open(request: OpenRequest): Promise<{ accepted: boolean; fallback?: 'preview' }> {\n if (!this.capabilities.includes('open')) return { accepted: false }\n return await this.request('frame.open', { request }) as { accepted: boolean; fallback?: 'preview' }\n }\n async beforeClose(reason: 'user' | 'logout' | 'shell' = 'user'): Promise<CloseDecision> {\n if (!this.ready || !this.capabilities.includes('beforeClose')) return 'allow'\n const r = await this.request('frame.beforeClose', { reason }) as { decision?: CloseDecision }\n return r.decision === 'allow' || r.decision === 'pending' ? r.decision : 'deny'\n }\n async back(): Promise<boolean> {\n if (!this.capabilities.includes('back')) return false\n return (await this.request('frame.back', {}) as { handled?: boolean }).handled === true\n }\n dispose(): void {\n window.removeEventListener('message', this.listener)\n this.pending.forEach(p => { clearTimeout(p.timer); p.reject(new Error('App frame disposed')) })\n this.pending.clear(); this.ready = false\n }\n}\n/**\n * Origin of the window embedding this page, when `accept` admits it. `location.ancestorOrigins` names the real\n * parent even after the frame navigated through other pages (a sign-in round trip); the referrer is the fallback.\n */\nexport function embedderOrigin(accept: (origin: string) => boolean): string | null {\n if (window.parent === window) return null\n const candidates = [window.location.ancestorOrigins?.[0], document.referrer]\n for (const candidate of candidates) {\n if (!candidate) continue\n try {\n const origin = new URL(candidate).origin\n if (accept(origin)) return origin\n } catch {}\n }\n return null\n}\nexport const originInZone = (origin: string, zoneHost: string): boolean => {\n try {\n const url = new URL(origin)\n return url.protocol === window.location.protocol && (url.hostname === zoneHost || url.hostname.endsWith(`.${zoneHost}`))\n } catch { return false }\n}\nexport class AppFrameClient {\n init?: FrameInit\n private title?: string\n private focused?: boolean\n private helloTimer?: ReturnType<typeof setInterval>\n private helloDeadline?: ReturnType<typeof setTimeout>\n private readonly nonce: string | null\n private readonly origin: string\n private readonly listener = (event: MessageEvent) => { void this.receive(event) }\n constructor(private options: {\n shellOrigin: string\n /** The Zone's system entry (its root origin): where content is opened when this page is not embedded in the shell. */\n systemOrigin?: string\n /** This App's id, so the system does not offer the content back to it. */\n appId?: string\n onInit?: (init: FrameInit) => void\n onOpen?: (request: OpenRequest) => Promise<{ accepted: boolean; fallback?: 'preview' }> | { accepted: boolean; fallback?: 'preview' }\n onBeforeClose?: (reason: 'user' | 'logout' | 'shell') => Promise<CloseDecision> | CloseDecision\n onBack?: () => Promise<boolean> | boolean\n onTheme?: (theme: FrameInit['theme']) => void\n onLocale?: (locale: string) => void\n onFocus?: (focused: boolean) => void\n }) {\n this.origin = new URL(options.shellOrigin).origin\n this.nonce = new URLSearchParams(window.location.hash.slice(1)).get('bfp')\n window.addEventListener('message', this.listener)\n if (window.parent !== window && this.nonce) {\n const hello = () => window.parent.postMessage(envelope('frame.hello', { nonce: this.nonce, appCapabilities: [\n ...options.onOpen ? ['open'] : [], ...options.onBeforeClose ? ['beforeClose'] : [], ...options.onBack ? ['back'] : [],\n ] }), this.origin)\n hello()\n this.helloTimer = setInterval(hello, 250)\n this.helloDeadline = setTimeout(() => clearInterval(this.helloTimer), 1500)\n }\n }\n private async receive(event: MessageEvent): Promise<void> {\n if (event.source !== window.parent || event.origin !== this.origin || !isMessage(event.data)) return\n const m = event.data\n const p = m.payload as Record<string, unknown>\n if (m.type === 'frame.init') {\n if (!this.nonce || p.nonce !== this.nonce || typeof p.locale !== 'string' || !p.theme || typeof p.windowId !== 'string' || p.launch && !isOpenRequest(p.launch)) return\n clearInterval(this.helloTimer); clearTimeout(this.helloDeadline)\n this.init = p as unknown as FrameInit\n this.title = undefined; this.focused = undefined\n this.options.onInit?.(this.init)\n return\n }\n if (!this.init) return\n const reply = (payload: unknown) => window.parent.postMessage(envelope(m.type + 'Result', payload, { replyTo: m.id }), this.origin)\n try {\n if (m.type === 'frame.open' && isOpenRequest(p.request)) reply(await this.options.onOpen?.(p.request) ?? { accepted: false })\n if (m.type === 'frame.beforeClose') reply({ decision: await this.options.onBeforeClose?.(p.reason as 'user') ?? 'allow' })\n if (m.type === 'frame.back') reply({ handled: await this.options.onBack?.() ?? false })\n if (m.type === 'frame.themeChanged' && (p.mode === 'dark' || p.mode === 'light')) this.options.onTheme?.(p as FrameInit['theme'])\n if (m.type === 'frame.localeChanged' && typeof p.locale === 'string') this.options.onLocale?.(p.locale)\n if (m.type === 'frame.focusChanged' && this.focused !== (p.focused === true)) { this.focused = p.focused === true; this.options.onFocus?.(this.focused) }\n } catch {\n if (m.type === 'frame.open') reply({ accepted: false, fallback: 'preview' })\n if (m.type === 'frame.beforeClose') reply({ decision: 'deny' })\n }\n }\n send(type: string, payload: unknown): void {\n if (this.init) window.parent.postMessage(envelope(type, payload), this.origin)\n }\n setTitle(title: string, dirty = false): void {\n const key = JSON.stringify([title, dirty])\n if (!this.init || key === this.title) return\n this.title = key\n this.send('window.setTitle', { title, dirty })\n }\n requestClose(): void { this.send('window.requestClose', {}) }\n /**\n * Asks the system to open content: with its default app, in Preview, or by letting the user choose (`chooser`).\n * Embedded in the shell the request goes over the frame; in a standalone tab it opens the Zone's system entry\n * (`systemOrigin`) in a new tab. Returns false when neither is available.\n */\n openContent(request: Omit<OpenRequest, 'requestId'>, target: ContentOpenTarget = 'default', options: { newWindow?: boolean; hints?: ContentHints } = {}): boolean {\n const hints = options.hints ?? {}\n if (this.init) { this.send('content.open', { request, target, newWindow: options.newWindow === true, hints }); return true }\n if (!this.options.systemOrigin) return false\n window.open(systemOpenUrl(this.options.systemOrigin, { request, target, hints, from: this.options.appId }), '_blank', 'noopener')\n return true\n }\n dispose(): void { clearInterval(this.helloTimer); clearTimeout(this.helloDeadline); window.removeEventListener('message', this.listener) }\n}\n\n/**\n * Preview embed protocol (`buckyos.preview-embed` v1): an App shows the system Preview component inside its own UI.\n * The App frames `<systemOrigin>/embed/preview` (component only, no shell) and hands it a content reference; the\n * system page reads the content with its own Zone-root session, so no token crosses origins. Open With goes back\n * through the App to the shell (`AppFrameClient.openContent(…, 'chooser')`).\n */\nexport type PreviewEmbedSource = TransferableContentRef | { kind: 'blob'; blob: Blob; name: string }\nexport interface PreviewEmbedInit {\n nonce: string\n source: PreviewEmbedSource\n session?: TransferableSessionContext\n theme: 'light' | 'dark'\n locale: string\n}\nexport interface PreviewEmbedState {\n status: 'loading' | 'ready' | 'error'\n /** Preview error kind (`unsupported`, `not-found`, `permission-denied`, `timeout`, `error`, …) and code. */\n error?: { kind: string; code: string }\n title?: string\n mediaType?: string\n}\nexport interface PreviewEmbedOpenWith { request: Omit<OpenRequest, 'requestId'>; hints: ContentHints }\nconst PREVIEW_EMBED = 'buckyos.preview-embed'\nconst embedEnvelope = (type: string, payload: unknown) => ({ protocol: PREVIEW_EMBED, version: 1, type, payload })\nconst isEmbedMessage = (value: unknown): value is { type: string; payload: Record<string, unknown> } => {\n const v = value as { protocol?: unknown; version?: unknown; type?: unknown; payload?: unknown } | null\n return !!v && v.protocol === PREVIEW_EMBED && v.version === 1 && typeof v.type === 'string' && !!v.payload && typeof v.payload === 'object'\n}\nconst isEmbedSource = (value: unknown): value is PreviewEmbedSource =>\n isTransferableRef(value) || (!!value && typeof value === 'object' && (value as { kind?: unknown }).kind === 'blob' &&\n typeof Blob !== 'undefined' && (value as { blob?: unknown }).blob instanceof Blob && typeof (value as { name?: unknown }).name === 'string')\nexport const PREVIEW_EMBED_PATH = '/embed/preview'\n\n/** App side: owns the iframe that shows the system Preview. */\nexport class PreviewEmbed {\n readonly url: string\n private readonly nonce = crypto.randomUUID()\n private readonly origin: string\n private readonly listener = (event: MessageEvent) => this.receive(event)\n private init: Omit<PreviewEmbedInit, 'nonce'>\n constructor(private options: {\n systemOrigin: string\n frame: () => HTMLIFrameElement | null\n init: Omit<PreviewEmbedInit, 'nonce'>\n onState?: (state: PreviewEmbedState) => void\n onOpenWith?: (open: PreviewEmbedOpenWith) => void\n onExit?: () => void\n }) {\n this.origin = new URL(options.systemOrigin).origin\n this.init = options.init\n this.url = `${this.origin}${PREVIEW_EMBED_PATH}#bpe=${this.nonce}&po=${encodeURIComponent(window.location.origin)}`\n window.addEventListener('message', this.listener)\n }\n private post(type: string, payload: unknown): void {\n this.options.frame()?.contentWindow?.postMessage(embedEnvelope(type, payload), this.origin)\n }\n private receive(event: MessageEvent): void {\n if (event.origin !== this.origin || event.source !== this.options.frame()?.contentWindow || !isEmbedMessage(event.data)) return\n const { type, payload: p } = event.data\n if (type === 'embed.hello') { if (p.nonce === this.nonce) this.post('embed.init', { ...this.init, nonce: this.nonce }); return }\n if (type === 'embed.state' && (p.status === 'loading' || p.status === 'ready' || p.status === 'error')) {\n const error = p.error as { kind?: unknown; code?: unknown } | undefined\n this.options.onState?.({ status: p.status,\n error: error && typeof error.kind === 'string' && typeof error.code === 'string' ? { kind: error.kind, code: error.code } : undefined,\n title: typeof p.title === 'string' ? p.title.slice(0, 256) : undefined, mediaType: typeof p.mediaType === 'string' ? p.mediaType.slice(0, 128) : undefined })\n }\n if (type === 'embed.openWith') {\n const request = p.request as Omit<OpenRequest, 'requestId'> | undefined\n if (request && isTransferableRef(request.source) && (request.session === undefined || isTransferableSession(request.session))) {\n this.options.onOpenWith?.({ request: { source: request.source, session: request.session }, hints: readContentHints(p.hints) })\n }\n }\n if (type === 'embed.exit') this.options.onExit?.()\n }\n update(patch: Partial<Pick<PreviewEmbedInit, 'theme' | 'locale'>>): void {\n this.init = { ...this.init, ...patch }\n this.post('embed.update', patch)\n }\n dispose(): void { window.removeEventListener('message', this.listener) }\n}\n\n/** System side: the component-only page at `PREVIEW_EMBED_PATH`. Accepts one embedding App whose origin `accept` admits. */\nexport class PreviewEmbedHost {\n readonly parentOrigin: string | null\n private readonly nonce: string | null\n private ready = false\n private readonly hello?: ReturnType<typeof setInterval>\n private readonly listener = (event: MessageEvent) => this.receive(event)\n constructor(private options: {\n accept: (origin: string) => boolean\n onInit: (init: PreviewEmbedInit) => void\n onUpdate?: (patch: Partial<Pick<PreviewEmbedInit, 'theme' | 'locale'>>) => void\n }) {\n const params = new URLSearchParams(window.location.hash.slice(1))\n this.nonce = params.get('bpe')\n let parentOrigin: string | null = null\n try { parentOrigin = new URL(params.get('po') ?? '').origin } catch {}\n this.parentOrigin = window.parent !== window && this.nonce && parentOrigin && options.accept(parentOrigin) ? parentOrigin : null\n if (!this.parentOrigin) return\n window.addEventListener('message', this.listener)\n const hello = () => window.parent.postMessage(embedEnvelope('embed.hello', { nonce: this.nonce }), this.parentOrigin!)\n hello()\n this.hello = setInterval(() => { if (!this.ready) hello() }, 250)\n }\n private receive(event: MessageEvent): void {\n if (event.source !== window.parent || event.origin !== this.parentOrigin || !isEmbedMessage(event.data)) return\n const { type, payload: p } = event.data\n if (type === 'embed.init') {\n if (p.nonce !== this.nonce || !isEmbedSource(p.source) || (p.session !== undefined && !isTransferableSession(p.session)) || typeof p.locale !== 'string') return\n this.ready = true; clearInterval(this.hello)\n this.options.onInit({ nonce: String(p.nonce), source: p.source, session: p.session as TransferableSessionContext | undefined, theme: p.theme === 'dark' ? 'dark' : 'light', locale: p.locale })\n return\n }\n if (type === 'embed.update' && this.ready) {\n const patch: Partial<Pick<PreviewEmbedInit, 'theme' | 'locale'>> = {}\n if (p.theme === 'dark' || p.theme === 'light') patch.theme = p.theme\n if (typeof p.locale === 'string') patch.locale = p.locale\n this.options.onUpdate?.(patch)\n }\n }\n private post(type: string, payload: unknown): void {\n if (this.ready && this.parentOrigin) window.parent.postMessage(embedEnvelope(type, payload), this.parentOrigin)\n }\n state(state: PreviewEmbedState): void { this.post('embed.state', state) }\n openWith(open: PreviewEmbedOpenWith): void { this.post('embed.openWith', open) }\n exit(): void { this.post('embed.exit', {}) }\n dispose(): void { clearInterval(this.hello); window.removeEventListener('message', this.listener) }\n}\n"],"names":["envelope","type","payload","extra","protocol","version","isMessage","value","v","PREVIEW_EMBED","embedEnvelope","isEmbedMessage","PREVIEW_EMBED_PATH","constructor","options","this","listener","event","receive","origin","URL","shellOrigin","nonce","URLSearchParams","window","location","hash","slice","get","addEventListener","parent","hello","postMessage","appCapabilities","onOpen","onBeforeClose","onBack","helloTimer","setInterval","helloDeadline","setTimeout","clearInterval","source","data","m","p","locale","theme","windowId","launch","isOpenRequest","clearTimeout","init","title","focused","_b","_a","onInit","call","reply","replyTo","id","request","_d","_c","accepted","decision","_f","_e","reason","handled","_h","_g","mode","_j","_i","onTheme","_l","_k","onLocale","_n","_m","onFocus","fallback","send","setTitle","dirty","key","JSON","stringify","requestClose","openContent","target","hints","newWindow","systemOrigin","open","systemOpenUrl","from","appId","dispose","removeEventListener","ready","capabilities","pending","Map","opens","Array","isArray","filter","c","onReady","timer","delete","resolve","onTitle","onRequestClose","requestId","crypto","randomUUID","t","Date","now","length","push","onContentOpen","readContentHints","update","setFocused","timeout","Promise","reject","Error","set","includes","beforeClose","r","back","forEach","clear","url","encodeURIComponent","post","frame","contentWindow","status","error","onState","kind","code","mediaType","isTransferableRef","session","isTransferableSession","onOpenWith","onExit","patch","params","parentOrigin","accept","Blob","blob","name","String","onUpdate","state","openWith","exit","candidates","ancestorOrigins","document","referrer","candidate","zoneHost","hostname","endsWith"],"mappings":"uJAcA,MAAMA,EAAW,CAACC,EAAcC,EAAkBC,EAA2C,CAAA,KAAA,CACxFC,SAAU,oBAAqBC,QAAS,EAAGJ,OAAMC,aAAYC,IAC5DG,EAAaC,IACb,IAACA,GAA0B,iBAAVA,EAA2B,OAAA,EAChD,MAAMC,EAAID,EACV,MAAsB,sBAAfC,EAAEJ,UAAkD,IAAdI,EAAEH,SAAmC,iBAAXG,EAAEP,QAAuBO,EAAEN,SAAgC,iBAAdM,EAAEN,OAAY,EAwNpI,MAAMO,EAAgB,wBAChBC,EAAgB,CAACT,EAAcC,KAAsB,CAAEE,SAAUK,EAAeJ,QAAS,EAAGJ,OAAMC,YAClGS,EAAkBJ,IACtB,MAAMC,EAAID,EACV,QAASC,GAAKA,EAAEJ,WAAaK,GAA+B,IAAdD,EAAEH,SAAmC,iBAAXG,EAAEP,QAAuBO,EAAEN,SAAgC,iBAAdM,EAAEN,OAAY,EAKxHU,EAAqB,wCArH3B,MASL,WAAAC,CAAoBC,GAiBlB,GAjBkBC,KAAAD,QAAAA,EADHC,KAAAC,SAAYC,IAA+BF,KAAKG,QAAQD,EAAK,EAe5EF,KAAKI,OAAS,IAAIC,IAAIN,EAAQO,aAAaF,OACtCJ,KAAAO,MAAQ,IAAIC,gBAAgBC,OAAOC,SAASC,KAAKC,MAAM,IAAIC,IAAI,OAC7DJ,OAAAK,iBAAiB,UAAWd,KAAKC,UACpCQ,OAAOM,SAAWN,QAAUT,KAAKO,MAAO,CACpC,MAAAS,EAAQ,IAAMP,OAAOM,OAAOE,YAAYhC,EAAS,cAAe,CAAEsB,MAAOP,KAAKO,MAAOW,gBAAiB,IACvGnB,EAAQoB,OAAS,CAAC,QAAU,MAAOpB,EAAQqB,cAAgB,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OAASD,EAAEC,QAC9C,OAAAS,GAAAC,EAAAzC,KAAAD,SAAQsJ,WAAW7G,EAAAG,KAAAF,EAAAoG,EAC1B,CACF,CACQ,IAAAd,CAAK7I,EAAcC,GACrBa,KAAKuF,OAASvF,KAAK+I,cAActI,OAAOM,OAAOE,YAAYtB,EAAcT,EAAMC,GAAUa,KAAK+I,aACpG,CACA,KAAAO,CAAMA,GAAuCtJ,KAAA+H,KAAK,cAAeuB,EAAO,CACxE,QAAAC,CAAStE,GAAyCjF,KAAA+H,KAAK,iBAAkB9C,EAAM,CAC/E,IAAAuE,GAAoBxJ,KAAA+H,KAAK,aAAc,CAAA,EAAI,CAC3C,OAAA1C,GAAkB3D,cAAc1B,KAAKgB,OAAeP,OAAA6E,oBAAoB,UAAWtF,KAAKC,SAAU,0BAtO7F,SAAwB+I,SAC7B,GAAIvI,OAAOM,SAAWN,OAAe,OAAA,KAC/B,MAAAgJ,EAAa,CAAC,OAAAhH,EAAOhC,OAAAC,SAASgJ,sBAAkB,EAAAjH,EAAA,GAAIkH,SAASC,UACnE,IAAA,MAAWC,KAAaJ,EACtB,GAAKI,EACD,IACF,MAAMzJ,EAAS,IAAIC,IAAIwJ,GAAWzJ,OAClC,GAAI4I,EAAO5I,GAAgB,OAAAA,CAAA,CACrB,MAAC,CAEJ,OAAA,IACT,uBAC4B,CAACA,EAAgB0J,KACvC,IACI,MAAAjC,EAAM,IAAIxH,IAAID,GACpB,OAAOyH,EAAIxI,WAAaoB,OAAOC,SAASrB,WAAawI,EAAIkC,WAAaD,GAAYjC,EAAIkC,SAASC,SAAS,IAAIF,KAAU,CAChH,MAAS,OAAA,CAAM"}
|
|
1
|
+
{"version":3,"file":"app-frame.cjs","sources":["../src/app-frame.ts"],"sourcesContent":["import { isOpenRequest, isTransferableRef, isTransferableSession, readContentHints, readSelectDialogResult, systemOpenUrl, SELECT_DIALOG_PATH, SystemDialogError, SYSTEM_DIALOG_ERROR_CODES, type ContentHints, type ContentOpenTarget, type OpenRequest, type SelectDialogParams, type SelectDialogResult, type SystemDialogErrorCode, type TransferableContentRef, type TransferableSessionContext } from './content'\nexport type SystemDialogReply = { ok: true; result: unknown } | { ok: false; code: SystemDialogErrorCode }\nconst dialogErrorCode = (value: unknown): SystemDialogErrorCode =>\n SYSTEM_DIALOG_ERROR_CODES.includes(value as SystemDialogErrorCode) ? value as SystemDialogErrorCode : 'protocol'\nexport interface AppFrameMessage<T extends string = string, P = unknown> {\n protocol: 'buckyos.app-frame'; version: 1; type: T; id?: string; replyTo?: string; payload: P\n}\nexport interface FrameInit {\n nonce: string\n windowId: string\n formFactor: 'desktop' | 'mobile'\n theme: { mode: 'light' | 'dark'; accent?: string }\n locale: string\n launch?: OpenRequest\n shellCapabilities: string[]\n}\nexport type CloseDecision = 'allow' | 'deny' | 'pending'\nconst envelope = (type: string, payload: unknown, extra: { id?: string; replyTo?: string } = {}): AppFrameMessage =>\n ({ protocol: 'buckyos.app-frame', version: 1, type, payload, ...extra })\nconst isMessage = (value: unknown): value is AppFrameMessage => {\n if (!value || typeof value !== 'object') return false\n const v = value as AppFrameMessage\n return v.protocol === 'buckyos.app-frame' && v.version === 1 && typeof v.type === 'string' && !!v.payload && typeof v.payload === 'object'\n}\nexport class AppFrameHost {\n ready = false\n capabilities: string[] = []\n private pending = new Map<string, { resolve: (v: unknown) => void; reject: (e: Error) => void; timer: ReturnType<typeof setTimeout>; type: string }>()\n private listener = (event: MessageEvent) => this.receive(event)\n private opens: number[] = []\n constructor(private options: {\n target: () => Window | null; origin: string; init: FrameInit\n onReady?: () => void\n onTitle?: (title: string, dirty: boolean) => void\n onRequestClose?: () => void\n onContentOpen?: (request: OpenRequest, target: ContentOpenTarget, options: { newWindow: boolean; hints: ContentHints }) => void\n /** Shows a system dialog the App asked for (`sysdlg.open`). `params` is untrusted input: validate it. */\n onSystemDialog?: (path: string, params: unknown) => Promise<SystemDialogReply>\n }) { window.addEventListener('message', this.listener) }\n private focused?: boolean\n private dialogOpen = false\n private async systemDialog(id: string, path: unknown, params: unknown): Promise<void> {\n const reply = (payload: SystemDialogReply) => { if (this.ready) this.options.target()?.postMessage(envelope('sysdlg.openResult', payload, { replyTo: id }), this.options.origin) }\n if (!this.options.onSystemDialog || typeof path !== 'string') return reply({ ok: false, code: 'unsupported' })\n if (this.dialogOpen) return reply({ ok: false, code: 'busy' })\n this.dialogOpen = true\n try { reply(await this.options.onSystemDialog(path, params)) }\n catch (error) { reply({ ok: false, code: error instanceof SystemDialogError ? error.code : 'closed' }) }\n finally { this.dialogOpen = false }\n }\n private receive(event: MessageEvent): void {\n if (event.source !== this.options.target() || event.origin !== this.options.origin || !isMessage(event.data)) return\n const m = event.data\n const p = m.payload as Record<string, unknown>\n if (m.type === 'frame.hello') {\n if (p.nonce !== this.options.init.nonce || !Array.isArray(p.appCapabilities)) return\n this.ready = true\n this.capabilities = p.appCapabilities.filter((c): c is string => typeof c === 'string')\n this.send('frame.init', this.options.init)\n if (this.focused !== undefined) this.send('frame.focusChanged', { focused: this.focused })\n this.options.onReady?.()\n return\n }\n if (!this.ready) return\n if (m.replyTo) {\n const pending = this.pending.get(m.replyTo)\n if (pending && m.type === pending.type + 'Result') {\n clearTimeout(pending.timer); this.pending.delete(m.replyTo); pending.resolve(m.payload)\n }\n return\n }\n if (m.type === 'window.setTitle' && typeof p.title === 'string') this.options.onTitle?.(p.title.slice(0, 256), p.dirty === true)\n if (m.type === 'window.requestClose') this.options.onRequestClose?.()\n if (m.type === 'sysdlg.open' && typeof m.id === 'string') void this.systemDialog(m.id, p.path, p.params)\n if (m.type === 'content.open' && (p.target === 'default' || p.target === 'preview' || p.target === 'chooser')) {\n const request = { ...(p.request as object), requestId: crypto.randomUUID() }\n if (!isOpenRequest(request)) return\n this.opens = this.opens.filter(t => t > Date.now() - 10000)\n if (this.opens.length >= 5) return\n this.opens.push(Date.now())\n this.options.onContentOpen?.(request, p.target, { newWindow: p.newWindow === true, hints: readContentHints(p.hints) })\n }\n }\n update(init: Partial<FrameInit>): void { this.options.init = { ...this.options.init, ...init } }\n /** Reports whether the App's window is the focused one; only a change is sent. */\n setFocused(focused: boolean): void {\n if (this.focused === focused) return\n this.focused = focused\n this.send('frame.focusChanged', { focused })\n }\n send(type: string, payload: unknown): void {\n if (this.ready) this.options.target()?.postMessage(envelope(type, payload), this.options.origin)\n }\n request(type: string, payload: unknown, timeout = 3000): Promise<unknown> {\n if (!this.ready) return Promise.reject(new Error('App frame is not ready'))\n const id = crypto.randomUUID()\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => { this.pending.delete(id); reject(new Error('App frame timed out')) }, timeout)\n this.pending.set(id, { resolve, reject, timer, type })\n this.options.target()?.postMessage(envelope(type, payload, { id }), this.options.origin)\n })\n }\n async open(request: OpenRequest): Promise<{ accepted: boolean; fallback?: 'preview' }> {\n if (!this.capabilities.includes('open')) return { accepted: false }\n return await this.request('frame.open', { request }) as { accepted: boolean; fallback?: 'preview' }\n }\n async beforeClose(reason: 'user' | 'logout' | 'shell' = 'user'): Promise<CloseDecision> {\n if (!this.ready || !this.capabilities.includes('beforeClose')) return 'allow'\n const r = await this.request('frame.beforeClose', { reason }) as { decision?: CloseDecision }\n return r.decision === 'allow' || r.decision === 'pending' ? r.decision : 'deny'\n }\n async back(): Promise<boolean> {\n if (!this.capabilities.includes('back')) return false\n return (await this.request('frame.back', {}) as { handled?: boolean }).handled === true\n }\n dispose(): void {\n window.removeEventListener('message', this.listener)\n this.pending.forEach(p => { clearTimeout(p.timer); p.reject(new Error('App frame disposed')) })\n this.pending.clear(); this.ready = false\n }\n}\n/**\n * Origin of the window embedding this page, when `accept` admits it. `location.ancestorOrigins` names the real\n * parent even after the frame navigated through other pages (a sign-in round trip); the referrer is the fallback.\n */\nexport function embedderOrigin(accept: (origin: string) => boolean): string | null {\n if (window.parent === window) return null\n const candidates = [window.location.ancestorOrigins?.[0], document.referrer]\n for (const candidate of candidates) {\n if (!candidate) continue\n try {\n const origin = new URL(candidate).origin\n if (accept(origin)) return origin\n } catch {}\n }\n return null\n}\nexport const originInZone = (origin: string, zoneHost: string): boolean => {\n try {\n const url = new URL(origin)\n return url.protocol === window.location.protocol && (url.hostname === zoneHost || url.hostname.endsWith(`.${zoneHost}`))\n } catch { return false }\n}\nexport class AppFrameClient {\n init?: FrameInit\n private title?: string\n private focused?: boolean\n private helloTimer?: ReturnType<typeof setInterval>\n private helloDeadline?: ReturnType<typeof setTimeout>\n private readonly nonce: string | null\n private readonly origin: string\n private readonly listener = (event: MessageEvent) => { void this.receive(event) }\n private dialogs = new Map<string, { resolve: (result: SelectDialogResult) => void; reject: (error: Error) => void; allowLocal: boolean }>()\n private embedAbort?: AbortController\n constructor(private options: {\n shellOrigin: string\n /** The Zone's system entry (its root origin): where content is opened when this page is not embedded in the shell. */\n systemOrigin?: string\n /** This App's id, so the system does not offer the content back to it. */\n appId?: string\n onInit?: (init: FrameInit) => void\n onOpen?: (request: OpenRequest) => Promise<{ accepted: boolean; fallback?: 'preview' }> | { accepted: boolean; fallback?: 'preview' }\n onBeforeClose?: (reason: 'user' | 'logout' | 'shell') => Promise<CloseDecision> | CloseDecision\n onBack?: () => Promise<boolean> | boolean\n onTheme?: (theme: FrameInit['theme']) => void\n onLocale?: (locale: string) => void\n onFocus?: (focused: boolean) => void\n }) {\n this.origin = new URL(options.shellOrigin).origin\n this.nonce = new URLSearchParams(window.location.hash.slice(1)).get('bfp')\n window.addEventListener('message', this.listener)\n if (window.parent !== window && this.nonce) {\n const hello = () => window.parent.postMessage(envelope('frame.hello', { nonce: this.nonce, appCapabilities: [\n ...options.onOpen ? ['open'] : [], ...options.onBeforeClose ? ['beforeClose'] : [], ...options.onBack ? ['back'] : [],\n ] }), this.origin)\n hello()\n this.helloTimer = setInterval(hello, 250)\n this.helloDeadline = setTimeout(() => clearInterval(this.helloTimer), 1500)\n }\n }\n private async receive(event: MessageEvent): Promise<void> {\n if (event.source !== window.parent || event.origin !== this.origin || !isMessage(event.data)) return\n const m = event.data\n const p = m.payload as Record<string, unknown>\n if (m.type === 'frame.init') {\n if (!this.nonce || p.nonce !== this.nonce || typeof p.locale !== 'string' || !p.theme || typeof p.windowId !== 'string' || p.launch && !isOpenRequest(p.launch)) return\n clearInterval(this.helloTimer); clearTimeout(this.helloDeadline)\n this.init = p as unknown as FrameInit\n this.title = undefined; this.focused = undefined\n this.options.onInit?.(this.init)\n return\n }\n if (!this.init) return\n if (m.type === 'sysdlg.openResult') {\n const pending = m.replyTo ? this.dialogs.get(m.replyTo) : undefined\n if (!pending) return\n this.dialogs.delete(m.replyTo!)\n if (p.ok !== true) return pending.reject(new SystemDialogError(dialogErrorCode(p.code)))\n const result = readSelectDialogResult(p.result, { allowLocal: pending.allowLocal })\n if (result) pending.resolve(result)\n else pending.reject(new SystemDialogError('protocol'))\n return\n }\n const reply = (payload: unknown) => window.parent.postMessage(envelope(m.type + 'Result', payload, { replyTo: m.id }), this.origin)\n try {\n if (m.type === 'frame.open' && isOpenRequest(p.request)) reply(await this.options.onOpen?.(p.request) ?? { accepted: false })\n if (m.type === 'frame.beforeClose') reply({ decision: await this.options.onBeforeClose?.(p.reason as 'user') ?? 'allow' })\n if (m.type === 'frame.back') reply({ handled: await this.options.onBack?.() ?? false })\n if (m.type === 'frame.themeChanged' && (p.mode === 'dark' || p.mode === 'light')) this.options.onTheme?.(p as FrameInit['theme'])\n if (m.type === 'frame.localeChanged' && typeof p.locale === 'string') this.options.onLocale?.(p.locale)\n if (m.type === 'frame.focusChanged' && this.focused !== (p.focused === true)) { this.focused = p.focused === true; this.options.onFocus?.(this.focused) }\n } catch {\n if (m.type === 'frame.open') reply({ accepted: false, fallback: 'preview' })\n if (m.type === 'frame.beforeClose') reply({ decision: 'deny' })\n }\n }\n send(type: string, payload: unknown): void {\n if (this.init) window.parent.postMessage(envelope(type, payload), this.origin)\n }\n setTitle(title: string, dirty = false): void {\n const key = JSON.stringify([title, dirty])\n if (!this.init || key === this.title) return\n this.title = key\n this.send('window.setTitle', { title, dirty })\n }\n requestClose(): void { this.send('window.requestClose', {}) }\n /**\n * Asks the system to open content: with its default app, in Preview, or by letting the user choose (`chooser`).\n * Embedded in the shell the request goes over the frame; in a standalone tab it opens the Zone's system entry\n * (`systemOrigin`) in a new tab. Returns false when neither is available.\n */\n openContent(request: Omit<OpenRequest, 'requestId'>, target: ContentOpenTarget = 'default', options: { newWindow?: boolean; hints?: ContentHints } = {}): boolean {\n const hints = options.hints ?? {}\n if (this.init) { this.send('content.open', { request, target, newWindow: options.newWindow === true, hints }); return true }\n if (!this.options.systemOrigin) return false\n window.open(systemOpenUrl(this.options.systemOrigin, { request, target, hints, from: this.options.appId }), '_blank', 'noopener')\n return true\n }\n /**\n * Shows the system file picker (`sysdlg/select`) and resolves with what the user chose; cancelling resolves with\n * `{ action: 'cancelled' }`. Embedded in the shell the shell draws the dialog over this App's window; in a\n * standalone tab the picker page of the Zone's system entry (`systemOrigin`) is framed over this page. Rejects\n * with a `SystemDialogError` when no picker is available or the request did not complete.\n */\n selectContent(params: SelectDialogParams = {}, options: { signal?: AbortSignal; theme?: 'light' | 'dark'; locale?: string } = {}): Promise<SelectDialogResult> {\n if (this.init) {\n if (!this.init.shellCapabilities.includes(SELECT_DIALOG_PATH)) return Promise.reject(new SystemDialogError('unsupported'))\n if (this.dialogs.size) return Promise.reject(new SystemDialogError('busy'))\n const id = crypto.randomUUID()\n return new Promise((resolve, reject) => {\n this.dialogs.set(id, { resolve, reject, allowLocal: params.allowLocal === true })\n window.parent.postMessage(envelope('sysdlg.open', { path: SELECT_DIALOG_PATH, params }, { id }), this.origin)\n })\n }\n if (!this.options.systemOrigin) return Promise.reject(new SystemDialogError('unsupported'))\n const abort = this.embedAbort = new AbortController()\n options.signal?.addEventListener('abort', () => abort.abort(), { once: true })\n if (options.signal?.aborted) abort.abort()\n return openSelectEmbed(this.options.systemOrigin, params, { ...options, signal: abort.signal })\n }\n dispose(): void {\n clearInterval(this.helloTimer); clearTimeout(this.helloDeadline); window.removeEventListener('message', this.listener)\n this.dialogs.forEach(pending => pending.reject(new SystemDialogError('closed')))\n this.dialogs.clear(); this.embedAbort?.abort()\n }\n}\n\n/**\n * Preview embed protocol (`buckyos.preview-embed` v1): an App shows the system Preview component inside its own UI.\n * The App frames `<systemOrigin>/embed/preview` (component only, no shell) and hands it a content reference; the\n * system page reads the content with its own Zone-root session, so no token crosses origins. Open With goes back\n * through the App to the shell (`AppFrameClient.openContent(…, 'chooser')`).\n */\nexport type PreviewEmbedSource = TransferableContentRef | { kind: 'blob'; blob: Blob; name: string }\nexport interface PreviewEmbedInit {\n nonce: string\n source: PreviewEmbedSource\n session?: TransferableSessionContext\n theme: 'light' | 'dark'\n locale: string\n}\nexport interface PreviewEmbedState {\n status: 'loading' | 'ready' | 'error'\n /** Preview error kind (`unsupported`, `not-found`, `permission-denied`, `timeout`, `error`, …) and code. */\n error?: { kind: string; code: string }\n title?: string\n mediaType?: string\n}\nexport interface PreviewEmbedOpenWith { request: Omit<OpenRequest, 'requestId'>; hints: ContentHints }\nconst PREVIEW_EMBED = 'buckyos.preview-embed'\nconst embedEnvelope = (type: string, payload: unknown, protocol = PREVIEW_EMBED) => ({ protocol, version: 1, type, payload })\nconst isEmbedMessage = (value: unknown, protocol = PREVIEW_EMBED): value is { type: string; payload: Record<string, unknown> } => {\n const v = value as { protocol?: unknown; version?: unknown; type?: unknown; payload?: unknown } | null\n return !!v && v.protocol === protocol && v.version === 1 && typeof v.type === 'string' && !!v.payload && typeof v.payload === 'object'\n}\nconst isEmbedSource = (value: unknown): value is PreviewEmbedSource =>\n isTransferableRef(value) || (!!value && typeof value === 'object' && (value as { kind?: unknown }).kind === 'blob' &&\n typeof Blob !== 'undefined' && (value as { blob?: unknown }).blob instanceof Blob && typeof (value as { name?: unknown }).name === 'string')\nexport const PREVIEW_EMBED_PATH = '/embed/preview'\n\n/** App side: owns the iframe that shows the system Preview. */\nexport class PreviewEmbed {\n readonly url: string\n private readonly nonce = crypto.randomUUID()\n private readonly origin: string\n private readonly listener = (event: MessageEvent) => this.receive(event)\n private init: Omit<PreviewEmbedInit, 'nonce'>\n private ready = false\n constructor(private options: {\n systemOrigin: string\n frame: () => HTMLIFrameElement | null\n init: Omit<PreviewEmbedInit, 'nonce'>\n onState?: (state: PreviewEmbedState) => void\n onOpenWith?: (open: PreviewEmbedOpenWith) => void\n onExit?: () => void\n }) {\n this.origin = new URL(options.systemOrigin).origin\n this.init = options.init\n this.url = `${this.origin}${PREVIEW_EMBED_PATH}#bpe=${this.nonce}&po=${encodeURIComponent(window.location.origin)}`\n window.addEventListener('message', this.listener)\n }\n private post(type: string, payload: unknown): void {\n this.options.frame()?.contentWindow?.postMessage(embedEnvelope(type, payload), this.origin)\n }\n private receive(event: MessageEvent): void {\n if (event.origin !== this.origin || event.source !== this.options.frame()?.contentWindow || !isEmbedMessage(event.data)) return\n const { type, payload: p } = event.data\n if (type === 'embed.hello') { if (p.nonce === this.nonce) { this.ready = true; this.post('embed.init', { ...this.init, nonce: this.nonce }) } return }\n if (type === 'embed.state' && (p.status === 'loading' || p.status === 'ready' || p.status === 'error')) {\n const error = p.error as { kind?: unknown; code?: unknown } | undefined\n this.options.onState?.({ status: p.status,\n error: error && typeof error.kind === 'string' && typeof error.code === 'string' ? { kind: error.kind, code: error.code } : undefined,\n title: typeof p.title === 'string' ? p.title.slice(0, 256) : undefined, mediaType: typeof p.mediaType === 'string' ? p.mediaType.slice(0, 128) : undefined })\n }\n if (type === 'embed.openWith') {\n const request = p.request as Omit<OpenRequest, 'requestId'> | undefined\n if (request && isTransferableRef(request.source) && (request.session === undefined || isTransferableSession(request.session))) {\n this.options.onOpenWith?.({ request: { source: request.source, session: request.session }, hints: readContentHints(p.hints) })\n }\n }\n if (type === 'embed.exit') this.options.onExit?.()\n }\n update(patch: Partial<Pick<PreviewEmbedInit, 'theme' | 'locale'>>): void {\n this.init = { ...this.init, ...patch }\n // Before the handshake the frame still holds its initial about:blank (this App's origin, so the browser rejects\n // the target origin); `embed.init` carries the patch.\n if (this.ready) this.post('embed.update', patch)\n }\n dispose(): void { window.removeEventListener('message', this.listener) }\n}\n\n/** System side: the component-only page at `PREVIEW_EMBED_PATH`. Accepts one embedding App whose origin `accept` admits. */\nexport class PreviewEmbedHost {\n readonly parentOrigin: string | null\n private readonly nonce: string | null\n private ready = false\n private readonly hello?: ReturnType<typeof setInterval>\n private readonly listener = (event: MessageEvent) => this.receive(event)\n constructor(private options: {\n accept: (origin: string) => boolean\n onInit: (init: PreviewEmbedInit) => void\n onUpdate?: (patch: Partial<Pick<PreviewEmbedInit, 'theme' | 'locale'>>) => void\n }) {\n const params = new URLSearchParams(window.location.hash.slice(1))\n this.nonce = params.get('bpe')\n let parentOrigin: string | null = null\n try { parentOrigin = new URL(params.get('po') ?? '').origin } catch {}\n this.parentOrigin = window.parent !== window && this.nonce && parentOrigin && options.accept(parentOrigin) ? parentOrigin : null\n if (!this.parentOrigin) return\n window.addEventListener('message', this.listener)\n const hello = () => window.parent.postMessage(embedEnvelope('embed.hello', { nonce: this.nonce }), this.parentOrigin!)\n hello()\n this.hello = setInterval(() => { if (!this.ready) hello() }, 250)\n }\n private receive(event: MessageEvent): void {\n if (event.source !== window.parent || event.origin !== this.parentOrigin || !isEmbedMessage(event.data)) return\n const { type, payload: p } = event.data\n if (type === 'embed.init') {\n if (p.nonce !== this.nonce || !isEmbedSource(p.source) || (p.session !== undefined && !isTransferableSession(p.session)) || typeof p.locale !== 'string') return\n this.ready = true; clearInterval(this.hello)\n this.options.onInit({ nonce: String(p.nonce), source: p.source, session: p.session as TransferableSessionContext | undefined, theme: p.theme === 'dark' ? 'dark' : 'light', locale: p.locale })\n return\n }\n if (type === 'embed.update' && this.ready) {\n const patch: Partial<Pick<PreviewEmbedInit, 'theme' | 'locale'>> = {}\n if (p.theme === 'dark' || p.theme === 'light') patch.theme = p.theme\n if (typeof p.locale === 'string') patch.locale = p.locale\n this.options.onUpdate?.(patch)\n }\n }\n private post(type: string, payload: unknown): void {\n if (this.ready && this.parentOrigin) window.parent.postMessage(embedEnvelope(type, payload), this.parentOrigin)\n }\n state(state: PreviewEmbedState): void { this.post('embed.state', state) }\n openWith(open: PreviewEmbedOpenWith): void { this.post('embed.openWith', open) }\n exit(): void { this.post('embed.exit', {}) }\n dispose(): void { clearInterval(this.hello); window.removeEventListener('message', this.listener) }\n}\n\n/**\n * System dialog embed protocol (`buckyos.sysdlg-embed` v1): a standalone App page (no shell) shows the system file\n * picker by framing `<systemOrigin>/embed/sysdlg/select` over itself. The handshake is the Preview embed's\n * (`embed.hello` → `embed.init`); the system page browses with its own Zone-root session and answers with\n * `embed.result`. No token crosses origins, and every message names its exact target origin.\n */\nconst SYSDLG_EMBED = 'buckyos.sysdlg-embed'\nexport const SELECT_EMBED_PATH = '/embed/sysdlg/select'\nexport interface SelectEmbedInit { nonce: string; params: unknown; theme: 'light' | 'dark'; locale: string }\nlet selectEmbedOpen = false\n\n/** App side of `buckyos.sysdlg-embed`: the full-page layer that frames the picker. One at a time per page. */\nexport function openSelectEmbed(systemOrigin: string, params: SelectDialogParams, options: { signal?: AbortSignal; theme?: 'light' | 'dark'; locale?: string } = {}): Promise<SelectDialogResult> {\n if (options.signal?.aborted) return Promise.reject(new SystemDialogError('closed'))\n if (selectEmbedOpen) return Promise.reject(new SystemDialogError('busy'))\n selectEmbedOpen = true\n const origin = new URL(systemOrigin).origin\n const locale = options.locale ?? navigator.language ?? 'en'\n const theme = options.theme ?? (window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\n const zh = locale.toLowerCase().startsWith('zh')\n return new Promise((resolve, reject) => {\n const body = document.body\n const html = document.documentElement\n const focused = document.activeElement instanceof HTMLElement ? document.activeElement : null\n const scroll = { x: window.scrollX, y: window.scrollY }\n const saved = { body: body.getAttribute('style'), html: html.getAttribute('style') }\n const siblings = Array.from(body.children).filter((el): el is HTMLElement => el instanceof HTMLElement)\n .map(el => ({ el, inert: el.inert, hidden: el.getAttribute('aria-hidden') }))\n const root = document.createElement('div')\n root.setAttribute('data-buckyos-sysdlg', 'select')\n root.setAttribute('role', 'dialog'); root.setAttribute('aria-modal', 'true')\n root.setAttribute('aria-label', zh ? '文件选择器' : 'File picker')\n root.style.cssText = 'position:fixed;inset:0;height:100vh;height:100dvh;z-index:2147483647;background:rgba(0,0,0,.32);display:flex;align-items:center;justify-content:center'\n let frame: HTMLIFrameElement | undefined\n let nonce = ''\n let timer: ReturnType<typeof setTimeout> | undefined\n let done = false\n const block = (event: Event) => { if (!root.contains(event.target as Node)) { event.stopPropagation(); event.preventDefault() } }\n const blocked = ['keydown', 'pointerdown', 'mousedown', 'touchstart', 'wheel'] as const\n const cleanup = () => {\n if (done) return false\n done = true; selectEmbedOpen = false\n clearTimeout(timer)\n window.removeEventListener('message', receive)\n options.signal?.removeEventListener('abort', abort)\n if (!('inert' in HTMLElement.prototype)) blocked.forEach(type => document.removeEventListener(type, block, true))\n root.remove()\n siblings.forEach(({ el, inert, hidden }) => { el.inert = inert; if (hidden === null) el.removeAttribute('aria-hidden'); else el.setAttribute('aria-hidden', hidden) })\n if (saved.body === null) body.removeAttribute('style'); else body.setAttribute('style', saved.body)\n if (saved.html === null) html.removeAttribute('style'); else html.setAttribute('style', saved.html)\n window.scrollTo(scroll.x, scroll.y)\n focused?.focus({ preventScroll: true })\n return true\n }\n const finish = (result: SelectDialogResult) => { if (cleanup()) resolve(result) }\n const fail = (code: SystemDialogErrorCode) => { if (cleanup()) reject(new SystemDialogError(code)) }\n const abort = () => fail('closed')\n const showFailure = () => {\n frame?.remove(); frame = undefined\n const panel = document.createElement('div')\n panel.setAttribute('role', 'alert')\n panel.style.cssText = `max-width:22rem;margin:1rem;padding:1.25rem;border-radius:16px;font:14px/1.6 system-ui,sans-serif;background:${theme === 'dark' ? '#1f2329' : '#fff'};color:${theme === 'dark' ? '#f2f3f5' : '#1f2329'};box-shadow:0 24px 64px rgba(0,0,0,.24)`\n const text = document.createElement('p')\n text.style.margin = '0 0 1rem'\n text.textContent = zh ? '无法加载文件选择器' : 'Unable to load the file picker'\n const actions = document.createElement('div')\n actions.style.cssText = 'display:flex;gap:.5rem;justify-content:flex-end'\n const button = (label: string, action: () => void) => {\n const el = document.createElement('button')\n el.type = 'button'; el.textContent = label\n el.style.cssText = 'min-height:2.25rem;padding:0 1rem;font:inherit;border-radius:999px;border:1px solid currentColor;background:transparent;color:inherit;cursor:pointer'\n el.addEventListener('click', action); actions.append(el); return el\n }\n button(zh ? '取消' : 'Cancel', () => fail('load_failed'))\n const retry = button(zh ? '重试' : 'Retry', () => { panel.remove(); load() })\n panel.append(text, actions); root.append(panel); retry.focus()\n }\n const load = () => {\n nonce = crypto.randomUUID()\n frame = document.createElement('iframe')\n frame.title = zh ? '文件选择器' : 'File picker'\n frame.style.cssText = 'position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent;color-scheme:normal'\n frame.setAttribute('allowtransparency', 'true')\n frame.addEventListener('error', showFailure)\n frame.src = `${origin}${SELECT_EMBED_PATH}#bse=${nonce}&po=${encodeURIComponent(window.location.origin)}`\n root.append(frame)\n timer = setTimeout(showFailure, 10000)\n }\n const receive = (event: MessageEvent) => {\n if (!frame || event.origin !== origin || event.source !== frame.contentWindow || !isEmbedMessage(event.data, SYSDLG_EMBED)) return\n const { type, payload: p } = event.data\n if (type === 'embed.hello') {\n if (p.nonce !== nonce) return\n clearTimeout(timer)\n frame.contentWindow?.postMessage(embedEnvelope('embed.init', { nonce, params, theme, locale } satisfies SelectEmbedInit, SYSDLG_EMBED), origin)\n frame.focus()\n }\n if (type === 'embed.error') fail(dialogErrorCode(p.code))\n if (type === 'embed.result') {\n const result = readSelectDialogResult(p.result, { allowLocal: params.allowLocal === true })\n if (result) finish(result)\n else fail('protocol')\n }\n }\n window.addEventListener('message', receive)\n options.signal?.addEventListener('abort', abort, { once: true })\n if ('inert' in HTMLElement.prototype) siblings.forEach(({ el }) => { el.inert = true })\n else { siblings.forEach(({ el }) => el.setAttribute('aria-hidden', 'true')); blocked.forEach(type => document.addEventListener(type, block, true)) }\n // `overflow: hidden` alone does not stop the page behind from scrolling on iOS; pinning the body does.\n html.style.overflow = 'hidden'\n body.style.position = 'fixed'; body.style.top = `${-scroll.y}px`; body.style.left = `${-scroll.x}px`; body.style.right = '0'; body.style.overflow = 'hidden'\n body.append(root)\n load()\n })\n}\n\n/** System side: the picker page at `SELECT_EMBED_PATH`. Works only for an embedding page whose origin `accept` admits. */\nexport class SelectEmbedHost {\n readonly parentOrigin: string | null\n private readonly nonce: string | null\n private ready = false\n private readonly hello?: ReturnType<typeof setInterval>\n private readonly listener = (event: MessageEvent) => this.receive(event)\n constructor(private options: { accept: (origin: string) => boolean; onInit: (init: SelectEmbedInit) => void }) {\n const params = new URLSearchParams(window.location.hash.slice(1))\n this.nonce = params.get('bse')\n let parentOrigin: string | null = null\n try { parentOrigin = new URL(params.get('po') ?? '').origin } catch {}\n this.parentOrigin = window.parent !== window && this.nonce && parentOrigin && options.accept(parentOrigin) ? parentOrigin : null\n if (!this.parentOrigin) return\n window.addEventListener('message', this.listener)\n const hello = () => window.parent.postMessage(embedEnvelope('embed.hello', { nonce: this.nonce }, SYSDLG_EMBED), this.parentOrigin!)\n hello()\n this.hello = setInterval(() => { if (!this.ready) hello() }, 250)\n }\n private receive(event: MessageEvent): void {\n if (event.source !== window.parent || event.origin !== this.parentOrigin || !isEmbedMessage(event.data, SYSDLG_EMBED)) return\n const { type, payload: p } = event.data\n if (type !== 'embed.init' || this.ready || p.nonce !== this.nonce || typeof p.locale !== 'string') return\n this.ready = true; clearInterval(this.hello)\n this.options.onInit({ nonce: String(p.nonce), params: p.params, theme: p.theme === 'dark' ? 'dark' : 'light', locale: p.locale })\n }\n private post(type: string, payload: unknown): void {\n if (this.ready && this.parentOrigin) window.parent.postMessage(embedEnvelope(type, payload, SYSDLG_EMBED), this.parentOrigin)\n }\n result(result: SelectDialogResult): void { this.post('embed.result', { result }) }\n error(code: SystemDialogErrorCode): void { this.post('embed.error', { code }) }\n dispose(): void { clearInterval(this.hello); window.removeEventListener('message', this.listener) }\n}\n"],"names":["dialogErrorCode","value","SYSTEM_DIALOG_ERROR_CODES","includes","envelope","type","payload","extra","protocol","version","isMessage","v","PREVIEW_EMBED","embedEnvelope","isEmbedMessage","PREVIEW_EMBED_PATH","SYSDLG_EMBED","SELECT_EMBED_PATH","selectEmbedOpen","openSelectEmbed","systemOrigin","params","options","_a","signal","aborted","Promise","reject","SystemDialogError","origin","URL","locale","navigator","language","theme","_b","window","matchMedia","call","matches","zh","toLowerCase","startsWith","resolve","body","document","html","documentElement","focused","activeElement","HTMLElement","scroll","x","scrollX","y","scrollY","saved","getAttribute","siblings","Array","from","children","filter","el","map","inert","hidden","root","createElement","frame","setAttribute","style","cssText","timer","nonce","done","block","event","contains","target","stopPropagation","preventDefault","blocked","cleanup","clearTimeout","removeEventListener","receive","abort","prototype","forEach","remove","removeAttribute","scrollTo","focus","preventScroll","fail","code","showFailure","panel","text","margin","textContent","actions","button","label","action","addEventListener","append","retry","load","crypto","randomUUID","title","src","encodeURIComponent","location","setTimeout","source","contentWindow","data","p","postMessage","result","readSelectDialogResult","allowLocal","finish","once","overflow","position","top","left","right","constructor","this","listener","dialogs","Map","shellOrigin","URLSearchParams","hash","slice","get","parent","hello","appCapabilities","onOpen","onBeforeClose","onBack","helloTimer","setInterval","helloDeadline","clearInterval","m","windowId","launch","isOpenRequest","init","onInit","pending","replyTo","delete","ok","reply","id","request","_d","_c","accepted","decision","_f","_e","reason","handled","_h","_g","mode","_j","_i","onTheme","_l","_k","onLocale","_n","_m","onFocus","fallback","send","setTitle","dirty","key","JSON","stringify","requestClose","openContent","hints","newWindow","open","systemOpenUrl","appId","selectContent","shellCapabilities","SELECT_DIALOG_PATH","size","set","path","embedAbort","AbortController","dispose","clear","ready","capabilities","opens","dialogOpen","systemDialog","onSystemDialog","error","isArray","c","onReady","onTitle","onRequestClose","requestId","t","Date","now","length","push","onContentOpen","readContentHints","update","setFocused","timeout","Error","beforeClose","r","back","url","post","status","onState","kind","mediaType","isTransferableRef","session","isTransferableSession","onOpenWith","onExit","patch","parentOrigin","accept","Blob","blob","name","String","onUpdate","state","openWith","exit","candidates","ancestorOrigins","referrer","candidate","zoneHost","hostname","endsWith"],"mappings":"uJAEA,MAAMA,EAAmBC,GACvBC,4BAA0BC,SAASF,GAAkCA,EAAiC,WAclGG,EAAW,CAACC,EAAcC,EAAkBC,EAA2C,CAAA,KAAA,CACxFC,SAAU,oBAAqBC,QAAS,EAAGJ,OAAMC,aAAYC,IAC5DG,EAAaT,IACb,IAACA,GAA0B,iBAAVA,EAA2B,OAAA,EAChD,MAAMU,EAAIV,EACV,MAAsB,sBAAfU,EAAEH,UAAkD,IAAdG,EAAEF,SAAmC,iBAAXE,EAAEN,QAAuBM,EAAEL,SAAgC,iBAAdK,EAAEL,OAAY,EA2QpI,MAAMM,EAAgB,wBAChBC,EAAgB,CAACR,EAAcC,EAAkBE,EAAWI,KAAmB,CAAEJ,WAAUC,QAAS,EAAGJ,OAAMC,YAC7GQ,EAAiB,CAACb,EAAgBO,EAAWI,KACjD,MAAMD,EAAIV,EACV,QAASU,GAAKA,EAAEH,WAAaA,GAA0B,IAAdG,EAAEF,SAAmC,iBAAXE,EAAEN,QAAuBM,EAAEL,SAAgC,iBAAdK,EAAEL,OAAY,EAKnHS,EAAqB,iBA2GlC,MAAMC,EAAe,uBACRC,EAAoB,uBAEjC,IAAIC,GAAkB,EAGf,SAASC,EAAgBC,EAAsBC,EAA4BC,EAA+E,CAAA,WAC3J,GAAA,OAAAC,EAAAD,EAAQE,aAAQ,EAAAD,EAAAE,QAAS,OAAOC,QAAQC,OAAO,IAAIC,EAAAA,kBAAkB,WACrE,GAAAV,EAAiB,OAAOQ,QAAQC,OAAO,IAAIC,EAAAA,kBAAkB,SAC/CV,GAAA,EAClB,MAAMW,EAAS,IAAIC,IAAIV,GAAcS,OAC/BE,EAAST,EAAQS,QAAUC,UAAUC,UAAY,KACjDC,EAAQZ,EAAQY,SAAU,OAAAC,EAAAC,OAAOC,iBAAa,EAAAF,EAAAG,KAAAF,OAAA,gCAAgCG,SA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ACjCV,KAAA/G,QAAQuI,OAAO,CAAEnF,MAAOmL,OAAOrI,EAAE9C,OAAQrD,OAAQmG,EAAEnG,OAAQa,MAAmB,SAAZsF,EAAEtF,MAAmB,OAAS,QAASH,OAAQyF,EAAEzF,SAC1H,CACQ,IAAA8M,CAAKxO,EAAcC,GACrB+H,KAAK4E,OAAS5E,KAAKmH,cAAqBpN,OAAA0G,OAAOrB,YAAY5G,EAAcR,EAAMC,EAASU,GAAeqH,KAAKmH,aAClH,CACA,MAAA9H,CAAOA,GAAoCW,KAAKwG,KAAK,eAAgB,CAAEnH,UAAU,CACjF,KAAA6F,CAAMvH,GAAqCqC,KAAKwG,KAAK,cAAe,CAAE7I,QAAQ,CAC9E,OAAA+G,GAAkBxD,cAAclB,KAAKU,OAAe3G,OAAAiD,oBAAoB,UAAWgD,KAAKC,SAAU,0BAra7F,SAAwBmH,SAC7B,GAAIrN,OAAO0G,SAAW1G,OAAe,OAAA,KAC/B,MAAA8N,EAAa,CAAC,OAAA3O,EAAOa,OAAA+E,SAASgJ,sBAAkB,EAAA5O,EAAA,GAAIsB,SAASuN,UACnE,IAAA,MAAWC,KAAaH,EACtB,GAAKG,EACD,IACF,MAAMxO,EAAS,IAAIC,IAAIuO,GAAWxO,OAClC,GAAI4N,EAAO5N,GAAgB,OAAAA,CAAA,CACrB,MAAC,CAEJ,OAAA,IACT,iDAC4B,CAACA,EAAgByO,KACvC,IACI,MAAA1B,EAAM,IAAI9M,IAAID,GACpB,OAAO+M,EAAIpO,WAAa4B,OAAO+E,SAAS3G,WAAaoO,EAAI2B,WAAaD,GAAY1B,EAAI2B,SAASC,SAAS,IAAIF,KAAU,CAChH,MAAS,OAAA,CAAM"}
|
package/dist/app-frame.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import { type ContentHints, type ContentOpenTarget, type OpenRequest, type TransferableContentRef, type TransferableSessionContext } from './content';
|
|
1
|
+
import { type ContentHints, type ContentOpenTarget, type OpenRequest, type SelectDialogParams, type SelectDialogResult, type SystemDialogErrorCode, type TransferableContentRef, type TransferableSessionContext } from './content';
|
|
2
|
+
export type SystemDialogReply = {
|
|
3
|
+
ok: true;
|
|
4
|
+
result: unknown;
|
|
5
|
+
} | {
|
|
6
|
+
ok: false;
|
|
7
|
+
code: SystemDialogErrorCode;
|
|
8
|
+
};
|
|
2
9
|
export interface AppFrameMessage<T extends string = string, P = unknown> {
|
|
3
10
|
protocol: 'buckyos.app-frame';
|
|
4
11
|
version: 1;
|
|
@@ -38,8 +45,12 @@ export declare class AppFrameHost {
|
|
|
38
45
|
newWindow: boolean;
|
|
39
46
|
hints: ContentHints;
|
|
40
47
|
}) => void;
|
|
48
|
+
/** Shows a system dialog the App asked for (`sysdlg.open`). `params` is untrusted input: validate it. */
|
|
49
|
+
onSystemDialog?: (path: string, params: unknown) => Promise<SystemDialogReply>;
|
|
41
50
|
});
|
|
42
51
|
private focused?;
|
|
52
|
+
private dialogOpen;
|
|
53
|
+
private systemDialog;
|
|
43
54
|
private receive;
|
|
44
55
|
update(init: Partial<FrameInit>): void;
|
|
45
56
|
/** Reports whether the App's window is the focused one; only a change is sent. */
|
|
@@ -70,6 +81,8 @@ export declare class AppFrameClient {
|
|
|
70
81
|
private readonly nonce;
|
|
71
82
|
private readonly origin;
|
|
72
83
|
private readonly listener;
|
|
84
|
+
private dialogs;
|
|
85
|
+
private embedAbort?;
|
|
73
86
|
constructor(options: {
|
|
74
87
|
shellOrigin: string;
|
|
75
88
|
/** The Zone's system entry (its root origin): where content is opened when this page is not embedded in the shell. */
|
|
@@ -103,6 +116,17 @@ export declare class AppFrameClient {
|
|
|
103
116
|
newWindow?: boolean;
|
|
104
117
|
hints?: ContentHints;
|
|
105
118
|
}): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Shows the system file picker (`sysdlg/select`) and resolves with what the user chose; cancelling resolves with
|
|
121
|
+
* `{ action: 'cancelled' }`. Embedded in the shell the shell draws the dialog over this App's window; in a
|
|
122
|
+
* standalone tab the picker page of the Zone's system entry (`systemOrigin`) is framed over this page. Rejects
|
|
123
|
+
* with a `SystemDialogError` when no picker is available or the request did not complete.
|
|
124
|
+
*/
|
|
125
|
+
selectContent(params?: SelectDialogParams, options?: {
|
|
126
|
+
signal?: AbortSignal;
|
|
127
|
+
theme?: 'light' | 'dark';
|
|
128
|
+
locale?: string;
|
|
129
|
+
}): Promise<SelectDialogResult>;
|
|
106
130
|
dispose(): void;
|
|
107
131
|
}
|
|
108
132
|
/**
|
|
@@ -146,6 +170,7 @@ export declare class PreviewEmbed {
|
|
|
146
170
|
private readonly origin;
|
|
147
171
|
private readonly listener;
|
|
148
172
|
private init;
|
|
173
|
+
private ready;
|
|
149
174
|
constructor(options: {
|
|
150
175
|
systemOrigin: string;
|
|
151
176
|
frame: () => HTMLIFrameElement | null;
|
|
@@ -179,4 +204,35 @@ export declare class PreviewEmbedHost {
|
|
|
179
204
|
exit(): void;
|
|
180
205
|
dispose(): void;
|
|
181
206
|
}
|
|
207
|
+
export declare const SELECT_EMBED_PATH = "/embed/sysdlg/select";
|
|
208
|
+
export interface SelectEmbedInit {
|
|
209
|
+
nonce: string;
|
|
210
|
+
params: unknown;
|
|
211
|
+
theme: 'light' | 'dark';
|
|
212
|
+
locale: string;
|
|
213
|
+
}
|
|
214
|
+
/** App side of `buckyos.sysdlg-embed`: the full-page layer that frames the picker. One at a time per page. */
|
|
215
|
+
export declare function openSelectEmbed(systemOrigin: string, params: SelectDialogParams, options?: {
|
|
216
|
+
signal?: AbortSignal;
|
|
217
|
+
theme?: 'light' | 'dark';
|
|
218
|
+
locale?: string;
|
|
219
|
+
}): Promise<SelectDialogResult>;
|
|
220
|
+
/** System side: the picker page at `SELECT_EMBED_PATH`. Works only for an embedding page whose origin `accept` admits. */
|
|
221
|
+
export declare class SelectEmbedHost {
|
|
222
|
+
private options;
|
|
223
|
+
readonly parentOrigin: string | null;
|
|
224
|
+
private readonly nonce;
|
|
225
|
+
private ready;
|
|
226
|
+
private readonly hello?;
|
|
227
|
+
private readonly listener;
|
|
228
|
+
constructor(options: {
|
|
229
|
+
accept: (origin: string) => boolean;
|
|
230
|
+
onInit: (init: SelectEmbedInit) => void;
|
|
231
|
+
});
|
|
232
|
+
private receive;
|
|
233
|
+
private post;
|
|
234
|
+
result(result: SelectDialogResult): void;
|
|
235
|
+
error(code: SystemDialogErrorCode): void;
|
|
236
|
+
dispose(): void;
|
|
237
|
+
}
|
|
182
238
|
//# sourceMappingURL=app-frame.d.ts.map
|
package/dist/app-frame.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-frame.d.ts","sourceRoot":"","sources":["../src/app-frame.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"app-frame.d.ts","sourceRoot":"","sources":["../src/app-frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsL,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,KAAK,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,KAAK,qBAAqB,EAAE,KAAK,sBAAsB,EAAE,KAAK,0BAA0B,EAAE,MAAM,WAAW,CAAA;AACvZ,MAAM,MAAM,iBAAiB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,qBAAqB,CAAA;CAAE,CAAA;AAG1G,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO;IACrE,QAAQ,EAAE,mBAAmB,CAAC;IAAC,OAAO,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,CAAC,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAC9F;AACD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAA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