human2ai 0.1.4 → 0.1.5
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/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/domain/composition/draft.js +1 -1
- package/dist/domain/composition/draft.js.map +1 -1
- package/locales/en/common.json +13 -2
- package/package.json +1 -1
- package/skills/human2ai/SKILL.md +1 -1
- package/web/out/404/index.html +1 -1
- package/web/out/404.html +1 -1
- package/web/out/__next.__PAGE__.txt +9 -9
- package/web/out/__next._full.txt +10 -10
- package/web/out/__next._tree.txt +6 -6
- package/web/out/_next/static/chunks/130-930cfe062cda6fb5.js +1 -0
- package/web/out/_next/static/chunks/166-64abdc6456626378.js +1 -0
- package/web/out/_next/static/chunks/{635-611c009924b842be.js → 380-6a6a9517cf13350e.js} +21 -21
- package/web/out/_next/static/chunks/678-6a688c1f8589183c.js +1 -0
- package/web/out/_next/static/chunks/app/_not-found/page-527a4b0506fa60cb.js +1 -0
- package/web/out/_next/static/chunks/app/composition/page-945cb9644c513407.js +1 -0
- package/web/out/_next/static/chunks/app/{layout-1dd9196cde94389c.js → layout-33fe456f6115412e.js} +1 -1
- package/web/out/_next/static/chunks/app/page-b027a8ffdb9dda66.js +1 -0
- package/web/out/_next/static/chunks/app/spatial/page-c52d564a39d3b592.js +1 -0
- package/web/out/_next/static/chunks/app/styles/page-87d77b1f3e8fdd21.js +1 -0
- package/web/out/_next/static/chunks/app/ui-sketch/page-69219e06cc93c28f.js +1 -0
- package/web/out/_next/static/chunks/main-app-4a71cca48ead7720.js +1 -0
- package/web/out/_next/static/chunks/next/dist/client/components/builtin/global-error-6a956dd8904b8723.js +1 -0
- package/web/out/_next/static/chunks/{webpack-d16ce1f994e98178.js → webpack-c0280e9af5fc8cd3.js} +1 -1
- package/web/out/_next/static/css/{ce1b4bb3ad3c6073.css → 0ab45995828642ec.css} +1 -1
- package/web/out/_next/static/css/0c7915cdb1509f9d.css +1 -0
- package/web/out/_next/static/css/{06743b5635914999.css → 4fb1bde9070d5094.css} +1 -1
- package/web/out/_next/static/css/c39f5ecbfc8cb532.css +1 -0
- package/web/out/_next/static/css/{3b7982b41ed8eccd.css → d42ebb6745c15e30.css} +1 -1
- package/web/out/_next/static/css/d787350911847f22.css +1 -0
- package/web/out/_next/static/css/db78da93b4de5040.css +1 -0
- package/web/out/_not-found/__next._full.txt +6 -6
- package/web/out/_not-found/__next._not-found.__PAGE__.txt +5 -5
- package/web/out/_not-found/__next._tree.txt +3 -3
- package/web/out/_not-found/index.html +1 -1
- package/web/out/_not-found/index.txt +6 -6
- package/web/out/brand/h2a-1024.png +0 -0
- package/web/out/brand/h2a-128.png +0 -0
- package/web/out/brand/h2a-16.png +0 -0
- package/web/out/brand/h2a-256.png +0 -0
- package/web/out/brand/h2a-32.png +0 -0
- package/web/out/brand/h2a-48.png +0 -0
- package/web/out/brand/h2a-512.png +0 -0
- package/web/out/brand/h2a-64.png +0 -0
- package/web/out/brand/h2a.svg +10 -1
- package/web/out/composition/__next._full.txt +11 -11
- package/web/out/composition/__next._tree.txt +7 -7
- package/web/out/composition/__next.composition.__PAGE__.txt +10 -10
- package/web/out/composition/index.html +1 -1
- package/web/out/composition/index.txt +11 -11
- package/web/out/favicon.ico +0 -0
- package/web/out/icon.svg +10 -1
- package/web/out/index.html +1 -1
- package/web/out/index.txt +10 -10
- package/web/out/spatial/__next._full.txt +9 -9
- package/web/out/spatial/__next._tree.txt +5 -5
- package/web/out/spatial/__next.spatial.__PAGE__.txt +8 -8
- package/web/out/spatial/index.html +1 -1
- package/web/out/spatial/index.txt +9 -9
- package/web/out/styles/__next._full.txt +9 -9
- package/web/out/styles/__next._tree.txt +5 -5
- package/web/out/styles/__next.styles.__PAGE__.txt +8 -8
- package/web/out/styles/index.html +1 -1
- package/web/out/styles/index.txt +9 -9
- package/web/out/ui-sketch/__next._full.txt +10 -10
- package/web/out/ui-sketch/__next._tree.txt +6 -6
- package/web/out/ui-sketch/__next.ui-sketch.__PAGE__.txt +9 -9
- package/web/out/ui-sketch/index.html +1 -1
- package/web/out/ui-sketch/index.txt +10 -10
- package/web/out/_next/static/chunks/130-7e9e715a084569bb.js +0 -1
- package/web/out/_next/static/chunks/166-96a8c6ae1e9aed59.js +0 -1
- package/web/out/_next/static/chunks/678-32d3aa1859450d63.js +0 -1
- package/web/out/_next/static/chunks/app/_not-found/page-b92817fdc4609975.js +0 -1
- package/web/out/_next/static/chunks/app/composition/page-6c12ee8472715448.js +0 -1
- package/web/out/_next/static/chunks/app/page-741ecaf9ee8c3c07.js +0 -1
- package/web/out/_next/static/chunks/app/spatial/page-5ba0940650df6c7f.js +0 -1
- package/web/out/_next/static/chunks/app/styles/page-1ccfc2c5fbc1e646.js +0 -1
- package/web/out/_next/static/chunks/app/ui-sketch/page-ef4f2e531583e684.js +0 -1
- package/web/out/_next/static/chunks/main-app-cf37a257d91ce62e.js +0 -1
- package/web/out/_next/static/chunks/next/dist/client/components/builtin/global-error-33b4f58f02e82215.js +0 -1
- package/web/out/_next/static/css/1f8501a43042a5a2.css +0 -1
- package/web/out/_next/static/css/39e8cace36461a15.css +0 -1
- package/web/out/_next/static/css/81ae71f1d3e9a866.css +0 -1
- package/web/out/_next/static/css/db96ae2e88545d96.css +0 -1
- /package/web/out/_next/static/{n4UcxqMmr_2CBmSxBp52z → Rem7hlT5iXtA-5codwSoe}/_buildManifest.js +0 -0
- /package/web/out/_next/static/{n4UcxqMmr_2CBmSxBp52z → Rem7hlT5iXtA-5codwSoe}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[166],{31854:(e,t,r)=>{"use strict";r.d(t,{t:()=>o});var i=r(1521),n=r(8020),a=r(60458);function o(e,t,r){let{t:o}=(0,n.Bd)(),[s,l]=(0,i.useState)(null),[c,d]=(0,i.useState)([]),[u,h]=(0,i.useState)(!0),[y,p]=(0,i.useState)(!1),[m,g]=(0,i.useState)(null),[f,b]=(0,i.useState)(0),w=(0,i.useRef)(e);w.current=e;let v=(0,i.useRef)(!1),L=(0,i.useRef)(0);async function S(r){if(v.current)return;v.current=!0,++L.current,p(!0),g(null);let i=e;try{if(i??=await t(),null!==w.current&&w.current!==i)return;let e=s?.session.id===i?s:await (0,a.YM)(i),n=await (0,a.T8)(i,r,e.session.revision);(w.current===i||null===w.current)&&l(n)}catch(e){throw(w.current===i||null===w.current)&&g(e instanceof a.wP&&409===e.status?o("sessionStyle.conflict"):o("errors.operationFailed")),e}finally{v.current=!1,p(!1),h(!1)}}async function k(){if(!e)return;let t=await (0,a.YM)(e);return w.current===e&&l(t),t.style?o("sessionStyle.prompt",{summary:t.style.promptSummary}):void 0}return(0,i.useEffect)(()=>{let t=!1,r=!1;h(!0),g(null);let i=async()=>{if(r||v.current)return;r=!0;let i=++L.current;try{let[r,n]=await Promise.all([(0,a.X0)(),e?(0,a.YM)(e):Promise.resolve(null)]);if(t||i!==L.current)return;d(r),l(n),g(null)}catch{t||i!==L.current||g(o("styleLibrary.loadFailed"))}finally{r=!1,t||i!==L.current||h(!1)}};i();let n=window.setInterval(()=>void i(),3e3);return()=>{t=!0,window.clearInterval(n)}},[e,r,f,o]),{styles:c,currentStyle:s?.session.id===e?s.style:null,loading:u,saving:y,error:m,bind:S,readPromptLine:k,refresh:()=>b(e=>e+1)}}},42614:(e,t,r)=>{"use strict";r.d(t,{B:()=>o});let i={globalNoteHeading:"notes.global.promptHeading",note:"notes.element.prompt",displayText:"textContent.prompt",visualWeight:"visualWeight.prompt",weightAuto:"visualWeight.auto",weightHigh:"visualWeight.high",weightMedium:"visualWeight.medium",weightLow:"visualWeight.low",weightDecorative:"visualWeight.decorative"},n={planningHeading:"composition.planning.title",planningGoldenSection:"composition.planning.types.golden-section",planningThirds:"composition.planning.types.thirds",planningBoth:"composition.planning.both",planningHorizontal:"composition.planning.horizontal",planningVertical:"composition.planning.vertical",shotScale:"composition.depth.prompt",foreground:"composition.depth.foreground",midground:"composition.depth.midground",background:"composition.depth.background",processingSemantic:"composition.mode.prompt",sceneComposition:"composition.mode.scene",editorialLayout:"composition.mode.editorial",unselected:"composition.mode.unselected",unselectedGuidance:"composition.mode.unselectedGuidance",sceneGuidance:"composition.mode.sceneGuidance",editorialGuidance:"composition.mode.editorialGuidance",imageHeading:"canvas.imageNode.promptHeading",flowHeading:"composition.flow.promptHeading",flowReference:"composition.flow.promptReference"},a={stateName:"uiSketch.states.defaultName",visible:"uiSketch.canvasLabels.visible",hidden:"uiSketch.canvasLabels.hidden"};function o(e,t){return i[t]??("composition"===e?n[t]:a[t])??`${e}.prompt.${t}`}},46109:(e,t,r)=>{"use strict";function i(e){return{model:{label:e("styleLibrary.model.label"),loading:e("styleLibrary.model.loading"),failed:e("styleLibrary.model.failed"),reset:e("styleLibrary.model.reset"),controls:e("styleLibrary.model.controls"),retry:e("actions.retry")},newStyle:e("styleLibrary.newStyle"),editStyle:e("styleLibrary.editStyle"),name:e("styleLibrary.name"),namePlaceholder:e("styleLibrary.namePlaceholder"),category:e("styleLibrary.category.label"),allCategories:e("styleLibrary.category.all"),visualCategory:e("styleLibrary.category.visual"),uiCategory:e("styleLibrary.category.ui"),spatialCategory:e("styleLibrary.category.spatial"),creator:e("styleLibrary.creator.label"),allCreators:e("styleLibrary.creator.all"),userCreator:e("styleLibrary.creator.user"),agentCreator:e("styleLibrary.creator.agent"),references:e("styleLibrary.references.heading"),noReferences:e("styleLibrary.references.empty"),addReferences:e("styleLibrary.references.add"),removeReference:e("styleLibrary.references.remove"),pasteHint:e("styleLibrary.references.pasteHint"),fileTypes:e("styleLibrary.references.fileTypes"),description:e("styleLibrary.description.heading"),promptSummary:e("styleLibrary.promptSummary.label"),promptSummaryPlaceholder:e("styleLibrary.promptSummary.placeholder"),descriptionPlaceholder:e("styleLibrary.description.placeholder"),spatialDescriptionPlaceholder:e("styleLibrary.description.spatialPlaceholder"),searchPlaceholder:e("styleLibrary.searchPlaceholder"),deleteTitle:e("styleLibrary.deleteTitle"),deleteDescription:e("styleLibrary.deleteDescription"),empty:e("styleLibrary.empty"),noMatches:e("styleLibrary.noMatches"),loading:e("styleLibrary.loading"),loadFailed:e("styleLibrary.loadFailed"),retry:e("actions.retry"),save:e("styleLibrary.save"),cancel:e("actions.cancel"),delete:e("actions.delete"),operationFailed:e("errors.operationFailed"),imageInvalid:e("styleLibrary.imageInvalid"),openStyle:t=>e("styleLibrary.openStyle",{name:t}),closePreview:e("styleLibrary.closePreview")}}r.d(t,{Q:()=>i})},46295:(e,t,r)=>{"use strict";function i(e,t){let r=t?new URL(t).origin:null,i=`session connect --session ${e}`;return r?`human2ai --api-url ${r} --web-url ${r} ${i}`:`human2ai ${i}`}r.d(t,{m:()=>i})},48197:(e,t,r)=>{"use strict";r.d(t,{H:()=>l});var i=r(73365),n=r(16415),a=r(8020),o=r(60458),s=r(46109);function l({controller:e,category:t,processing:r,disabled:c,showProcessingStatus:d=!0}){let{t:u}=(0,a.Bd)(),h=e.currentStyle;return(0,i.jsx)(n.WL,{styles:e.styles,currentStyle:h,category:t,labels:{title:u("sessionStyle.label"),choose:u("sessionStyle.choose"),dialogTitle:u("sessionStyle.dialogTitle"),unbind:u("sessionStyle.unbind"),select:u("sessionStyle.select"),pending:u("sessionStyle.pending")},libraryLabels:(0,s.Q)(u),imageUrl:o.Pf,modelUrl:o.x,onBind:e.bind,onRetry:e.refresh,loading:e.loading,saving:e.saving,error:e.error,disabled:c,pending:d&&!!(h&&(r?.styleId!==h.id||r.styleRevision!==h.revision))})}},52003:(e,t,r)=>{"use strict";r.d(t,{S:()=>s});var i=r(1521);class n{constructor(e){this.past=[],this.future=[],this.current=structuredClone(e)}get canUndo(){return this.past.length>0}get canRedo(){return this.future.length>0}record(e,t,r=t,i){if(JSON.stringify(this.current)===JSON.stringify(e))return!1;let n=this.past.at(-1),a=structuredClone(e);return i&&n?.group===i?(n.after=a,n.afterContext=r,JSON.stringify(n.before)===JSON.stringify(a)&&this.past.pop()):(this.past.push({before:this.current,after:a,beforeContext:t,afterContext:r,group:i}),this.past.length>100&&this.past.shift()),this.current=a,this.future=[],!0}undo(){let e=this.past.pop();return e?(this.future.push(e),this.current=e.before,{draft:structuredClone(this.current),context:e.beforeContext}):null}redo(){let e=this.future.pop();return e?(this.past.push(e),this.current=e.after,{draft:structuredClone(this.current),context:e.afterContext}):null}reset(e){this.current=structuredClone(e),this.past=[],this.future=[]}}function a(e){return e instanceof Element&&!!e.closest('textarea, input:not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]), [contenteditable="true"], [role="textbox"]')}function o(e){return e===document.body||e instanceof Element&&!!e.closest("[data-canvas-editor], [data-human2ai-auto-save-node-editor]")}function s(e,t,r=!1){let[l]=(0,i.useState)(()=>new n(e)),[,c]=(0,i.useState)(0),[d,u]=(0,i.useState)(0),h=(0,i.useRef)({restore:t,disabled:r});h.current={restore:t,disabled:r};let y=(0,i.useRef)({}),p=(0,i.useRef)(new Map),m=(0,i.useMemo)(()=>{let e=()=>c(e=>e+1),t=()=>{for(let[e,t]of[...p.current])t.dispatchEvent(new PointerEvent("pointercancel",{pointerId:e,bubbles:!0}));p.current.clear(),y.current={}},r=r=>{if(h.current.disabled)return;t();let i=l[r]();i&&(h.current.restore(i),u(e=>e+1),e())};return{current:()=>l.current,record(t,r,i=r){let n=y.current.pointer??y.current.text??y.current.key,a=l.record(t,r,i,n);return a&&e(),a},reset(r){t(),l.reset(r),u(e=>e+1),e()},undo:()=>r("undo"),redo:()=>r("redo")}},[l]);return(0,i.useEffect)(()=>{let e=e=>{o(e.target)&&e.target instanceof Element&&(p.current.set(e.pointerId,e.target),a(e.target)||(y.current.pointer=Symbol("pointer")))},t=e=>{p.current.delete(e.pointerId);let t=y.current.pointer;window.setTimeout(()=>{y.current.pointer===t&&(y.current.pointer=void 0)},0)},r=e=>{a(e.target)&&(y.current.text=Symbol("input"))},i=()=>{y.current.text=void 0},n=()=>{y.current={},p.current.clear()},s=e=>{if(e.isComposing||a(e.target)||!o(e.target))return;let t=e.key.toLowerCase();if((e.ctrlKey||e.metaKey)&&!e.altKey&&("z"===t||"y"===t)){if(h.current.disabled)return;e.preventDefault(),e.stopPropagation(),"y"===t||e.shiftKey?m.redo():m.undo()}else e.repeat||(y.current.key=Symbol("key"))},l=e=>{let t=y.current.key;a(e.target)||window.setTimeout(()=>{y.current.key===t&&(y.current.key=void 0)},0)};return window.addEventListener("pointerdown",e,!0),window.addEventListener("pointerup",t,!0),window.addEventListener("pointercancel",t,!0),window.addEventListener("focusin",r,!0),window.addEventListener("focusout",i,!0),window.addEventListener("keydown",s,!0),window.addEventListener("keyup",l,!0),window.addEventListener("blur",n),()=>{window.removeEventListener("pointerdown",e,!0),window.removeEventListener("pointerup",t,!0),window.removeEventListener("pointercancel",t,!0),window.removeEventListener("focusin",r,!0),window.removeEventListener("focusout",i,!0),window.removeEventListener("keydown",s,!0),window.removeEventListener("keyup",l,!0),window.removeEventListener("blur",n)}},[m]),{...m,restoreToken:d,canUndo:!r&&l.canUndo,canRedo:!r&&l.canRedo}}},55894:()=>{},94946:(e,t,r)=>{"use strict";r.d(t,{h:()=>m});var i=r(73365),n=r(1521);r(22392),r(55894);var a=r(46811);let o=[{key:"16:9",label:"16:9",width:16,height:9},{key:"9:16",label:"9:16",width:9,height:16},{key:"4:3",label:"4:3",width:4,height:3},{key:"3:4",label:"3:4",width:3,height:4},{key:"3:2",label:"3:2",width:3,height:2},{key:"1:1",label:"1:1",width:1,height:1},{key:"2:3",label:"2:3",width:2,height:3}],s=["left-top","right-top","left-middle","right-middle","left-bottom","center-bottom","right-bottom"];function l(e,t){if(void 0!==e&&(!Number.isFinite(e.width)||e.width<=0||!Number.isFinite(e.height)||e.height<=0))throw Error(`AspectRatioSelector ${t} 的宽高必须是正数。`)}function c(e,t,r){for(let i=1;i<=e.length;i+=1){let n=(t+i*r+e.length)%e.length;if(!e[n].disabled)return n}return t}function d(e){return{width:e.width,height:e.height}}function u(e,t){let r=e.width*t.height,i=t.width*e.height,n=1e-9*Math.max(1,Math.abs(r),Math.abs(i));return Math.abs(r-i)<=n}function h(e,t){return e.find(e=>u(e,t))}function y(e){return String(e)}function p(e){let t=Number(e);return""!==e.trim()&&Number.isFinite(t)&&t>0?t:null}function m({options:e=o,value:t,defaultValue:r,onChange:g,ratio:f,defaultRatio:b,onRatioChange:w,title:v="比例",widthLabel:L="w",heightLabel:S="h","aria-label":k="比例选择",disabled:x=!1,className:E,style:N}){let R;if(0===e.length||e.length>s.length)throw Error("AspectRatioSelector 需要 1 至 7 个比例选项。");let C=new Set;for(let t of e){if(C.has(t.key))throw Error(`AspectRatioSelector 选项 key 必须唯一:${t.key}`);if(!Number.isFinite(t.width)||t.width<=0||!Number.isFinite(t.height)||t.height<=0)throw Error(`AspectRatioSelector 比例必须是正数:${t.key}`);C.add(t.key)}if(void 0!==t&&!C.has(t))throw Error(`AspectRatioSelector value 不存在于 options:${t}`);if(void 0!==r&&!C.has(r))throw Error(`AspectRatioSelector defaultValue 不存在于 options:${r}`);l(f,"ratio"),l(b,"defaultRatio");let $=e.find(e=>!e.disabled)?.key??e[0].key,j=new Map(e.map(e=>[e.key,e])),M=j.get(r??$)??e[0],P=b??d(M),[H,T]=(0,n.useState)(P),[A,F]=(0,n.useState)(()=>void 0!==b?h(e,b)?.key??null:M.key),I=void 0===t?void 0:j.get(t),B=f??(I?d(I):H),D=j.get(t??A??""),W=D&&u(D,B)?D:h(e,B),G=W?.key??null,[U,K]=(0,n.useState)(()=>y(B.width)),[J,O]=(0,n.useState)(()=>y(B.height)),_=(0,n.useId)(),z=(0,n.useRef)([]);function Y(e){if(x||e.disabled)return;let r=d(e);void 0===f&&void 0===t&&(T(r),F(e.key),K(y(r.width)),O(y(r.height))),g?.(e.key,e),w?.(r,e)}function Q(r,i){var n;let a,o=i.currentTarget.value,s="width"===r?o:U,l="height"===r?o:J;"width"===r?K(o):O(o);let c=p(s),d=p(l);null!==c&&null!==d&&(a=h(e,n={width:c,height:d}),void 0===f&&void 0===t&&(T(n),F(a?.key??null)),w?.(n,a))}function V(e,r){(null===p(r.currentTarget.value)||void 0!==f||void 0!==t)&&("width"===e?K(y(B.width)):O(y(B.height)))}return(0,n.useEffect)(()=>{(void 0!==f||void 0!==t)&&(K(y(B.width)),O(y(B.height)))},[B.height,B.width,f,t]),(0,i.jsxs)("div",{...(0,a.S)("aspect-ratio-selector","AspectRatioSelector","selection-pattern"),className:["yisi-aspect-ratio-selector",E].filter(Boolean).join(" "),style:N,"aria-disabled":x,children:[(0,i.jsxs)("div",{className:"yisi-aspect-ratio-selector-header",children:[(0,i.jsx)("span",{className:"yisi-aspect-ratio-selector-title",title:v,children:v}),(0,i.jsxs)("div",{className:"yisi-aspect-ratio-selector-inputs",children:[(0,i.jsxs)("label",{className:"yisi-aspect-ratio-selector-input-label",children:[(0,i.jsx)("span",{children:L}),(0,i.jsx)("input",{id:`${_}-width`,className:"yisi-aspect-ratio-selector-input",type:"number",min:"0",step:"any",inputMode:"decimal",autoComplete:"off","aria-label":L,"aria-invalid":null===p(U),disabled:x,value:U,onChange:e=>Q("width",e),onBlur:e=>V("width",e)})]}),(0,i.jsx)("span",{className:"yisi-aspect-ratio-selector-multiply","aria-hidden":"true",children:"\xd7"}),(0,i.jsxs)("label",{className:"yisi-aspect-ratio-selector-input-label",children:[(0,i.jsx)("span",{children:S}),(0,i.jsx)("input",{id:`${_}-height`,className:"yisi-aspect-ratio-selector-input",type:"number",min:"0",step:"any",inputMode:"decimal",autoComplete:"off","aria-label":S,"aria-invalid":null===p(J),disabled:x,value:J,onChange:e=>Q("height",e),onBlur:e=>V("height",e)})]})]})]}),(0,i.jsxs)("div",{className:"yisi-aspect-ratio-selector-options",role:"radiogroup","aria-label":k,"aria-disabled":x,children:[(0,i.jsxs)("div",{className:"yisi-aspect-ratio-selector-preview-area","aria-live":"polite","aria-atomic":"true",children:[(0,i.jsxs)("span",{className:"yisi-aspect-ratio-selector-current",children:[v,": ",y(B.width)," \xd7 ",y(B.height)]}),(0,i.jsx)("span",{className:"yisi-aspect-ratio-selector-preview",style:(R=Math.min(62/B.width,60/B.height),{"--yisiui-aspect-ratio-preview-width":`${Math.max(12,B.width*R)}px`,"--yisiui-aspect-ratio-preview-height":`${Math.max(12,B.height*R)}px`}),"data-ratio":G??`${B.width}:${B.height}`,"data-ratio-value":`${B.width}:${B.height}`,"aria-hidden":"true"})]}),e.map((t,r)=>{let n=t.key===G,a=W?.disabled??!1,o=(null===G||a)&&t.key===$;return(0,i.jsx)("button",{ref:e=>{z.current[r]=e},className:"yisi-aspect-ratio-selector-option",type:"button",role:"radio","aria-checked":n,"aria-label":t.ariaLabel,title:t.label,"data-ratio-key":t.key,"data-position":s[r],disabled:x||t.disabled,tabIndex:n||o?0:-1,onClick:()=>Y(t),onKeyDown:t=>{let i;return i=null,void("ArrowRight"===t.key||"ArrowDown"===t.key?i=c(e,r,1):"ArrowLeft"===t.key||"ArrowUp"===t.key?i=c(e,r,-1):"Home"===t.key?i=e.findIndex(e=>!e.disabled):"End"===t.key&&(i=function(e){for(let t=e.length-1;t>=0;t-=1)if(!e[t].disabled)return t;return -1}(e)),null!==i&&!(i<0)&&i!==r&&(t.preventDefault(),Y(e[i]),z.current[i]?.focus()))},children:(0,i.jsx)("span",{children:t.label})},t.key)})]})]})}}}]);
|