@univerjs/preset-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.
Files changed (2) hide show
  1. package/lib/umd/index.js +1 -1
  2. package/package.json +7 -6
package/lib/umd/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @univerjs/docs-hyper-link/index
2
- (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 v=(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",h={};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=h,r,i,n){super(),this._config=t,this._injector=r,this._configService=i,this._commandService=n;const{...s}=e.merge({},h,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)}},v(_,"pluginName",y),v(_,"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"})});
2
+ (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"})});
3
3
 
4
4
 
5
5
  // @univerjs/docs-hyper-link-ui/index
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/preset-docs-hyper-link",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -57,17 +57,18 @@
57
57
  "rxjs": ">=7.0.0"
58
58
  },
59
59
  "dependencies": {
60
- "@univerjs/docs-hyper-link": "0.5.3",
61
- "@univerjs/docs-hyper-link-ui": "0.5.3"
60
+ "@univerjs/docs-hyper-link": "0.5.4",
61
+ "@univerjs/docs-hyper-link-ui": "0.5.4"
62
62
  },
63
63
  "devDependencies": {
64
- "@univerjs/core": "0.5.3",
64
+ "@univerjs/core": "0.5.4",
65
65
  "typescript": "^5.7.2",
66
- "@univerjs-infra/shared": "0.5.3"
66
+ "@univerjs-infra/shared": "0.5.4"
67
67
  },
68
68
  "scripts": {
69
69
  "prebuild:preset": "tsx prepare.ts",
70
- "build:preset": "tsx build.ts"
70
+ "build:preset": "tsx build.ts",
71
+ "lint:types": "tsc --noEmit"
71
72
  },
72
73
  "module": "./lib/es/index.js"
73
74
  }