@univerjs/docs-hyper-link 0.10.4 → 0.10.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/lib/umd/index.js +1 -1
- package/package.json +5 -5
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(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"})});
|
|
1
|
+
(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"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/docs-hyper-link",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Univer thread comment plugin",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"lib"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@univerjs/core": "0.10.
|
|
46
|
+
"@univerjs/core": "0.10.5"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"typescript": "^5.
|
|
50
|
-
"vite": "^7.
|
|
49
|
+
"typescript": "^5.9.2",
|
|
50
|
+
"vite": "^7.1.3",
|
|
51
51
|
"vitest": "^3.2.4",
|
|
52
|
-
"@univerjs-infra/shared": "0.10.
|
|
52
|
+
"@univerjs-infra/shared": "0.10.5"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"test": "vitest run",
|