@univerjs-pro/docs-reference 1.0.0-rc.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/README.md +37 -0
- package/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/es/facade.js +1 -0
- package/lib/es/index.js +1 -0
- package/lib/facade.js +1 -0
- package/lib/index.js +1 -0
- package/lib/types/commands/commands/document-footnote.command.d.ts +37 -0
- package/lib/types/commands/commands/set-document-footnote-settings.command.d.ts +29 -0
- package/lib/types/config/config.d.ts +5 -0
- package/lib/types/facade/f-document.d.ts +137 -0
- package/lib/types/facade/index.d.ts +2 -0
- package/lib/types/index.d.ts +5 -0
- package/lib/types/plugin.d.ts +14 -0
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +1 -0
- package/package.json +83 -0
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @univerjs-pro/docs-reference
|
|
2
|
+
|
|
3
|
+
Document reference commands and Facade APIs for Univer Pro. Register this plugin for traditional-document footnote and endnote creation, deletion and settings. It has no browser UI and can be used with the Docs runtime on Node.js.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Keep all Univer packages on the same version and configure `UniverLicensePlugin` with your application license.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { UniverDocsReferencePlugin } from '@univerjs-pro/docs-reference';
|
|
11
|
+
import '@univerjs-pro/docs-reference/facade';
|
|
12
|
+
|
|
13
|
+
univer.registerPlugin(UniverDocsReferencePlugin);
|
|
14
|
+
|
|
15
|
+
const document = univerAPI.getActiveDocument();
|
|
16
|
+
const id = document?.insertFootnote(5, {
|
|
17
|
+
body: { dataStream: 'Source details\r\n', paragraphs: [{ startIndex: 14 }] },
|
|
18
|
+
});
|
|
19
|
+
if (id) {
|
|
20
|
+
document.getTextRange(0, 6, id).setText('Citation');
|
|
21
|
+
}
|
|
22
|
+
document?.setFootnoteSettings({ numberFormat: 'decimal', restart: 'eachSect' });
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`getFootnotes()` returns detached note data in reference order. `deleteFootnote(id)` removes both the reference and content. `getFootnoteSettings(sectionId?)` reads explicit settings; `setFootnoteSettings(settings, sectionId?)` replaces them, and `null` restores inheritance.
|
|
26
|
+
|
|
27
|
+
## Data and editing
|
|
28
|
+
|
|
29
|
+
References use stable IDs and the core document note segments. Commands use the existing rich-text editing mutation, permissions, undo/redo and collaboration channels. No additional collaboration mutation or resource is required. Text offsets are UTF-16 offsets in the document body, including structural tokens.
|
|
30
|
+
|
|
31
|
+
Footnotes and endnotes are available only in traditional documents. Modern-mode DOCX import removes references and note content before calculating text offsets. Note bodies support paragraphs, inline images and ordinary tables; document and section settings control numbering, placement and columns. Separator, continuation separator and continuation notice bodies belong to document settings.
|
|
32
|
+
|
|
33
|
+
Install `@univerjs-pro/docs-reference-ui` for the References ribbon, settings and navigation.
|
|
34
|
+
|
|
35
|
+
Endnotes use `insertEndnote(offset, content?)`, `getEndnotes()`, and `deleteEndnote(id)`. Their content is edited with the same segment text-range APIs as footnotes. `setEndnoteSettings({ position: 'docEnd', numberFormat: 'lowerRoman' })` configures document defaults; pass a section ID to configure `sectEnd` placement or numbering restart for that section. `getEndnoteSettings(sectionId?)` reads explicit settings and passing `null` to the setter restores inheritance. Footnotes and endnotes count independently.
|
|
36
|
+
|
|
37
|
+
Snapshots store both kinds in `notes: Record<string, IDocumentNote>`, identified by stable `noteId` and a `type` of `footnote` or `endnote`. Document defaults live in `noteSettings.footnote` and `noteSettings.endnote`; section overrides live in `sectionBreaks[].noteProperties`. References, content and settings use the existing rich-text mutation and undo/collaboration path. All collaborating clients must understand the new snapshot fields and `ENDNOTE` range type.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x1c3166=_0x263d;(function(_0x4a4c7c,_0x43326f){const _0x829170=_0x263d,_0x91e829=_0x4a4c7c();while(!![]){try{const _0x43150f=-parseInt(_0x829170(0x19e))/0x1+parseInt(_0x829170(0x16e))/0x2*(parseInt(_0x829170(0x193))/0x3)+parseInt(_0x829170(0x178))/0x4*(parseInt(_0x829170(0x19b))/0x5)+-parseInt(_0x829170(0x181))/0x6+parseInt(_0x829170(0x187))/0x7*(-parseInt(_0x829170(0x19c))/0x8)+-parseInt(_0x829170(0x176))/0x9+parseInt(_0x829170(0x19a))/0xa*(parseInt(_0x829170(0x18d))/0xb);if(_0x43150f===_0x43326f)break;else _0x91e829['push'](_0x91e829['shift']());}catch(_0x50f7bc){_0x91e829['push'](_0x91e829['shift']());}}}(_0x1196,0x5b284));function _0x263d(_0xc541d5,_0x46264b){_0xc541d5=_0xc541d5-0x16c;const _0x119621=_0x1196();let _0x263d04=_0x119621[_0xc541d5];return _0x263d04;}function _0x1196(){const _0x5b56a9=['FOOTNOTE','noteId','2649648yBlOtv','noteProperties','find','getFootnoteSettings','getDocumentDataModel','Tools','2612617YQWvVW','DeleteDocumentEndnoteCommand','syncExecuteCommand','sectionBreaks','getFootnotes','startIndex','14455837mjlsjB','CustomRangeType','endnote','notes','generateRandomId','setEndnoteSettings','2187FGnGuN','flatMap','deepClone','SetDocumentFootnoteSettingsCommand','setFootnoteSettings','insertFootnote','ICommandService','10JdUyul','5UJDrEA','8pIgomT','customRanges','94130dBPNRs','string','deleteFootnote','_injector','getSnapshot','properties','InsertDocumentEndnoteCommand','1244ljqWnU','extend','rangeType','filter','getEndnoteSettings','sort','FDocument','get','4786407fFyLsJ','noteSettings','186268PXNsmP','sectionId','insertEndnote','InsertDocumentFootnoteCommand','footnote','ENDNOTE','body'];_0x1196=function(){return _0x5b56a9;};return _0x1196();}let e=require('@univerjs-pro/docs-reference'),t=require('@univerjs/core'),n=require('@univerjs/docs/facade');var r=class extends n[_0x1c3166(0x174)]{[_0x1c3166(0x198)](_0x5c5d95,_0x22119b={}){const _0x2c1646=_0x1c3166;let _0x3df532=(0x0,t[_0x2c1646(0x191)])(0xc);return this[_0x2c1646(0x1a1)][_0x2c1646(0x175)](t[_0x2c1646(0x199)])[_0x2c1646(0x189)](e[_0x2c1646(0x17b)]['id'],{..._0x22119b,'unitId':this['id'],'offset':_0x5c5d95,'noteId':_0x3df532})?_0x3df532:null;}[_0x1c3166(0x18b)](){const _0x1f192d=_0x1c3166;var _0x14e926;let _0x6261ba=this[_0x1f192d(0x185)]()['getSnapshot']();return(((_0x14e926=_0x6261ba[_0x1f192d(0x17e)])==null?void 0x0:_0x14e926[_0x1f192d(0x19d)])??[])[_0x1f192d(0x171)](_0x36233a=>_0x36233a[_0x1f192d(0x170)]===t[_0x1f192d(0x18e)][_0x1f192d(0x17f)])[_0x1f192d(0x173)]((_0x43c734,_0x2ba59c)=>_0x43c734[_0x1f192d(0x18c)]-_0x2ba59c[_0x1f192d(0x18c)])[_0x1f192d(0x194)](_0x483581=>{const _0x2f4bdf=_0x1f192d;var _0x4d1310,_0x7b2b8f;let _0x5b6b5c=(_0x4d1310=_0x483581['properties'])==null?void 0x0:_0x4d1310[_0x2f4bdf(0x180)],_0x5ecd1f=typeof _0x5b6b5c==_0x2f4bdf(0x19f)?(_0x7b2b8f=_0x6261ba[_0x2f4bdf(0x190)])==null?void 0x0:_0x7b2b8f[_0x5b6b5c]:void 0x0;return _0x5ecd1f?[t[_0x2f4bdf(0x186)][_0x2f4bdf(0x195)](_0x5ecd1f)]:[];});}[_0x1c3166(0x1a0)](_0x17d42d){const _0x39d649=_0x1c3166;return this['_injector'][_0x39d649(0x175)](t['ICommandService'])[_0x39d649(0x189)](e['DeleteDocumentFootnoteCommand']['id'],{'unitId':this['id'],'noteId':_0x17d42d});}[_0x1c3166(0x184)](_0x41ac77){const _0x17cc06=_0x1c3166;var _0x31ccd5,_0x273451;let _0x1ccec4=this[_0x17cc06(0x185)]()[_0x17cc06(0x1a2)](),_0x383437=_0x41ac77==null?(_0x31ccd5=_0x1ccec4[_0x17cc06(0x177)])==null?void 0x0:_0x31ccd5[_0x17cc06(0x17c)]:(_0x273451=_0x1ccec4[_0x17cc06(0x17e)])==null||(_0x273451=_0x273451[_0x17cc06(0x18a)])==null||(_0x273451=_0x273451[_0x17cc06(0x183)](_0x1dfb6f=>_0x1dfb6f[_0x17cc06(0x179)]===_0x41ac77))==null||(_0x273451=_0x273451[_0x17cc06(0x182)])==null?void 0x0:_0x273451['footnote'];return _0x383437==null?void 0x0:t[_0x17cc06(0x186)][_0x17cc06(0x195)](_0x383437);}[_0x1c3166(0x197)](_0x2e7804,_0x2591f1){const _0x118d95=_0x1c3166;return this[_0x118d95(0x1a1)][_0x118d95(0x175)](t['ICommandService'])[_0x118d95(0x189)](e[_0x118d95(0x196)]['id'],{'unitId':this['id'],'settings':_0x2e7804,'sectionId':_0x2591f1});}[_0x1c3166(0x17a)](_0x4b9a87,_0x539da6={}){const _0x102a46=_0x1c3166;let _0x73ea0d=(0x0,t[_0x102a46(0x191)])(0xc);return this[_0x102a46(0x1a1)][_0x102a46(0x175)](t['ICommandService'])[_0x102a46(0x189)](e[_0x102a46(0x16d)]['id'],{..._0x539da6,'unitId':this['id'],'offset':_0x4b9a87,'noteId':_0x73ea0d})?_0x73ea0d:null;}['getEndnotes'](){const _0x376f16=_0x1c3166;var _0x500c85;let _0x443e55=this[_0x376f16(0x185)]()['getSnapshot']();return(((_0x500c85=_0x443e55[_0x376f16(0x17e)])==null?void 0x0:_0x500c85[_0x376f16(0x19d)])??[])[_0x376f16(0x171)](_0x3e15d6=>_0x3e15d6[_0x376f16(0x170)]===t['CustomRangeType'][_0x376f16(0x17d)])['sort']((_0x1fc41f,_0x4c23ca)=>_0x1fc41f[_0x376f16(0x18c)]-_0x4c23ca['startIndex'])['flatMap'](_0x528d77=>{const _0x55ad62=_0x376f16;var _0xd085db,_0x2c7cbb;let _0x5ae86c=(_0xd085db=_0x528d77[_0x55ad62(0x16c)])==null?void 0x0:_0xd085db[_0x55ad62(0x180)],_0x3efd0f=typeof _0x5ae86c=='string'?(_0x2c7cbb=_0x443e55['notes'])==null?void 0x0:_0x2c7cbb[_0x5ae86c]:void 0x0;return _0x3efd0f?[t['Tools'][_0x55ad62(0x195)](_0x3efd0f)]:[];});}['deleteEndnote'](_0x55914e){const _0x566658=_0x1c3166;return this[_0x566658(0x1a1)][_0x566658(0x175)](t['ICommandService'])[_0x566658(0x189)](e[_0x566658(0x188)]['id'],{'unitId':this['id'],'noteId':_0x55914e});}[_0x1c3166(0x172)](_0x1bed57){const _0x3e4c0a=_0x1c3166;var _0x43645b,_0x390d3f;let _0x21d22c=this['getDocumentDataModel']()['getSnapshot'](),_0x2b24d6=_0x1bed57==null?(_0x43645b=_0x21d22c['noteSettings'])==null?void 0x0:_0x43645b[_0x3e4c0a(0x18f)]:(_0x390d3f=_0x21d22c[_0x3e4c0a(0x17e)])==null||(_0x390d3f=_0x390d3f['sectionBreaks'])==null||(_0x390d3f=_0x390d3f[_0x3e4c0a(0x183)](_0x544be2=>_0x544be2[_0x3e4c0a(0x179)]===_0x1bed57))==null||(_0x390d3f=_0x390d3f[_0x3e4c0a(0x182)])==null?void 0x0:_0x390d3f[_0x3e4c0a(0x18f)];return _0x2b24d6==null?void 0x0:t[_0x3e4c0a(0x186)][_0x3e4c0a(0x195)](_0x2b24d6);}[_0x1c3166(0x192)](_0x205fdc,_0x26225a){const _0x575fcc=_0x1c3166;return this[_0x575fcc(0x1a1)][_0x575fcc(0x175)](t['ICommandService'])['syncExecuteCommand'](e['SetDocumentEndnoteSettingsCommand']['id'],{'unitId':this['id'],'settings':_0x205fdc,'sectionId':_0x26225a});}};n[_0x1c3166(0x174)][_0x1c3166(0x16f)](r);
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x54d71b=_0x48b2;(function(_0x585e98,_0x4687cf){const _0x5d8df5=_0x48b2,_0x4d67d3=_0x585e98();while(!![]){try{const _0x4fb926=-parseInt(_0x5d8df5(0x1f8))/0x1+-parseInt(_0x5d8df5(0x213))/0x2+parseInt(_0x5d8df5(0x219))/0x3*(-parseInt(_0x5d8df5(0x1f5))/0x4)+-parseInt(_0x5d8df5(0x25b))/0x5+-parseInt(_0x5d8df5(0x1dc))/0x6*(parseInt(_0x5d8df5(0x1d6))/0x7)+-parseInt(_0x5d8df5(0x1e5))/0x8+parseInt(_0x5d8df5(0x216))/0x9;if(_0x4fb926===_0x4687cf)break;else _0x4d67d3['push'](_0x4d67d3['shift']());}catch(_0x1c9cb8){_0x4d67d3['push'](_0x4d67d3['shift']());}}}(_0x1905,0xa64b2),Object[_0x54d71b(0x206)](exports,Symbol[_0x54d71b(0x259)],{'value':_0x54d71b(0x242)}));let e=require('@univerjs/core'),t=require('@univerjs/docs'),n=require('@univerjs-pro/license');function _0x1905(){const _0x313d58=['Tools','pageBottom','DocumentFlavor','set-','doc.command.delete-endnote','sectEnd','noteProperties','getInstance','symbol','unitId','_configService','continuationNotice','registerCommand','noteSettings','Plugin','footers','body','InsertDocumentEndnoteCommand','diffValue','drawingsOrder','continuationSeparator','_config','startNumber','version','validateDocumentStructure','length','Module','delete','lists','1.0.0-rc.0','documentFlavor','ICommandService','eachPage','iterator','UNIVER_DOC','_commandService','UniverInstanceType','UNIVER_DOCS_REFERENCE_PLUGIN','retain','segmentId','CustomRangeType','insertOp','ENDNOTE','InsertDocumentFootnoteCommand','UniverLicensePlugin','deepClone','onStarting','dataStream','includes','toStringTag','settings','5866820TZoJnN','syncExecuteCommand','customRanges','DeleteDocumentEndnoteCommand','doc.command.set-endnote-settings','startIndex','7emvWJS','beneathText','UniverDocsReferencePlugin','eachSect','get','FOOTNOTE','1322418QXxqOQ','DeleteDocumentFootnoteCommand','getUnit','getSnapshot','TextX','drawings','TRADITIONAL','noteId','customMark','3586344nLmOWJ','removeOp','JSONX','pluginName','doc.command.delete-footnote','documentStyle','function','insert-','doc.command.set-footnote-settings','isNoop','createSectionId','DependentOn','IUniverInstanceService','findIndex','insert','suppressEndnotes','12ogmeRy','generateRandomId','validateDocBodyStructure','1073678qZduXn','CommandType','string','editOp','sectionId','find','decorate','getOwnPropertyDescriptor','default','footnote','type','createParagraphId','COMMAND','object','defineProperty','packageName','endnote','compose','headers','Injector','keys','docEnd','call','disposeWithMe','delete-','serialize','@univerjs-pro/docs-reference','225476MzZJif','separator','restart','39793329DGDhVZ','merge','doc.command.insert-footnote','711867rKRQcj','RichTextEditingMutation','replaceOp','notes','sectionBreaks','UniverDocsPlugin','constructor','SetDocumentFootnoteSettingsCommand','continuous','boolean','numberFormat','position','columnCount','rangeType','referenceTextStyle'];_0x1905=function(){return _0x313d58;};return _0x1905();}function r(_0x4bd8b3,_0x4d55ee,_0x1beb67){const _0x511016=_0x54d71b;if(_0x4bd8b3['position']!=null&&!(_0x4d55ee===_0x511016(0x201)?[_0x511016(0x229),_0x511016(0x1d7)]:[_0x511016(0x20d),_0x511016(0x22d)])['includes'](_0x4bd8b3[_0x511016(0x224)])||_0x4bd8b3[_0x511016(0x215)]!=null&&!(_0x4d55ee===_0x511016(0x201)?[_0x511016(0x221),_0x511016(0x1d9),_0x511016(0x248)]:[_0x511016(0x221),_0x511016(0x1d9)])[_0x511016(0x258)](_0x4bd8b3['restart'])||_0x4bd8b3[_0x511016(0x23e)]!=null&&(!Number['isInteger'](_0x4bd8b3[_0x511016(0x23e)])||_0x4bd8b3['startNumber']<0x1)||_0x511016(0x225)in _0x4bd8b3&&_0x4bd8b3[_0x511016(0x225)]!=null&&(_0x4d55ee!==_0x511016(0x201)||!Number['isInteger'](_0x4bd8b3[_0x511016(0x225)])||_0x4bd8b3[_0x511016(0x225)]<0x0||_0x4bd8b3['columnCount']>0x4)||_0x4bd8b3[_0x511016(0x223)]!=null&&(typeof _0x4bd8b3['numberFormat']!=_0x511016(0x1fa)||_0x4bd8b3['numberFormat']['length']===0x0))return!0x1;for(let _0x5adb79 of[_0x4bd8b3[_0x511016(0x214)],_0x4bd8b3[_0x511016(0x23c)],_0x4bd8b3[_0x511016(0x233)]])if(_0x5adb79!=null&&(_0x1beb67!=null||(0x0,e[_0x511016(0x1f7)])(_0x5adb79)[_0x511016(0x241)]>0x0))return!0x1;return!0x0;}function i(_0xa159ef,_0x1b5c4e,_0x3e6293){const _0x5df9c0=_0x54d71b;var _0x53f394,_0x2072d9;if(_0x1b5c4e[_0x5df9c0(0x25a)]!=null&&!r(_0x1b5c4e[_0x5df9c0(0x25a)],_0x3e6293,_0x1b5c4e[_0x5df9c0(0x1fc)]))return!0x1;let _0xc94924=((_0x53f394=_0xa159ef[_0x5df9c0(0x238)])==null||(_0x53f394=_0x53f394[_0x5df9c0(0x21d)])==null?void 0x0:_0x53f394[_0x5df9c0(0x1f2)](_0x85e6b9=>_0x85e6b9[_0x5df9c0(0x1fc)]===_0x1b5c4e[_0x5df9c0(0x1fc)]))??-0x1;if(_0x1b5c4e[_0x5df9c0(0x1fc)]!=null&&_0xc94924<0x0)return!0x1;let _0x29a63a=_0x1b5c4e['sectionId']==null?_0xa159ef[_0x5df9c0(0x235)]:(_0x2072d9=_0xa159ef[_0x5df9c0(0x238)])==null||(_0x2072d9=_0x2072d9[_0x5df9c0(0x21d)])==null?void 0x0:_0x2072d9[_0xc94924][_0x5df9c0(0x22e)],_0x3d34fd=_0x1b5c4e[_0x5df9c0(0x25a)]==null?void 0x0:e[_0x5df9c0(0x228)][_0x5df9c0(0x255)](_0x1b5c4e[_0x5df9c0(0x25a)]),_0x27c365=_0x1b5c4e[_0x5df9c0(0x1fc)]==null?['noteSettings']:['body',_0x5df9c0(0x21d),_0xc94924,_0x5df9c0(0x22e)],_0x5442e4=e[_0x5df9c0(0x1e7)][_0x5df9c0(0x22f)](),_0x4dca32=null;if(e[_0x5df9c0(0x228)][_0x5df9c0(0x23a)](_0x29a63a==null?void 0x0:_0x29a63a[_0x3e6293],_0x3d34fd)||(_0x4dca32=_0x29a63a==null?_0x5442e4[_0x5df9c0(0x251)](_0x27c365,{[_0x3e6293]:_0x3d34fd}):_0x1b5c4e[_0x5df9c0(0x1fc)]!=null&&_0x3d34fd==null&&Object[_0x5df9c0(0x20c)](_0x29a63a)['every'](_0x2e87b3=>_0x2e87b3===_0x3e6293)?_0x5442e4[_0x5df9c0(0x1e6)](_0x27c365,_0x29a63a):_0x5442e4['replaceOp']([..._0x27c365,_0x3e6293],_0x29a63a[_0x3e6293],_0x3d34fd)),_0x1b5c4e[_0x5df9c0(0x1f4)]!=null){var _0xdb834e;if(_0x3e6293!==_0x5df9c0(0x208)||_0x1b5c4e[_0x5df9c0(0x1fc)]==null||typeof _0x1b5c4e[_0x5df9c0(0x1f4)]!=_0x5df9c0(0x222))return!0x1;let _0x4ff814=(_0xdb834e=_0xa159ef[_0x5df9c0(0x238)])==null||(_0xdb834e=_0xdb834e[_0x5df9c0(0x21d)])==null?void 0x0:_0xdb834e[_0xc94924]['suppressEndnotes'];_0x4ff814!==_0x1b5c4e['suppressEndnotes']&&(_0x4dca32=e[_0x5df9c0(0x1e7)][_0x5df9c0(0x209)](_0x4dca32,_0x5442e4[_0x5df9c0(0x21b)](['body',_0x5df9c0(0x21d),_0xc94924,_0x5df9c0(0x1f4)],_0x4ff814,_0x1b5c4e[_0x5df9c0(0x1f4)])));}return _0x4dca32;}function a(_0x146452,_0x3d07f1,_0x4993a5){const _0x3430b5=_0x54d71b;if(!_0x3d07f1)return!0x1;let _0x6d2fa1=_0x146452[_0x3430b5(0x1da)](e[_0x3430b5(0x1f1)])['getUnit'](_0x3d07f1['unitId'],e[_0x3430b5(0x24c)][_0x3430b5(0x24a)]),_0x1fc52f=_0x6d2fa1==null?void 0x0:_0x6d2fa1[_0x3430b5(0x1df)]();if(!_0x1fc52f||_0x1fc52f[_0x3430b5(0x1ea)]['documentFlavor']!==e[_0x3430b5(0x22a)][_0x3430b5(0x1e2)])return!0x1;let _0x5092a5=i(_0x1fc52f,_0x3d07f1,_0x4993a5);return _0x5092a5===!0x1||e[_0x3430b5(0x1e7)][_0x3430b5(0x1ee)](_0x5092a5)?!0x1:!!_0x146452['get'](e[_0x3430b5(0x247)])[_0x3430b5(0x25c)](t[_0x3430b5(0x21a)]['id'],{'unitId':_0x3d07f1['unitId'],'segmentId':'','historyAction':_0x3430b5(0x22b)+_0x4993a5+'-settings','actions':_0x5092a5,'textRanges':null,'noNeedSetTextRange':!0x0,'isEditing':!0x1,'debounce':!0x1});}const o={'id':_0x54d71b(0x1ed),'type':e[_0x54d71b(0x1f9)]['COMMAND'],'handler':(_0x4f73f7,_0x1dfafa)=>a(_0x4f73f7,_0x1dfafa,'footnote')},s={'id':_0x54d71b(0x25f),'type':e[_0x54d71b(0x1f9)][_0x54d71b(0x204)],'handler':(_0x1bef01,_0x4ad098)=>a(_0x1bef01,_0x4ad098,_0x54d71b(0x208))};function c(_0x31e829,_0x3a15b4){const _0x13fbae=_0x54d71b;return(_0x31e829==null?void 0x0:_0x31e829[_0x13fbae(0x1ea)]['documentFlavor'])===e[_0x13fbae(0x22a)][_0x13fbae(0x1e2)]&&!!_0x31e829[_0x13fbae(0x238)]&&Number['isInteger'](_0x3a15b4)&&_0x3a15b4>=0x0&&_0x3a15b4<_0x31e829[_0x13fbae(0x238)][_0x13fbae(0x257)][_0x13fbae(0x241)]-0x1;}function l(_0x25e33a,_0x342d7c,_0x13d8ef){const _0x13e095=_0x54d71b;var _0x244fcf,_0x42be00;if(_0x342d7c['settings']===void 0x0&&_0x342d7c[_0x13e095(0x1f4)]===void 0x0)return null;let _0x584d43=_0x342d7c[_0x13e095(0x1fc)]==null?(_0x244fcf=_0x25e33a[_0x13e095(0x235)])==null?void 0x0:_0x244fcf[_0x13d8ef]:(_0x42be00=_0x25e33a[_0x13e095(0x238)])==null||(_0x42be00=_0x42be00['sectionBreaks'])==null||(_0x42be00=_0x42be00[_0x13e095(0x1fd)](_0x2a152f=>_0x2a152f[_0x13e095(0x1fc)]===_0x342d7c[_0x13e095(0x1fc)]))==null||(_0x42be00=_0x42be00[_0x13e095(0x22e)])==null?void 0x0:_0x42be00[_0x13d8ef];return i(_0x25e33a,{'settings':_0x342d7c['settings']===void 0x0?_0x584d43??null:_0x342d7c['settings'],'sectionId':_0x342d7c[_0x13e095(0x1fc)],'suppressEndnotes':_0x342d7c['suppressEndnotes']},_0x13d8ef);}function u(_0xa69e43,_0x529b53,_0x5dd353){const _0x15982f=_0x54d71b;var _0x239dca,_0x265cc9,_0x4a2a5a;if(!_0x529b53||_0x529b53[_0x15982f(0x24f)])return!0x1;let _0x40de51=_0xa69e43[_0x15982f(0x1da)](e[_0x15982f(0x1f1)])[_0x15982f(0x1de)](_0x529b53['unitId'],e[_0x15982f(0x24c)][_0x15982f(0x24a)]),_0xe20224=_0x40de51==null?void 0x0:_0x40de51['getSnapshot'](),{offset:_0x36bcac}=_0x529b53;if(!c(_0xe20224,_0x36bcac))return!0x1;let _0x1a788e=l(_0xe20224,_0x529b53,_0x5dd353);if(_0x1a788e===!0x1)return!0x1;let _0x472199=_0x529b53['noteId']??(0x0,e[_0x15982f(0x1f6)])(0xc);if((_0x239dca=_0xe20224[_0x15982f(0x21c)])!=null&&_0x239dca[_0x472199]||(_0x265cc9=_0xe20224[_0x15982f(0x20a)])!=null&&_0x265cc9[_0x472199]||(_0x4a2a5a=_0xe20224[_0x15982f(0x237)])!=null&&_0x4a2a5a[_0x472199])return!0x1;let _0x10ca22=e[_0x15982f(0x228)]['deepClone']({'type':_0x5dd353,'noteId':_0x472199,'body':_0x529b53[_0x15982f(0x238)]??{'dataStream':'\x0d\x0a','paragraphs':[{'paragraphId':(0x0,e[_0x15982f(0x203)])(new Set()),'startIndex':0x0}],'sectionBreaks':[{'sectionId':(0x0,e[_0x15982f(0x1ef)])(new Set()),'startIndex':0x1}]},'customMark':_0x529b53[_0x15982f(0x1e4)],'referenceTextStyle':_0x529b53[_0x15982f(0x227)],'tableSource':_0x529b53['tableSource'],'drawings':_0x529b53[_0x15982f(0x1e1)],'drawingsOrder':_0x529b53[_0x15982f(0x23b)],'lists':_0x529b53[_0x15982f(0x244)]});if((0x0,e[_0x15982f(0x240)])({'notes':{[_0x472199]:_0x10ca22}})[_0x15982f(0x241)]>0x0)return!0x1;let _0x1df3ed=new e[(_0x15982f(0x1e0))]();_0x36bcac>0x0&&_0x1df3ed[_0x15982f(0x24e)](_0x36bcac),_0x1df3ed[_0x15982f(0x1f3)](0x1,{'dataStream':'','customRanges':[{'rangeType':_0x5dd353===_0x15982f(0x201)?e[_0x15982f(0x250)][_0x15982f(0x1db)]:e[_0x15982f(0x250)][_0x15982f(0x252)],'rangeId':(0x0,e[_0x15982f(0x1f6)])(0xc),'startIndex':0x0,'endIndex':0x0,'wholeEntity':!0x0,'properties':{'noteId':_0x472199}}]});let _0x5059bf=e[_0x15982f(0x1e7)][_0x15982f(0x22f)](),_0x34a05d=_0xe20224[_0x15982f(0x21c)]==null?_0x5059bf[_0x15982f(0x251)]([_0x15982f(0x21c)],{[_0x472199]:_0x10ca22}):_0x5059bf[_0x15982f(0x251)]([_0x15982f(0x21c),_0x472199],_0x10ca22);return!!_0xa69e43[_0x15982f(0x1da)](e[_0x15982f(0x247)])[_0x15982f(0x25c)](t['RichTextEditingMutation']['id'],{'unitId':_0x529b53[_0x15982f(0x231)],'segmentId':'','historyAction':_0x15982f(0x1ec)+_0x5dd353,'actions':e[_0x15982f(0x1e7)][_0x15982f(0x209)](e[_0x15982f(0x1e7)][_0x15982f(0x209)](_0x1a788e,_0x34a05d),_0x5059bf[_0x15982f(0x1fb)](_0x1df3ed[_0x15982f(0x211)](),[_0x15982f(0x238)])),'textRanges':[{'segmentId':_0x472199,'startOffset':0x0,'endOffset':0x0,'collapsed':!0x0}],'debounce':!0x1});}function d(_0x374593,_0x518c95,_0x31d929){const _0x34d382=_0x54d71b;var _0x52f748,_0x13762d;if(!_0x518c95)return!0x1;let _0x33e302=_0x374593[_0x34d382(0x1da)](e[_0x34d382(0x1f1)])[_0x34d382(0x1de)](_0x518c95[_0x34d382(0x231)],e['UniverInstanceType']['UNIVER_DOC']),_0x3f2ec8=_0x33e302==null?void 0x0:_0x33e302[_0x34d382(0x1df)](),_0x89bead=_0x3f2ec8==null||(_0x52f748=_0x3f2ec8[_0x34d382(0x21c)])==null?void 0x0:_0x52f748[_0x518c95[_0x34d382(0x1e3)]],_0x36de76=_0x3f2ec8==null||(_0x13762d=_0x3f2ec8[_0x34d382(0x238)])==null||(_0x13762d=_0x13762d[_0x34d382(0x25d)])==null?void 0x0:_0x13762d[_0x34d382(0x1fd)](_0x38b739=>{const _0x3d44b6=_0x34d382;var _0x558844;return(_0x38b739[_0x3d44b6(0x226)]===e['CustomRangeType']['FOOTNOTE']||_0x38b739[_0x3d44b6(0x226)]===e[_0x3d44b6(0x250)]['ENDNOTE'])&&((_0x558844=_0x38b739['properties'])==null?void 0x0:_0x558844['noteId'])===_0x518c95[_0x3d44b6(0x1e3)];});if(!_0x3f2ec8||_0x3f2ec8[_0x34d382(0x1ea)][_0x34d382(0x246)]!==e[_0x34d382(0x22a)][_0x34d382(0x1e2)]||!_0x89bead||_0x89bead['type']!==_0x31d929||!_0x36de76)return!0x1;let _0x1170d2=new e[(_0x34d382(0x1e0))]();_0x36de76[_0x34d382(0x1d5)]>0x0&&_0x1170d2['retain'](_0x36de76[_0x34d382(0x1d5)]),_0x1170d2[_0x34d382(0x243)](0x1);let _0xba59f=e[_0x34d382(0x1e7)][_0x34d382(0x22f)]();return!!_0x374593[_0x34d382(0x1da)](e['ICommandService'])[_0x34d382(0x25c)](t[_0x34d382(0x21a)]['id'],{'unitId':_0x518c95[_0x34d382(0x231)],'segmentId':'','historyAction':_0x34d382(0x210)+_0x31d929,'actions':e['JSONX']['compose'](_0xba59f['editOp'](_0x1170d2[_0x34d382(0x211)](),[_0x34d382(0x238)]),_0xba59f['removeOp']([_0x34d382(0x21c),_0x518c95[_0x34d382(0x1e3)]],_0x89bead)),'textRanges':[{'startOffset':_0x36de76['startIndex'],'endOffset':_0x36de76[_0x34d382(0x1d5)],'collapsed':!0x0}],'debounce':!0x1});}const f={'id':_0x54d71b(0x218),'type':e['CommandType'][_0x54d71b(0x204)],'handler':(_0x5d4dd4,_0x529ea4)=>u(_0x5d4dd4,_0x529ea4,_0x54d71b(0x201))},p={'id':_0x54d71b(0x1e9),'type':e[_0x54d71b(0x1f9)][_0x54d71b(0x204)],'handler':(_0x1eee13,_0x24891d)=>d(_0x1eee13,_0x24891d,_0x54d71b(0x201))},m={'id':'doc.command.insert-endnote','type':e[_0x54d71b(0x1f9)][_0x54d71b(0x204)],'handler':(_0x466985,_0x8fd62f)=>u(_0x466985,_0x8fd62f,_0x54d71b(0x208))},h={'id':_0x54d71b(0x22c),'type':e[_0x54d71b(0x1f9)]['COMMAND'],'handler':(_0x197a44,_0x1832ae)=>d(_0x197a44,_0x1832ae,_0x54d71b(0x208))};var g=_0x54d71b(0x212),_=_0x54d71b(0x245);const v={};function y(_0x3682a2,_0x409e35){return function(_0x25b60c,_0x4701bf){_0x409e35(_0x25b60c,_0x4701bf,_0x3682a2);};}function b(_0x3020e6,_0x3d5976,_0x41d6d6,_0x5c12e8){const _0x5cb173=_0x54d71b;var _0x3de4cf=arguments['length'],_0x54870e=_0x3de4cf<0x3?_0x3d5976:_0x5c12e8===null?_0x5c12e8=Object[_0x5cb173(0x1ff)](_0x3d5976,_0x41d6d6):_0x5c12e8,_0x4e0114;if(typeof Reflect==_0x5cb173(0x205)&&typeof Reflect['decorate']==_0x5cb173(0x1eb))_0x54870e=Reflect[_0x5cb173(0x1fe)](_0x3020e6,_0x3d5976,_0x41d6d6,_0x5c12e8);else{for(var _0x5622b3=_0x3020e6[_0x5cb173(0x241)]-0x1;_0x5622b3>=0x0;_0x5622b3--)(_0x4e0114=_0x3020e6[_0x5622b3])&&(_0x54870e=(_0x3de4cf<0x3?_0x4e0114(_0x54870e):_0x3de4cf>0x3?_0x4e0114(_0x3d5976,_0x41d6d6,_0x54870e):_0x4e0114(_0x3d5976,_0x41d6d6))||_0x54870e);}return _0x3de4cf>0x3&&_0x54870e&&Object['defineProperty'](_0x3d5976,_0x41d6d6,_0x54870e),_0x54870e;}function x(_0x4ea883){'@babel/helpers - typeof';const _0x5731fd=_0x54d71b;return x=typeof Symbol==_0x5731fd(0x1eb)&&typeof Symbol[_0x5731fd(0x249)]=='symbol'?function(_0x59f738){return typeof _0x59f738;}:function(_0x251919){const _0x49fdcc=_0x5731fd;return _0x251919&&typeof Symbol=='function'&&_0x251919[_0x49fdcc(0x21f)]===Symbol&&_0x251919!==Symbol['prototype']?_0x49fdcc(0x230):typeof _0x251919;},x(_0x4ea883);}function _0x48b2(_0x4f72b0,_0x1aa4f7){_0x4f72b0=_0x4f72b0-0x1d5;const _0x19057f=_0x1905();let _0x48b267=_0x19057f[_0x4f72b0];return _0x48b267;}function S(_0x5e142f,_0x42e669){const _0x3b87f7=_0x54d71b;if(x(_0x5e142f)!=_0x3b87f7(0x205)||!_0x5e142f)return _0x5e142f;var _0x31aad8=_0x5e142f[Symbol['toPrimitive']];if(_0x31aad8!==void 0x0){var _0x14b4ce=_0x31aad8[_0x3b87f7(0x20e)](_0x5e142f,_0x42e669||_0x3b87f7(0x200));if(x(_0x14b4ce)!=_0x3b87f7(0x205))return _0x14b4ce;throw TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x42e669===_0x3b87f7(0x1fa)?String:Number)(_0x5e142f);}function C(_0x1cfee9){const _0x5ccedf=_0x54d71b;var _0x57cbd4=S(_0x1cfee9,_0x5ccedf(0x1fa));return x(_0x57cbd4)==_0x5ccedf(0x230)?_0x57cbd4:_0x57cbd4+'';}function w(_0x39b806,_0x239ad8,_0x4994ce){const _0x477898=_0x54d71b;return(_0x239ad8=C(_0x239ad8))in _0x39b806?Object[_0x477898(0x206)](_0x39b806,_0x239ad8,{'value':_0x4994ce,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x39b806[_0x239ad8]=_0x4994ce,_0x39b806;}let T=class extends e[_0x54d71b(0x236)]{constructor(_0x572d52=v,_0x142013,_0x3b6762,_0x45f9e2){const _0xe177be=_0x54d71b;super(),this['_config']=_0x572d52,this['_injector']=_0x142013,this[_0xe177be(0x232)]=_0x3b6762,this[_0xe177be(0x24b)]=_0x45f9e2;let {..._0x2e60a4}=(0x0,e[_0xe177be(0x217)])({},v,this[_0xe177be(0x23d)]);this[_0xe177be(0x232)]['setConfig']('docs-reference.config',_0x2e60a4);}[_0x54d71b(0x256)](){const _0x403c5e=_0x54d71b;[f,p,o,m,h,s]['forEach'](_0x2d0f76=>this[_0x403c5e(0x20f)](this['_commandService'][_0x403c5e(0x234)](_0x2d0f76)));}};w(T,_0x54d71b(0x1e8),_0x54d71b(0x24d)),w(T,_0x54d71b(0x207),g),w(T,_0x54d71b(0x23f),_),w(T,_0x54d71b(0x202),e['UniverInstanceType'][_0x54d71b(0x24a)]),T=b([(0x0,e[_0x54d71b(0x1f0)])(n[_0x54d71b(0x254)],t[_0x54d71b(0x21e)]),y(0x1,(0x0,e['Inject'])(e[_0x54d71b(0x20b)])),y(0x2,e['IConfigService']),y(0x3,e[_0x54d71b(0x247)])],T),exports[_0x54d71b(0x25e)]=h,exports[_0x54d71b(0x1dd)]=p,exports[_0x54d71b(0x239)]=m,exports[_0x54d71b(0x253)]=f,exports['SetDocumentEndnoteSettingsCommand']=s,exports[_0x54d71b(0x220)]=o,Object['defineProperty'](exports,_0x54d71b(0x1d8),{'enumerable':!0x0,'get':function(){return T;}});
|
package/lib/es/facade.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0xb23a80=_0x5e4d;(function(_0x246153,_0x309dec){const _0x38d3d9=_0x5e4d,_0x375f06=_0x246153();while(!![]){try{const _0x14e8f7=-parseInt(_0x38d3d9(0x1c2))/0x1+-parseInt(_0x38d3d9(0x1b4))/0x2+parseInt(_0x38d3d9(0x1b7))/0x3+-parseInt(_0x38d3d9(0x1b9))/0x4+-parseInt(_0x38d3d9(0x1d2))/0x5+parseInt(_0x38d3d9(0x1c1))/0x6+-parseInt(_0x38d3d9(0x1c9))/0x7*(-parseInt(_0x38d3d9(0x1ba))/0x8);if(_0x14e8f7===_0x309dec)break;else _0x375f06['push'](_0x375f06['shift']());}catch(_0x2bdfdb){_0x375f06['push'](_0x375f06['shift']());}}}(_0x1ea5,0xacdd4));function _0x5e4d(_0x15023d,_0x1dd7f6){_0x15023d=_0x15023d-0x1af;const _0x1ea5a6=_0x1ea5();let _0x5e4dcb=_0x1ea5a6[_0x15023d];return _0x5e4dcb;}import{DeleteDocumentEndnoteCommand as _0x58167c,DeleteDocumentFootnoteCommand as _0x2fede9,InsertDocumentEndnoteCommand as _0x52acd0,InsertDocumentFootnoteCommand as _0x1ce3bb,SetDocumentEndnoteSettingsCommand as _0x21a887,SetDocumentFootnoteSettingsCommand as _0x25bb23}from'@univerjs-pro/docs-reference';import{CustomRangeType as _0x26d87d,ICommandService as _0x28486d,Tools as _0x1e0df7,generateRandomId as _0x446bb3}from'@univerjs/core';import{FDocument as _0x184400}from'@univerjs/docs/facade';var d=class extends _0x184400{[_0xb23a80(0x1c3)](_0x186840,_0x21f858={}){const _0x1f08e6=_0xb23a80;let _0x4e66d7=_0x446bb3(0xc);return this['_injector'][_0x1f08e6(0x1c5)](_0x28486d)[_0x1f08e6(0x1c6)](_0x1ce3bb['id'],{..._0x21f858,'unitId':this['id'],'offset':_0x186840,'noteId':_0x4e66d7})?_0x4e66d7:null;}[_0xb23a80(0x1d3)](){const _0x10fd35=_0xb23a80;var _0x424438;let _0x24ef45=this[_0x10fd35(0x1ca)]()[_0x10fd35(0x1c4)]();return(((_0x424438=_0x24ef45['body'])==null?void 0x0:_0x424438[_0x10fd35(0x1af)])??[])[_0x10fd35(0x1b2)](_0x44ef7c=>_0x44ef7c[_0x10fd35(0x1bb)]===_0x26d87d[_0x10fd35(0x1c0)])[_0x10fd35(0x1ce)]((_0x22dbc3,_0x5bb211)=>_0x22dbc3['startIndex']-_0x5bb211[_0x10fd35(0x1be)])[_0x10fd35(0x1b1)](_0x169246=>{const _0x24c05d=_0x10fd35;var _0x4d2c66,_0x463e11;let _0x494dde=(_0x4d2c66=_0x169246['properties'])==null?void 0x0:_0x4d2c66[_0x24c05d(0x1bd)],_0x25e487=typeof _0x494dde=='string'?(_0x463e11=_0x24ef45[_0x24c05d(0x1bc)])==null?void 0x0:_0x463e11[_0x494dde]:void 0x0;return _0x25e487?[_0x1e0df7[_0x24c05d(0x1d6)](_0x25e487)]:[];});}['deleteFootnote'](_0x4dcf5a){const _0x1573c0=_0xb23a80;return this['_injector'][_0x1573c0(0x1c5)](_0x28486d)[_0x1573c0(0x1c6)](_0x2fede9['id'],{'unitId':this['id'],'noteId':_0x4dcf5a});}[_0xb23a80(0x1b8)](_0xbeb023){const _0x567ea2=_0xb23a80;var _0x33632a,_0x4df251;let _0x3fbd99=this['getDocumentDataModel']()[_0x567ea2(0x1c4)](),_0x2c7456=_0xbeb023==null?(_0x33632a=_0x3fbd99[_0x567ea2(0x1cb)])==null?void 0x0:_0x33632a[_0x567ea2(0x1d1)]:(_0x4df251=_0x3fbd99[_0x567ea2(0x1b5)])==null||(_0x4df251=_0x4df251[_0x567ea2(0x1c7)])==null||(_0x4df251=_0x4df251[_0x567ea2(0x1cd)](_0x1d9674=>_0x1d9674['sectionId']===_0xbeb023))==null||(_0x4df251=_0x4df251[_0x567ea2(0x1cf)])==null?void 0x0:_0x4df251[_0x567ea2(0x1d1)];return _0x2c7456==null?void 0x0:_0x1e0df7[_0x567ea2(0x1d6)](_0x2c7456);}[_0xb23a80(0x1d4)](_0x14936d,_0x207d0e){const _0x8e6c81=_0xb23a80;return this['_injector'][_0x8e6c81(0x1c5)](_0x28486d)[_0x8e6c81(0x1c6)](_0x25bb23['id'],{'unitId':this['id'],'settings':_0x14936d,'sectionId':_0x207d0e});}['insertEndnote'](_0x2d2fe4,_0x18cd68={}){const _0x50d8fb=_0xb23a80;let _0xf119ca=_0x446bb3(0xc);return this['_injector']['get'](_0x28486d)[_0x50d8fb(0x1c6)](_0x52acd0['id'],{..._0x18cd68,'unitId':this['id'],'offset':_0x2d2fe4,'noteId':_0xf119ca})?_0xf119ca:null;}['getEndnotes'](){const _0x2a31de=_0xb23a80;var _0x56b564;let _0x38aa7f=this[_0x2a31de(0x1ca)]()['getSnapshot']();return(((_0x56b564=_0x38aa7f[_0x2a31de(0x1b5)])==null?void 0x0:_0x56b564[_0x2a31de(0x1af)])??[])[_0x2a31de(0x1b2)](_0x315c83=>_0x315c83[_0x2a31de(0x1bb)]===_0x26d87d['ENDNOTE'])['sort']((_0x34ceea,_0x114d0f)=>_0x34ceea[_0x2a31de(0x1be)]-_0x114d0f['startIndex'])['flatMap'](_0x58d026=>{const _0x50a0b9=_0x2a31de;var _0x1dcb1f,_0x3128c6;let _0x5cd801=(_0x1dcb1f=_0x58d026[_0x50a0b9(0x1d5)])==null?void 0x0:_0x1dcb1f[_0x50a0b9(0x1bd)],_0x58bdd8=typeof _0x5cd801==_0x50a0b9(0x1c8)?(_0x3128c6=_0x38aa7f[_0x50a0b9(0x1bc)])==null?void 0x0:_0x3128c6[_0x5cd801]:void 0x0;return _0x58bdd8?[_0x1e0df7['deepClone'](_0x58bdd8)]:[];});}[_0xb23a80(0x1d0)](_0x26ded8){const _0x248913=_0xb23a80;return this['_injector'][_0x248913(0x1c5)](_0x28486d)['syncExecuteCommand'](_0x58167c['id'],{'unitId':this['id'],'noteId':_0x26ded8});}[_0xb23a80(0x1cc)](_0x264806){const _0x30cdda=_0xb23a80;var _0xacde97,_0x3e1bac;let _0x4852df=this[_0x30cdda(0x1ca)]()[_0x30cdda(0x1c4)](),_0x5affe1=_0x264806==null?(_0xacde97=_0x4852df['noteSettings'])==null?void 0x0:_0xacde97[_0x30cdda(0x1b6)]:(_0x3e1bac=_0x4852df['body'])==null||(_0x3e1bac=_0x3e1bac['sectionBreaks'])==null||(_0x3e1bac=_0x3e1bac[_0x30cdda(0x1cd)](_0x39d464=>_0x39d464['sectionId']===_0x264806))==null||(_0x3e1bac=_0x3e1bac[_0x30cdda(0x1cf)])==null?void 0x0:_0x3e1bac['endnote'];return _0x5affe1==null?void 0x0:_0x1e0df7[_0x30cdda(0x1d6)](_0x5affe1);}[_0xb23a80(0x1bf)](_0x161879,_0x2a9c6b){const _0x34443d=_0xb23a80;return this[_0x34443d(0x1b0)][_0x34443d(0x1c5)](_0x28486d)[_0x34443d(0x1c6)](_0x21a887['id'],{'unitId':this['id'],'settings':_0x161879,'sectionId':_0x2a9c6b});}};_0x184400[_0xb23a80(0x1b3)](d);export{};function _0x1ea5(){const _0x58f8af=['get','syncExecuteCommand','sectionBreaks','string','20568653qrtsPw','getDocumentDataModel','noteSettings','getEndnoteSettings','find','sort','noteProperties','deleteEndnote','footnote','1741345FZLmrJ','getFootnotes','setFootnoteSettings','properties','deepClone','customRanges','_injector','flatMap','filter','extend','2413884beAFes','body','endnote','202785cKQcbA','getFootnoteSettings','1059752AQTgWI','8XRUreD','rangeType','notes','noteId','startIndex','setEndnoteSettings','FOOTNOTE','2797344RmOScK','943997oIyCkm','insertFootnote','getSnapshot'];_0x1ea5=function(){return _0x58f8af;};return _0x1ea5();}
|
package/lib/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0xc30877=_0x49dd;(function(_0x4b43cb,_0x1f723b){const _0x5f195b=_0x49dd,_0x2fd8f3=_0x4b43cb();while(!![]){try{const _0x385b24=parseInt(_0x5f195b(0x109))/0x1+-parseInt(_0x5f195b(0x144))/0x2*(-parseInt(_0x5f195b(0x13a))/0x3)+-parseInt(_0x5f195b(0x160))/0x4*(-parseInt(_0x5f195b(0x12e))/0x5)+parseInt(_0x5f195b(0x123))/0x6+-parseInt(_0x5f195b(0x136))/0x7+parseInt(_0x5f195b(0x126))/0x8*(parseInt(_0x5f195b(0x102))/0x9)+parseInt(_0x5f195b(0x14c))/0xa*(-parseInt(_0x5f195b(0x149))/0xb);if(_0x385b24===_0x1f723b)break;else _0x2fd8f3['push'](_0x2fd8f3['shift']());}catch(_0x368c73){_0x2fd8f3['push'](_0x2fd8f3['shift']());}}}(_0x249d,0xb0ac8));import{CommandType as _0x142f06,CustomRangeType as _0x582f35,DependentOn as _0x15001a,DocumentFlavor as _0x217cf5,ICommandService as _0x2b4e4,IConfigService as _0x1f1bae,IUniverInstanceService as _0xe30e64,Inject as _0x3d8cc,Injector as _0x49b800,JSONX as _0x45928d,Plugin as _0x507d43,TextX as _0x58319d,Tools as _0x31c092,UniverInstanceType as _0x5625e7,createParagraphId as _0x5bc908,createSectionId as _0x39906f,generateRandomId as _0x4d4105,merge as _0xd329bd,validateDocBodyStructure as _0x570a6a,validateDocumentStructure as _0x47a580}from'@univerjs/core';import{RichTextEditingMutation as _0x515ab4,UniverDocsPlugin as _0x461dd7}from'@univerjs/docs';import{UniverLicensePlugin as _0x4f32c6}from'@univerjs-pro/license';function C(_0xeb8fbf,_0x2a60fd,_0x45f649){const _0x36ee06=_0x49dd;if(_0xeb8fbf['position']!=null&&!(_0x2a60fd===_0x36ee06(0x108)?[_0x36ee06(0x15d),_0x36ee06(0x112)]:['docEnd','sectEnd'])[_0x36ee06(0x13f)](_0xeb8fbf['position'])||_0xeb8fbf['restart']!=null&&!(_0x2a60fd===_0x36ee06(0x108)?['continuous',_0x36ee06(0x156),'eachPage']:[_0x36ee06(0x121),'eachSect'])[_0x36ee06(0x13f)](_0xeb8fbf['restart'])||_0xeb8fbf[_0x36ee06(0x146)]!=null&&(!Number['isInteger'](_0xeb8fbf[_0x36ee06(0x146)])||_0xeb8fbf[_0x36ee06(0x146)]<0x1)||_0x36ee06(0x103)in _0xeb8fbf&&_0xeb8fbf['columnCount']!=null&&(_0x2a60fd!==_0x36ee06(0x108)||!Number[_0x36ee06(0x165)](_0xeb8fbf['columnCount'])||_0xeb8fbf['columnCount']<0x0||_0xeb8fbf[_0x36ee06(0x103)]>0x4)||_0xeb8fbf[_0x36ee06(0x148)]!=null&&(typeof _0xeb8fbf[_0x36ee06(0x148)]!=_0x36ee06(0x157)||_0xeb8fbf['numberFormat'][_0x36ee06(0x11a)]===0x0))return!0x1;for(let _0x2397a7 of[_0xeb8fbf[_0x36ee06(0x167)],_0xeb8fbf['continuationSeparator'],_0xeb8fbf[_0x36ee06(0x13c)]])if(_0x2397a7!=null&&(_0x45f649!=null||_0x570a6a(_0x2397a7)[_0x36ee06(0x11a)]>0x0))return!0x1;return!0x0;}function w(_0x40ba13,_0x5a965b,_0x32afd9){const _0xe749ba=_0x49dd;var _0x4521f2,_0x48770c;if(_0x5a965b[_0xe749ba(0x10e)]!=null&&!C(_0x5a965b[_0xe749ba(0x10e)],_0x32afd9,_0x5a965b[_0xe749ba(0x12c)]))return!0x1;let _0x14cdff=((_0x4521f2=_0x40ba13[_0xe749ba(0x13d)])==null||(_0x4521f2=_0x4521f2[_0xe749ba(0x163)])==null?void 0x0:_0x4521f2[_0xe749ba(0x15c)](_0x33acd4=>_0x33acd4[_0xe749ba(0x12c)]===_0x5a965b['sectionId']))??-0x1;if(_0x5a965b[_0xe749ba(0x12c)]!=null&&_0x14cdff<0x0)return!0x1;let _0x2627b0=_0x5a965b[_0xe749ba(0x12c)]==null?_0x40ba13['noteSettings']:(_0x48770c=_0x40ba13[_0xe749ba(0x13d)])==null||(_0x48770c=_0x48770c['sectionBreaks'])==null?void 0x0:_0x48770c[_0x14cdff][_0xe749ba(0x12f)],_0x2b4148=_0x5a965b['settings']==null?void 0x0:_0x31c092['deepClone'](_0x5a965b[_0xe749ba(0x10e)]),_0x439f9e=_0x5a965b[_0xe749ba(0x12c)]==null?[_0xe749ba(0x129)]:[_0xe749ba(0x13d),_0xe749ba(0x163),_0x14cdff,_0xe749ba(0x12f)],_0x19477d=_0x45928d[_0xe749ba(0x115)](),_0xf8e8c5=null;if(_0x31c092['diffValue'](_0x2627b0==null?void 0x0:_0x2627b0[_0x32afd9],_0x2b4148)||(_0xf8e8c5=_0x2627b0==null?_0x19477d[_0xe749ba(0x106)](_0x439f9e,{[_0x32afd9]:_0x2b4148}):_0x5a965b[_0xe749ba(0x12c)]!=null&&_0x2b4148==null&&Object[_0xe749ba(0x13e)](_0x2627b0)['every'](_0x542ac2=>_0x542ac2===_0x32afd9)?_0x19477d[_0xe749ba(0x105)](_0x439f9e,_0x2627b0):_0x19477d[_0xe749ba(0x153)]([..._0x439f9e,_0x32afd9],_0x2627b0[_0x32afd9],_0x2b4148)),_0x5a965b[_0xe749ba(0x101)]!=null){var _0x2415ee;if(_0x32afd9!==_0xe749ba(0x10b)||_0x5a965b[_0xe749ba(0x12c)]==null||typeof _0x5a965b[_0xe749ba(0x101)]!=_0xe749ba(0x122))return!0x1;let _0x45110c=(_0x2415ee=_0x40ba13['body'])==null||(_0x2415ee=_0x2415ee[_0xe749ba(0x163)])==null?void 0x0:_0x2415ee[_0x14cdff][_0xe749ba(0x101)];_0x45110c!==_0x5a965b['suppressEndnotes']&&(_0xf8e8c5=_0x45928d[_0xe749ba(0x110)](_0xf8e8c5,_0x19477d[_0xe749ba(0x153)]([_0xe749ba(0x13d),_0xe749ba(0x163),_0x14cdff,_0xe749ba(0x101)],_0x45110c,_0x5a965b[_0xe749ba(0x101)])));}return _0xf8e8c5;}function T(_0x15ffa1,_0x5a2dc7,_0x345299){const _0x56af73=_0x49dd;if(!_0x5a2dc7)return!0x1;let _0xcaddca=_0x15ffa1[_0x56af73(0x145)](_0xe30e64)[_0x56af73(0x124)](_0x5a2dc7[_0x56af73(0x133)],_0x5625e7[_0x56af73(0x11b)]),_0x332f9f=_0xcaddca==null?void 0x0:_0xcaddca['getSnapshot']();if(!_0x332f9f||_0x332f9f[_0x56af73(0x113)][_0x56af73(0x161)]!==_0x217cf5['TRADITIONAL'])return!0x1;let _0x1b2a8f=w(_0x332f9f,_0x5a2dc7,_0x345299);return _0x1b2a8f===!0x1||_0x45928d[_0x56af73(0x15e)](_0x1b2a8f)?!0x1:!!_0x15ffa1['get'](_0x2b4e4)[_0x56af73(0x117)](_0x515ab4['id'],{'unitId':_0x5a2dc7['unitId'],'segmentId':'','historyAction':'set-'+_0x345299+'-settings','actions':_0x1b2a8f,'textRanges':null,'noNeedSetTextRange':!0x0,'isEditing':!0x1,'debounce':!0x1});}const E={'id':_0xc30877(0x158),'type':_0x142f06[_0xc30877(0x147)],'handler':(_0xd37ac7,_0x33893f)=>T(_0xd37ac7,_0x33893f,_0xc30877(0x108))},D={'id':'doc.command.set-endnote-settings','type':_0x142f06[_0xc30877(0x147)],'handler':(_0x5aa1f1,_0x440bc9)=>T(_0x5aa1f1,_0x440bc9,'endnote')};function O(_0x2bc780,_0x2d18be){const _0x2249fb=_0xc30877;return(_0x2bc780==null?void 0x0:_0x2bc780['documentStyle'][_0x2249fb(0x161)])===_0x217cf5[_0x2249fb(0x168)]&&!!_0x2bc780[_0x2249fb(0x13d)]&&Number['isInteger'](_0x2d18be)&&_0x2d18be>=0x0&&_0x2d18be<_0x2bc780['body']['dataStream'][_0x2249fb(0x11a)]-0x1;}function _0x249d(){const _0x22631c=['registerCommand','6630386dWlxKM','version','startIndex','pluginName','3NQBLVW','type','continuationNotice','body','keys','includes','iterator','object','retain','toPrimitive','1972914VdVTQy','get','startNumber','COMMAND','numberFormat','11ueaBmD','default','headers','17826070PKbPpJ','find','symbol','prototype','customRanges','serialize','getOwnPropertyDescriptor','replaceOp','segmentId','_configService','eachSect','string','doc.command.set-footnote-settings','editOp','1.0.0-rc.0','disposeWithMe','findIndex','pageBottom','isNoop','lists','3764slAMGI','documentFlavor','forEach','sectionBreaks','delete-','isInteger','noteId','separator','TRADITIONAL','suppressEndnotes','11268WseeXC','columnCount','notes','removeOp','insertOp','onStarting','footnote','359307MZTURX','_config','endnote','doc.command.delete-footnote','function','settings','deepClone','compose','ENDNOTE','beneathText','documentStyle','insert','getInstance','decorate','syncExecuteCommand','delete','footers','length','UNIVER_DOC','FOOTNOTE','doc.command.insert-footnote','_commandService','call','_injector','continuous','boolean','4779030gMLeRQ','getUnit','doc.command.insert-endnote','3568UHfpSY','properties','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','noteSettings','@univerjs-pro/docs-reference','drawings','sectionId','referenceTextStyle','4000SFdeij','noteProperties','rangeType','doc.command.delete-endnote','packageName','unitId','constructor'];_0x249d=function(){return _0x22631c;};return _0x249d();}function k(_0x5ce2d6,_0x437df6,_0x2ad0fc){const _0x2dc322=_0xc30877;var _0x309132,_0x3ea3eb;if(_0x437df6[_0x2dc322(0x10e)]===void 0x0&&_0x437df6[_0x2dc322(0x101)]===void 0x0)return null;let _0x849530=_0x437df6['sectionId']==null?(_0x309132=_0x5ce2d6[_0x2dc322(0x129)])==null?void 0x0:_0x309132[_0x2ad0fc]:(_0x3ea3eb=_0x5ce2d6[_0x2dc322(0x13d)])==null||(_0x3ea3eb=_0x3ea3eb[_0x2dc322(0x163)])==null||(_0x3ea3eb=_0x3ea3eb[_0x2dc322(0x14d)](_0x22caae=>_0x22caae['sectionId']===_0x437df6['sectionId']))==null||(_0x3ea3eb=_0x3ea3eb[_0x2dc322(0x12f)])==null?void 0x0:_0x3ea3eb[_0x2ad0fc];return w(_0x5ce2d6,{'settings':_0x437df6[_0x2dc322(0x10e)]===void 0x0?_0x849530??null:_0x437df6[_0x2dc322(0x10e)],'sectionId':_0x437df6['sectionId'],'suppressEndnotes':_0x437df6[_0x2dc322(0x101)]},_0x2ad0fc);}function A(_0x725072,_0x1c06c5,_0x1069da){const _0x68d5b5=_0xc30877;var _0x2748ed,_0xc4371,_0x345808;if(!_0x1c06c5||_0x1c06c5[_0x68d5b5(0x154)])return!0x1;let _0x3bfb03=_0x725072[_0x68d5b5(0x145)](_0xe30e64)[_0x68d5b5(0x124)](_0x1c06c5['unitId'],_0x5625e7['UNIVER_DOC']),_0x595f1c=_0x3bfb03==null?void 0x0:_0x3bfb03['getSnapshot'](),{offset:_0x32a897}=_0x1c06c5;if(!O(_0x595f1c,_0x32a897))return!0x1;let _0x2c7b9c=k(_0x595f1c,_0x1c06c5,_0x1069da);if(_0x2c7b9c===!0x1)return!0x1;let _0x3d933d=_0x1c06c5[_0x68d5b5(0x166)]??_0x4d4105(0xc);if((_0x2748ed=_0x595f1c[_0x68d5b5(0x104)])!=null&&_0x2748ed[_0x3d933d]||(_0xc4371=_0x595f1c[_0x68d5b5(0x14b)])!=null&&_0xc4371[_0x3d933d]||(_0x345808=_0x595f1c[_0x68d5b5(0x119)])!=null&&_0x345808[_0x3d933d])return!0x1;let _0x285ee8=_0x31c092[_0x68d5b5(0x10f)]({'type':_0x1069da,'noteId':_0x3d933d,'body':_0x1c06c5[_0x68d5b5(0x13d)]??{'dataStream':'\x0d\x0a','paragraphs':[{'paragraphId':_0x5bc908(new Set()),'startIndex':0x0}],'sectionBreaks':[{'sectionId':_0x39906f(new Set()),'startIndex':0x1}]},'customMark':_0x1c06c5['customMark'],'referenceTextStyle':_0x1c06c5[_0x68d5b5(0x12d)],'tableSource':_0x1c06c5['tableSource'],'drawings':_0x1c06c5[_0x68d5b5(0x12b)],'drawingsOrder':_0x1c06c5['drawingsOrder'],'lists':_0x1c06c5[_0x68d5b5(0x15f)]});if(_0x47a580({'notes':{[_0x3d933d]:_0x285ee8}})[_0x68d5b5(0x11a)]>0x0)return!0x1;let _0x4a688e=new _0x58319d();_0x32a897>0x0&&_0x4a688e[_0x68d5b5(0x142)](_0x32a897),_0x4a688e[_0x68d5b5(0x114)](0x1,{'dataStream':'','customRanges':[{'rangeType':_0x1069da===_0x68d5b5(0x108)?_0x582f35['FOOTNOTE']:_0x582f35[_0x68d5b5(0x111)],'rangeId':_0x4d4105(0xc),'startIndex':0x0,'endIndex':0x0,'wholeEntity':!0x0,'properties':{'noteId':_0x3d933d}}]});let _0x166eeb=_0x45928d[_0x68d5b5(0x115)](),_0x4942ae=_0x595f1c['notes']==null?_0x166eeb['insertOp'](['notes'],{[_0x3d933d]:_0x285ee8}):_0x166eeb[_0x68d5b5(0x106)]([_0x68d5b5(0x104),_0x3d933d],_0x285ee8);return!!_0x725072[_0x68d5b5(0x145)](_0x2b4e4)['syncExecuteCommand'](_0x515ab4['id'],{'unitId':_0x1c06c5[_0x68d5b5(0x133)],'segmentId':'','historyAction':'insert-'+_0x1069da,'actions':_0x45928d[_0x68d5b5(0x110)](_0x45928d[_0x68d5b5(0x110)](_0x2c7b9c,_0x4942ae),_0x166eeb[_0x68d5b5(0x159)](_0x4a688e[_0x68d5b5(0x151)](),[_0x68d5b5(0x13d)])),'textRanges':[{'segmentId':_0x3d933d,'startOffset':0x0,'endOffset':0x0,'collapsed':!0x0}],'debounce':!0x1});}function j(_0x202040,_0x2a32d3,_0x1e036b){const _0x4fcbef=_0xc30877;var _0x28108a,_0x482db9;if(!_0x2a32d3)return!0x1;let _0x101704=_0x202040[_0x4fcbef(0x145)](_0xe30e64)['getUnit'](_0x2a32d3[_0x4fcbef(0x133)],_0x5625e7[_0x4fcbef(0x11b)]),_0x5b5e78=_0x101704==null?void 0x0:_0x101704['getSnapshot'](),_0x22deec=_0x5b5e78==null||(_0x28108a=_0x5b5e78['notes'])==null?void 0x0:_0x28108a[_0x2a32d3['noteId']],_0x3206a4=_0x5b5e78==null||(_0x482db9=_0x5b5e78['body'])==null||(_0x482db9=_0x482db9[_0x4fcbef(0x150)])==null?void 0x0:_0x482db9[_0x4fcbef(0x14d)](_0x3e6ea9=>{const _0x577f36=_0x4fcbef;var _0x3843c9;return(_0x3e6ea9[_0x577f36(0x130)]===_0x582f35[_0x577f36(0x11c)]||_0x3e6ea9[_0x577f36(0x130)]===_0x582f35[_0x577f36(0x111)])&&((_0x3843c9=_0x3e6ea9[_0x577f36(0x127)])==null?void 0x0:_0x3843c9[_0x577f36(0x166)])===_0x2a32d3[_0x577f36(0x166)];});if(!_0x5b5e78||_0x5b5e78[_0x4fcbef(0x113)][_0x4fcbef(0x161)]!==_0x217cf5[_0x4fcbef(0x168)]||!_0x22deec||_0x22deec[_0x4fcbef(0x13b)]!==_0x1e036b||!_0x3206a4)return!0x1;let _0x417c04=new _0x58319d();_0x3206a4[_0x4fcbef(0x138)]>0x0&&_0x417c04['retain'](_0x3206a4[_0x4fcbef(0x138)]),_0x417c04[_0x4fcbef(0x118)](0x1);let _0x220a25=_0x45928d[_0x4fcbef(0x115)]();return!!_0x202040['get'](_0x2b4e4)[_0x4fcbef(0x117)](_0x515ab4['id'],{'unitId':_0x2a32d3[_0x4fcbef(0x133)],'segmentId':'','historyAction':_0x4fcbef(0x164)+_0x1e036b,'actions':_0x45928d[_0x4fcbef(0x110)](_0x220a25[_0x4fcbef(0x159)](_0x417c04[_0x4fcbef(0x151)](),['body']),_0x220a25[_0x4fcbef(0x105)](['notes',_0x2a32d3[_0x4fcbef(0x166)]],_0x22deec)),'textRanges':[{'startOffset':_0x3206a4[_0x4fcbef(0x138)],'endOffset':_0x3206a4[_0x4fcbef(0x138)],'collapsed':!0x0}],'debounce':!0x1});}const M={'id':_0xc30877(0x11d),'type':_0x142f06[_0xc30877(0x147)],'handler':(_0x5362bd,_0x260229)=>A(_0x5362bd,_0x260229,'footnote')},N={'id':_0xc30877(0x10c),'type':_0x142f06[_0xc30877(0x147)],'handler':(_0x6df550,_0x1eff2d)=>j(_0x6df550,_0x1eff2d,_0xc30877(0x108))},P={'id':_0xc30877(0x125),'type':_0x142f06[_0xc30877(0x147)],'handler':(_0x40ae0c,_0x2688c8)=>A(_0x40ae0c,_0x2688c8,_0xc30877(0x10b))},F={'id':_0xc30877(0x131),'type':_0x142f06[_0xc30877(0x147)],'handler':(_0x2fb9d0,_0x11ee1c)=>j(_0x2fb9d0,_0x11ee1c,_0xc30877(0x10b))};var I=_0xc30877(0x12a),L=_0xc30877(0x15a);const R={};function z(_0x31094a,_0x15f30c){return function(_0x5d9a75,_0x56ab81){_0x15f30c(_0x5d9a75,_0x56ab81,_0x31094a);};}function B(_0x3294a7,_0x3f8675,_0x1f4499,_0x49b4c7){const _0x4a0839=_0xc30877;var _0x23665a=arguments[_0x4a0839(0x11a)],_0x560d56=_0x23665a<0x3?_0x3f8675:_0x49b4c7===null?_0x49b4c7=Object[_0x4a0839(0x152)](_0x3f8675,_0x1f4499):_0x49b4c7,_0x446d95;if(typeof Reflect==_0x4a0839(0x141)&&typeof Reflect['decorate']=='function')_0x560d56=Reflect[_0x4a0839(0x116)](_0x3294a7,_0x3f8675,_0x1f4499,_0x49b4c7);else{for(var _0x344cb0=_0x3294a7[_0x4a0839(0x11a)]-0x1;_0x344cb0>=0x0;_0x344cb0--)(_0x446d95=_0x3294a7[_0x344cb0])&&(_0x560d56=(_0x23665a<0x3?_0x446d95(_0x560d56):_0x23665a>0x3?_0x446d95(_0x3f8675,_0x1f4499,_0x560d56):_0x446d95(_0x3f8675,_0x1f4499))||_0x560d56);}return _0x23665a>0x3&&_0x560d56&&Object['defineProperty'](_0x3f8675,_0x1f4499,_0x560d56),_0x560d56;}function V(_0x1febfb){'@babel/helpers - typeof';const _0x5609cb=_0xc30877;return V=typeof Symbol==_0x5609cb(0x10d)&&typeof Symbol[_0x5609cb(0x140)]==_0x5609cb(0x14e)?function(_0x4babd2){return typeof _0x4babd2;}:function(_0x5175e5){const _0x351214=_0x5609cb;return _0x5175e5&&typeof Symbol==_0x351214(0x10d)&&_0x5175e5[_0x351214(0x134)]===Symbol&&_0x5175e5!==Symbol[_0x351214(0x14f)]?_0x351214(0x14e):typeof _0x5175e5;},V(_0x1febfb);}function H(_0x49000f,_0x43e191){const _0x2f393c=_0xc30877;if(V(_0x49000f)!='object'||!_0x49000f)return _0x49000f;var _0x5642f4=_0x49000f[Symbol[_0x2f393c(0x143)]];if(_0x5642f4!==void 0x0){var _0xb0c750=_0x5642f4[_0x2f393c(0x11f)](_0x49000f,_0x43e191||_0x2f393c(0x14a));if(V(_0xb0c750)!=_0x2f393c(0x141))return _0xb0c750;throw TypeError(_0x2f393c(0x128));}return(_0x43e191==='string'?String:Number)(_0x49000f);}function U(_0x4ae7cb){const _0x1b44bb=_0xc30877;var _0x4f0375=H(_0x4ae7cb,_0x1b44bb(0x157));return V(_0x4f0375)==_0x1b44bb(0x14e)?_0x4f0375:_0x4f0375+'';}function _0x49dd(_0x46b2b6,_0x417e2f){_0x46b2b6=_0x46b2b6-0x101;const _0x249dc5=_0x249d();let _0x49dd7a=_0x249dc5[_0x46b2b6];return _0x49dd7a;}function W(_0x534f2e,_0x10dfc6,_0x28d218){return(_0x10dfc6=U(_0x10dfc6))in _0x534f2e?Object['defineProperty'](_0x534f2e,_0x10dfc6,{'value':_0x28d218,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x534f2e[_0x10dfc6]=_0x28d218,_0x534f2e;}let G=class extends _0x507d43{constructor(_0xa74c62=R,_0x5889ac,_0x304df5,_0x530d84){const _0x39c576=_0xc30877;super(),this['_config']=_0xa74c62,this[_0x39c576(0x120)]=_0x5889ac,this[_0x39c576(0x155)]=_0x304df5,this[_0x39c576(0x11e)]=_0x530d84;let {..._0x592a61}=_0xd329bd({},R,this[_0x39c576(0x10a)]);this[_0x39c576(0x155)]['setConfig']('docs-reference.config',_0x592a61);}[_0xc30877(0x107)](){const _0x2823ac=_0xc30877;[M,N,E,P,F,D][_0x2823ac(0x162)](_0x4c8518=>this[_0x2823ac(0x15b)](this['_commandService'][_0x2823ac(0x135)](_0x4c8518)));}};W(G,_0xc30877(0x139),'UNIVER_DOCS_REFERENCE_PLUGIN'),W(G,_0xc30877(0x132),I),W(G,_0xc30877(0x137),L),W(G,_0xc30877(0x13b),_0x5625e7[_0xc30877(0x11b)]),G=B([_0x15001a(_0x4f32c6,_0x461dd7),z(0x1,_0x3d8cc(_0x49b800)),z(0x2,_0x1f1bae),z(0x3,_0x2b4e4)],G);export{F as DeleteDocumentEndnoteCommand,N as DeleteDocumentFootnoteCommand,P as InsertDocumentEndnoteCommand,M as InsertDocumentFootnoteCommand,D as SetDocumentEndnoteSettingsCommand,E as SetDocumentFootnoteSettingsCommand,G as UniverDocsReferencePlugin};
|
package/lib/facade.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0xb23a80=_0x5e4d;(function(_0x246153,_0x309dec){const _0x38d3d9=_0x5e4d,_0x375f06=_0x246153();while(!![]){try{const _0x14e8f7=-parseInt(_0x38d3d9(0x1c2))/0x1+-parseInt(_0x38d3d9(0x1b4))/0x2+parseInt(_0x38d3d9(0x1b7))/0x3+-parseInt(_0x38d3d9(0x1b9))/0x4+-parseInt(_0x38d3d9(0x1d2))/0x5+parseInt(_0x38d3d9(0x1c1))/0x6+-parseInt(_0x38d3d9(0x1c9))/0x7*(-parseInt(_0x38d3d9(0x1ba))/0x8);if(_0x14e8f7===_0x309dec)break;else _0x375f06['push'](_0x375f06['shift']());}catch(_0x2bdfdb){_0x375f06['push'](_0x375f06['shift']());}}}(_0x1ea5,0xacdd4));function _0x5e4d(_0x15023d,_0x1dd7f6){_0x15023d=_0x15023d-0x1af;const _0x1ea5a6=_0x1ea5();let _0x5e4dcb=_0x1ea5a6[_0x15023d];return _0x5e4dcb;}import{DeleteDocumentEndnoteCommand as _0x58167c,DeleteDocumentFootnoteCommand as _0x2fede9,InsertDocumentEndnoteCommand as _0x52acd0,InsertDocumentFootnoteCommand as _0x1ce3bb,SetDocumentEndnoteSettingsCommand as _0x21a887,SetDocumentFootnoteSettingsCommand as _0x25bb23}from'@univerjs-pro/docs-reference';import{CustomRangeType as _0x26d87d,ICommandService as _0x28486d,Tools as _0x1e0df7,generateRandomId as _0x446bb3}from'@univerjs/core';import{FDocument as _0x184400}from'@univerjs/docs/facade';var d=class extends _0x184400{[_0xb23a80(0x1c3)](_0x186840,_0x21f858={}){const _0x1f08e6=_0xb23a80;let _0x4e66d7=_0x446bb3(0xc);return this['_injector'][_0x1f08e6(0x1c5)](_0x28486d)[_0x1f08e6(0x1c6)](_0x1ce3bb['id'],{..._0x21f858,'unitId':this['id'],'offset':_0x186840,'noteId':_0x4e66d7})?_0x4e66d7:null;}[_0xb23a80(0x1d3)](){const _0x10fd35=_0xb23a80;var _0x424438;let _0x24ef45=this[_0x10fd35(0x1ca)]()[_0x10fd35(0x1c4)]();return(((_0x424438=_0x24ef45['body'])==null?void 0x0:_0x424438[_0x10fd35(0x1af)])??[])[_0x10fd35(0x1b2)](_0x44ef7c=>_0x44ef7c[_0x10fd35(0x1bb)]===_0x26d87d[_0x10fd35(0x1c0)])[_0x10fd35(0x1ce)]((_0x22dbc3,_0x5bb211)=>_0x22dbc3['startIndex']-_0x5bb211[_0x10fd35(0x1be)])[_0x10fd35(0x1b1)](_0x169246=>{const _0x24c05d=_0x10fd35;var _0x4d2c66,_0x463e11;let _0x494dde=(_0x4d2c66=_0x169246['properties'])==null?void 0x0:_0x4d2c66[_0x24c05d(0x1bd)],_0x25e487=typeof _0x494dde=='string'?(_0x463e11=_0x24ef45[_0x24c05d(0x1bc)])==null?void 0x0:_0x463e11[_0x494dde]:void 0x0;return _0x25e487?[_0x1e0df7[_0x24c05d(0x1d6)](_0x25e487)]:[];});}['deleteFootnote'](_0x4dcf5a){const _0x1573c0=_0xb23a80;return this['_injector'][_0x1573c0(0x1c5)](_0x28486d)[_0x1573c0(0x1c6)](_0x2fede9['id'],{'unitId':this['id'],'noteId':_0x4dcf5a});}[_0xb23a80(0x1b8)](_0xbeb023){const _0x567ea2=_0xb23a80;var _0x33632a,_0x4df251;let _0x3fbd99=this['getDocumentDataModel']()[_0x567ea2(0x1c4)](),_0x2c7456=_0xbeb023==null?(_0x33632a=_0x3fbd99[_0x567ea2(0x1cb)])==null?void 0x0:_0x33632a[_0x567ea2(0x1d1)]:(_0x4df251=_0x3fbd99[_0x567ea2(0x1b5)])==null||(_0x4df251=_0x4df251[_0x567ea2(0x1c7)])==null||(_0x4df251=_0x4df251[_0x567ea2(0x1cd)](_0x1d9674=>_0x1d9674['sectionId']===_0xbeb023))==null||(_0x4df251=_0x4df251[_0x567ea2(0x1cf)])==null?void 0x0:_0x4df251[_0x567ea2(0x1d1)];return _0x2c7456==null?void 0x0:_0x1e0df7[_0x567ea2(0x1d6)](_0x2c7456);}[_0xb23a80(0x1d4)](_0x14936d,_0x207d0e){const _0x8e6c81=_0xb23a80;return this['_injector'][_0x8e6c81(0x1c5)](_0x28486d)[_0x8e6c81(0x1c6)](_0x25bb23['id'],{'unitId':this['id'],'settings':_0x14936d,'sectionId':_0x207d0e});}['insertEndnote'](_0x2d2fe4,_0x18cd68={}){const _0x50d8fb=_0xb23a80;let _0xf119ca=_0x446bb3(0xc);return this['_injector']['get'](_0x28486d)[_0x50d8fb(0x1c6)](_0x52acd0['id'],{..._0x18cd68,'unitId':this['id'],'offset':_0x2d2fe4,'noteId':_0xf119ca})?_0xf119ca:null;}['getEndnotes'](){const _0x2a31de=_0xb23a80;var _0x56b564;let _0x38aa7f=this[_0x2a31de(0x1ca)]()['getSnapshot']();return(((_0x56b564=_0x38aa7f[_0x2a31de(0x1b5)])==null?void 0x0:_0x56b564[_0x2a31de(0x1af)])??[])[_0x2a31de(0x1b2)](_0x315c83=>_0x315c83[_0x2a31de(0x1bb)]===_0x26d87d['ENDNOTE'])['sort']((_0x34ceea,_0x114d0f)=>_0x34ceea[_0x2a31de(0x1be)]-_0x114d0f['startIndex'])['flatMap'](_0x58d026=>{const _0x50a0b9=_0x2a31de;var _0x1dcb1f,_0x3128c6;let _0x5cd801=(_0x1dcb1f=_0x58d026[_0x50a0b9(0x1d5)])==null?void 0x0:_0x1dcb1f[_0x50a0b9(0x1bd)],_0x58bdd8=typeof _0x5cd801==_0x50a0b9(0x1c8)?(_0x3128c6=_0x38aa7f[_0x50a0b9(0x1bc)])==null?void 0x0:_0x3128c6[_0x5cd801]:void 0x0;return _0x58bdd8?[_0x1e0df7['deepClone'](_0x58bdd8)]:[];});}[_0xb23a80(0x1d0)](_0x26ded8){const _0x248913=_0xb23a80;return this['_injector'][_0x248913(0x1c5)](_0x28486d)['syncExecuteCommand'](_0x58167c['id'],{'unitId':this['id'],'noteId':_0x26ded8});}[_0xb23a80(0x1cc)](_0x264806){const _0x30cdda=_0xb23a80;var _0xacde97,_0x3e1bac;let _0x4852df=this[_0x30cdda(0x1ca)]()[_0x30cdda(0x1c4)](),_0x5affe1=_0x264806==null?(_0xacde97=_0x4852df['noteSettings'])==null?void 0x0:_0xacde97[_0x30cdda(0x1b6)]:(_0x3e1bac=_0x4852df['body'])==null||(_0x3e1bac=_0x3e1bac['sectionBreaks'])==null||(_0x3e1bac=_0x3e1bac[_0x30cdda(0x1cd)](_0x39d464=>_0x39d464['sectionId']===_0x264806))==null||(_0x3e1bac=_0x3e1bac[_0x30cdda(0x1cf)])==null?void 0x0:_0x3e1bac['endnote'];return _0x5affe1==null?void 0x0:_0x1e0df7[_0x30cdda(0x1d6)](_0x5affe1);}[_0xb23a80(0x1bf)](_0x161879,_0x2a9c6b){const _0x34443d=_0xb23a80;return this[_0x34443d(0x1b0)][_0x34443d(0x1c5)](_0x28486d)[_0x34443d(0x1c6)](_0x21a887['id'],{'unitId':this['id'],'settings':_0x161879,'sectionId':_0x2a9c6b});}};_0x184400[_0xb23a80(0x1b3)](d);export{};function _0x1ea5(){const _0x58f8af=['get','syncExecuteCommand','sectionBreaks','string','20568653qrtsPw','getDocumentDataModel','noteSettings','getEndnoteSettings','find','sort','noteProperties','deleteEndnote','footnote','1741345FZLmrJ','getFootnotes','setFootnoteSettings','properties','deepClone','customRanges','_injector','flatMap','filter','extend','2413884beAFes','body','endnote','202785cKQcbA','getFootnoteSettings','1059752AQTgWI','8XRUreD','rangeType','notes','noteId','startIndex','setEndnoteSettings','FOOTNOTE','2797344RmOScK','943997oIyCkm','insertFootnote','getSnapshot'];_0x1ea5=function(){return _0x58f8af;};return _0x1ea5();}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0xc30877=_0x49dd;(function(_0x4b43cb,_0x1f723b){const _0x5f195b=_0x49dd,_0x2fd8f3=_0x4b43cb();while(!![]){try{const _0x385b24=parseInt(_0x5f195b(0x109))/0x1+-parseInt(_0x5f195b(0x144))/0x2*(-parseInt(_0x5f195b(0x13a))/0x3)+-parseInt(_0x5f195b(0x160))/0x4*(-parseInt(_0x5f195b(0x12e))/0x5)+parseInt(_0x5f195b(0x123))/0x6+-parseInt(_0x5f195b(0x136))/0x7+parseInt(_0x5f195b(0x126))/0x8*(parseInt(_0x5f195b(0x102))/0x9)+parseInt(_0x5f195b(0x14c))/0xa*(-parseInt(_0x5f195b(0x149))/0xb);if(_0x385b24===_0x1f723b)break;else _0x2fd8f3['push'](_0x2fd8f3['shift']());}catch(_0x368c73){_0x2fd8f3['push'](_0x2fd8f3['shift']());}}}(_0x249d,0xb0ac8));import{CommandType as _0x142f06,CustomRangeType as _0x582f35,DependentOn as _0x15001a,DocumentFlavor as _0x217cf5,ICommandService as _0x2b4e4,IConfigService as _0x1f1bae,IUniverInstanceService as _0xe30e64,Inject as _0x3d8cc,Injector as _0x49b800,JSONX as _0x45928d,Plugin as _0x507d43,TextX as _0x58319d,Tools as _0x31c092,UniverInstanceType as _0x5625e7,createParagraphId as _0x5bc908,createSectionId as _0x39906f,generateRandomId as _0x4d4105,merge as _0xd329bd,validateDocBodyStructure as _0x570a6a,validateDocumentStructure as _0x47a580}from'@univerjs/core';import{RichTextEditingMutation as _0x515ab4,UniverDocsPlugin as _0x461dd7}from'@univerjs/docs';import{UniverLicensePlugin as _0x4f32c6}from'@univerjs-pro/license';function C(_0xeb8fbf,_0x2a60fd,_0x45f649){const _0x36ee06=_0x49dd;if(_0xeb8fbf['position']!=null&&!(_0x2a60fd===_0x36ee06(0x108)?[_0x36ee06(0x15d),_0x36ee06(0x112)]:['docEnd','sectEnd'])[_0x36ee06(0x13f)](_0xeb8fbf['position'])||_0xeb8fbf['restart']!=null&&!(_0x2a60fd===_0x36ee06(0x108)?['continuous',_0x36ee06(0x156),'eachPage']:[_0x36ee06(0x121),'eachSect'])[_0x36ee06(0x13f)](_0xeb8fbf['restart'])||_0xeb8fbf[_0x36ee06(0x146)]!=null&&(!Number['isInteger'](_0xeb8fbf[_0x36ee06(0x146)])||_0xeb8fbf[_0x36ee06(0x146)]<0x1)||_0x36ee06(0x103)in _0xeb8fbf&&_0xeb8fbf['columnCount']!=null&&(_0x2a60fd!==_0x36ee06(0x108)||!Number[_0x36ee06(0x165)](_0xeb8fbf['columnCount'])||_0xeb8fbf['columnCount']<0x0||_0xeb8fbf[_0x36ee06(0x103)]>0x4)||_0xeb8fbf[_0x36ee06(0x148)]!=null&&(typeof _0xeb8fbf[_0x36ee06(0x148)]!=_0x36ee06(0x157)||_0xeb8fbf['numberFormat'][_0x36ee06(0x11a)]===0x0))return!0x1;for(let _0x2397a7 of[_0xeb8fbf[_0x36ee06(0x167)],_0xeb8fbf['continuationSeparator'],_0xeb8fbf[_0x36ee06(0x13c)]])if(_0x2397a7!=null&&(_0x45f649!=null||_0x570a6a(_0x2397a7)[_0x36ee06(0x11a)]>0x0))return!0x1;return!0x0;}function w(_0x40ba13,_0x5a965b,_0x32afd9){const _0xe749ba=_0x49dd;var _0x4521f2,_0x48770c;if(_0x5a965b[_0xe749ba(0x10e)]!=null&&!C(_0x5a965b[_0xe749ba(0x10e)],_0x32afd9,_0x5a965b[_0xe749ba(0x12c)]))return!0x1;let _0x14cdff=((_0x4521f2=_0x40ba13[_0xe749ba(0x13d)])==null||(_0x4521f2=_0x4521f2[_0xe749ba(0x163)])==null?void 0x0:_0x4521f2[_0xe749ba(0x15c)](_0x33acd4=>_0x33acd4[_0xe749ba(0x12c)]===_0x5a965b['sectionId']))??-0x1;if(_0x5a965b[_0xe749ba(0x12c)]!=null&&_0x14cdff<0x0)return!0x1;let _0x2627b0=_0x5a965b[_0xe749ba(0x12c)]==null?_0x40ba13['noteSettings']:(_0x48770c=_0x40ba13[_0xe749ba(0x13d)])==null||(_0x48770c=_0x48770c['sectionBreaks'])==null?void 0x0:_0x48770c[_0x14cdff][_0xe749ba(0x12f)],_0x2b4148=_0x5a965b['settings']==null?void 0x0:_0x31c092['deepClone'](_0x5a965b[_0xe749ba(0x10e)]),_0x439f9e=_0x5a965b[_0xe749ba(0x12c)]==null?[_0xe749ba(0x129)]:[_0xe749ba(0x13d),_0xe749ba(0x163),_0x14cdff,_0xe749ba(0x12f)],_0x19477d=_0x45928d[_0xe749ba(0x115)](),_0xf8e8c5=null;if(_0x31c092['diffValue'](_0x2627b0==null?void 0x0:_0x2627b0[_0x32afd9],_0x2b4148)||(_0xf8e8c5=_0x2627b0==null?_0x19477d[_0xe749ba(0x106)](_0x439f9e,{[_0x32afd9]:_0x2b4148}):_0x5a965b[_0xe749ba(0x12c)]!=null&&_0x2b4148==null&&Object[_0xe749ba(0x13e)](_0x2627b0)['every'](_0x542ac2=>_0x542ac2===_0x32afd9)?_0x19477d[_0xe749ba(0x105)](_0x439f9e,_0x2627b0):_0x19477d[_0xe749ba(0x153)]([..._0x439f9e,_0x32afd9],_0x2627b0[_0x32afd9],_0x2b4148)),_0x5a965b[_0xe749ba(0x101)]!=null){var _0x2415ee;if(_0x32afd9!==_0xe749ba(0x10b)||_0x5a965b[_0xe749ba(0x12c)]==null||typeof _0x5a965b[_0xe749ba(0x101)]!=_0xe749ba(0x122))return!0x1;let _0x45110c=(_0x2415ee=_0x40ba13['body'])==null||(_0x2415ee=_0x2415ee[_0xe749ba(0x163)])==null?void 0x0:_0x2415ee[_0x14cdff][_0xe749ba(0x101)];_0x45110c!==_0x5a965b['suppressEndnotes']&&(_0xf8e8c5=_0x45928d[_0xe749ba(0x110)](_0xf8e8c5,_0x19477d[_0xe749ba(0x153)]([_0xe749ba(0x13d),_0xe749ba(0x163),_0x14cdff,_0xe749ba(0x101)],_0x45110c,_0x5a965b[_0xe749ba(0x101)])));}return _0xf8e8c5;}function T(_0x15ffa1,_0x5a2dc7,_0x345299){const _0x56af73=_0x49dd;if(!_0x5a2dc7)return!0x1;let _0xcaddca=_0x15ffa1[_0x56af73(0x145)](_0xe30e64)[_0x56af73(0x124)](_0x5a2dc7[_0x56af73(0x133)],_0x5625e7[_0x56af73(0x11b)]),_0x332f9f=_0xcaddca==null?void 0x0:_0xcaddca['getSnapshot']();if(!_0x332f9f||_0x332f9f[_0x56af73(0x113)][_0x56af73(0x161)]!==_0x217cf5['TRADITIONAL'])return!0x1;let _0x1b2a8f=w(_0x332f9f,_0x5a2dc7,_0x345299);return _0x1b2a8f===!0x1||_0x45928d[_0x56af73(0x15e)](_0x1b2a8f)?!0x1:!!_0x15ffa1['get'](_0x2b4e4)[_0x56af73(0x117)](_0x515ab4['id'],{'unitId':_0x5a2dc7['unitId'],'segmentId':'','historyAction':'set-'+_0x345299+'-settings','actions':_0x1b2a8f,'textRanges':null,'noNeedSetTextRange':!0x0,'isEditing':!0x1,'debounce':!0x1});}const E={'id':_0xc30877(0x158),'type':_0x142f06[_0xc30877(0x147)],'handler':(_0xd37ac7,_0x33893f)=>T(_0xd37ac7,_0x33893f,_0xc30877(0x108))},D={'id':'doc.command.set-endnote-settings','type':_0x142f06[_0xc30877(0x147)],'handler':(_0x5aa1f1,_0x440bc9)=>T(_0x5aa1f1,_0x440bc9,'endnote')};function O(_0x2bc780,_0x2d18be){const _0x2249fb=_0xc30877;return(_0x2bc780==null?void 0x0:_0x2bc780['documentStyle'][_0x2249fb(0x161)])===_0x217cf5[_0x2249fb(0x168)]&&!!_0x2bc780[_0x2249fb(0x13d)]&&Number['isInteger'](_0x2d18be)&&_0x2d18be>=0x0&&_0x2d18be<_0x2bc780['body']['dataStream'][_0x2249fb(0x11a)]-0x1;}function _0x249d(){const _0x22631c=['registerCommand','6630386dWlxKM','version','startIndex','pluginName','3NQBLVW','type','continuationNotice','body','keys','includes','iterator','object','retain','toPrimitive','1972914VdVTQy','get','startNumber','COMMAND','numberFormat','11ueaBmD','default','headers','17826070PKbPpJ','find','symbol','prototype','customRanges','serialize','getOwnPropertyDescriptor','replaceOp','segmentId','_configService','eachSect','string','doc.command.set-footnote-settings','editOp','1.0.0-rc.0','disposeWithMe','findIndex','pageBottom','isNoop','lists','3764slAMGI','documentFlavor','forEach','sectionBreaks','delete-','isInteger','noteId','separator','TRADITIONAL','suppressEndnotes','11268WseeXC','columnCount','notes','removeOp','insertOp','onStarting','footnote','359307MZTURX','_config','endnote','doc.command.delete-footnote','function','settings','deepClone','compose','ENDNOTE','beneathText','documentStyle','insert','getInstance','decorate','syncExecuteCommand','delete','footers','length','UNIVER_DOC','FOOTNOTE','doc.command.insert-footnote','_commandService','call','_injector','continuous','boolean','4779030gMLeRQ','getUnit','doc.command.insert-endnote','3568UHfpSY','properties','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','noteSettings','@univerjs-pro/docs-reference','drawings','sectionId','referenceTextStyle','4000SFdeij','noteProperties','rangeType','doc.command.delete-endnote','packageName','unitId','constructor'];_0x249d=function(){return _0x22631c;};return _0x249d();}function k(_0x5ce2d6,_0x437df6,_0x2ad0fc){const _0x2dc322=_0xc30877;var _0x309132,_0x3ea3eb;if(_0x437df6[_0x2dc322(0x10e)]===void 0x0&&_0x437df6[_0x2dc322(0x101)]===void 0x0)return null;let _0x849530=_0x437df6['sectionId']==null?(_0x309132=_0x5ce2d6[_0x2dc322(0x129)])==null?void 0x0:_0x309132[_0x2ad0fc]:(_0x3ea3eb=_0x5ce2d6[_0x2dc322(0x13d)])==null||(_0x3ea3eb=_0x3ea3eb[_0x2dc322(0x163)])==null||(_0x3ea3eb=_0x3ea3eb[_0x2dc322(0x14d)](_0x22caae=>_0x22caae['sectionId']===_0x437df6['sectionId']))==null||(_0x3ea3eb=_0x3ea3eb[_0x2dc322(0x12f)])==null?void 0x0:_0x3ea3eb[_0x2ad0fc];return w(_0x5ce2d6,{'settings':_0x437df6[_0x2dc322(0x10e)]===void 0x0?_0x849530??null:_0x437df6[_0x2dc322(0x10e)],'sectionId':_0x437df6['sectionId'],'suppressEndnotes':_0x437df6[_0x2dc322(0x101)]},_0x2ad0fc);}function A(_0x725072,_0x1c06c5,_0x1069da){const _0x68d5b5=_0xc30877;var _0x2748ed,_0xc4371,_0x345808;if(!_0x1c06c5||_0x1c06c5[_0x68d5b5(0x154)])return!0x1;let _0x3bfb03=_0x725072[_0x68d5b5(0x145)](_0xe30e64)[_0x68d5b5(0x124)](_0x1c06c5['unitId'],_0x5625e7['UNIVER_DOC']),_0x595f1c=_0x3bfb03==null?void 0x0:_0x3bfb03['getSnapshot'](),{offset:_0x32a897}=_0x1c06c5;if(!O(_0x595f1c,_0x32a897))return!0x1;let _0x2c7b9c=k(_0x595f1c,_0x1c06c5,_0x1069da);if(_0x2c7b9c===!0x1)return!0x1;let _0x3d933d=_0x1c06c5[_0x68d5b5(0x166)]??_0x4d4105(0xc);if((_0x2748ed=_0x595f1c[_0x68d5b5(0x104)])!=null&&_0x2748ed[_0x3d933d]||(_0xc4371=_0x595f1c[_0x68d5b5(0x14b)])!=null&&_0xc4371[_0x3d933d]||(_0x345808=_0x595f1c[_0x68d5b5(0x119)])!=null&&_0x345808[_0x3d933d])return!0x1;let _0x285ee8=_0x31c092[_0x68d5b5(0x10f)]({'type':_0x1069da,'noteId':_0x3d933d,'body':_0x1c06c5[_0x68d5b5(0x13d)]??{'dataStream':'\x0d\x0a','paragraphs':[{'paragraphId':_0x5bc908(new Set()),'startIndex':0x0}],'sectionBreaks':[{'sectionId':_0x39906f(new Set()),'startIndex':0x1}]},'customMark':_0x1c06c5['customMark'],'referenceTextStyle':_0x1c06c5[_0x68d5b5(0x12d)],'tableSource':_0x1c06c5['tableSource'],'drawings':_0x1c06c5[_0x68d5b5(0x12b)],'drawingsOrder':_0x1c06c5['drawingsOrder'],'lists':_0x1c06c5[_0x68d5b5(0x15f)]});if(_0x47a580({'notes':{[_0x3d933d]:_0x285ee8}})[_0x68d5b5(0x11a)]>0x0)return!0x1;let _0x4a688e=new _0x58319d();_0x32a897>0x0&&_0x4a688e[_0x68d5b5(0x142)](_0x32a897),_0x4a688e[_0x68d5b5(0x114)](0x1,{'dataStream':'','customRanges':[{'rangeType':_0x1069da===_0x68d5b5(0x108)?_0x582f35['FOOTNOTE']:_0x582f35[_0x68d5b5(0x111)],'rangeId':_0x4d4105(0xc),'startIndex':0x0,'endIndex':0x0,'wholeEntity':!0x0,'properties':{'noteId':_0x3d933d}}]});let _0x166eeb=_0x45928d[_0x68d5b5(0x115)](),_0x4942ae=_0x595f1c['notes']==null?_0x166eeb['insertOp'](['notes'],{[_0x3d933d]:_0x285ee8}):_0x166eeb[_0x68d5b5(0x106)]([_0x68d5b5(0x104),_0x3d933d],_0x285ee8);return!!_0x725072[_0x68d5b5(0x145)](_0x2b4e4)['syncExecuteCommand'](_0x515ab4['id'],{'unitId':_0x1c06c5[_0x68d5b5(0x133)],'segmentId':'','historyAction':'insert-'+_0x1069da,'actions':_0x45928d[_0x68d5b5(0x110)](_0x45928d[_0x68d5b5(0x110)](_0x2c7b9c,_0x4942ae),_0x166eeb[_0x68d5b5(0x159)](_0x4a688e[_0x68d5b5(0x151)](),[_0x68d5b5(0x13d)])),'textRanges':[{'segmentId':_0x3d933d,'startOffset':0x0,'endOffset':0x0,'collapsed':!0x0}],'debounce':!0x1});}function j(_0x202040,_0x2a32d3,_0x1e036b){const _0x4fcbef=_0xc30877;var _0x28108a,_0x482db9;if(!_0x2a32d3)return!0x1;let _0x101704=_0x202040[_0x4fcbef(0x145)](_0xe30e64)['getUnit'](_0x2a32d3[_0x4fcbef(0x133)],_0x5625e7[_0x4fcbef(0x11b)]),_0x5b5e78=_0x101704==null?void 0x0:_0x101704['getSnapshot'](),_0x22deec=_0x5b5e78==null||(_0x28108a=_0x5b5e78['notes'])==null?void 0x0:_0x28108a[_0x2a32d3['noteId']],_0x3206a4=_0x5b5e78==null||(_0x482db9=_0x5b5e78['body'])==null||(_0x482db9=_0x482db9[_0x4fcbef(0x150)])==null?void 0x0:_0x482db9[_0x4fcbef(0x14d)](_0x3e6ea9=>{const _0x577f36=_0x4fcbef;var _0x3843c9;return(_0x3e6ea9[_0x577f36(0x130)]===_0x582f35[_0x577f36(0x11c)]||_0x3e6ea9[_0x577f36(0x130)]===_0x582f35[_0x577f36(0x111)])&&((_0x3843c9=_0x3e6ea9[_0x577f36(0x127)])==null?void 0x0:_0x3843c9[_0x577f36(0x166)])===_0x2a32d3[_0x577f36(0x166)];});if(!_0x5b5e78||_0x5b5e78[_0x4fcbef(0x113)][_0x4fcbef(0x161)]!==_0x217cf5[_0x4fcbef(0x168)]||!_0x22deec||_0x22deec[_0x4fcbef(0x13b)]!==_0x1e036b||!_0x3206a4)return!0x1;let _0x417c04=new _0x58319d();_0x3206a4[_0x4fcbef(0x138)]>0x0&&_0x417c04['retain'](_0x3206a4[_0x4fcbef(0x138)]),_0x417c04[_0x4fcbef(0x118)](0x1);let _0x220a25=_0x45928d[_0x4fcbef(0x115)]();return!!_0x202040['get'](_0x2b4e4)[_0x4fcbef(0x117)](_0x515ab4['id'],{'unitId':_0x2a32d3[_0x4fcbef(0x133)],'segmentId':'','historyAction':_0x4fcbef(0x164)+_0x1e036b,'actions':_0x45928d[_0x4fcbef(0x110)](_0x220a25[_0x4fcbef(0x159)](_0x417c04[_0x4fcbef(0x151)](),['body']),_0x220a25[_0x4fcbef(0x105)](['notes',_0x2a32d3[_0x4fcbef(0x166)]],_0x22deec)),'textRanges':[{'startOffset':_0x3206a4[_0x4fcbef(0x138)],'endOffset':_0x3206a4[_0x4fcbef(0x138)],'collapsed':!0x0}],'debounce':!0x1});}const M={'id':_0xc30877(0x11d),'type':_0x142f06[_0xc30877(0x147)],'handler':(_0x5362bd,_0x260229)=>A(_0x5362bd,_0x260229,'footnote')},N={'id':_0xc30877(0x10c),'type':_0x142f06[_0xc30877(0x147)],'handler':(_0x6df550,_0x1eff2d)=>j(_0x6df550,_0x1eff2d,_0xc30877(0x108))},P={'id':_0xc30877(0x125),'type':_0x142f06[_0xc30877(0x147)],'handler':(_0x40ae0c,_0x2688c8)=>A(_0x40ae0c,_0x2688c8,_0xc30877(0x10b))},F={'id':_0xc30877(0x131),'type':_0x142f06[_0xc30877(0x147)],'handler':(_0x2fb9d0,_0x11ee1c)=>j(_0x2fb9d0,_0x11ee1c,_0xc30877(0x10b))};var I=_0xc30877(0x12a),L=_0xc30877(0x15a);const R={};function z(_0x31094a,_0x15f30c){return function(_0x5d9a75,_0x56ab81){_0x15f30c(_0x5d9a75,_0x56ab81,_0x31094a);};}function B(_0x3294a7,_0x3f8675,_0x1f4499,_0x49b4c7){const _0x4a0839=_0xc30877;var _0x23665a=arguments[_0x4a0839(0x11a)],_0x560d56=_0x23665a<0x3?_0x3f8675:_0x49b4c7===null?_0x49b4c7=Object[_0x4a0839(0x152)](_0x3f8675,_0x1f4499):_0x49b4c7,_0x446d95;if(typeof Reflect==_0x4a0839(0x141)&&typeof Reflect['decorate']=='function')_0x560d56=Reflect[_0x4a0839(0x116)](_0x3294a7,_0x3f8675,_0x1f4499,_0x49b4c7);else{for(var _0x344cb0=_0x3294a7[_0x4a0839(0x11a)]-0x1;_0x344cb0>=0x0;_0x344cb0--)(_0x446d95=_0x3294a7[_0x344cb0])&&(_0x560d56=(_0x23665a<0x3?_0x446d95(_0x560d56):_0x23665a>0x3?_0x446d95(_0x3f8675,_0x1f4499,_0x560d56):_0x446d95(_0x3f8675,_0x1f4499))||_0x560d56);}return _0x23665a>0x3&&_0x560d56&&Object['defineProperty'](_0x3f8675,_0x1f4499,_0x560d56),_0x560d56;}function V(_0x1febfb){'@babel/helpers - typeof';const _0x5609cb=_0xc30877;return V=typeof Symbol==_0x5609cb(0x10d)&&typeof Symbol[_0x5609cb(0x140)]==_0x5609cb(0x14e)?function(_0x4babd2){return typeof _0x4babd2;}:function(_0x5175e5){const _0x351214=_0x5609cb;return _0x5175e5&&typeof Symbol==_0x351214(0x10d)&&_0x5175e5[_0x351214(0x134)]===Symbol&&_0x5175e5!==Symbol[_0x351214(0x14f)]?_0x351214(0x14e):typeof _0x5175e5;},V(_0x1febfb);}function H(_0x49000f,_0x43e191){const _0x2f393c=_0xc30877;if(V(_0x49000f)!='object'||!_0x49000f)return _0x49000f;var _0x5642f4=_0x49000f[Symbol[_0x2f393c(0x143)]];if(_0x5642f4!==void 0x0){var _0xb0c750=_0x5642f4[_0x2f393c(0x11f)](_0x49000f,_0x43e191||_0x2f393c(0x14a));if(V(_0xb0c750)!=_0x2f393c(0x141))return _0xb0c750;throw TypeError(_0x2f393c(0x128));}return(_0x43e191==='string'?String:Number)(_0x49000f);}function U(_0x4ae7cb){const _0x1b44bb=_0xc30877;var _0x4f0375=H(_0x4ae7cb,_0x1b44bb(0x157));return V(_0x4f0375)==_0x1b44bb(0x14e)?_0x4f0375:_0x4f0375+'';}function _0x49dd(_0x46b2b6,_0x417e2f){_0x46b2b6=_0x46b2b6-0x101;const _0x249dc5=_0x249d();let _0x49dd7a=_0x249dc5[_0x46b2b6];return _0x49dd7a;}function W(_0x534f2e,_0x10dfc6,_0x28d218){return(_0x10dfc6=U(_0x10dfc6))in _0x534f2e?Object['defineProperty'](_0x534f2e,_0x10dfc6,{'value':_0x28d218,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x534f2e[_0x10dfc6]=_0x28d218,_0x534f2e;}let G=class extends _0x507d43{constructor(_0xa74c62=R,_0x5889ac,_0x304df5,_0x530d84){const _0x39c576=_0xc30877;super(),this['_config']=_0xa74c62,this[_0x39c576(0x120)]=_0x5889ac,this[_0x39c576(0x155)]=_0x304df5,this[_0x39c576(0x11e)]=_0x530d84;let {..._0x592a61}=_0xd329bd({},R,this[_0x39c576(0x10a)]);this[_0x39c576(0x155)]['setConfig']('docs-reference.config',_0x592a61);}[_0xc30877(0x107)](){const _0x2823ac=_0xc30877;[M,N,E,P,F,D][_0x2823ac(0x162)](_0x4c8518=>this[_0x2823ac(0x15b)](this['_commandService'][_0x2823ac(0x135)](_0x4c8518)));}};W(G,_0xc30877(0x139),'UNIVER_DOCS_REFERENCE_PLUGIN'),W(G,_0xc30877(0x132),I),W(G,_0xc30877(0x137),L),W(G,_0xc30877(0x13b),_0x5625e7[_0xc30877(0x11b)]),G=B([_0x15001a(_0x4f32c6,_0x461dd7),z(0x1,_0x3d8cc(_0x49b800)),z(0x2,_0x1f1bae),z(0x3,_0x2b4e4)],G);export{F as DeleteDocumentEndnoteCommand,N as DeleteDocumentFootnoteCommand,P as InsertDocumentEndnoteCommand,M as InsertDocumentFootnoteCommand,D as SetDocumentEndnoteSettingsCommand,E as SetDocumentFootnoteSettingsCommand,G as UniverDocsReferencePlugin};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { ICommand, IDocumentNote, IEndnoteSettings, IFootnoteSettings } from '@univerjs/core';
|
|
17
|
+
export interface IInsertDocumentFootnoteCommandParams extends Partial<Omit<IDocumentNote, 'noteId' | 'type'>> {
|
|
18
|
+
unitId: string;
|
|
19
|
+
/** UTF-16 offset in the main document body. */
|
|
20
|
+
offset: number;
|
|
21
|
+
segmentId?: string;
|
|
22
|
+
noteId?: string;
|
|
23
|
+
/** Apply numbering/layout settings atomically with the new note. Omit to retain existing settings. */
|
|
24
|
+
settings?: IFootnoteSettings | IEndnoteSettings | null;
|
|
25
|
+
/** Scope of settings; omitted for document defaults. */
|
|
26
|
+
sectionId?: string;
|
|
27
|
+
/** Only valid for an endnote with an explicit sectionId. */
|
|
28
|
+
suppressEndnotes?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface IDeleteDocumentFootnoteCommandParams {
|
|
31
|
+
unitId: string;
|
|
32
|
+
noteId: string;
|
|
33
|
+
}
|
|
34
|
+
export declare const InsertDocumentFootnoteCommand: ICommand<IInsertDocumentFootnoteCommandParams>;
|
|
35
|
+
export declare const DeleteDocumentFootnoteCommand: ICommand<IDeleteDocumentFootnoteCommandParams>;
|
|
36
|
+
export declare const InsertDocumentEndnoteCommand: ICommand<IInsertDocumentFootnoteCommandParams>;
|
|
37
|
+
export declare const DeleteDocumentEndnoteCommand: ICommand<IDeleteDocumentFootnoteCommandParams>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { DocumentNoteType, ICommand, IDocumentData, IEndnoteSettings, IFootnoteSettings, JSONXActions } from '@univerjs/core';
|
|
17
|
+
export interface ISetDocumentFootnoteSettingsCommandParams {
|
|
18
|
+
unitId: string;
|
|
19
|
+
/** Omit for document defaults. A section supports numbering, position and columns only. */
|
|
20
|
+
sectionId?: string;
|
|
21
|
+
/** Endnotes only: defer this section’s notes to the next section that permits them. */
|
|
22
|
+
suppressEndnotes?: boolean;
|
|
23
|
+
/** Replaces the explicit settings; null restores the document/Word defaults. */
|
|
24
|
+
settings: IFootnoteSettings | IEndnoteSettings | null;
|
|
25
|
+
}
|
|
26
|
+
export declare function isValidNoteSettings(settings: IFootnoteSettings | IEndnoteSettings, type: DocumentNoteType, sectionId?: string): boolean;
|
|
27
|
+
export declare function buildNoteSettingsAction(snapshot: IDocumentData, params: Omit<ISetDocumentFootnoteSettingsCommandParams, 'unitId'>, type: DocumentNoteType): JSONXActions | false;
|
|
28
|
+
export declare const SetDocumentFootnoteSettingsCommand: ICommand<ISetDocumentFootnoteSettingsCommandParams>;
|
|
29
|
+
export declare const SetDocumentEndnoteSettingsCommand: ICommand<ISetDocumentFootnoteSettingsCommandParams>;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { IDocumentNote, IEndnoteSettings, IFootnoteSettings } from '@univerjs/core';
|
|
2
|
+
import { FDocument } from '@univerjs/docs/facade';
|
|
3
|
+
export interface IFDocumentReferenceMixin {
|
|
4
|
+
/**
|
|
5
|
+
* Inserts a traditional-document footnote at a UTF-16 body offset and selects its content.
|
|
6
|
+
* The reference and rich content share one undo/collaboration mutation. Returns null
|
|
7
|
+
* for a modern document, an invalid position/content, or insufficient edit permission.
|
|
8
|
+
* @param {number} offset Position in the main body, including structural tokens.
|
|
9
|
+
* @param {Partial<Omit<IDocumentNote, 'noteId' | 'type'>>} content Optional paragraphs, inline drawings, tables and custom mark.
|
|
10
|
+
* @returns {string | null} Stable segment id, usable with getTextRange and getParagraphs.
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const document = univerAPI.getActiveDocument();
|
|
14
|
+
* const id = document?.insertFootnote(5, {
|
|
15
|
+
* body: { dataStream: 'Source details\r\n', paragraphs: [{ startIndex: 14 }] },
|
|
16
|
+
* });
|
|
17
|
+
* if (id) console.log(document.getParagraphs(id));
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
insertFootnote(offset: number, content?: Partial<Omit<IDocumentNote, 'noteId' | 'type'>>): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Returns detached note data in reference order. Automatic labels depend on layout
|
|
23
|
+
* when numbering restarts on each page; the persisted segment id remains stable.
|
|
24
|
+
* @returns {IDocumentNote[]} Notes referenced by the main body.
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* console.log(univerAPI.getActiveDocument()?.getFootnotes());
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
getFootnotes(): IDocumentNote[];
|
|
31
|
+
/**
|
|
32
|
+
* Removes a footnote together with its body reference. Supports undo and collaboration.
|
|
33
|
+
* @param {string} noteId Stable segment id returned by insertFootnote or getFootnotes.
|
|
34
|
+
* @returns {boolean} Whether the deletion was applied.
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const document = univerAPI.getActiveDocument();
|
|
38
|
+
* const note = document?.getFootnotes()[0];
|
|
39
|
+
* if (note) document.deleteFootnote(note.noteId);
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
deleteFootnote(noteId: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Reads explicit document defaults or a section override, without expanding inherited values.
|
|
45
|
+
* @param {string} sectionId Optional stable section id.
|
|
46
|
+
* @returns {IFootnoteSettings | undefined} Detached explicit settings, or undefined if absent.
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* console.log(univerAPI.getActiveDocument()?.getFootnoteSettings());
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
getFootnoteSettings(sectionId?: string): IFootnoteSettings | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Replaces explicit footnote settings; null restores inherited defaults. Section overrides
|
|
55
|
+
* support position, columns and numbering. Separator bodies belong to document defaults.
|
|
56
|
+
* @param {IFootnoteSettings | null} settings Replacement settings or null to reset.
|
|
57
|
+
* @param {string} sectionId Optional stable section id.
|
|
58
|
+
* @returns {boolean} Whether the settings changed.
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* univerAPI.getActiveDocument()?.setFootnoteSettings({
|
|
62
|
+
* position: 'pageBottom', columnCount: 2, numberFormat: 'decimal',
|
|
63
|
+
* startNumber: 1, restart: 'eachSect',
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
setFootnoteSettings(settings: IFootnoteSettings | null, sectionId?: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Inserts an endnote with its body reference as one undoable change.
|
|
70
|
+
* @param {number} offset UTF-16 body offset.
|
|
71
|
+
* @param {Partial<Omit<IDocumentNote, 'noteId' | 'type'>>} content Optional rich content and custom mark.
|
|
72
|
+
* @returns {string | null} Stable note segment id, or null when insertion is rejected.
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const id = univerAPI.getActiveDocument()?.insertEndnote(5);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
insertEndnote(offset: number, content?: Partial<Omit<IDocumentNote, 'noteId' | 'type'>>): string | null;
|
|
79
|
+
/**
|
|
80
|
+
* Returns detached endnotes in body reference order.
|
|
81
|
+
* @returns {IDocumentNote[]} Endnote data.
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* console.log(univerAPI.getActiveDocument()?.getEndnotes());
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
getEndnotes(): IDocumentNote[];
|
|
88
|
+
/**
|
|
89
|
+
* Removes an endnote and its body reference; supports undo and collaboration.
|
|
90
|
+
* @param {string} noteId Stable endnote segment id.
|
|
91
|
+
* @returns {boolean} Whether deletion succeeded.
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* const document = univerAPI.getActiveDocument();
|
|
95
|
+
* const note = document?.getEndnotes()[0];
|
|
96
|
+
* if (note) document.deleteEndnote(note.noteId);
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
deleteEndnote(noteId: string): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Returns explicit document settings or section overrides.
|
|
102
|
+
* @param {string} sectionId Optional section id.
|
|
103
|
+
* @returns {IEndnoteSettings | undefined} Detached explicit settings.
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* console.log(univerAPI.getActiveDocument()?.getEndnoteSettings());
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
getEndnoteSettings(sectionId?: string): IEndnoteSettings | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Replaces endnote settings; null restores inherited defaults.
|
|
112
|
+
* @param {IEndnoteSettings | null} settings Endnote settings or null.
|
|
113
|
+
* @param {string} sectionId Optional section id.
|
|
114
|
+
* @returns {boolean} Whether settings changed.
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* univerAPI.getActiveDocument()?.setEndnoteSettings({ position: 'sectEnd', restart: 'eachSect' });
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
setEndnoteSettings(settings: IEndnoteSettings | null, sectionId?: string): boolean;
|
|
121
|
+
}
|
|
122
|
+
export declare class FDocumentReferenceMixin extends FDocument implements IFDocumentReferenceMixin {
|
|
123
|
+
insertFootnote(offset: number, content?: Partial<Omit<IDocumentNote, 'noteId' | 'type'>>): string | null;
|
|
124
|
+
getFootnotes(): IDocumentNote[];
|
|
125
|
+
deleteFootnote(noteId: string): boolean;
|
|
126
|
+
getFootnoteSettings(sectionId?: string): IFootnoteSettings | undefined;
|
|
127
|
+
setFootnoteSettings(settings: IFootnoteSettings | null, sectionId?: string): boolean;
|
|
128
|
+
insertEndnote(offset: number, content?: Partial<Omit<IDocumentNote, 'noteId' | 'type'>>): string | null;
|
|
129
|
+
getEndnotes(): IDocumentNote[];
|
|
130
|
+
deleteEndnote(noteId: string): boolean;
|
|
131
|
+
getEndnoteSettings(sectionId?: string): IEndnoteSettings | undefined;
|
|
132
|
+
setEndnoteSettings(settings: IEndnoteSettings | null, sectionId?: string): boolean;
|
|
133
|
+
}
|
|
134
|
+
declare module '@univerjs/docs/facade' {
|
|
135
|
+
interface FDocument extends IFDocumentReferenceMixin {
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { IDeleteDocumentFootnoteCommandParams, IInsertDocumentFootnoteCommandParams } from './commands/commands/document-footnote.command';
|
|
2
|
+
export { DeleteDocumentEndnoteCommand, DeleteDocumentFootnoteCommand, InsertDocumentEndnoteCommand, InsertDocumentFootnoteCommand } from './commands/commands/document-footnote.command';
|
|
3
|
+
export type { ISetDocumentFootnoteSettingsCommandParams } from './commands/commands/set-document-footnote-settings.command';
|
|
4
|
+
export { SetDocumentEndnoteSettingsCommand, SetDocumentFootnoteSettingsCommand } from './commands/commands/set-document-footnote-settings.command';
|
|
5
|
+
export { UniverDocsReferencePlugin } from './plugin';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IUniverDocsReferenceConfig } from './config/config';
|
|
2
|
+
import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
|
+
export declare class UniverDocsReferencePlugin extends Plugin {
|
|
4
|
+
private readonly _config;
|
|
5
|
+
readonly _injector: Injector;
|
|
6
|
+
private readonly _configService;
|
|
7
|
+
private readonly _commandService;
|
|
8
|
+
static pluginName: string;
|
|
9
|
+
static packageName: string;
|
|
10
|
+
static version: string;
|
|
11
|
+
static type: UniverInstanceType;
|
|
12
|
+
constructor(_config: IUniverDocsReferenceConfig | undefined, _injector: Injector, _configService: IConfigService, _commandService: ICommandService);
|
|
13
|
+
onStarting(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x4e8b(_0x3aeb22,_0x329fa8){_0x3aeb22=_0x3aeb22-0x181;const _0x5195c8=_0x5195();let _0x4e8bd0=_0x5195c8[_0x3aeb22];return _0x4e8bd0;}(function(_0x305b4f,_0x4d98f3){const _0x4f3052=_0x4e8b,_0x58f57c=_0x305b4f();while(!![]){try{const _0x829b4e=parseInt(_0x4f3052(0x19c))/0x1*(-parseInt(_0x4f3052(0x199))/0x2)+-parseInt(_0x4f3052(0x1b6))/0x3*(parseInt(_0x4f3052(0x190))/0x4)+-parseInt(_0x4f3052(0x198))/0x5+parseInt(_0x4f3052(0x19e))/0x6+-parseInt(_0x4f3052(0x196))/0x7*(parseInt(_0x4f3052(0x1a1))/0x8)+-parseInt(_0x4f3052(0x184))/0x9*(-parseInt(_0x4f3052(0x18a))/0xa)+parseInt(_0x4f3052(0x1bb))/0xb;if(_0x829b4e===_0x4d98f3)break;else _0x58f57c['push'](_0x58f57c['shift']());}catch(_0x3072ef){_0x58f57c['push'](_0x58f57c['shift']());}}}(_0x5195,0x65713),function(_0x15ef59,_0x4bf9d9){const _0x2a47eb=_0x4e8b;typeof exports==_0x2a47eb(0x1af)&&typeof module<'u'?_0x4bf9d9(require('@univerjs-pro/docs-reference'),require('@univerjs/core'),require('@univerjs/docs/facade')):typeof define==_0x2a47eb(0x1b0)&&define[_0x2a47eb(0x1b2)]?define([_0x2a47eb(0x18d),_0x2a47eb(0x191),_0x2a47eb(0x192)],_0x4bf9d9):(_0x15ef59=typeof globalThis<'u'?globalThis:_0x15ef59||self,_0x4bf9d9(_0x15ef59['UniverProDocsReference'],_0x15ef59[_0x2a47eb(0x188)],_0x15ef59[_0x2a47eb(0x194)]));}(this,function(_0x4a1a80,_0x59d53d,_0x337bb8){const _0x3ce987=_0x4e8b;var _0x209894=class extends _0x337bb8[_0x3ce987(0x19d)]{[_0x3ce987(0x186)](_0x5e6e31,_0xb4bfbf={}){const _0x2d6604=_0x3ce987;let _0x10b4da=(0x0,_0x59d53d['generateRandomId'])(0xc);return this[_0x2d6604(0x18c)][_0x2d6604(0x182)](_0x59d53d[_0x2d6604(0x1b1)])[_0x2d6604(0x1b7)](_0x4a1a80[_0x2d6604(0x1ab)]['id'],{..._0xb4bfbf,'unitId':this['id'],'offset':_0x5e6e31,'noteId':_0x10b4da})?_0x10b4da:null;}['getFootnotes'](){const _0x171f26=_0x3ce987;var _0x5ab2a5;let _0x59e648=this[_0x171f26(0x19a)]()['getSnapshot']();return(((_0x5ab2a5=_0x59e648[_0x171f26(0x19b)])==null?void 0x0:_0x5ab2a5[_0x171f26(0x1a8)])??[])[_0x171f26(0x187)](_0x26d786=>_0x26d786[_0x171f26(0x18f)]===_0x59d53d[_0x171f26(0x1b3)]['FOOTNOTE'])[_0x171f26(0x193)]((_0xa1ab2d,_0x54f8e9)=>_0xa1ab2d[_0x171f26(0x1a0)]-_0x54f8e9[_0x171f26(0x1a0)])['flatMap'](_0xaf1360=>{const _0x2519f3=_0x171f26;var _0x1a13e7,_0x3ba889;let _0x32eaf1=(_0x1a13e7=_0xaf1360['properties'])==null?void 0x0:_0x1a13e7['noteId'],_0x107b71=typeof _0x32eaf1==_0x2519f3(0x1b4)?(_0x3ba889=_0x59e648['notes'])==null?void 0x0:_0x3ba889[_0x32eaf1]:void 0x0;return _0x107b71?[_0x59d53d[_0x2519f3(0x1ae)]['deepClone'](_0x107b71)]:[];});}[_0x3ce987(0x189)](_0x2ebce5){const _0x3bd47e=_0x3ce987;return this[_0x3bd47e(0x18c)][_0x3bd47e(0x182)](_0x59d53d[_0x3bd47e(0x1b1)])[_0x3bd47e(0x1b7)](_0x4a1a80[_0x3bd47e(0x197)]['id'],{'unitId':this['id'],'noteId':_0x2ebce5});}[_0x3ce987(0x18b)](_0x1c6375){const _0x10573f=_0x3ce987;var _0x349a31,_0x1b3f47;let _0x57625c=this[_0x10573f(0x19a)]()[_0x10573f(0x1b9)](),_0x328c28=_0x1c6375==null?(_0x349a31=_0x57625c[_0x10573f(0x195)])==null?void 0x0:_0x349a31[_0x10573f(0x1a2)]:(_0x1b3f47=_0x57625c['body'])==null||(_0x1b3f47=_0x1b3f47[_0x10573f(0x1a9)])==null||(_0x1b3f47=_0x1b3f47[_0x10573f(0x1ba)](_0x60d257=>_0x60d257[_0x10573f(0x1ac)]===_0x1c6375))==null||(_0x1b3f47=_0x1b3f47['noteProperties'])==null?void 0x0:_0x1b3f47[_0x10573f(0x1a2)];return _0x328c28==null?void 0x0:_0x59d53d['Tools'][_0x10573f(0x18e)](_0x328c28);}[_0x3ce987(0x1b8)](_0x4d4d56,_0x3ed371){const _0x5d1401=_0x3ce987;return this['_injector'][_0x5d1401(0x182)](_0x59d53d[_0x5d1401(0x1b1)])[_0x5d1401(0x1b7)](_0x4a1a80[_0x5d1401(0x1a4)]['id'],{'unitId':this['id'],'settings':_0x4d4d56,'sectionId':_0x3ed371});}['insertEndnote'](_0x495234,_0x5c4664={}){const _0x406351=_0x3ce987;let _0x5e7884=(0x0,_0x59d53d['generateRandomId'])(0xc);return this[_0x406351(0x18c)][_0x406351(0x182)](_0x59d53d[_0x406351(0x1b1)])[_0x406351(0x1b7)](_0x4a1a80[_0x406351(0x1a3)]['id'],{..._0x5c4664,'unitId':this['id'],'offset':_0x495234,'noteId':_0x5e7884})?_0x5e7884:null;}[_0x3ce987(0x1a5)](){const _0x56e1fb=_0x3ce987;var _0x1bc95c;let _0x253aeb=this[_0x56e1fb(0x19a)]()[_0x56e1fb(0x1b9)]();return(((_0x1bc95c=_0x253aeb[_0x56e1fb(0x19b)])==null?void 0x0:_0x1bc95c['customRanges'])??[])['filter'](_0x55c5d2=>_0x55c5d2[_0x56e1fb(0x18f)]===_0x59d53d['CustomRangeType'][_0x56e1fb(0x1b5)])[_0x56e1fb(0x193)]((_0x4b0704,_0x14dadd)=>_0x4b0704[_0x56e1fb(0x1a0)]-_0x14dadd[_0x56e1fb(0x1a0)])[_0x56e1fb(0x181)](_0x1a01d8=>{const _0x186de8=_0x56e1fb;var _0x3ba0b1,_0x1208de;let _0x44038f=(_0x3ba0b1=_0x1a01d8[_0x186de8(0x19f)])==null?void 0x0:_0x3ba0b1[_0x186de8(0x1bc)],_0x467891=typeof _0x44038f==_0x186de8(0x1b4)?(_0x1208de=_0x253aeb[_0x186de8(0x1ad)])==null?void 0x0:_0x1208de[_0x44038f]:void 0x0;return _0x467891?[_0x59d53d[_0x186de8(0x1ae)][_0x186de8(0x18e)](_0x467891)]:[];});}['deleteEndnote'](_0x361b74){const _0x565df6=_0x3ce987;return this[_0x565df6(0x18c)][_0x565df6(0x182)](_0x59d53d[_0x565df6(0x1b1)])[_0x565df6(0x1b7)](_0x4a1a80['DeleteDocumentEndnoteCommand']['id'],{'unitId':this['id'],'noteId':_0x361b74});}[_0x3ce987(0x185)](_0x252db3){const _0x4981f3=_0x3ce987;var _0x1c35dc,_0x3c65b8;let _0x3edf64=this[_0x4981f3(0x19a)]()[_0x4981f3(0x1b9)](),_0x4e16f7=_0x252db3==null?(_0x1c35dc=_0x3edf64[_0x4981f3(0x195)])==null?void 0x0:_0x1c35dc[_0x4981f3(0x183)]:(_0x3c65b8=_0x3edf64[_0x4981f3(0x19b)])==null||(_0x3c65b8=_0x3c65b8[_0x4981f3(0x1a9)])==null||(_0x3c65b8=_0x3c65b8['find'](_0x1b3ba1=>_0x1b3ba1[_0x4981f3(0x1ac)]===_0x252db3))==null||(_0x3c65b8=_0x3c65b8[_0x4981f3(0x1a7)])==null?void 0x0:_0x3c65b8[_0x4981f3(0x183)];return _0x4e16f7==null?void 0x0:_0x59d53d['Tools'][_0x4981f3(0x18e)](_0x4e16f7);}[_0x3ce987(0x1aa)](_0x19a907,_0x3f3416){const _0x3d88d7=_0x3ce987;return this[_0x3d88d7(0x18c)]['get'](_0x59d53d[_0x3d88d7(0x1b1)])['syncExecuteCommand'](_0x4a1a80[_0x3d88d7(0x1a6)]['id'],{'unitId':this['id'],'settings':_0x19a907,'sectionId':_0x3f3416});}};_0x337bb8['FDocument']['extend'](_0x209894);}));function _0x5195(){const _0x5a8de6=['UniverDocsFacade','noteSettings','63zcHIzj','DeleteDocumentFootnoteCommand','3710205vyTUMF','28ynidLr','getDocumentDataModel','body','33523iQjChl','FDocument','2030790tcfCOf','properties','startIndex','720208IeHQoG','footnote','InsertDocumentEndnoteCommand','SetDocumentFootnoteSettingsCommand','getEndnotes','SetDocumentEndnoteSettingsCommand','noteProperties','customRanges','sectionBreaks','setEndnoteSettings','InsertDocumentFootnoteCommand','sectionId','notes','Tools','object','function','ICommandService','amd','CustomRangeType','string','ENDNOTE','15hbxOxd','syncExecuteCommand','setFootnoteSettings','getSnapshot','find','22485287JzMSFW','noteId','flatMap','get','endnote','3763323ypLhQw','getEndnoteSettings','insertFootnote','filter','UniverCore','deleteFootnote','10DTszcZ','getFootnoteSettings','_injector','@univerjs-pro/docs-reference','deepClone','rangeType','290900TBLUca','@univerjs/core','@univerjs/docs/facade','sort'];_0x5195=function(){return _0x5a8de6;};return _0x5195();}
|
package/lib/umd/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x20df(_0x112aea,_0x3e8ab1){_0x112aea=_0x112aea-0x145;const _0xe5927d=_0xe592();let _0x20df0d=_0xe5927d[_0x112aea];return _0x20df0d;}(function(_0x5ad8f1,_0x529c99){const _0x80ae4e=_0x20df,_0x4a533b=_0x5ad8f1();while(!![]){try{const _0x308a93=-parseInt(_0x80ae4e(0x16e))/0x1+parseInt(_0x80ae4e(0x158))/0x2*(parseInt(_0x80ae4e(0x1aa))/0x3)+parseInt(_0x80ae4e(0x14b))/0x4*(parseInt(_0x80ae4e(0x185))/0x5)+parseInt(_0x80ae4e(0x1d6))/0x6*(parseInt(_0x80ae4e(0x199))/0x7)+-parseInt(_0x80ae4e(0x149))/0x8*(parseInt(_0x80ae4e(0x15d))/0x9)+parseInt(_0x80ae4e(0x1b2))/0xa+-parseInt(_0x80ae4e(0x166))/0xb;if(_0x308a93===_0x529c99)break;else _0x4a533b['push'](_0x4a533b['shift']());}catch(_0x5d1cec){_0x4a533b['push'](_0x4a533b['shift']());}}}(_0xe592,0x8325c),function(_0x4d5e86,_0x46bf75){const _0x5133c9=_0x20df;typeof exports==_0x5133c9(0x1c3)&&typeof module<'u'?_0x46bf75(exports,require('@univerjs/core'),require('@univerjs/docs'),require('@univerjs-pro/license')):typeof define==_0x5133c9(0x1d5)&&define[_0x5133c9(0x1d2)]?define([_0x5133c9(0x172),_0x5133c9(0x1ca),_0x5133c9(0x146),_0x5133c9(0x1b9)],_0x46bf75):(_0x4d5e86=typeof globalThis<'u'?globalThis:_0x4d5e86||self,_0x46bf75(_0x4d5e86[_0x5133c9(0x1c2)]={},_0x4d5e86[_0x5133c9(0x16a)],_0x4d5e86[_0x5133c9(0x198)],_0x4d5e86['UniverProLicense']));}(this,function(_0x506898,_0x38833c,_0x4627b8,_0x564f23){const _0x320486=_0x20df;Object['defineProperty'](_0x506898,Symbol[_0x320486(0x168)],{'value':_0x320486(0x19a)});function _0x318221(_0x2be775,_0x5a669a,_0x256238){const _0x3fefb3=_0x320486;if(_0x2be775[_0x3fefb3(0x16c)]!=null&&!(_0x5a669a===_0x3fefb3(0x1c5)?[_0x3fefb3(0x19f),_0x3fefb3(0x180)]:['docEnd',_0x3fefb3(0x1ce)])[_0x3fefb3(0x188)](_0x2be775['position'])||_0x2be775[_0x3fefb3(0x175)]!=null&&!(_0x5a669a==='footnote'?[_0x3fefb3(0x1a0),_0x3fefb3(0x195),_0x3fefb3(0x194)]:[_0x3fefb3(0x1a0),_0x3fefb3(0x195)])[_0x3fefb3(0x188)](_0x2be775[_0x3fefb3(0x175)])||_0x2be775[_0x3fefb3(0x15e)]!=null&&(!Number[_0x3fefb3(0x1b3)](_0x2be775[_0x3fefb3(0x15e)])||_0x2be775[_0x3fefb3(0x15e)]<0x1)||_0x3fefb3(0x17e)in _0x2be775&&_0x2be775[_0x3fefb3(0x17e)]!=null&&(_0x5a669a!==_0x3fefb3(0x1c5)||!Number[_0x3fefb3(0x1b3)](_0x2be775['columnCount'])||_0x2be775['columnCount']<0x0||_0x2be775['columnCount']>0x4)||_0x2be775['numberFormat']!=null&&(typeof _0x2be775[_0x3fefb3(0x1b7)]!='string'||_0x2be775[_0x3fefb3(0x1b7)][_0x3fefb3(0x1bb)]===0x0))return!0x1;for(let _0x1fff0f of[_0x2be775[_0x3fefb3(0x1b5)],_0x2be775[_0x3fefb3(0x18e)],_0x2be775[_0x3fefb3(0x152)]])if(_0x1fff0f!=null&&(_0x256238!=null||(0x0,_0x38833c[_0x3fefb3(0x1b8)])(_0x1fff0f)['length']>0x0))return!0x1;return!0x0;}function _0x4a1aaf(_0x17f5ce,_0x2a6e78,_0x20c6be){const _0x39a318=_0x320486;var _0x122008,_0x326b5a;if(_0x2a6e78[_0x39a318(0x148)]!=null&&!_0x318221(_0x2a6e78[_0x39a318(0x148)],_0x20c6be,_0x2a6e78[_0x39a318(0x14a)]))return!0x1;let _0x555648=((_0x122008=_0x17f5ce['body'])==null||(_0x122008=_0x122008['sectionBreaks'])==null?void 0x0:_0x122008['findIndex'](_0x3969af=>_0x3969af[_0x39a318(0x14a)]===_0x2a6e78[_0x39a318(0x14a)]))??-0x1;if(_0x2a6e78[_0x39a318(0x14a)]!=null&&_0x555648<0x0)return!0x1;let _0x507853=_0x2a6e78[_0x39a318(0x14a)]==null?_0x17f5ce[_0x39a318(0x14c)]:(_0x326b5a=_0x17f5ce[_0x39a318(0x14f)])==null||(_0x326b5a=_0x326b5a[_0x39a318(0x18f)])==null?void 0x0:_0x326b5a[_0x555648][_0x39a318(0x160)],_0x2b68f7=_0x2a6e78[_0x39a318(0x148)]==null?void 0x0:_0x38833c[_0x39a318(0x193)][_0x39a318(0x1cc)](_0x2a6e78[_0x39a318(0x148)]),_0x31d015=_0x2a6e78[_0x39a318(0x14a)]==null?[_0x39a318(0x14c)]:[_0x39a318(0x14f),'sectionBreaks',_0x555648,_0x39a318(0x160)],_0x3286a1=_0x38833c[_0x39a318(0x15b)]['getInstance'](),_0x2855b7=null;if(_0x38833c[_0x39a318(0x193)][_0x39a318(0x14e)](_0x507853==null?void 0x0:_0x507853[_0x20c6be],_0x2b68f7)||(_0x2855b7=_0x507853==null?_0x3286a1[_0x39a318(0x145)](_0x31d015,{[_0x20c6be]:_0x2b68f7}):_0x2a6e78['sectionId']!=null&&_0x2b68f7==null&&Object[_0x39a318(0x1a6)](_0x507853)[_0x39a318(0x196)](_0x1a4c0d=>_0x1a4c0d===_0x20c6be)?_0x3286a1[_0x39a318(0x16b)](_0x31d015,_0x507853):_0x3286a1['replaceOp']([..._0x31d015,_0x20c6be],_0x507853[_0x20c6be],_0x2b68f7)),_0x2a6e78['suppressEndnotes']!=null){var _0x11cad8;if(_0x20c6be!==_0x39a318(0x161)||_0x2a6e78['sectionId']==null||typeof _0x2a6e78[_0x39a318(0x16f)]!=_0x39a318(0x1d0))return!0x1;let _0x17e9fc=(_0x11cad8=_0x17f5ce[_0x39a318(0x14f)])==null||(_0x11cad8=_0x11cad8['sectionBreaks'])==null?void 0x0:_0x11cad8[_0x555648][_0x39a318(0x16f)];_0x17e9fc!==_0x2a6e78[_0x39a318(0x16f)]&&(_0x2855b7=_0x38833c['JSONX'][_0x39a318(0x1c9)](_0x2855b7,_0x3286a1[_0x39a318(0x173)]([_0x39a318(0x14f),_0x39a318(0x18f),_0x555648,_0x39a318(0x16f)],_0x17e9fc,_0x2a6e78['suppressEndnotes'])));}return _0x2855b7;}function _0x4c29ff(_0x2d5e44,_0x1bb34c,_0x5096a0){const _0xd19cc9=_0x320486;if(!_0x1bb34c)return!0x1;let _0x53b79e=_0x2d5e44[_0xd19cc9(0x1a2)](_0x38833c[_0xd19cc9(0x165)])[_0xd19cc9(0x171)](_0x1bb34c[_0xd19cc9(0x19d)],_0x38833c[_0xd19cc9(0x17d)]['UNIVER_DOC']),_0x4f4ed=_0x53b79e==null?void 0x0:_0x53b79e['getSnapshot']();if(!_0x4f4ed||_0x4f4ed[_0xd19cc9(0x1b0)][_0xd19cc9(0x1d3)]!==_0x38833c[_0xd19cc9(0x162)][_0xd19cc9(0x170)])return!0x1;let _0x4338e2=_0x4a1aaf(_0x4f4ed,_0x1bb34c,_0x5096a0);return _0x4338e2===!0x1||_0x38833c[_0xd19cc9(0x15b)]['isNoop'](_0x4338e2)?!0x1:!!_0x2d5e44[_0xd19cc9(0x1a2)](_0x38833c[_0xd19cc9(0x186)])[_0xd19cc9(0x1bc)](_0x4627b8[_0xd19cc9(0x1ad)]['id'],{'unitId':_0x1bb34c[_0xd19cc9(0x19d)],'segmentId':'','historyAction':_0xd19cc9(0x18d)+_0x5096a0+_0xd19cc9(0x1a4),'actions':_0x4338e2,'textRanges':null,'noNeedSetTextRange':!0x0,'isEditing':!0x1,'debounce':!0x1});}let _0x481d21={'id':_0x320486(0x179),'type':_0x38833c['CommandType'][_0x320486(0x19c)],'handler':(_0x4abf5c,_0x1ee85f)=>_0x4c29ff(_0x4abf5c,_0x1ee85f,_0x320486(0x1c5))},_0x21cbe6={'id':_0x320486(0x1a3),'type':_0x38833c['CommandType']['COMMAND'],'handler':(_0x425d6c,_0x4215f0)=>_0x4c29ff(_0x425d6c,_0x4215f0,'endnote')};function _0x48ed90(_0x57498a,_0x1cc8d7){const _0x149098=_0x320486;return(_0x57498a==null?void 0x0:_0x57498a[_0x149098(0x1b0)][_0x149098(0x1d3)])===_0x38833c[_0x149098(0x162)][_0x149098(0x170)]&&!!_0x57498a['body']&&Number['isInteger'](_0x1cc8d7)&&_0x1cc8d7>=0x0&&_0x1cc8d7<_0x57498a[_0x149098(0x14f)][_0x149098(0x1ab)]['length']-0x1;}function _0x301749(_0x23b26f,_0xfeb71e,_0x12fb7a){const _0x1b1ea9=_0x320486;var _0x2e26f9,_0xd06ddc;if(_0xfeb71e[_0x1b1ea9(0x148)]===void 0x0&&_0xfeb71e[_0x1b1ea9(0x16f)]===void 0x0)return null;let _0x2a9b91=_0xfeb71e['sectionId']==null?(_0x2e26f9=_0x23b26f[_0x1b1ea9(0x14c)])==null?void 0x0:_0x2e26f9[_0x12fb7a]:(_0xd06ddc=_0x23b26f[_0x1b1ea9(0x14f)])==null||(_0xd06ddc=_0xd06ddc[_0x1b1ea9(0x18f)])==null||(_0xd06ddc=_0xd06ddc[_0x1b1ea9(0x1af)](_0x3da6d2=>_0x3da6d2[_0x1b1ea9(0x14a)]===_0xfeb71e[_0x1b1ea9(0x14a)]))==null||(_0xd06ddc=_0xd06ddc[_0x1b1ea9(0x160)])==null?void 0x0:_0xd06ddc[_0x12fb7a];return _0x4a1aaf(_0x23b26f,{'settings':_0xfeb71e[_0x1b1ea9(0x148)]===void 0x0?_0x2a9b91??null:_0xfeb71e['settings'],'sectionId':_0xfeb71e[_0x1b1ea9(0x14a)],'suppressEndnotes':_0xfeb71e[_0x1b1ea9(0x16f)]},_0x12fb7a);}function _0x15ac1d(_0x260d6f,_0x5dd895,_0x3950f7){const _0x54d6f8=_0x320486;var _0x5883c2,_0x5a61c3,_0x2f5fff;if(!_0x5dd895||_0x5dd895[_0x54d6f8(0x189)])return!0x1;let _0x54ebc1=_0x260d6f[_0x54d6f8(0x1a2)](_0x38833c[_0x54d6f8(0x165)])['getUnit'](_0x5dd895[_0x54d6f8(0x19d)],_0x38833c[_0x54d6f8(0x17d)]['UNIVER_DOC']),_0x4e02f0=_0x54ebc1==null?void 0x0:_0x54ebc1[_0x54d6f8(0x17c)](),{offset:_0x9fc60c}=_0x5dd895;if(!_0x48ed90(_0x4e02f0,_0x9fc60c))return!0x1;let _0x31cbbe=_0x301749(_0x4e02f0,_0x5dd895,_0x3950f7);if(_0x31cbbe===!0x1)return!0x1;let _0xbbfbb7=_0x5dd895[_0x54d6f8(0x1bd)]??(0x0,_0x38833c[_0x54d6f8(0x18a)])(0xc);if((_0x5883c2=_0x4e02f0[_0x54d6f8(0x18c)])!=null&&_0x5883c2[_0xbbfbb7]||(_0x5a61c3=_0x4e02f0[_0x54d6f8(0x1c4)])!=null&&_0x5a61c3[_0xbbfbb7]||(_0x2f5fff=_0x4e02f0[_0x54d6f8(0x164)])!=null&&_0x2f5fff[_0xbbfbb7])return!0x1;let _0x48ce37=_0x38833c['Tools']['deepClone']({'type':_0x3950f7,'noteId':_0xbbfbb7,'body':_0x5dd895[_0x54d6f8(0x14f)]??{'dataStream':'\x0d\x0a','paragraphs':[{'paragraphId':(0x0,_0x38833c[_0x54d6f8(0x1a5)])(new Set()),'startIndex':0x0}],'sectionBreaks':[{'sectionId':(0x0,_0x38833c[_0x54d6f8(0x1d4)])(new Set()),'startIndex':0x1}]},'customMark':_0x5dd895[_0x54d6f8(0x197)],'referenceTextStyle':_0x5dd895[_0x54d6f8(0x187)],'tableSource':_0x5dd895[_0x54d6f8(0x14d)],'drawings':_0x5dd895[_0x54d6f8(0x15f)],'drawingsOrder':_0x5dd895['drawingsOrder'],'lists':_0x5dd895['lists']});if((0x0,_0x38833c[_0x54d6f8(0x1c1)])({'notes':{[_0xbbfbb7]:_0x48ce37}})[_0x54d6f8(0x1bb)]>0x0)return!0x1;let _0x5bbd77=new _0x38833c['TextX']();_0x9fc60c>0x0&&_0x5bbd77[_0x54d6f8(0x1a1)](_0x9fc60c),_0x5bbd77[_0x54d6f8(0x19b)](0x1,{'dataStream':'','customRanges':[{'rangeType':_0x3950f7===_0x54d6f8(0x1c5)?_0x38833c[_0x54d6f8(0x1bf)][_0x54d6f8(0x1ac)]:_0x38833c[_0x54d6f8(0x1bf)][_0x54d6f8(0x150)],'rangeId':(0x0,_0x38833c[_0x54d6f8(0x18a)])(0xc),'startIndex':0x0,'endIndex':0x0,'wholeEntity':!0x0,'properties':{'noteId':_0xbbfbb7}}]});let _0x524571=_0x38833c[_0x54d6f8(0x15b)][_0x54d6f8(0x1c8)](),_0x3320cb=_0x4e02f0[_0x54d6f8(0x18c)]==null?_0x524571[_0x54d6f8(0x145)]([_0x54d6f8(0x18c)],{[_0xbbfbb7]:_0x48ce37}):_0x524571[_0x54d6f8(0x145)]([_0x54d6f8(0x18c),_0xbbfbb7],_0x48ce37);return!!_0x260d6f[_0x54d6f8(0x1a2)](_0x38833c[_0x54d6f8(0x186)])['syncExecuteCommand'](_0x4627b8[_0x54d6f8(0x1ad)]['id'],{'unitId':_0x5dd895[_0x54d6f8(0x19d)],'segmentId':'','historyAction':_0x54d6f8(0x16d)+_0x3950f7,'actions':_0x38833c[_0x54d6f8(0x15b)]['compose'](_0x38833c['JSONX'][_0x54d6f8(0x1c9)](_0x31cbbe,_0x3320cb),_0x524571['editOp'](_0x5bbd77[_0x54d6f8(0x154)](),[_0x54d6f8(0x14f)])),'textRanges':[{'segmentId':_0xbbfbb7,'startOffset':0x0,'endOffset':0x0,'collapsed':!0x0}],'debounce':!0x1});}function _0x596102(_0x870df,_0x56f04e,_0x40fc41){const _0x28047f=_0x320486;var _0x1e3a90,_0x27f447;if(!_0x56f04e)return!0x1;let _0x5d039c=_0x870df[_0x28047f(0x1a2)](_0x38833c[_0x28047f(0x165)])['getUnit'](_0x56f04e[_0x28047f(0x19d)],_0x38833c[_0x28047f(0x17d)][_0x28047f(0x155)]),_0x59cfa3=_0x5d039c==null?void 0x0:_0x5d039c[_0x28047f(0x17c)](),_0x68e2f1=_0x59cfa3==null||(_0x1e3a90=_0x59cfa3[_0x28047f(0x18c)])==null?void 0x0:_0x1e3a90[_0x56f04e[_0x28047f(0x1bd)]],_0x8c91a8=_0x59cfa3==null||(_0x27f447=_0x59cfa3[_0x28047f(0x14f)])==null||(_0x27f447=_0x27f447[_0x28047f(0x1d1)])==null?void 0x0:_0x27f447[_0x28047f(0x1af)](_0x31da7c=>{const _0x5ec599=_0x28047f;var _0x4f7cb8;return(_0x31da7c[_0x5ec599(0x184)]===_0x38833c[_0x5ec599(0x1bf)][_0x5ec599(0x1ac)]||_0x31da7c[_0x5ec599(0x184)]===_0x38833c[_0x5ec599(0x1bf)][_0x5ec599(0x150)])&&((_0x4f7cb8=_0x31da7c[_0x5ec599(0x178)])==null?void 0x0:_0x4f7cb8['noteId'])===_0x56f04e[_0x5ec599(0x1bd)];});if(!_0x59cfa3||_0x59cfa3['documentStyle'][_0x28047f(0x1d3)]!==_0x38833c[_0x28047f(0x162)]['TRADITIONAL']||!_0x68e2f1||_0x68e2f1[_0x28047f(0x17f)]!==_0x40fc41||!_0x8c91a8)return!0x1;let _0x25a5ab=new _0x38833c[(_0x28047f(0x18b))]();_0x8c91a8['startIndex']>0x0&&_0x25a5ab['retain'](_0x8c91a8['startIndex']),_0x25a5ab[_0x28047f(0x1b4)](0x1);let _0x346432=_0x38833c['JSONX'][_0x28047f(0x1c8)]();return!!_0x870df[_0x28047f(0x1a2)](_0x38833c['ICommandService'])[_0x28047f(0x1bc)](_0x4627b8[_0x28047f(0x1ad)]['id'],{'unitId':_0x56f04e[_0x28047f(0x19d)],'segmentId':'','historyAction':_0x28047f(0x1c7)+_0x40fc41,'actions':_0x38833c[_0x28047f(0x15b)][_0x28047f(0x1c9)](_0x346432[_0x28047f(0x153)](_0x25a5ab[_0x28047f(0x154)](),[_0x28047f(0x14f)]),_0x346432['removeOp']([_0x28047f(0x18c),_0x56f04e['noteId']],_0x68e2f1)),'textRanges':[{'startOffset':_0x8c91a8['startIndex'],'endOffset':_0x8c91a8[_0x28047f(0x17a)],'collapsed':!0x0}],'debounce':!0x1});}let _0x2720a1={'id':'doc.command.insert-footnote','type':_0x38833c['CommandType'][_0x320486(0x19c)],'handler':(_0xe5c1a7,_0x1962ac)=>_0x15ac1d(_0xe5c1a7,_0x1962ac,_0x320486(0x1c5))},_0x3268a4={'id':_0x320486(0x182),'type':_0x38833c[_0x320486(0x19e)][_0x320486(0x19c)],'handler':(_0x7a5947,_0x2b8268)=>_0x596102(_0x7a5947,_0x2b8268,_0x320486(0x1c5))},_0x75b689={'id':_0x320486(0x1ae),'type':_0x38833c[_0x320486(0x19e)][_0x320486(0x19c)],'handler':(_0x83b7b0,_0x3e21bb)=>_0x15ac1d(_0x83b7b0,_0x3e21bb,_0x320486(0x161))},_0x4fd571={'id':_0x320486(0x183),'type':_0x38833c['CommandType'][_0x320486(0x19c)],'handler':(_0x440b50,_0x3d2297)=>_0x596102(_0x440b50,_0x3d2297,_0x320486(0x161))};var _0x4bed8d=_0x320486(0x1c0),_0x11ca44=_0x320486(0x1cf);let _0x453acc={};function _0x2eae30(_0x2026ce,_0x30b978){return function(_0x10c1ac,_0x226a6e){_0x30b978(_0x10c1ac,_0x226a6e,_0x2026ce);};}function _0x51a1f6(_0x2a54c8,_0x212313,_0x3fdfdf,_0x39ca39){const _0x515956=_0x320486;var _0x56fc8d=arguments[_0x515956(0x1bb)],_0x3a64fa=_0x56fc8d<0x3?_0x212313:_0x39ca39===null?_0x39ca39=Object[_0x515956(0x169)](_0x212313,_0x3fdfdf):_0x39ca39,_0x225dba;if(typeof Reflect==_0x515956(0x1c3)&&typeof Reflect[_0x515956(0x15c)]==_0x515956(0x1d5))_0x3a64fa=Reflect['decorate'](_0x2a54c8,_0x212313,_0x3fdfdf,_0x39ca39);else{for(var _0x90c9e2=_0x2a54c8[_0x515956(0x1bb)]-0x1;_0x90c9e2>=0x0;_0x90c9e2--)(_0x225dba=_0x2a54c8[_0x90c9e2])&&(_0x3a64fa=(_0x56fc8d<0x3?_0x225dba(_0x3a64fa):_0x56fc8d>0x3?_0x225dba(_0x212313,_0x3fdfdf,_0x3a64fa):_0x225dba(_0x212313,_0x3fdfdf))||_0x3a64fa);}return _0x56fc8d>0x3&&_0x3a64fa&&Object['defineProperty'](_0x212313,_0x3fdfdf,_0x3a64fa),_0x3a64fa;}function _0x433a14(_0x3e636d){'@babel/helpers - typeof';const _0x51789c=_0x320486;return _0x433a14=typeof Symbol==_0x51789c(0x1d5)&&typeof Symbol[_0x51789c(0x1a9)]==_0x51789c(0x1a7)?function(_0x102d14){return typeof _0x102d14;}:function(_0x26b7bd){const _0x177f7d=_0x51789c;return _0x26b7bd&&typeof Symbol=='function'&&_0x26b7bd[_0x177f7d(0x1cb)]===Symbol&&_0x26b7bd!==Symbol['prototype']?_0x177f7d(0x1a7):typeof _0x26b7bd;},_0x433a14(_0x3e636d);}function _0x17d02b(_0x3a2bd8,_0x4d9ea8){const _0x378eb0=_0x320486;if(_0x433a14(_0x3a2bd8)!=_0x378eb0(0x1c3)||!_0x3a2bd8)return _0x3a2bd8;var _0x5861e7=_0x3a2bd8[Symbol[_0x378eb0(0x167)]];if(_0x5861e7!==void 0x0){var _0x4d4d05=_0x5861e7['call'](_0x3a2bd8,_0x4d9ea8||_0x378eb0(0x1be));if(_0x433a14(_0x4d4d05)!='object')return _0x4d4d05;throw TypeError(_0x378eb0(0x163));}return(_0x4d9ea8===_0x378eb0(0x177)?String:Number)(_0x3a2bd8);}function _0x38265b(_0x3b7995){const _0xa7b956=_0x320486;var _0xdf273e=_0x17d02b(_0x3b7995,_0xa7b956(0x177));return _0x433a14(_0xdf273e)=='symbol'?_0xdf273e:_0xdf273e+'';}function _0x1b814e(_0x5599d5,_0x5d5d56,_0x4317a8){const _0x5e6715=_0x320486;return(_0x5d5d56=_0x38265b(_0x5d5d56))in _0x5599d5?Object[_0x5e6715(0x147)](_0x5599d5,_0x5d5d56,{'value':_0x4317a8,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x5599d5[_0x5d5d56]=_0x4317a8,_0x5599d5;}let _0x59d920=class extends _0x38833c[_0x320486(0x1a8)]{constructor(_0x3c1d96=_0x453acc,_0x20980f,_0x320e52,_0x5f585a){const _0x13b064=_0x320486;super(),this['_config']=_0x3c1d96,this['_injector']=_0x20980f,this['_configService']=_0x320e52,this[_0x13b064(0x176)]=_0x5f585a;let {..._0x545729}=(0x0,_0x38833c[_0x13b064(0x151)])({},_0x453acc,this['_config']);this['_configService']['setConfig']('docs-reference.config',_0x545729);}[_0x320486(0x1ba)](){const _0x3cb845=_0x320486;[_0x2720a1,_0x3268a4,_0x481d21,_0x75b689,_0x4fd571,_0x21cbe6][_0x3cb845(0x1c6)](_0x382c51=>this['disposeWithMe'](this['_commandService'][_0x3cb845(0x15a)](_0x382c51)));}};_0x1b814e(_0x59d920,_0x320486(0x192),_0x320486(0x156)),_0x1b814e(_0x59d920,'packageName',_0x4bed8d),_0x1b814e(_0x59d920,'version',_0x11ca44),_0x1b814e(_0x59d920,_0x320486(0x17f),_0x38833c['UniverInstanceType'][_0x320486(0x155)]),_0x59d920=_0x51a1f6([(0x0,_0x38833c[_0x320486(0x159)])(_0x564f23[_0x320486(0x1b6)],_0x4627b8[_0x320486(0x1cd)]),_0x2eae30(0x1,(0x0,_0x38833c[_0x320486(0x190)])(_0x38833c['Injector'])),_0x2eae30(0x2,_0x38833c[_0x320486(0x157)]),_0x2eae30(0x3,_0x38833c['ICommandService'])],_0x59d920),_0x506898[_0x320486(0x181)]=_0x4fd571,_0x506898['DeleteDocumentFootnoteCommand']=_0x3268a4,_0x506898[_0x320486(0x1b1)]=_0x75b689,_0x506898[_0x320486(0x174)]=_0x2720a1,_0x506898['SetDocumentEndnoteSettingsCommand']=_0x21cbe6,_0x506898[_0x320486(0x191)]=_0x481d21,Object['defineProperty'](_0x506898,_0x320486(0x17b),{'enumerable':!0x0,'get':function(){return _0x59d920;}});}));function _0xe592(){const _0x1a71e7=['onStarting','length','syncExecuteCommand','noteId','default','CustomRangeType','@univerjs-pro/docs-reference','validateDocumentStructure','UniverProDocsReference','object','headers','footnote','forEach','delete-','getInstance','compose','@univerjs/core','constructor','deepClone','UniverDocsPlugin','sectEnd','1.0.0-rc.0','boolean','customRanges','amd','documentFlavor','createSectionId','function','1264962ikUTrh','insertOp','@univerjs/docs','defineProperty','settings','232hgQKDK','sectionId','23972SfFcrp','noteSettings','tableSource','diffValue','body','ENDNOTE','merge','continuationNotice','editOp','serialize','UNIVER_DOC','UNIVER_DOCS_REFERENCE_PLUGIN','IConfigService','10RhVaOI','DependentOn','registerCommand','JSONX','decorate','273042pAQdlY','startNumber','drawings','noteProperties','endnote','DocumentFlavor','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','footers','IUniverInstanceService','2066163VEjojI','toPrimitive','toStringTag','getOwnPropertyDescriptor','UniverCore','removeOp','position','insert-','342921QSHaIM','suppressEndnotes','TRADITIONAL','getUnit','exports','replaceOp','InsertDocumentFootnoteCommand','restart','_commandService','string','properties','doc.command.set-footnote-settings','startIndex','UniverDocsReferencePlugin','getSnapshot','UniverInstanceType','columnCount','type','beneathText','DeleteDocumentEndnoteCommand','doc.command.delete-footnote','doc.command.delete-endnote','rangeType','175JowSoT','ICommandService','referenceTextStyle','includes','segmentId','generateRandomId','TextX','notes','set-','continuationSeparator','sectionBreaks','Inject','SetDocumentFootnoteSettingsCommand','pluginName','Tools','eachPage','eachSect','every','customMark','UniverDocs','28KjEpFy','Module','insert','COMMAND','unitId','CommandType','pageBottom','continuous','retain','get','doc.command.set-endnote-settings','-settings','createParagraphId','keys','symbol','Plugin','iterator','131073rojXIy','dataStream','FOOTNOTE','RichTextEditingMutation','doc.command.insert-endnote','find','documentStyle','InsertDocumentEndnoteCommand','6762180CUwoJa','isInteger','delete','separator','UniverLicensePlugin','numberFormat','validateDocBodyStructure','@univerjs-pro/license'];_0xe592=function(){return _0x1a71e7;};return _0xe592();}
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@univerjs-pro/docs-reference",
|
|
3
|
+
"version": "1.0.0-rc.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Document references commands and Facade integration.",
|
|
6
|
+
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
|
7
|
+
"funding": {
|
|
8
|
+
"type": "opencollective",
|
|
9
|
+
"url": "https://opencollective.com/univer"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://univer.ai",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/dream-num/univer-pro"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/dream-num/univer/issues"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"univer",
|
|
21
|
+
"univer-pro",
|
|
22
|
+
"docs",
|
|
23
|
+
"references",
|
|
24
|
+
"footnotes",
|
|
25
|
+
"plugin"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"import": "./lib/es/index.js",
|
|
30
|
+
"require": "./lib/cjs/index.js",
|
|
31
|
+
"types": "./lib/types/index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./*": {
|
|
34
|
+
"import": "./lib/es/*",
|
|
35
|
+
"require": "./lib/cjs/*",
|
|
36
|
+
"types": "./lib/types/index.d.ts"
|
|
37
|
+
},
|
|
38
|
+
"./facade": {
|
|
39
|
+
"import": "./lib/es/facade.js",
|
|
40
|
+
"require": "./lib/cjs/facade.js",
|
|
41
|
+
"types": "./lib/types/facade/index.d.ts"
|
|
42
|
+
},
|
|
43
|
+
"./lib/facade": {
|
|
44
|
+
"import": "./lib/es/facade.js",
|
|
45
|
+
"require": "./lib/cjs/facade.js",
|
|
46
|
+
"types": "./lib/types/facade/index.d.ts"
|
|
47
|
+
},
|
|
48
|
+
"./lib/*": "./lib/*"
|
|
49
|
+
},
|
|
50
|
+
"main": "./lib/es/index.js",
|
|
51
|
+
"types": "./lib/types/index.d.ts",
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"directories": {
|
|
56
|
+
"lib": "lib"
|
|
57
|
+
},
|
|
58
|
+
"files": [
|
|
59
|
+
"lib"
|
|
60
|
+
],
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"@univerjs-pro/license": "1.0.0-rc.0",
|
|
63
|
+
"@univerjs/core": "1.0.0-rc.0",
|
|
64
|
+
"@univerjs/docs": "1.0.0-rc.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@univerjs-infra/shared": "1.0.0-rc.0",
|
|
68
|
+
"@univerjs/engine-render": "1.0.0-rc.0",
|
|
69
|
+
"rxjs": "7.8.2",
|
|
70
|
+
"typescript": "^6.0.3",
|
|
71
|
+
"vitest": "^4.1.11"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"test": "vitest run",
|
|
75
|
+
"test:watch": "vitest",
|
|
76
|
+
"coverage": "vitest run --coverage",
|
|
77
|
+
"typecheck": "tsc --noEmit",
|
|
78
|
+
"build:bundle": "univer-cli build",
|
|
79
|
+
"build:types": "tsc -p tsconfig.node.json",
|
|
80
|
+
"build": "pnpm run build:bundle && pnpm run build:types"
|
|
81
|
+
},
|
|
82
|
+
"module": "./lib/es/index.js"
|
|
83
|
+
}
|