@univerjs/preset-docs-hyper-link 0.16.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.css CHANGED
@@ -1 +1 @@
1
- .univer-ml-2{margin-left:.5rem}.univer-mr-2{margin-right:.5rem}.univer-box-border{box-sizing:border-box}.univer-flex{display:flex}.univer-size-5{width:1.25rem;height:1.25rem}.univer-size-6{width:1.5rem;height:1.5rem}.univer-h-6{height:1.5rem}.univer-w-\[328px\]{width:328px}.univer-max-w-80{max-width:20rem}.univer-flex-1{flex:1 1 0%}.univer-flex-\[0_0_auto\]{flex:0 0 auto}.univer-cursor-pointer{cursor:pointer}.univer-items-center{align-items:center}.univer-justify-end{justify-content:flex-end}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-gap-3{gap:.75rem}.univer-overflow-hidden{overflow:hidden}.univer-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.univer-rounded{border-radius:.25rem}.univer-rounded-lg{border-radius:.5rem}.univer-rounded-xl{border-radius:.75rem}.univer-bg-white{background-color:var(--univer-white)}.univer-p-3{padding:.75rem}.univer-px-6{padding-left:1.5rem;padding-right:1.5rem}.univer-py-5{padding-top:1.25rem;padding-bottom:1.25rem}.univer-text-base{font-size:1rem;line-height:1.5rem}.univer-text-sm{font-size:.875rem;line-height:1.25rem}.univer-leading-5{line-height:1.25rem}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-primary-500{color:var(--univer-primary-500)}.univer-shadow{--univer-tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--univer-tw-shadow-colored: 0 1px 3px 0 var(--univer-tw-shadow-color), 0 1px 2px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--univer-tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--univer-tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--univer-tw-shadow)}.dark\:\!univer-bg-gray-900:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)!important}.dark\:\!univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}
1
+ .univer-ml-2{margin-left:.5rem}.univer-mr-2{margin-right:.5rem}.univer-box-border{box-sizing:border-box}.univer-flex{display:flex}.univer-size-5{width:1.25rem;height:1.25rem}.univer-size-6{width:1.5rem;height:1.5rem}.univer-h-6{height:1.5rem}.univer-w-\[328px\]{width:328px}.univer-max-w-80{max-width:20rem}.univer-flex-1{flex:1}.univer-flex-\[0_0_auto\]{flex:none}.univer-cursor-pointer{cursor:pointer}.univer-items-center{align-items:center}.univer-justify-end{justify-content:flex-end}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-gap-3{gap:.75rem}.univer-overflow-hidden{overflow:hidden}.univer-truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.univer-rounded{border-radius:.25rem}.univer-rounded-lg{border-radius:.5rem}.univer-rounded-xl{border-radius:.75rem}.univer-bg-white{background-color:var(--univer-white)}.univer-p-3{padding:.75rem}.univer-px-6{padding-left:1.5rem;padding-right:1.5rem}.univer-py-5{padding-top:1.25rem;padding-bottom:1.25rem}.univer-text-base{font-size:1rem;line-height:1.5rem}.univer-text-sm{font-size:.875rem;line-height:1.25rem}.univer-leading-5{line-height:1.25rem}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-primary-500{color:var(--univer-primary-500)}.univer-shadow{--univer-tw-shadow: 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--univer-tw-shadow-colored: 0 1px 3px 0 var(--univer-tw-shadow-color), 0 1px 2px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--univer-tw-ring-offset-shadow, 0 0 #0000),var(--univer-tw-ring-shadow, 0 0 #0000),var(--univer-tw-shadow)}.dark\:\!univer-bg-gray-900:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)!important}.dark\:\!univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}
package/lib/umd/index.js CHANGED
@@ -1,10 +1,31 @@
1
1
  // @univerjs/docs-hyper-link/index
2
- (function(a,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("@univerjs/core")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core"],e):(a=typeof globalThis<"u"?globalThis:a||self,e(a.UniverDocsHyperLink={},a.UniverCore))})(this,(function(a,e){"use strict";var N=Object.defineProperty;var O=(a,e,p)=>e in a?N(a,e,{enumerable:!0,configurable:!0,writable:!0,value:p}):a[e]=p;var f=(a,e,p)=>O(a,typeof e!="symbol"?e+"":e,p);var h;const p={id:"docs.mutation.add-hyper-link",type:e.CommandType.MUTATION,handler:()=>!0},I={id:"docs.mutation.update-hyper-link",type:e.CommandType.MUTATION,handler:()=>!0},m={id:"docs.mutation.delete-hyper-link",type:e.CommandType.MUTATION,handler:()=>!0},U="docs-hyper-link.config",g={};var C=Object.getOwnPropertyDescriptor,D=(s,n,t,o)=>{for(var r=o>1?void 0:o?C(n,t):n,i=s.length-1,c;i>=0;i--)(c=s[i])&&(r=c(r)||r);return r},v=(s,n)=>(t,o)=>n(t,o,s);const y="DOC_HYPER_LINK_PLUGIN";let l=class extends e.Disposable{constructor(s,n){super(),this._resourceManagerService=s,this._univerInstanceService=n,this._init()}_init(){this._resourceManagerService.registerPluginResource({pluginName:y,businesses:[e.UniverInstanceType.UNIVER_DOC],onLoad:(s,n)=>{const t=this._univerInstanceService.getUnit(s,e.UniverInstanceType.UNIVER_DOC);if(!t)return;const o=new Map,r=i=>{var c,d;return(d=(c=i.getBody())==null?void 0:c.customRanges)==null||d.forEach(u=>{u.rangeType===e.CustomRangeType.HYPERLINK&&o.set(u.rangeId,u)}),o};t.headerModelMap.forEach(i=>{r(i)}),t.footerModelMap.forEach(i=>{r(i)}),r(t),n.links.forEach(i=>{const c=o.get(i.id);c&&(c.properties={...c.properties,url:i.payload})})},onUnLoad:s=>{},toJson:s=>{const n=this._univerInstanceService.getUnit(s,e.UniverInstanceType.UNIVER_DOC),t=[];if(n){const o=r=>{var i,c;(c=(i=r.getBody())==null?void 0:i.customRanges)==null||c.forEach(d=>{var u;d.rangeType===e.CustomRangeType.HYPERLINK&&t.push({id:d.rangeId,payload:((u=d.properties)==null?void 0:u.url)||""})})};n.headerModelMap.forEach(r=>{o(r)}),n.footerModelMap.forEach(r=>{o(r)}),o(n)}return JSON.stringify({links:t})},parseJson(s){return JSON.parse(s)}})}};l=D([v(0,e.Inject(e.IResourceManagerService)),v(1,e.IUniverInstanceService)],l);var P=Object.getOwnPropertyDescriptor,M=(s,n,t,o)=>{for(var r=o>1?void 0:o?P(n,t):n,i=s.length-1,c;i>=0;i--)(c=s[i])&&(r=c(r)||r);return r},_=(s,n)=>(t,o)=>n(t,o,s);a.UniverDocsHyperLinkPlugin=(h=class extends e.Plugin{constructor(n=g,t,o,r){super(),this._config=n,this._injector=t,this._configService=o,this._commandService=r;const{...i}=e.merge({},g,this._config);this._configService.setConfig(U,i)}onStarting(){[[l]].forEach(t=>this._injector.add(t)),[p,m,I].forEach(t=>{this.disposeWithMe(this._commandService.registerCommand(t))}),this._injector.get(l)}},f(h,"pluginName",y),f(h,"type",e.UniverInstanceType.UNIVER_DOC),h),a.UniverDocsHyperLinkPlugin=M([_(1,e.Inject(e.Injector)),_(2,e.IConfigService),_(3,e.ICommandService)],a.UniverDocsHyperLinkPlugin),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverDocsHyperLink={},e.UniverCore))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=`@univerjs/docs-hyper-link`,r=`0.18.0`;let i={id:`docs.mutation.add-hyper-link`,type:t.CommandType.MUTATION,handler:()=>!0},a={id:`docs.mutation.update-hyper-link`,type:t.CommandType.MUTATION,handler:()=>!0},o={id:`docs.mutation.delete-hyper-link`,type:t.CommandType.MUTATION,handler:()=>!0},s=`docs-hyper-link.config`;Symbol(s);let c={};function l(e,t){return function(n,r){t(n,r,e)}}function u(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let d=`DOC_HYPER_LINK_PLUGIN`,f=class extends t.Disposable{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){this._resourceManagerService.registerPluginResource({pluginName:d,businesses:[t.UniverInstanceType.UNIVER_DOC],onLoad:(e,n)=>{let r=this._univerInstanceService.getUnit(e,t.UniverInstanceType.UNIVER_DOC);if(!r)return;let i=new Map,a=e=>{var n;return(n=e.getBody())==null||(n=n.customRanges)==null||n.forEach(e=>{e.rangeType===t.CustomRangeType.HYPERLINK&&i.set(e.rangeId,e)}),i};r.headerModelMap.forEach(e=>{a(e)}),r.footerModelMap.forEach(e=>{a(e)}),a(r),n.links.forEach(e=>{let t=i.get(e.id);t&&(t.properties={...t.properties,url:e.payload})})},onUnLoad:e=>{},toJson:e=>{let n=this._univerInstanceService.getUnit(e,t.UniverInstanceType.UNIVER_DOC),r=[];if(n){let e=e=>{var n;(n=e.getBody())==null||(n=n.customRanges)==null||n.forEach(e=>{if(e.rangeType===t.CustomRangeType.HYPERLINK){var n;r.push({id:e.rangeId,payload:((n=e.properties)==null?void 0:n.url)||``})}})};n.headerModelMap.forEach(t=>{e(t)}),n.footerModelMap.forEach(t=>{e(t)}),e(n)}return JSON.stringify({links:r})},parseJson(e){return JSON.parse(e)}})}};f=u([l(0,(0,t.Inject)(t.IResourceManagerService)),l(1,t.IUniverInstanceService)],f);function p(e){"@babel/helpers - typeof";return p=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},p(e)}function m(e,t){if(p(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(p(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function h(e){var t=m(e,`string`);return p(t)==`symbol`?t:t+``}function g(e,t,n){return(t=h(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let _=class extends t.Plugin{constructor(e=c,n,r,i){super(),this._config=e,this._injector=n,this._configService=r,this._commandService=i;let{...a}=(0,t.merge)({},c,this._config);this._configService.setConfig(s,a)}onStarting(){[[f]].forEach(e=>this._injector.add(e)),[i,o,a].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))}),this._injector.get(f)}};g(_,`pluginName`,d),g(_,`packageName`,n),g(_,`version`,r),g(_,`type`,t.UniverInstanceType.UNIVER_DOC),_=u([l(1,(0,t.Inject)(t.Injector)),l(2,t.IConfigService),l(3,t.ICommandService)],_),Object.defineProperty(e,`UniverDocsHyperLinkPlugin`,{enumerable:!0,get:function(){return _}})});
4
3
 
5
4
  // @univerjs/docs-hyper-link-ui/index
6
- (function(a,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/docs-hyper-link"),require("@univerjs/engine-render"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("rxjs"),require("react/jsx-runtime"),require("@univerjs/design"),require("@univerjs/ui"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs-hyper-link","@univerjs/engine-render","@univerjs/docs","@univerjs/docs-ui","rxjs","react/jsx-runtime","@univerjs/design","@univerjs/ui","react"],o):(a=typeof globalThis<"u"?globalThis:a||self,o(a.UniverDocsHyperLinkUi={},a.UniverCore,a.UniverDocsHyperLink,a.UniverEngineRender,a.UniverDocs,a.UniverDocsUi,a.rxjs,a.React,a.UniverDesign,a.UniverUi,a.React))})(this,(function(a,o,w,Ce,S,E,O,u,C,p,y){"use strict";var We=Object.defineProperty;var Ge=(a,o,w)=>o in a?We(a,o,{enumerable:!0,configurable:!0,writable:!0,value:w}):a[o]=w;var D=(a,o,w)=>Ge(a,typeof o!="symbol"?o+"":o,w);const _e="docs-hyper-link-ui.config",z={},J={type:o.CommandType.COMMAND,id:"docs.command.add-hyper-link",async handler(n,e){if(!e)return!1;const{payload:t,unitId:i,selections:r}=e,s=n.get(o.ICommandService),c=o.generateRandomId(),d=S.addCustomRangeBySelectionFactory(n,{rangeId:c,rangeType:o.CustomRangeType.HYPERLINK,properties:{url:t},unitId:i,selections:r});return d?s.syncExecuteCommand(d.id,d.params):!1}},Q={id:"docs.command.update-hyper-link",type:o.CommandType.COMMAND,handler(n,e){var I;if(!e)return!1;const{unitId:t,payload:i,segmentId:r,linkId:s}=e,c=n.get(o.ICommandService),d=n.get(o.IUniverInstanceService),g=n.get(S.DocSelectionManagerService).getActiveTextRange(),m=d.getUnit(t,o.UniverInstanceType.UNIVER_DOC);if(!g||!m)return!1;const f=(I=o.getBodySlice(m.getSelfOrHeaderFooterModel(r).getBody(),g.startOffset,g.endOffset).textRuns)==null?void 0:I[0];f&&(f.ed=e.label.length+1);const l=S.replaceSelectionFactory(n,{unitId:t,body:{dataStream:`${e.label}`,customRanges:[{rangeId:s,rangeType:o.CustomRangeType.HYPERLINK,startIndex:0,endIndex:e.label.length+1,properties:{url:i}}],textRuns:f?[f]:void 0},selection:{startOffset:g.startOffset,endOffset:g.endOffset,collapsed:!1,segmentId:r}});return l?c.syncExecuteCommand(l.id,l.params):!1}};function ye(n){return/^[a-zA-Z]+:\/\//.test(n)}function Se(n){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(n)}function xe(n){return ye(n)?n:Se(n)?`mailto://${n}`:`https://${n}`}const b=()=>{const n=p.useDependency(x),e=p.useDependency(o.LocaleService),t=p.useObservable(n.editingLink$),i=p.useDependency(o.ICommandService),r=p.useDependency(o.IUniverInstanceService),s=p.useDependency(S.DocSelectionManagerService),[c,d]=y.useState(""),[h,g]=y.useState(""),[m,_]=y.useState(!1),f=o.Tools.isLegalUrl(c),l=t?r.getUnit(t.unitId,o.UniverInstanceType.UNIVER_DOC):r.getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC);y.useEffect(()=>{var le,ue,pe,ve,he,ge,Ie,fe,me;const v=s.getActiveTextRange();if(!v)return;if(t){const H=(le=l==null?void 0:l.getSelfOrHeaderFooterModel(t.segmentId))==null?void 0:le.getBody(),K=(ue=H==null?void 0:H.customRanges)==null?void 0:ue.find(G=>(t==null?void 0:t.linkId)===G.rangeId&&G.startIndex===t.startIndex&&G.endIndex===t.endIndex);l&&K&&(d((ve=(pe=K.properties)==null?void 0:pe.url)!=null?ve:""),g(o.BuildTextUtils.transform.getPlainText(o.getBodySlice(H,K.startIndex,K.endIndex+1).dataStream)));return}const L=(he=l==null?void 0:l.getSelfOrHeaderFooterModel(v.segmentId))==null?void 0:he.getBody(),ae=L?v:null,j=ae&&((Ie=o.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(ae,(ge=L==null?void 0:L.customRanges)!=null?ge:[]))==null?void 0:Ie[0]);l&&j&&d((me=(fe=j==null?void 0:j.properties)==null?void 0:fe.url)!=null?me:"")},[l,t,s,r]);const I=()=>{n.hideEditPopup()},k=()=>{if(_(!0),!f||!l)return;const v=xe(c);if(!t)i.executeCommand(J.id,{unitId:l.getUnitId(),payload:v});else{if(!h)return;i.executeCommand(Q.id,{unitId:l.getUnitId(),payload:v,linkId:t.linkId,label:h,segmentId:t.segmentId})}n.hideEditPopup()};if(l)return u.jsxs("div",{className:C.clsx("univer-box-border univer-w-[328px] univer-rounded-xl univer-bg-white univer-px-6 univer-py-5 univer-shadow dark:!univer-bg-gray-900",C.borderClassName),children:[u.jsxs("div",{children:[t?u.jsx(C.FormLayout,{label:e.t("docLink.edit.label"),error:m&&!h?e.t("docLink.edit.labelError"):"",children:u.jsx(C.Input,{value:h,onChange:g,autoFocus:!0,onKeyDown:v=>{v.keyCode===p.KeyCode.ENTER&&k()}})}):null,u.jsx(C.FormLayout,{label:e.t("docLink.edit.address"),error:m&&!f?e.t("docLink.edit.addressError"):"",children:u.jsx(C.Input,{value:c,onChange:d,autoFocus:!0,onKeyDown:v=>{v.keyCode===p.KeyCode.ENTER&&k()}})})]}),u.jsxs("div",{className:"univer-flex univer-justify-end univer-gap-3",children:[u.jsx(C.Button,{onClick:I,children:e.t("docLink.edit.cancel")}),u.jsx(C.Button,{variant:"primary",disabled:!c,onClick:k,children:e.t("docLink.edit.confirm")})]})]})};b.componentKey="docs-hyper-link-edit";function U({ref:n,...e}){const{icon:t,id:i,className:r,extend:s,...c}=e,d=`univerjs-icon univerjs-icon-${i} ${r||""}`.trim(),h=y.useRef(`_${De()}`);return X(t,`${i}`,{defIds:t.defIds,idSuffix:h.current},{ref:n,className:d,...c},s)}function X(n,e,t,i,r){return y.createElement(n.tag,{key:e,...ke(n,t,r),...i},(Le(n,t).children||[]).map((s,c)=>X(s,`${e}-${n.tag}-${c}`,t,void 0,r)))}function ke(n,e,t){const i={...n.attrs};t!=null&&t.colorChannel1&&i.fill==="colorChannel1"&&(i.fill=t.colorChannel1),n.tag==="mask"&&i.id&&(i.id=i.id+e.idSuffix),Object.entries(i).forEach(([s,c])=>{s==="mask"&&typeof c=="string"&&(i[s]=c.replace(/url\(#(.*)\)/,`url(#$1${e.idSuffix})`))});const{defIds:r}=e;return!r||r.length===0||(n.tag==="use"&&i["xlink:href"]&&(i["xlink:href"]=i["xlink:href"]+e.idSuffix),Object.entries(i).forEach(([s,c])=>{typeof c=="string"&&(i[s]=c.replace(/url\(#(.*)\)/,`url(#$1${e.idSuffix})`))})),i}function Le(n,e){var i;const{defIds:t}=e;return!t||t.length===0?n:n.tag==="defs"&&((i=n.children)!=null&&i.length)?{...n,children:n.children.map(r=>typeof r.attrs.id=="string"&&t&&t.includes(r.attrs.id)?{...r,attrs:{...r.attrs,id:r.attrs.id+e.idSuffix}}:r)}:n}function De(){return Math.random().toString(36).substring(2,8)}U.displayName="UniverIcon";const we={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ee=y.forwardRef(function(e,t){return y.createElement(U,Object.assign({},e,{id:"copy-icon",ref:t,icon:we}))});ee.displayName="CopyIcon";const Oe={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z"}}]},A=y.forwardRef(function(e,t){return y.createElement(U,Object.assign({},e,{id:"link-icon",ref:t,icon:Oe}))});A.displayName="LinkIcon";const Pe={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157C6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449C14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797C11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395C4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092C3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721C8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332C2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302C13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332Z"}}]},ne=y.forwardRef(function(e,t){return y.createElement(U,Object.assign({},e,{id:"unlink-icon",ref:t,icon:Pe}))});ne.displayName="UnlinkIcon";const Ue={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z"}}]},te=y.forwardRef(function(e,t){return y.createElement(U,Object.assign({},e,{id:"write-icon",ref:t,icon:Ue}))});te.displayName="WriteIcon";const ie={type:o.CommandType.COMMAND,id:"docs.command.delete-hyper-link",async handler(n,e){if(!e)return!1;const{unitId:t,linkId:i,segmentId:r}=e,s=n.get(o.ICommandService),c=S.deleteCustomRangeFactory(n,{unitId:t,rangeId:i,segmentId:r});return c?await s.syncExecuteCommand(c.id,c.params):!1}},re=n=>{const e=n.get(S.DocSelectionManagerService),t=n.get(o.IUniverInstanceService),i=e.getTextRanges();if(!(i!=null&&i.length))return!0;const r=i[0];return!!(!t.getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC)||!r||r.collapsed)},P={type:o.CommandType.OPERATION,id:"doc.operation.show-hyper-link-edit-popup",handler(n,e){var c;const t=e==null?void 0:e.link,i=n.get(o.IUniverInstanceService);if(re(n)&&!t)return!1;const r=n.get(x),s=(t==null?void 0:t.unitId)||((c=i.getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC))==null?void 0:c.getUnitId());return s?(r.showEditPopup(s,t),!0):!1}},B={type:o.CommandType.OPERATION,id:"doc.operation.toggle-hyper-link-info-popup",handler(n,e){const t=n.get(x);return e?(t.showInfoPopup(e),!0):(t.hideInfoPopup(),!0)}},oe={type:o.CommandType.OPERATION,id:"doc.operation.click-hyper-link",handler(n,e){var g,m,_;if(!e)return!1;const{unitId:t,linkId:i,segmentId:r}=e,c=n.get(o.IUniverInstanceService).getUnit(t,o.UniverInstanceType.UNIVER_DOC),d=c==null?void 0:c.getSelfOrHeaderFooterModel(r).getBody(),h=(_=(m=(g=d==null?void 0:d.customRanges)==null?void 0:g.find(f=>f.rangeId===i&&f.rangeType===o.CustomRangeType.HYPERLINK))==null?void 0:m.properties)==null?void 0:_.url;return h&&window.open(h,"_blank","noopener noreferrer"),!0}},T=()=>{var k,v;const n=p.useDependency(x),e=p.useDependency(o.ICommandService),t=p.useDependency(p.IMessageService),i=p.useDependency(o.LocaleService),r=p.useObservable(n.showingLink$),s=p.useDependency(o.IUniverInstanceService);if(!r)return null;const{unitId:c,linkId:d,segmentId:h,startIndex:g,endIndex:m}=r,_=s.getUnit(c,o.UniverInstanceType.UNIVER_DOC),f=_==null?void 0:_.getSelfOrHeaderFooterModel(h).getBody(),l=(k=f==null?void 0:f.customRanges)==null?void 0:k.find(L=>L.rangeId===d&&L.rangeType===o.CustomRangeType.HYPERLINK&&L.startIndex===g&&L.endIndex===m);if(!l)return null;const I=(v=l.properties)==null?void 0:v.url;return u.jsxs("div",{className:C.clsx("univer-box-border univer-flex univer-max-w-80 univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow dark:!univer-bg-gray-900",C.borderClassName),onClick:()=>{n.hideInfoPopup()},children:[u.jsxs("div",{className:"univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-500",onClick:()=>window.open(I,void 0,"noopener noreferrer"),children:[u.jsx("div",{className:"univer-mr-2 univer-flex univer-size-5 univer-flex-[0_0_auto] univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white",children:u.jsx(A,{})}),u.jsx(C.Tooltip,{showIfEllipsis:!0,title:I,children:u.jsx("span",{className:"univer-flex-1 univer-truncate",children:I})})]}),u.jsxs("div",{className:"univer-flex univer-h-6 univer-flex-[0_0_auto] univer-items-center univer-justify-center",children:[u.jsx("div",{className:"univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base",onClick:()=>{navigator.clipboard.writeText(I),t.show({content:i.t("docLink.info.coped"),type:C.MessageType.Info})},children:u.jsx(C.Tooltip,{placement:"bottom",title:i.t("docLink.info.copy"),children:u.jsx(ee,{})})}),u.jsx("div",{className:"univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base",onClick:()=>{e.executeCommand(P.id,{link:r})},children:u.jsx(C.Tooltip,{placement:"bottom",title:i.t("docLink.info.edit"),children:u.jsx(te,{})})}),u.jsx("div",{className:"univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base",onClick:()=>{e.executeCommand(ie.id,{unitId:c,linkId:l.rangeId,segmentId:h})},children:u.jsx(C.Tooltip,{placement:"bottom",title:i.t("docLink.info.cancel"),children:u.jsx(ne,{})})})]})]})};T.componentKey="univer.doc.link-info-popup";var Me=Object.getOwnPropertyDescriptor,Ee=(n,e,t,i)=>{for(var r=i>1?void 0:i?Me(e,t):e,s=n.length-1,c;s>=0;s--)(c=n[s])&&(r=c(r)||r);return r},F=(n,e)=>(t,i)=>e(t,i,n);let x=class extends o.Disposable{constructor(e,t,i){super();D(this,"_editingLink$",new O.BehaviorSubject(null));D(this,"_showingLink$",new O.BehaviorSubject(null));D(this,"editingLink$",this._editingLink$.asObservable());D(this,"showingLink$",this._showingLink$.asObservable());D(this,"_editPopup",null);D(this,"_infoPopup",null);this._docCanvasPopupManagerService=e,this._textSelectionManagerService=t,this._univerInstanceService=i,this.disposeWithMe(()=>{this._editingLink$.complete(),this._showingLink$.complete()})}get editing(){return this._editingLink$.value}get showing(){return this._showingLink$.value}showEditPopup(e,t){this._editPopup&&this._editPopup.dispose(),this._editingLink$.next(t);const i=this._textSelectionManagerService.getTextRanges({unitId:e,subUnitId:e});let r=i==null?void 0:i[i.length-1];if(t){const{segmentId:s,segmentPage:c,startIndex:d,endIndex:h}=t;r={collapsed:!1,startOffset:d,endOffset:h+1,segmentId:s,segmentPage:c},this._textSelectionManagerService.replaceDocRanges([{startOffset:d,endOffset:h+1}])}return r?(this._editPopup=this._docCanvasPopupManagerService.attachPopupToRange(r,{componentKey:b.componentKey,direction:"bottom"},e),this._editPopup):null}hideEditPopup(){var e;this._editingLink$.next(null),(e=this._editPopup)==null||e.dispose()}showInfoPopup(e){var g,m,_,f,l,I;const{linkId:t,unitId:i,segmentId:r,segmentPage:s,startIndex:c,endIndex:d}=e;if(!(((g=this.showing)==null?void 0:g.linkId)===t&&((m=this.showing)==null?void 0:m.unitId)===i&&((_=this.showing)==null?void 0:_.segmentId)===r&&((f=this.showing)==null?void 0:f.segmentPage)===s&&((l=this.showing)==null?void 0:l.startIndex)===c&&((I=this.showing)==null?void 0:I.endIndex)===d||(this._infoPopup&&this._infoPopup.dispose(),!this._univerInstanceService.getUnit(i,o.UniverInstanceType.UNIVER_DOC))))return this._showingLink$.next({unitId:i,linkId:t,segmentId:r,segmentPage:s,startIndex:c,endIndex:d}),this._infoPopup=this._docCanvasPopupManagerService.attachPopupToRange({collapsed:!1,startOffset:c,endOffset:d+1,segmentId:r,segmentPage:s},{componentKey:T.componentKey,direction:"top-center",multipleDirection:"top",onClickOutside:()=>{this.hideInfoPopup()}},i),this._infoPopup}hideInfoPopup(){var e;this._showingLink$.next(null),(e=this._infoPopup)==null||e.dispose()}};x=Ee([F(0,o.Inject(E.DocCanvasPopManagerService)),F(1,o.Inject(S.DocSelectionManagerService)),F(2,o.IUniverInstanceService)],x);var be=Object.getOwnPropertyDescriptor,Te=(n,e,t,i)=>{for(var r=i>1?void 0:i?be(e,t):e,s=n.length-1,c;s>=0;s--)(c=n[s])&&(r=c(r)||r);return r},V=(n,e)=>(t,i)=>e(t,i,n);let R=class extends o.Disposable{constructor(n,e,t){super(),this._commandService=n,this._univerInstanceService=e,this._docHyperLinkService=t,this._initSelectionChange()}_initSelectionChange(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{var e,t,i;if(n.id===S.SetTextSelectionsOperation.id){const r=n.params,{unitId:s,ranges:c,segmentId:d}=r,h=this._univerInstanceService.getUnit(s,o.UniverInstanceType.UNIVER_DOC),g=c[0];if(g&&h){const{startOffset:m,endOffset:_,collapsed:f,segmentPage:l}=g,I=(t=(e=h.getSelfOrHeaderFooterModel(d))==null?void 0:e.getBody())==null?void 0:t.customRanges;if(f){const k=(i=I==null?void 0:I.findIndex(v=>v.startIndex<m&&v.endIndex>_-1))!=null?i:-1;if(k>-1){const v=I[k];this._docHyperLinkService.showInfoPopup({unitId:s,linkId:v.rangeId,segmentId:d,segmentPage:l,startIndex:v.startIndex,endIndex:v.endIndex});return}}else if(I==null?void 0:I.find(v=>v.startIndex<=m&&v.endIndex>=_-1))return}this._docHyperLinkService.hideInfoPopup(),this._docHyperLinkService.hideEditPopup()}}))}};R=Te([V(0,o.ICommandService),V(1,o.IUniverInstanceService),V(2,o.Inject(x))],R);var Re=Object.getOwnPropertyDescriptor,Ne=(n,e,t,i)=>{for(var r=i>1?void 0:i?Re(e,t):e,s=n.length-1,c;s>=0;s--)(c=n[s])&&(r=c(r)||r);return r},M=(n,e)=>(t,i)=>e(t,i,n);let Z=class extends o.Disposable{constructor(n,e,t,i,r,s){super(),this._context=n,this._docEventManagerService=e,this._commandService=t,this._hyperLinkPopupService=i,this._docSkeletonManagerService=r,this._docSelectionManagerService=s,!(this._context.unitId===o.DOCS_ZEN_EDITOR_UNIT_ID_KEY||this._context.unitId===o.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)&&(this._initHover(),this._initClick())}get _skeleton(){return this._docSkeletonManagerService.getSkeleton()}_hideInfoPopup(){this._hyperLinkPopupService.showing&&this._commandService.executeCommand(B.id)}_initHover(){this.disposeWithMe(this._docEventManagerService.hoverCustomRanges$.subscribe(n=>{var r;const e=n.find(s=>s.range.rangeType===o.CustomRangeType.HYPERLINK),t=this._docSelectionManagerService.getTextRanges(),i=t==null?void 0:t[0].segmentId;if(((r=e==null?void 0:e.segmentId)!=null?r:"")!==i){this._hideInfoPopup();return}e?this._commandService.executeCommand(B.id,{unitId:this._context.unitId,linkId:e.range.rangeId,segmentId:e.segmentId,segmentPage:e.segmentPageIndex,rangeId:e.range.rangeId,startIndex:e.range.startIndex,endIndex:e.range.endIndex}):this._hideInfoPopup()}))}_initClick(){this.disposeWithMe(this._docEventManagerService.clickCustomRanges$.subscribe(n=>{const e=n.range;e&&this._commandService.executeCommand(oe.id,{unitId:this._context.unitId,linkId:e.rangeId,segmentId:n.segmentId})}))}};Z=Ne([M(1,o.Inject(E.DocEventManagerService)),M(2,o.ICommandService),M(3,o.Inject(x)),M(4,o.Inject(S.DocSkeletonManagerService)),M(5,o.Inject(S.DocSelectionManagerService))],Z);var $e=Object.getOwnPropertyDescriptor,je=(n,e,t,i)=>{for(var r=i>1?void 0:i?$e(e,t):e,s=n.length-1,c;s>=0;s--)(c=n[s])&&(r=c(r)||r);return r},Y=(n,e)=>(t,i)=>e(t,i,n);let q=class extends o.Disposable{constructor(n,e,t,i){super(),this._context=n,this._docInterceptorService=e,this._hyperLinkService=t,this._docRenderController=i,this._init(),this._initReRender()}_init(){this._docInterceptorService.intercept(S.DOC_INTERCEPTOR_POINT.CUSTOM_RANGE,{handler:(n,e,t)=>{if(!n)return t(n);const{unitId:i,index:r}=e,s=this._hyperLinkService.showing;if(!s)return t({...n,active:!1});const{linkId:c,unitId:d,startIndex:h,endIndex:g}=s,m=d===i&&n.rangeId===c&&r>=h&&r<=g;return t({...n,active:m})}})}_initReRender(){this.disposeWithMe(this._hyperLinkService.showingLink$.pipe(O.distinctUntilChanged((n,e)=>(n==null?void 0:n.linkId)===(e==null?void 0:e.linkId)&&(n==null?void 0:n.unitId)===(e==null?void 0:e.unitId)&&(n==null?void 0:n.startIndex)===(e==null?void 0:e.startIndex)),O.pairwise()).subscribe(([n,e])=>{e?e.unitId===this._context.unitId&&this._docRenderController.reRender(e.unitId):n&&n.unitId===this._context.unitId&&this._docRenderController.reRender(n.unitId)}))}};q=je([Y(1,o.Inject(S.DocInterceptorService)),Y(2,o.Inject(x)),Y(3,o.Inject(E.DocRenderController))],q);const se="doc-hyper-link-icon";function ce(n){return{id:P.id,type:p.MenuItemType.BUTTON,icon:se,title:"docLink.menu.tooltip",tooltip:"docLink.menu.tooltip",hidden$:p.getMenuHiddenObservable(n,o.UniverInstanceType.UNIVER_DOC),disabled$:new O.Observable(function(e){const i=n.get(S.DocSelectionManagerService).textSelection$.pipe(O.debounceTime(16)).subscribe(()=>{e.next(re(n))});return()=>{i.unsubscribe()}})}}const He={id:P.id,binding:p.MetaKeys.CTRL_COMMAND|p.KeyCode.K,description:"docLink.menu.tooltip",preconditions:E.whenDocAndEditorFocused},Ke={[p.RibbonInsertGroup.MEDIA]:{[P.id]:{order:1,menuItemFactory:ce}},[p.ContextMenuPosition.MAIN_AREA]:{[p.ContextMenuGroup.DATA]:{[P.id]:{order:0,menuItemFactory:ce}}}};var Ae=Object.getOwnPropertyDescriptor,Be=(n,e,t,i)=>{for(var r=i>1?void 0:i?Ae(e,t):e,s=n.length-1,c;s>=0;s--)(c=n[s])&&(r=c(r)||r);return r},N=(n,e)=>(t,i)=>e(t,i,n);let $=class extends o.Disposable{constructor(n,e,t,i){super(),this._componentManager=n,this._commandService=e,this._menuManagerService=t,this._shortcutService=i,this._initComponents(),this._initCommands(),this._initMenus(),this._initShortcut()}_initComponents(){[[b.componentKey,b],[T.componentKey,T],[se,A]].forEach(([n,e])=>{this.disposeWithMe(this._componentManager.register(n,e))})}_initCommands(){[J,Q,ie,P,B,oe].forEach(n=>{this._commandService.registerCommand(n)})}_initShortcut(){[He].forEach(n=>{this._shortcutService.registerShortcut(n)})}_initMenus(){this._menuManagerService.mergeMenu(Ke)}};$=Be([N(0,o.Inject(p.ComponentManager)),N(1,o.ICommandService),N(2,p.IMenuManagerService),N(3,p.IShortcutService)],$);const Fe="DOC_HYPER_LINK_UI_PLUGIN";var Ve=Object.defineProperty,Ze=Object.getOwnPropertyDescriptor,Ye=(n,e,t)=>e in n?Ve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,qe=(n,e,t,i)=>{for(var r=i>1?void 0:i?Ze(e,t):e,s=n.length-1,c;s>=0;s--)(c=n[s])&&(r=c(r)||r);return r},W=(n,e)=>(t,i)=>e(t,i,n),de=(n,e,t)=>Ye(n,typeof e!="symbol"?e+"":e,t);a.UniverDocsHyperLinkUIPlugin=class extends o.Plugin{constructor(e=z,t,i,r){super(),this._config=e,this._injector=t,this._renderManagerSrv=i,this._configService=r;const{menu:s,...c}=o.merge({},z,this._config);s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(_e,c)}onStarting(){[[x],[$],[R]].forEach(t=>{this._injector.add(t)}),this._injector.get($)}onReady(){this._injector.get(R)}onRendered(){this._initRenderModule()}_initRenderModule(){[[q],[Z]].forEach(e=>{this._renderManagerSrv.registerRenderModule(o.UniverInstanceType.UNIVER_DOC,e)})}},de(a.UniverDocsHyperLinkUIPlugin,"pluginName",Fe),de(a.UniverDocsHyperLinkUIPlugin,"type",o.UniverInstanceType.UNIVER_DOC),a.UniverDocsHyperLinkUIPlugin=qe([o.DependentOn(w.UniverDocsHyperLinkPlugin),W(1,o.Inject(o.Injector)),W(2,Ce.IRenderManagerService),W(3,o.IConfigService)],a.UniverDocsHyperLinkUIPlugin),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
7
-
5
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/docs-hyper-link`),require(`@univerjs/engine-render`),require(`@univerjs/docs`),require(`@univerjs/docs-ui`),require(`rxjs`),require(`@univerjs/design`),require(`@univerjs/ui`),require(`react`),require(`react/jsx-runtime`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/docs-hyper-link`,`@univerjs/engine-render`,`@univerjs/docs`,`@univerjs/docs-ui`,`rxjs`,`@univerjs/design`,`@univerjs/ui`,`react`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverDocsHyperLinkUi={},e.UniverCore,e.UniverDocsHyperLink,e.UniverEngineRender,e.UniverDocs,e.UniverDocsUi,e.rxjs,e.UniverDesign,e.UniverUi,e.React,e.React))})(this,function(e,t,n,r,i,a,o,s,c,l,u){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var d=`@univerjs/docs-hyper-link-ui`,f=`0.18.0`;let p=`docs-hyper-link-ui.config`;Symbol(p);let m={},h={type:t.CommandType.COMMAND,id:`docs.command.add-hyper-link`,async handler(e,n){if(!n)return!1;let{payload:r,unitId:a,selections:o}=n,s=e.get(t.ICommandService),c=(0,i.addCustomRangeBySelectionFactory)(e,{rangeId:(0,t.generateRandomId)(),rangeType:t.CustomRangeType.HYPERLINK,properties:{url:r},unitId:a,selections:o});return c?s.syncExecuteCommand(c.id,c.params):!1}},g={id:`docs.command.update-hyper-link`,type:t.CommandType.COMMAND,handler(e,n){var r;if(!n)return!1;let{unitId:a,payload:o,segmentId:s,linkId:c}=n,l=e.get(t.ICommandService),u=e.get(t.IUniverInstanceService),d=e.get(i.DocSelectionManagerService).getActiveTextRange(),f=u.getUnit(a,t.UniverInstanceType.UNIVER_DOC);if(!d||!f)return!1;let p=(r=(0,t.getBodySlice)(f.getSelfOrHeaderFooterModel(s).getBody(),d.startOffset,d.endOffset).textRuns)==null?void 0:r[0];p&&(p.ed=n.label.length+1);let m=(0,i.replaceSelectionFactory)(e,{unitId:a,body:{dataStream:`${n.label}`,customRanges:[{rangeId:c,rangeType:t.CustomRangeType.HYPERLINK,startIndex:0,endIndex:n.label.length+1,properties:{url:o}}],textRuns:p?[p]:void 0},selection:{startOffset:d.startOffset,endOffset:d.endOffset,collapsed:!1,segmentId:s}});return m?l.syncExecuteCommand(m.id,m.params):!1}};function _(e){return/^[a-zA-Z]+:\/\//.test(e)}function v(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function y(e){return _(e)?e:v(e)?`mailto://${e}`:`https://${e}`}let b=()=>{let e=(0,c.useDependency)(K),n=(0,c.useDependency)(t.LocaleService),r=(0,c.useObservable)(e.editingLink$),a=(0,c.useDependency)(t.ICommandService),o=(0,c.useDependency)(t.IUniverInstanceService),d=(0,c.useDependency)(i.DocSelectionManagerService),[f,p]=(0,l.useState)(``),[m,_]=(0,l.useState)(``),[v,b]=(0,l.useState)(!1),x=t.Tools.isLegalUrl(f),S=r?o.getUnit(r.unitId,t.UniverInstanceType.UNIVER_DOC):o.getCurrentUnitForType(t.UniverInstanceType.UNIVER_DOC);(0,l.useEffect)(()=>{var e,n,i;let a=d.getActiveTextRange();if(!a)return;if(r){var o,s;let e=S==null||(o=S.getSelfOrHeaderFooterModel(r.segmentId))==null?void 0:o.getBody(),n=e==null||(s=e.customRanges)==null?void 0:s.find(e=>(r==null?void 0:r.linkId)===e.rangeId&&e.startIndex===r.startIndex&&e.endIndex===r.endIndex);if(S&&n){var c,l;p((c=(l=n.properties)==null?void 0:l.url)==null?``:c),_(t.BuildTextUtils.transform.getPlainText((0,t.getBodySlice)(e,n.startIndex,n.endIndex+1).dataStream))}return}let u=S==null||(e=S.getSelfOrHeaderFooterModel(a.segmentId))==null?void 0:e.getBody(),f=u?a:null,m=f&&((n=t.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(f,(i=u==null?void 0:u.customRanges)==null?[]:i))==null?void 0:n[0]);if(S&&m){var h,g;p((h=m==null||(g=m.properties)==null?void 0:g.url)==null?``:h)}},[S,r,d,o]);let C=()=>{e.hideEditPopup()},w=()=>{if(b(!0),!x||!S)return;let t=y(f);if(!r)a.executeCommand(h.id,{unitId:S.getUnitId(),payload:t});else{if(!m)return;a.executeCommand(g.id,{unitId:S.getUnitId(),payload:t,linkId:r.linkId,label:m,segmentId:r.segmentId})}e.hideEditPopup()};if(S)return(0,u.jsxs)(`div`,{className:(0,s.clsx)(`
6
+ univer-box-border univer-w-[328px] univer-rounded-xl univer-bg-white univer-px-6 univer-py-5 univer-shadow
7
+ dark:!univer-bg-gray-900
8
+ `,s.borderClassName),children:[(0,u.jsxs)(`div`,{children:[r?(0,u.jsx)(s.FormLayout,{label:n.t(`docLink.edit.label`),error:v&&!m?n.t(`docLink.edit.labelError`):``,children:(0,u.jsx)(s.Input,{value:m,onChange:_,autoFocus:!0,onKeyDown:e=>{e.keyCode===c.KeyCode.ENTER&&w()}})}):null,(0,u.jsx)(s.FormLayout,{label:n.t(`docLink.edit.address`),error:v&&!x?n.t(`docLink.edit.addressError`):``,children:(0,u.jsx)(s.Input,{value:f,onChange:p,autoFocus:!0,onKeyDown:e=>{e.keyCode===c.KeyCode.ENTER&&w()}})})]}),(0,u.jsxs)(`div`,{className:`univer-flex univer-justify-end univer-gap-3`,children:[(0,u.jsx)(s.Button,{onClick:C,children:n.t(`docLink.edit.cancel`)}),(0,u.jsx)(s.Button,{variant:`primary`,disabled:!f,onClick:w,children:n.t(`docLink.edit.confirm`)})]})]})};b.componentKey=`docs-hyper-link-edit`;function x({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,s=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),c=(0,l.useRef)(`_${T()}`);return S(n,`${r}`,{defIds:n.defIds,idSuffix:c.current},{ref:e,className:s,...o},a)}function S(e,t,n,r,i){return(0,l.createElement)(e.tag,{key:t,...C(e,n,i),...r},(w(e,n).children||[]).map((r,a)=>S(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function C(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function w(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function T(){return Math.random().toString(36).substring(2,8)}x.displayName=`UniverIcon`;let E={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},D=(0,l.forwardRef)(function(e,t){return(0,l.createElement)(x,Object.assign({},e,{id:`copy-icon`,ref:t,icon:E}))});D.displayName=`CopyIcon`;let O={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z`}}]},k=(0,l.forwardRef)(function(e,t){return(0,l.createElement)(x,Object.assign({},e,{id:`link-icon`,ref:t,icon:O}))});k.displayName=`LinkIcon`;let A={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157C6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449C14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797C11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395C4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092C3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721C8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332C2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302C13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332Z`}}]},j=(0,l.forwardRef)(function(e,t){return(0,l.createElement)(x,Object.assign({},e,{id:`unlink-icon`,ref:t,icon:A}))});j.displayName=`UnlinkIcon`;let M={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z`}}]},N=(0,l.forwardRef)(function(e,t){return(0,l.createElement)(x,Object.assign({},e,{id:`write-icon`,ref:t,icon:M}))});N.displayName=`WriteIcon`;let P={type:t.CommandType.COMMAND,id:`docs.command.delete-hyper-link`,async handler(e,n){if(!n)return!1;let{unitId:r,linkId:a,segmentId:o}=n,s=e.get(t.ICommandService),c=(0,i.deleteCustomRangeFactory)(e,{unitId:r,rangeId:a,segmentId:o});return c?await s.syncExecuteCommand(c.id,c.params):!1}},F=e=>{let n=e.get(i.DocSelectionManagerService),r=e.get(t.IUniverInstanceService),a=n.getTextRanges();if(!(a!=null&&a.length))return!0;let o=a[0];return!!(!r.getCurrentUnitForType(t.UniverInstanceType.UNIVER_DOC)||!o||o.collapsed)},I={type:t.CommandType.OPERATION,id:`doc.operation.show-hyper-link-edit-popup`,handler(e,n){var r;let i=n==null?void 0:n.link,a=e.get(t.IUniverInstanceService);if(F(e)&&!i)return!1;let o=e.get(K),s=(i==null?void 0:i.unitId)||((r=a.getCurrentUnitForType(t.UniverInstanceType.UNIVER_DOC))==null?void 0:r.getUnitId());return s?(o.showEditPopup(s,i),!0):!1}},L={type:t.CommandType.OPERATION,id:`doc.operation.toggle-hyper-link-info-popup`,handler(e,t){let n=e.get(K);return t?(n.showInfoPopup(t),!0):(n.hideInfoPopup(),!0)}},R={type:t.CommandType.OPERATION,id:`doc.operation.click-hyper-link`,handler(e,n){var r;if(!n)return!1;let{unitId:i,linkId:a,segmentId:o}=n,s=e.get(t.IUniverInstanceService).getUnit(i,t.UniverInstanceType.UNIVER_DOC),c=s==null?void 0:s.getSelfOrHeaderFooterModel(o).getBody(),l=c==null||(r=c.customRanges)==null||(r=r.find(e=>e.rangeId===a&&e.rangeType===t.CustomRangeType.HYPERLINK))==null||(r=r.properties)==null?void 0:r.url;return l&&window.open(l,`_blank`,`noopener noreferrer`),!0}},z=()=>{var e,n;let r=(0,c.useDependency)(K),i=(0,c.useDependency)(t.ICommandService),a=(0,c.useDependency)(c.IMessageService),o=(0,c.useDependency)(t.LocaleService),l=(0,c.useObservable)(r.showingLink$),d=(0,c.useDependency)(t.IUniverInstanceService);if(!l)return null;let{unitId:f,linkId:p,segmentId:m,startIndex:h,endIndex:g}=l,_=d.getUnit(f,t.UniverInstanceType.UNIVER_DOC),v=_==null?void 0:_.getSelfOrHeaderFooterModel(m).getBody(),y=v==null||(e=v.customRanges)==null?void 0:e.find(e=>e.rangeId===p&&e.rangeType===t.CustomRangeType.HYPERLINK&&e.startIndex===h&&e.endIndex===g);if(!y)return null;let b=(n=y.properties)==null?void 0:n.url;return(0,u.jsxs)(`div`,{className:(0,s.clsx)(`
9
+ univer-box-border univer-flex univer-max-w-80 univer-items-center univer-justify-between
10
+ univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow
11
+ dark:!univer-bg-gray-900
12
+ `,s.borderClassName),onClick:()=>{r.hideInfoPopup()},children:[(0,u.jsxs)(`div`,{className:`
13
+ univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-items-center univer-truncate
14
+ univer-text-sm univer-leading-5 univer-text-primary-500
15
+ `,onClick:()=>window.open(b,void 0,`noopener noreferrer`),children:[(0,u.jsx)(`div`,{className:`
16
+ univer-mr-2 univer-flex univer-size-5 univer-flex-[0_0_auto] univer-items-center
17
+ univer-justify-center univer-text-base univer-text-gray-900
18
+ dark:!univer-text-white
19
+ `,children:(0,u.jsx)(k,{})}),(0,u.jsx)(s.Tooltip,{showIfEllipsis:!0,title:b,children:(0,u.jsx)(`span`,{className:`univer-flex-1 univer-truncate`,children:b})})]}),(0,u.jsxs)(`div`,{className:`univer-flex univer-h-6 univer-flex-[0_0_auto] univer-items-center univer-justify-center`,children:[(0,u.jsx)(`div`,{className:`
20
+ univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center
21
+ univer-justify-center univer-rounded univer-text-base
22
+ `,onClick:()=>{navigator.clipboard.writeText(b),a.show({content:o.t(`docLink.info.coped`),type:s.MessageType.Info})},children:(0,u.jsx)(s.Tooltip,{placement:`bottom`,title:o.t(`docLink.info.copy`),children:(0,u.jsx)(D,{})})}),(0,u.jsx)(`div`,{className:`
23
+ univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center
24
+ univer-justify-center univer-rounded univer-text-base
25
+ `,onClick:()=>{i.executeCommand(I.id,{link:l})},children:(0,u.jsx)(s.Tooltip,{placement:`bottom`,title:o.t(`docLink.info.edit`),children:(0,u.jsx)(N,{})})}),(0,u.jsx)(`div`,{className:`
26
+ univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center
27
+ univer-justify-center univer-rounded univer-text-base
28
+ `,onClick:()=>{i.executeCommand(P.id,{unitId:f,linkId:y.rangeId,segmentId:m})},children:(0,u.jsx)(s.Tooltip,{placement:`bottom`,title:o.t(`docLink.info.cancel`),children:(0,u.jsx)(j,{})})})]})]})};z.componentKey=`univer.doc.link-info-popup`;function B(e){"@babel/helpers - typeof";return B=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},B(e)}function V(e,t){if(B(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(B(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function H(e){var t=V(e,`string`);return B(t)==`symbol`?t:t+``}function U(e,t,n){return(t=H(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W(e,t){return function(n,r){t(n,r,e)}}function G(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let K=class extends t.Disposable{constructor(e,t,n){super(),this._docCanvasPopupManagerService=e,this._textSelectionManagerService=t,this._univerInstanceService=n,U(this,`_editingLink$`,new o.BehaviorSubject(null)),U(this,`_showingLink$`,new o.BehaviorSubject(null)),U(this,`editingLink$`,this._editingLink$.asObservable()),U(this,`showingLink$`,this._showingLink$.asObservable()),U(this,`_editPopup`,null),U(this,`_infoPopup`,null),this.disposeWithMe(()=>{this._editingLink$.complete(),this._showingLink$.complete()})}get editing(){return this._editingLink$.value}get showing(){return this._showingLink$.value}showEditPopup(e,t){this._editPopup&&this._editPopup.dispose(),this._editingLink$.next(t);let n=this._textSelectionManagerService.getTextRanges({unitId:e,subUnitId:e}),r=n==null?void 0:n[n.length-1];if(t){let{segmentId:e,segmentPage:n,startIndex:i,endIndex:a}=t;r={collapsed:!1,startOffset:i,endOffset:a+1,segmentId:e,segmentPage:n},this._textSelectionManagerService.replaceDocRanges([{startOffset:i,endOffset:a+1}])}return r?(this._editPopup=this._docCanvasPopupManagerService.attachPopupToRange(r,{componentKey:b.componentKey,direction:`bottom`},e),this._editPopup):null}hideEditPopup(){var e;this._editingLink$.next(null),(e=this._editPopup)==null||e.dispose()}showInfoPopup(e){var n,r,i,a,o,s;let{linkId:c,unitId:l,segmentId:u,segmentPage:d,startIndex:f,endIndex:p}=e;if(!(((n=this.showing)==null?void 0:n.linkId)===c&&((r=this.showing)==null?void 0:r.unitId)===l&&((i=this.showing)==null?void 0:i.segmentId)===u&&((a=this.showing)==null?void 0:a.segmentPage)===d&&((o=this.showing)==null?void 0:o.startIndex)===f&&((s=this.showing)==null?void 0:s.endIndex)===p)&&(this._infoPopup&&this._infoPopup.dispose(),this._univerInstanceService.getUnit(l,t.UniverInstanceType.UNIVER_DOC)))return this._showingLink$.next({unitId:l,linkId:c,segmentId:u,segmentPage:d,startIndex:f,endIndex:p}),this._infoPopup=this._docCanvasPopupManagerService.attachPopupToRange({collapsed:!1,startOffset:f,endOffset:p+1,segmentId:u,segmentPage:d},{componentKey:z.componentKey,direction:`top-center`,multipleDirection:`top`,onClickOutside:()=>{this.hideInfoPopup()}},l),this._infoPopup}hideInfoPopup(){var e;this._showingLink$.next(null),(e=this._infoPopup)==null||e.dispose()}};K=G([W(0,(0,t.Inject)(a.DocCanvasPopManagerService)),W(1,(0,t.Inject)(i.DocSelectionManagerService)),W(2,t.IUniverInstanceService)],K);let q=class extends t.Disposable{constructor(e,t,n){super(),this._commandService=e,this._univerInstanceService=t,this._docHyperLinkService=n,this._initSelectionChange()}_initSelectionChange(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===i.SetTextSelectionsOperation.id){let{unitId:i,ranges:a,segmentId:o}=e.params,s=this._univerInstanceService.getUnit(i,t.UniverInstanceType.UNIVER_DOC),c=a[0];if(c&&s){var n;let{startOffset:e,endOffset:t,collapsed:a,segmentPage:l}=c,u=(n=s.getSelfOrHeaderFooterModel(o))==null||(n=n.getBody())==null?void 0:n.customRanges;if(a){var r;let n=(r=u==null?void 0:u.findIndex(n=>n.startIndex<e&&n.endIndex>t-1))==null?-1:r;if(n>-1){let e=u[n];this._docHyperLinkService.showInfoPopup({unitId:i,linkId:e.rangeId,segmentId:o,segmentPage:l,startIndex:e.startIndex,endIndex:e.endIndex});return}}else if(u!=null&&u.find(n=>n.startIndex<=e&&n.endIndex>=t-1))return}this._docHyperLinkService.hideInfoPopup(),this._docHyperLinkService.hideEditPopup()}}))}};q=G([W(0,t.ICommandService),W(1,t.IUniverInstanceService),W(2,(0,t.Inject)(K))],q);let J=class extends t.Disposable{get _skeleton(){return this._docSkeletonManagerService.getSkeleton()}constructor(e,n,r,i,a,o){super(),this._context=e,this._docEventManagerService=n,this._commandService=r,this._hyperLinkPopupService=i,this._docSkeletonManagerService=a,this._docSelectionManagerService=o,!(this._context.unitId===t.DOCS_ZEN_EDITOR_UNIT_ID_KEY||this._context.unitId===t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)&&(this._initHover(),this._initClick())}_hideInfoPopup(){this._hyperLinkPopupService.showing&&this._commandService.executeCommand(L.id)}_initHover(){this.disposeWithMe(this._docEventManagerService.hoverCustomRanges$.subscribe(e=>{var n;let r=e.find(e=>e.range.rangeType===t.CustomRangeType.HYPERLINK),i=this._docSelectionManagerService.getTextRanges(),a=i==null?void 0:i[0].segmentId;if(((n=r==null?void 0:r.segmentId)==null?``:n)!==a){this._hideInfoPopup();return}r?this._commandService.executeCommand(L.id,{unitId:this._context.unitId,linkId:r.range.rangeId,segmentId:r.segmentId,segmentPage:r.segmentPageIndex,rangeId:r.range.rangeId,startIndex:r.range.startIndex,endIndex:r.range.endIndex}):this._hideInfoPopup()}))}_initClick(){this.disposeWithMe(this._docEventManagerService.clickCustomRanges$.subscribe(e=>{let t=e.range;t&&this._commandService.executeCommand(R.id,{unitId:this._context.unitId,linkId:t.rangeId,segmentId:e.segmentId})}))}};J=G([W(1,(0,t.Inject)(a.DocEventManagerService)),W(2,t.ICommandService),W(3,(0,t.Inject)(K)),W(4,(0,t.Inject)(i.DocSkeletonManagerService)),W(5,(0,t.Inject)(i.DocSelectionManagerService))],J);let Y=class extends t.Disposable{constructor(e,t,n,r){super(),this._context=e,this._docInterceptorService=t,this._hyperLinkService=n,this._docRenderController=r,this._init(),this._initReRender()}_init(){this._docInterceptorService.intercept(i.DOC_INTERCEPTOR_POINT.CUSTOM_RANGE,{handler:(e,t,n)=>{if(!e)return n(e);let{unitId:r,index:i}=t,a=this._hyperLinkService.showing;if(!a)return n({...e,active:!1});let{linkId:o,unitId:s,startIndex:c,endIndex:l}=a,u=s===r&&e.rangeId===o&&i>=c&&i<=l;return n({...e,active:u})}})}_initReRender(){this.disposeWithMe(this._hyperLinkService.showingLink$.pipe((0,o.distinctUntilChanged)((e,t)=>(e==null?void 0:e.linkId)===(t==null?void 0:t.linkId)&&(e==null?void 0:e.unitId)===(t==null?void 0:t.unitId)&&(e==null?void 0:e.startIndex)===(t==null?void 0:t.startIndex)),(0,o.pairwise)()).subscribe(([e,t])=>{t?t.unitId===this._context.unitId&&this._docRenderController.reRender(t.unitId):e&&e.unitId===this._context.unitId&&this._docRenderController.reRender(e.unitId)}))}};Y=G([W(1,(0,t.Inject)(i.DocInterceptorService)),W(2,(0,t.Inject)(K)),W(3,(0,t.Inject)(a.DocRenderController))],Y);let X=`doc-hyper-link-icon`;function Z(e){return{id:I.id,type:c.MenuItemType.BUTTON,icon:X,title:`docLink.menu.tooltip`,tooltip:`docLink.menu.tooltip`,hidden$:(0,c.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_DOC),disabled$:new o.Observable(function(t){let n=e.get(i.DocSelectionManagerService).textSelection$.pipe((0,o.debounceTime)(16)).subscribe(()=>{t.next(F(e))});return()=>{n.unsubscribe()}})}}let ee={id:I.id,binding:c.MetaKeys.CTRL_COMMAND|c.KeyCode.K,description:`docLink.menu.tooltip`,preconditions:a.whenDocAndEditorFocused},te={[c.RibbonInsertGroup.MEDIA]:{[I.id]:{order:1,menuItemFactory:Z}},[c.ContextMenuPosition.MAIN_AREA]:{[c.ContextMenuGroup.DATA]:{[I.id]:{order:0,menuItemFactory:Z}}}},Q=class extends t.Disposable{constructor(e,t,n,r){super(),this._componentManager=e,this._commandService=t,this._menuManagerService=n,this._shortcutService=r,this._initComponents(),this._initCommands(),this._initMenus(),this._initShortcut()}_initComponents(){[[b.componentKey,b],[z.componentKey,z],[X,k]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}_initCommands(){[h,g,P,I,L,R].forEach(e=>{this._commandService.registerCommand(e)})}_initShortcut(){[ee].forEach(e=>{this._shortcutService.registerShortcut(e)})}_initMenus(){this._menuManagerService.mergeMenu(te)}};Q=G([W(0,(0,t.Inject)(c.ComponentManager)),W(1,t.ICommandService),W(2,c.IMenuManagerService),W(3,c.IShortcutService)],Q);let $=class extends t.Plugin{constructor(e=m,n,r,i){super(),this._config=e,this._injector=n,this._renderManagerSrv=r,this._configService=i;let{menu:a,...o}=(0,t.merge)({},m,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(p,o)}onStarting(){[[K],[Q],[q]].forEach(e=>{this._injector.add(e)}),this._injector.get(Q)}onReady(){this._injector.get(q)}onRendered(){this._initRenderModule()}_initRenderModule(){[[Y],[J]].forEach(e=>{this._renderManagerSrv.registerRenderModule(t.UniverInstanceType.UNIVER_DOC,e)})}};U($,`pluginName`,`DOC_HYPER_LINK_UI_PLUGIN`),U($,`packageName`,d),U($,`version`,f),U($,`type`,t.UniverInstanceType.UNIVER_DOC),$=G([(0,t.DependentOn)(n.UniverDocsHyperLinkPlugin),W(1,(0,t.Inject)(t.Injector)),W(2,r.IRenderManagerService),W(3,t.IConfigService)],$),Object.defineProperty(e,`UniverDocsHyperLinkUIPlugin`,{enumerable:!0,get:function(){return $}})});
8
29
 
9
30
  // index
10
31
  (function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/docs-hyper-link"),require("@univerjs/docs-hyper-link-ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/docs-hyper-link","@univerjs/docs-hyper-link-ui"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e.UniverPresetDocsHyperLink={},e.UniverDocsHyperLink,e.UniverDocsHyperLinkUi))})(this,(function(e,i,n){"use strict";function r(){return{plugins:[i.UniverDocsHyperLinkPlugin,n.UniverDocsHyperLinkUIPlugin].filter(s=>!!s)}}e.UniverDocsHyperLinkPreset=r,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
@@ -1,6 +1,5 @@
1
1
  // @univerjs/docs-hyper-link-ui/locale/ca-ES
2
- (function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l():typeof define=="function"&&define.amd?define(l):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsHyperLinkUiCaES=l())})(this,(function(){"use strict";return{docLink:{edit:{confirm:"Confirma",cancel:"Cancel·la",title:"Enllaç",address:"Enllaç",placeholder:"Si us plau, introdueix una URL",addressError:"La URL no és vàlida!",label:"Etiqueta",labelError:"Si us plau, introdueix l'etiqueta de l'enllaç"},info:{copy:"Copia",edit:"Edita",cancel:"Elimina l'enllaç",coped:"Enllaç copiat al porta-retalls"},menu:{tooltip:"Afegeix enllaç"}}}}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiCaES=t())})(this,function(){return{docLink:{edit:{confirm:`Confirma`,cancel:`Cancel·la`,title:`Enllaç`,address:`Enllaç`,placeholder:`Si us plau, introdueix una URL`,addressError:`La URL no és vàlida!`,label:`Etiqueta`,labelError:`Si us plau, introdueix l'etiqueta de l'enllaç`},info:{copy:`Copia`,edit:`Edita`,cancel:`Elimina l'enllaç`,coped:`Enllaç copiat al porta-retalls`},menu:{tooltip:`Afegeix enllaç`}}}});
4
3
 
5
4
  // locale/ca-ES
6
5
  (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/docs-hyper-link-ui/locale/ca-ES")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/docs-hyper-link-ui/locale/ca-ES"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsHyperLinkCaES=i(e.UniverCore,e.UniverDocsHyperLinkUiCaES))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
@@ -1,6 +1,5 @@
1
1
  // @univerjs/docs-hyper-link-ui/locale/en-US
2
- (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsHyperLinkUiEnUS=i())})(this,(function(){"use strict";return{docLink:{edit:{confirm:"Confirm",cancel:"Cancel",title:"Link",address:"Link",placeholder:"Please input a link url",addressError:"Url is illegal!",label:"Label",labelError:"Please input label of link"},info:{copy:"Copy",edit:"Edit",cancel:"Cancel link",coped:"Link copied to clipboard"},menu:{tooltip:"Add link"}}}}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiEnUS=t())})(this,function(){return{docLink:{edit:{confirm:`Confirm`,cancel:`Cancel`,title:`Link`,address:`Link`,placeholder:`Please input a link url`,addressError:`Url is illegal!`,label:`Label`,labelError:`Please input label of link`},info:{copy:`Copy`,edit:`Edit`,cancel:`Cancel link`,coped:`Link copied to clipboard`},menu:{tooltip:`Add link`}}}});
4
3
 
5
4
  // locale/en-US
6
5
  (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@univerjs/core"),require("@univerjs/docs-hyper-link-ui/locale/en-US")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/docs-hyper-link-ui/locale/en-US"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsHyperLinkEnUS=n(e.UniverCore,e.UniverDocsHyperLinkUiEnUS))})(this,(function(e,n){"use strict";return e.mergeLocales(n)}));
@@ -1,6 +1,5 @@
1
1
  // @univerjs/docs-hyper-link-ui/locale/es-ES
2
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsHyperLinkUiEsES=n())})(this,(function(){"use strict";return{docLink:{edit:{confirm:"Confirmar",cancel:"Cancelar",title:"Enlace",address:"Enlace",placeholder:"Por favor, introduce una URL",addressError:"¡La URL no es válida!",label:"Etiqueta",labelError:"Por favor, introduce la etiqueta del enlace"},info:{copy:"Copiar",edit:"Editar",cancel:"Eliminar enlace",coped:"Enlace copiado al portapapeles"},menu:{tooltip:"Añadir enlace"}}}}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiEsES=t())})(this,function(){return{docLink:{edit:{confirm:`Confirmar`,cancel:`Cancelar`,title:`Enlace`,address:`Enlace`,placeholder:`Por favor, introduce una URL`,addressError:`¡La URL no es válida!`,label:`Etiqueta`,labelError:`Por favor, introduce la etiqueta del enlace`},info:{copy:`Copiar`,edit:`Editar`,cancel:`Eliminar enlace`,coped:`Enlace copiado al portapapeles`},menu:{tooltip:`Añadir enlace`}}}});
4
3
 
5
4
  // locale/es-ES
6
5
  (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/docs-hyper-link-ui/locale/es-ES")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/docs-hyper-link-ui/locale/es-ES"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsHyperLinkEsES=i(e.UniverCore,e.UniverDocsHyperLinkUiEsES))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
@@ -1,6 +1,5 @@
1
1
  // @univerjs/docs-hyper-link-ui/locale/fa-IR
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsHyperLinkUiFaIR=o())})(this,(function(){"use strict";return{docLink:{edit:{confirm:"تایید",cancel:"انصراف",title:"لینک",address:"لینک",placeholder:"لطفا یک آدرس لینک وارد کنید",addressError:"آدرس غیرمجاز است!",label:"برچسب",labelError:"لطفا برچسب لینک را وارد کنید"},info:{copy:"کپی",edit:"ویرایش",cancel:"لینک را لغو کنید",coped:"لینک به کلیپ بورد کپی شد"},menu:{tooltip:"افزودن لینک"}}}}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiFaIR=t())})(this,function(){return{docLink:{edit:{confirm:`تایید`,cancel:`انصراف`,title:`لینک`,address:`لینک`,placeholder:`لطفا یک آدرس لینک وارد کنید`,addressError:`آدرس غیرمجاز است!`,label:`برچسب`,labelError:`لطفا برچسب لینک را وارد کنید`},info:{copy:`کپی`,edit:`ویرایش`,cancel:`لینک را لغو کنید`,coped:`لینک به کلیپ بورد کپی شد`},menu:{tooltip:`افزودن لینک`}}}});
4
3
 
5
4
  // locale/fa-IR
6
5
  (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/docs-hyper-link-ui/locale/fa-IR")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/docs-hyper-link-ui/locale/fa-IR"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsHyperLinkFaIR=i(e.UniverCore,e.UniverDocsHyperLinkUiFaIR))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
@@ -1,6 +1,5 @@
1
1
  // @univerjs/docs-hyper-link-ui/locale/fr-FR
2
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsHyperLinkUiFrFR=n())})(this,(function(){"use strict";return{docLink:{edit:{confirm:"Confirmer",cancel:"Annuler",title:"Lien",address:"Link",placeholder:"Veuillez entrer un lien",addressError:"L'url est illégal!",label:"Label",labelError:"Veuillez entrer le label du lien"},info:{copy:"Copy",edit:"Edit",cancel:"Cancel link",coped:"Link copied to clipboard"},menu:{tooltip:"Add link"}}}}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiFrFR=t())})(this,function(){return{docLink:{edit:{confirm:`Confirmer`,cancel:`Annuler`,title:`Lien`,address:`Link`,placeholder:`Veuillez entrer un lien`,addressError:`L'url est illégal!`,label:`Label`,labelError:`Veuillez entrer le label du lien`},info:{copy:`Copy`,edit:`Edit`,cancel:`Cancel link`,coped:`Link copied to clipboard`},menu:{tooltip:`Add link`}}}});
4
3
 
5
4
  // locale/fr-FR
6
5
  (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("@univerjs/core"),require("@univerjs/docs-hyper-link-ui/locale/fr-FR")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/docs-hyper-link-ui/locale/fr-FR"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsHyperLinkFrFR=r(e.UniverCore,e.UniverDocsHyperLinkUiFrFR))})(this,(function(e,r){"use strict";return e.mergeLocales(r)}));
@@ -1,6 +1,5 @@
1
1
  // @univerjs/docs-hyper-link-ui/locale/ja-JP
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsHyperLinkUiJaJP=o())})(this,(function(){"use strict";return{docLink:{edit:{confirm:"OK",cancel:"キャンセル",title:"リンク",address:"アドレス",placeholder:"リンクのURLを入力してください",addressError:"URLが正しくありません!",label:"表示文字列",labelError:"リンクの表示文字列を入力してください"},info:{copy:"コピー",edit:"編集",cancel:"リンク解除",coped:"リンクがクリップボードにコピーされました"},menu:{tooltip:"ハイパーリンクの挿入"}}}}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiJaJP=t())})(this,function(){return{docLink:{edit:{confirm:`OK`,cancel:`キャンセル`,title:`リンク`,address:`アドレス`,placeholder:`リンクのURLを入力してください`,addressError:`URLが正しくありません!`,label:`表示文字列`,labelError:`リンクの表示文字列を入力してください`},info:{copy:`コピー`,edit:`編集`,cancel:`リンク解除`,coped:`リンクがクリップボードにコピーされました`},menu:{tooltip:`ハイパーリンクの挿入`}}}});
4
3
 
5
4
  // locale/ja-JP
6
5
  (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/docs-hyper-link-ui/locale/ja-JP")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/docs-hyper-link-ui/locale/ja-JP"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsHyperLinkJaJP=i(e.UniverCore,e.UniverDocsHyperLinkUiJaJP))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
@@ -1,6 +1,5 @@
1
1
  // @univerjs/docs-hyper-link-ui/locale/ko-KR
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsHyperLinkUiKoKR=o())})(this,(function(){"use strict";return{docLink:{edit:{confirm:"확인",cancel:"취소",title:"링크",address:"링크",placeholder:"링크 URL을 입력해주세요",addressError:"URL이 올바르지 않습니다!",label:"라벨",labelError:"링크 라벨을 입력해주세요"},info:{copy:"복사",edit:"편집",cancel:"링크 취소",coped:"링크가 클립보드에 복사되었습니다"},menu:{tooltip:"링크 추가"}}}}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiKoKR=t())})(this,function(){return{docLink:{edit:{confirm:`확인`,cancel:`취소`,title:`링크`,address:`링크`,placeholder:`링크 URL을 입력해주세요`,addressError:`URL이 올바르지 않습니다!`,label:`라벨`,labelError:`링크 라벨을 입력해주세요`},info:{copy:`복사`,edit:`편집`,cancel:`링크 취소`,coped:`링크가 클립보드에 복사되었습니다`},menu:{tooltip:`링크 추가`}}}});
4
3
 
5
4
  // locale/ko-KR
6
5
  (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/docs-hyper-link-ui/locale/ko-KR")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/docs-hyper-link-ui/locale/ko-KR"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsHyperLinkKoKR=i(e.UniverCore,e.UniverDocsHyperLinkUiKoKR))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
@@ -1,6 +1,5 @@
1
1
  // @univerjs/docs-hyper-link-ui/locale/ru-RU
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsHyperLinkUiRuRU=o())})(this,(function(){"use strict";return{docLink:{edit:{confirm:"Подтвердить",cancel:"Отменить",title:"Ссылка",address:"Ссылка",label:"Текст",labelError:"Введите текст ссылки",placeholder:"Пожалуйста, введите ссылку",addressError:"Пожалуйста, введите корректную ссылку"},info:{copy:"Копировать",edit:"Редактировать",cancel:"Отменить ссылку",coped:"Ссылка скопирована в буфер обмена"},menu:{tooltip:"Добавить ссылку"}}}}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiRuRU=t())})(this,function(){return{docLink:{edit:{confirm:`Подтвердить`,cancel:`Отменить`,title:`Ссылка`,address:`Ссылка`,label:`Текст`,labelError:`Введите текст ссылки`,placeholder:`Пожалуйста, введите ссылку`,addressError:`Пожалуйста, введите корректную ссылку`},info:{copy:`Копировать`,edit:`Редактировать`,cancel:`Отменить ссылку`,coped:`Ссылка скопирована в буфер обмена`},menu:{tooltip:`Добавить ссылку`}}}});
4
3
 
5
4
  // locale/ru-RU
6
5
  (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/docs-hyper-link-ui/locale/ru-RU")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/docs-hyper-link-ui/locale/ru-RU"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsHyperLinkRuRU=i(e.UniverCore,e.UniverDocsHyperLinkUiRuRU))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
@@ -1,6 +1,5 @@
1
1
  // @univerjs/docs-hyper-link-ui/locale/sk-SK
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsHyperLinkUiSkSK=o())})(this,(function(){"use strict";return{docLink:{edit:{confirm:"Potvrdiť",cancel:"Zrušiť",title:"Odkaz",address:"Odkaz",placeholder:"Zadajte URL odkazu",addressError:"URL je neplatná!",label:"Popisok",labelError:"Zadajte popis odkazu"},info:{copy:"Kopírovať",edit:"Upraviť",cancel:"Zrušiť odkaz",coped:"Odkaz skopírovaný do schránky"},menu:{tooltip:"Pridať odkaz"}}}}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiSkSK=t())})(this,function(){return{docLink:{edit:{confirm:`Potvrdiť`,cancel:`Zrušiť`,title:`Odkaz`,address:`Odkaz`,placeholder:`Zadajte URL odkazu`,addressError:`URL je neplatná!`,label:`Popisok`,labelError:`Zadajte popis odkazu`},info:{copy:`Kopírovať`,edit:`Upraviť`,cancel:`Zrušiť odkaz`,coped:`Odkaz skopírovaný do schránky`},menu:{tooltip:`Pridať odkaz`}}}});
4
3
 
5
4
  // locale/sk-SK
6
5
  (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/docs-hyper-link-ui/locale/sk-SK")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/docs-hyper-link-ui/locale/sk-SK"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsHyperLinkSkSK=i(e.UniverCore,e.UniverDocsHyperLinkUiSkSK))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
@@ -1,6 +1,5 @@
1
1
  // @univerjs/docs-hyper-link-ui/locale/vi-VN
2
- (function(n,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(n=typeof globalThis<"u"?globalThis:n||self,n.UniverDocsHyperLinkUiViVN=e())})(this,(function(){"use strict";return{docLink:{edit:{confirm:"Xác nhận",cancel:"Hủy",title:"Liên kết",address:"Liên kết",label:"Nhãn",labelError:"Vui lòng nhập nhãn liên kết",placeholder:"Vui lòng nhập liên kết hợp lệ",addressError:"Vui lòng nhập liên kết hợp lệ"},info:{copy:"Sao chép",edit:"Chỉnh sửa",cancel:"Hủy liên kết",coped:"Liên kết đã được sao chép vào clipboard"},menu:{tooltip:"Thêm liên kết"}}}}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiViVN=t())})(this,function(){return{docLink:{edit:{confirm:`Xác nhận`,cancel:`Hủy`,title:`Liên kết`,address:`Liên kết`,label:`Nhãn`,labelError:`Vui lòng nhập nhãn liên kết`,placeholder:`Vui lòng nhập liên kết hợp lệ`,addressError:`Vui lòng nhập liên kết hợp lệ`},info:{copy:`Sao chép`,edit:`Chỉnh sửa`,cancel:`Hủy liên kết`,coped:`Liên kết đã được sao chép vào clipboard`},menu:{tooltip:`Thêm liên kết`}}}});
4
3
 
5
4
  // locale/vi-VN
6
5
  (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/docs-hyper-link-ui/locale/vi-VN")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/docs-hyper-link-ui/locale/vi-VN"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsHyperLinkViVN=i(e.UniverCore,e.UniverDocsHyperLinkUiViVN))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
@@ -1,6 +1,5 @@
1
1
  // @univerjs/docs-hyper-link-ui/locale/zh-CN
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsHyperLinkUiZhCN=o())})(this,(function(){"use strict";return{docLink:{edit:{confirm:"确认",cancel:"取消",title:"链接",address:"链接",label:"文本",labelError:"请输入链接文本",placeholder:"请输入合法的链接",addressError:"请输入合法的链接"},info:{copy:"复制",edit:"编辑",cancel:"取消链接",coped:"链接已被复制到剪贴板"},menu:{tooltip:"添加链接"}}}}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiZhCN=t())})(this,function(){return{docLink:{edit:{confirm:`确认`,cancel:`取消`,title:`链接`,address:`链接`,label:`文本`,labelError:`请输入链接文本`,placeholder:`请输入合法的链接`,addressError:`请输入合法的链接`},info:{copy:`复制`,edit:`编辑`,cancel:`取消链接`,coped:`链接已被复制到剪贴板`},menu:{tooltip:`添加链接`}}}});
4
3
 
5
4
  // locale/zh-CN
6
5
  (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/docs-hyper-link-ui/locale/zh-CN")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/docs-hyper-link-ui/locale/zh-CN"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsHyperLinkZhCN=i(e.UniverCore,e.UniverDocsHyperLinkUiZhCN))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
@@ -1,6 +1,5 @@
1
1
  // @univerjs/docs-hyper-link-ui/locale/zh-TW
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverDocsHyperLinkUiZhTW=o())})(this,(function(){"use strict";return{docLink:{edit:{confirm:"確認",cancel:"取消",title:"連結",address:"連結",label:"文本",labelError:"请输入链接文本",placeholder:"請輸入合法的連結",addressError:"請輸入合法的連結"},info:{copy:"複製",edit:"編輯",cancel:"取消連結",coped:"連結已複製到剪貼板"},menu:{tooltip:"新增連結"}}}}));
3
-
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsHyperLinkUiZhTW=t())})(this,function(){return{docLink:{edit:{confirm:`確認`,cancel:`取消`,title:`連結`,address:`連結`,label:`文本`,labelError:`请输入链接文本`,placeholder:`請輸入合法的連結`,addressError:`請輸入合法的連結`},info:{copy:`複製`,edit:`編輯`,cancel:`取消連結`,coped:`連結已複製到剪貼板`},menu:{tooltip:`新增連結`}}}});
4
3
 
5
4
  // locale/zh-TW
6
5
  (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("@univerjs/core"),require("@univerjs/docs-hyper-link-ui/locale/zh-TW")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/docs-hyper-link-ui/locale/zh-TW"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetDocsHyperLinkZhTW=i(e.UniverCore,e.UniverDocsHyperLinkUiZhTW))})(this,(function(e,i){"use strict";return e.mergeLocales(i)}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/preset-docs-hyper-link",
3
- "version": "0.16.1",
3
+ "version": "0.18.0",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum Co., Ltd. <developer@univer.ai>",
@@ -58,16 +58,16 @@
58
58
  "rxjs": ">=7.0.0"
59
59
  },
60
60
  "dependencies": {
61
- "@univerjs/docs-hyper-link": "0.16.1",
62
- "@univerjs/docs-hyper-link-ui": "0.16.1"
61
+ "@univerjs/docs-hyper-link": "0.18.0",
62
+ "@univerjs/docs-hyper-link-ui": "0.18.0"
63
63
  },
64
64
  "devDependencies": {
65
- "@univerjs/core": "0.16.1",
65
+ "@univerjs/core": "0.18.0",
66
66
  "react": "18.3.1",
67
67
  "react-dom": "18.3.1",
68
68
  "rxjs": "7.8.2",
69
69
  "typescript": "^5.9.3",
70
- "@univerjs-infra/shared": "0.16.1"
70
+ "@univerjs-infra/shared": "0.18.0"
71
71
  },
72
72
  "scripts": {
73
73
  "prebuild:preset": "tsx prepare.ts",