@univerjs/docs-hyper-link 0.5.3 → 0.5.4
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/cjs/index.js +1 -1
- package/lib/es/index.js +7 -7
- package/lib/umd/index.js +1 -1
- package/package.json +4 -4
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var v=Object.defineProperty;var y=(t,e,r)=>e in t?v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var _=(t,e,r)=>y(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@univerjs/core"),I={id:"docs.mutation.add-hyper-link",type:s.CommandType.MUTATION,handler:()=>!0},P={id:"docs.mutation.update-hyper-link",type:s.CommandType.MUTATION,handler:()=>!0},m={id:"docs.mutation.delete-hyper-link",type:s.CommandType.MUTATION,handler:()=>!0},U="docs-hyper-link.config",h={};var O=Object.defineProperty,C=Object.getOwnPropertyDescriptor,D=(t,e,r,i)=>{for(var n=i>1?void 0:i?C(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&O(e,r,n),n},f=(t,e)=>(r,i)=>e(r,i,t);const g="DOC_HYPER_LINK_PLUGIN";let d=class extends s.Disposable{constructor(t,e){super(),this._resourceManagerService=t,this._univerInstanceService=e,this._init()}_init(){this._resourceManagerService.registerPluginResource({pluginName:g,businesses:[s.UniverInstanceType.UNIVER_DOC],onLoad:(t,e)=>{const r=this._univerInstanceService.getUnit(t,s.UniverInstanceType.UNIVER_DOC);if(!r)return;const i=new Map,n=o=>{var c,a;return(a=(c=o.getBody())==null?void 0:c.customRanges)==null||a.forEach(p=>{p.rangeType===s.CustomRangeType.HYPERLINK&&i.set(p.rangeId,p)}),i};r.headerModelMap.forEach(o=>{n(o)}),r.footerModelMap.forEach(o=>{n(o)}),n(r),e.links.forEach(o=>{const c=i.get(o.id);c&&(c.properties={...c.properties,url:o.payload})})},onUnLoad:t=>{},toJson:t=>{const e=this._univerInstanceService.getUnit(t,s.UniverInstanceType.UNIVER_DOC),r=[];if(e){const i=n=>{var o,c;(c=(o=n.getBody())==null?void 0:o.customRanges)==null||c.forEach(a=>{var p;a.rangeType===s.CustomRangeType.HYPERLINK&&r.push({id:a.rangeId,payload:((p=a.properties)==null?void 0:p.url)||""})})};e.headerModelMap.forEach(n=>{i(n)}),e.footerModelMap.forEach(n=>{i(n)}),i(e)}return JSON.stringify({links:r})},parseJson(t){return JSON.parse(t)}})}};d=D([f(0,s.Inject(s.IResourceManagerService)),f(1,s.IUniverInstanceService)],d);var M=Object.defineProperty,N=Object.getOwnPropertyDescriptor,E=(t,e,r,i)=>{for(var n=i>1?void 0:i?N(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&M(e,r,n),n},l=(t,e)=>(r,i)=>e(r,i,t),u;exports.UniverDocsHyperLinkPlugin=(u=class extends s.Plugin{constructor(e=h,r,i,n){super(),this._config=e,this._injector=r,this._configService=i,this._commandService=n;const{...o}=s.merge({},h,this._config);this._configService.setConfig(U,o)}onStarting(){[[d]].forEach(r=>this._injector.add(r)),[I,m,P].forEach(r=>{this.disposeWithMe(this._commandService.registerCommand(r))}),this._injector.get(d)}},_(u,"pluginName",g),_(u,"type",s.UniverInstanceType.UNIVER_DOC),u);exports.UniverDocsHyperLinkPlugin=E([l(1,s.Inject(s.Injector)),l(2,s.IConfigService),l(3,s.ICommandService)],exports.UniverDocsHyperLinkPlugin);
|
package/lib/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var m = Object.defineProperty;
|
|
2
2
|
var O = (r, e, n) => e in r ? m(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
|
|
3
|
-
var
|
|
3
|
+
var _ = (r, e, n) => O(r, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
import { CommandType as l, Inject as y, IResourceManagerService as M, Disposable as N, UniverInstanceType as d, IUniverInstanceService as E, CustomRangeType as f, Plugin as C, merge as D, Injector as S, IConfigService as U, ICommandService as L } from "@univerjs/core";
|
|
5
5
|
const R = {
|
|
6
6
|
id: "docs.mutation.add-hyper-link",
|
|
@@ -21,7 +21,7 @@ var b = Object.defineProperty, K = Object.getOwnPropertyDescriptor, Y = (r, e, n
|
|
|
21
21
|
return o && t && b(e, n, t), t;
|
|
22
22
|
}, v = (r, e) => (n, o) => e(n, o, r);
|
|
23
23
|
const P = "DOC_HYPER_LINK_PLUGIN";
|
|
24
|
-
let
|
|
24
|
+
let u = class extends N {
|
|
25
25
|
constructor(r, e) {
|
|
26
26
|
super(), this._resourceManagerService = r, this._univerInstanceService = e, this._init();
|
|
27
27
|
}
|
|
@@ -80,10 +80,10 @@ let _ = class extends N {
|
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
-
|
|
83
|
+
u = Y([
|
|
84
84
|
v(0, y(M)),
|
|
85
85
|
v(1, E)
|
|
86
|
-
],
|
|
86
|
+
], u);
|
|
87
87
|
var w = Object.defineProperty, A = Object.getOwnPropertyDescriptor, G = (r, e, n, o) => {
|
|
88
88
|
for (var t = o > 1 ? void 0 : o ? A(e, n) : e, i = r.length - 1, s; i >= 0; i--)
|
|
89
89
|
(s = r[i]) && (t = (o ? s(e, n, t) : s(t)) || t);
|
|
@@ -100,11 +100,11 @@ let I = (p = class extends C {
|
|
|
100
100
|
this._configService.setConfig(j, t);
|
|
101
101
|
}
|
|
102
102
|
onStarting() {
|
|
103
|
-
[[
|
|
103
|
+
[[u]].forEach((e) => this._injector.add(e)), [R, H, T].forEach((e) => {
|
|
104
104
|
this.disposeWithMe(this._commandService.registerCommand(e));
|
|
105
|
-
}), this._injector.get(
|
|
105
|
+
}), this._injector.get(u);
|
|
106
106
|
}
|
|
107
|
-
},
|
|
107
|
+
}, _(p, "pluginName", P), _(p, "type", d.UNIVER_DOC), p);
|
|
108
108
|
I = G([
|
|
109
109
|
h(1, y(S)),
|
|
110
110
|
h(2, U),
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("@univerjs/core")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.UniverDocsHyperLink={},c.UniverCore))})(this,function(c,e){"use strict";var T=Object.defineProperty;var E=(c,e,p)=>e in c?T(c,e,{enumerable:!0,configurable:!0,writable:!0,value:p}):c[e]=p;var
|
|
1
|
+
(function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("@univerjs/core")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.UniverDocsHyperLink={},c.UniverCore))})(this,function(c,e){"use strict";var T=Object.defineProperty;var E=(c,e,p)=>e in c?T(c,e,{enumerable:!0,configurable:!0,writable:!0,value:p}):c[e]=p;var h=(c,e,p)=>E(c,typeof e!="symbol"?e+"":e,p);var _;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},P="docs-hyper-link.config",v={};var U=Object.defineProperty,C=Object.getOwnPropertyDescriptor,D=(o,t,r,i)=>{for(var n=i>1?void 0:i?C(t,r):t,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(t,r,n):a(n))||n);return i&&n&&U(t,r,n),n},g=(o,t)=>(r,i)=>t(r,i,o);const y="DOC_HYPER_LINK_PLUGIN";let f=class extends e.Disposable{constructor(o,t){super(),this._resourceManagerService=o,this._univerInstanceService=t,this._init()}_init(){this._resourceManagerService.registerPluginResource({pluginName:y,businesses:[e.UniverInstanceType.UNIVER_DOC],onLoad:(o,t)=>{const r=this._univerInstanceService.getUnit(o,e.UniverInstanceType.UNIVER_DOC);if(!r)return;const i=new Map,n=s=>{var a,u;return(u=(a=s.getBody())==null?void 0:a.customRanges)==null||u.forEach(d=>{d.rangeType===e.CustomRangeType.HYPERLINK&&i.set(d.rangeId,d)}),i};r.headerModelMap.forEach(s=>{n(s)}),r.footerModelMap.forEach(s=>{n(s)}),n(r),t.links.forEach(s=>{const a=i.get(s.id);a&&(a.properties={...a.properties,url:s.payload})})},onUnLoad:o=>{},toJson:o=>{const t=this._univerInstanceService.getUnit(o,e.UniverInstanceType.UNIVER_DOC),r=[];if(t){const i=n=>{var s,a;(a=(s=n.getBody())==null?void 0:s.customRanges)==null||a.forEach(u=>{var d;u.rangeType===e.CustomRangeType.HYPERLINK&&r.push({id:u.rangeId,payload:((d=u.properties)==null?void 0:d.url)||""})})};t.headerModelMap.forEach(n=>{i(n)}),t.footerModelMap.forEach(n=>{i(n)}),i(t)}return JSON.stringify({links:r})},parseJson(o){return JSON.parse(o)}})}};f=D([g(0,e.Inject(e.IResourceManagerService)),g(1,e.IUniverInstanceService)],f);var O=Object.defineProperty,M=Object.getOwnPropertyDescriptor,N=(o,t,r,i)=>{for(var n=i>1?void 0:i?M(t,r):t,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(t,r,n):a(n))||n);return i&&n&&O(t,r,n),n},l=(o,t)=>(r,i)=>t(r,i,o);c.UniverDocsHyperLinkPlugin=(_=class extends e.Plugin{constructor(t=v,r,i,n){super(),this._config=t,this._injector=r,this._configService=i,this._commandService=n;const{...s}=e.merge({},v,this._config);this._configService.setConfig(P,s)}onStarting(){[[f]].forEach(r=>this._injector.add(r)),[p,m,I].forEach(r=>{this.disposeWithMe(this._commandService.registerCommand(r))}),this._injector.get(f)}},h(_,"pluginName",y),h(_,"type",e.UniverInstanceType.UNIVER_DOC),_),c.UniverDocsHyperLinkPlugin=N([l(1,e.Inject(e.Injector)),l(2,e.IConfigService),l(3,e.ICommandService)],c.UniverDocsHyperLinkPlugin),Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/docs-hyper-link",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Univer thread comment plugin",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"lib"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@univerjs/core": "0.5.
|
|
46
|
+
"@univerjs/core": "0.5.4"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"rxjs": "^7.8.1",
|
|
50
50
|
"typescript": "^5.7.2",
|
|
51
|
-
"vite": "^6.0.
|
|
51
|
+
"vite": "^6.0.7",
|
|
52
52
|
"vitest": "^2.1.8",
|
|
53
|
-
"@univerjs-infra/shared": "0.5.
|
|
53
|
+
"@univerjs-infra/shared": "0.5.4"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"test": "vitest run",
|