@univerjs/docs-thread-comment 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/LICENSE +176 -0
- package/README.md +39 -0
- package/lib/cjs/facade.js +82 -0
- package/lib/cjs/index.js +298 -0
- package/lib/es/facade.js +53 -0
- package/lib/es/index.js +288 -0
- package/lib/facade.js +53 -0
- package/lib/index.js +288 -0
- package/lib/types/commands/commands/create-doc-text-range-comment.command.d.ts +52 -0
- package/lib/types/common/const.d.ts +18 -0
- package/lib/types/config/config.d.ts +20 -0
- package/lib/types/controllers/docs-thread-comment-resource.controller.d.ts +24 -0
- package/lib/types/facade/f-document-text-range.d.ts +74 -0
- package/lib/types/facade/index.d.ts +17 -0
- package/lib/types/index.d.ts +20 -0
- package/lib/types/plugin.d.ts +29 -0
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
/** Stable subunit used by document text comments. */
|
|
17
|
+
export declare const DEFAULT_DOC_SUBUNIT_ID = "default_doc";
|
|
18
|
+
export declare const DOCS_THREAD_COMMENT_PLUGIN_NAME = "DOC_THREAD_COMMENT_PLUGIN";
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
export declare const DOCS_THREAD_COMMENT_PLUGIN_CONFIG_KEY = "docs-thread-comment.config";
|
|
17
|
+
export declare const configSymbol: unique symbol;
|
|
18
|
+
export interface IUniverDocsThreadCommentConfig {
|
|
19
|
+
}
|
|
20
|
+
export declare const defaultPluginConfig: IUniverDocsThreadCommentConfig;
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { Disposable, IResourceManagerService } from '@univerjs/core';
|
|
17
|
+
import { IThreadCommentDataSourceService, ThreadCommentModel } from '@univerjs/thread-comment';
|
|
18
|
+
export declare const DOC_UNIVER_THREAD_COMMENT_PLUGIN = "DOC_UNIVER_THREAD_COMMENT_PLUGIN";
|
|
19
|
+
export declare class DocsThreadCommentResourceController extends Disposable {
|
|
20
|
+
private readonly _resourceManagerService;
|
|
21
|
+
private readonly _threadCommentModel;
|
|
22
|
+
private readonly _threadCommentDataSourceService;
|
|
23
|
+
constructor(_resourceManagerService: IResourceManagerService, _threadCommentModel: ThreadCommentModel, _threadCommentDataSourceService: IThreadCommentDataSourceService);
|
|
24
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 { Injector } from '@univerjs/core';
|
|
17
|
+
import * as DocsThreadComment from '@univerjs/docs-thread-comment';
|
|
18
|
+
import * as DocsFacade from '@univerjs/docs/facade';
|
|
19
|
+
import * as ThreadComment from '@univerjs/thread-comment';
|
|
20
|
+
export type IDocumentTextRangeCommentCreateOptions = Omit<DocsThreadComment.ICreateDocTextRangeCommentParams, 'unitId' | 'range' | 'content'>;
|
|
21
|
+
/** Comment methods added to a fixed document text range. */
|
|
22
|
+
export interface IFDocumentTextRangeThreadCommentMixin {
|
|
23
|
+
/**
|
|
24
|
+
* Creates a comment on this text range.
|
|
25
|
+
* @param content Plain text or a Univer document body for rich comment content.
|
|
26
|
+
* @param options Optional stable IDs, author, attachments, and creation time.
|
|
27
|
+
* @returns `true` when the create command succeeds; otherwise, `false`.
|
|
28
|
+
* @throws {TypeError} If the content is empty.
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const range = univerAPI.getActiveDocument()?.getTextRange(0, 12);
|
|
32
|
+
* await range?.createCommentAsync('Verify this introduction.', { id: 'review-intro' });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
createCommentAsync(content: ThreadComment.ThreadCommentContent, options?: IDocumentTextRangeCommentCreateOptions): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Returns locally loaded comments whose comment decorations overlap this text range.
|
|
38
|
+
* @returns Matching comment threads. The returned anchors use `DOC_TEXT_RANGE`.
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const range = univerAPI.getActiveDocument()?.getTextRange(0, 12);
|
|
42
|
+
* const comments = range?.getComments() ?? [];
|
|
43
|
+
* comments.forEach(({ root, children }) => console.log(root.id, children.length));
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
getComments(): ThreadComment.IFacadeThreadCommentInfo[];
|
|
47
|
+
/**
|
|
48
|
+
* Synchronizes known document threads and returns comments whose decorations overlap this text range.
|
|
49
|
+
* @returns A promise resolving to the synchronized matching comment threads.
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const range = univerAPI.getActiveDocument()?.getTextRange(0, 12);
|
|
53
|
+
* const comments = range ? await range.listCommentsAsync() : [];
|
|
54
|
+
* console.log(comments.length);
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
listCommentsAsync(): Promise<ThreadComment.IFacadeThreadCommentInfo[]>;
|
|
58
|
+
}
|
|
59
|
+
export declare class FDocumentTextRangeThreadCommentMixin extends DocsFacade.FDocumentTextRange implements IFDocumentTextRangeThreadCommentMixin {
|
|
60
|
+
private _threadCommentCommandService;
|
|
61
|
+
private _threadCommentFacadeService;
|
|
62
|
+
_initialize(injector: Injector): void;
|
|
63
|
+
/** @inheritdoc */
|
|
64
|
+
createCommentAsync(content: ThreadComment.ThreadCommentContent, options?: IDocumentTextRangeCommentCreateOptions): Promise<boolean>;
|
|
65
|
+
/** @inheritdoc */
|
|
66
|
+
getComments(): ThreadComment.IFacadeThreadCommentInfo[];
|
|
67
|
+
/** @inheritdoc */
|
|
68
|
+
listCommentsAsync(): Promise<ThreadComment.IFacadeThreadCommentInfo[]>;
|
|
69
|
+
private _getOverlappingCommentIds;
|
|
70
|
+
}
|
|
71
|
+
declare module '@univerjs/docs/facade' {
|
|
72
|
+
interface FDocumentTextRange extends IFDocumentTextRangeThreadCommentMixin {
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 './f-document-text-range';
|
|
17
|
+
export type { IDocumentTextRangeCommentCreateOptions, IFDocumentTextRangeThreadCommentMixin, } from './f-document-text-range';
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
export { AddDocCommentDecorationMutation, CreateDocTextRangeCommentCommand, prepareDocTextRangeComment, } from './commands/commands/create-doc-text-range-comment.command';
|
|
17
|
+
export type { IAddDocTextRangeCommentParams, ICreateDocTextRangeCommentParams, IDocCommentDecorationMutationParams, IPreparedDocTextRangeComment, } from './commands/commands/create-doc-text-range-comment.command';
|
|
18
|
+
export { DEFAULT_DOC_SUBUNIT_ID } from './common/const';
|
|
19
|
+
export type { IUniverDocsThreadCommentConfig } from './config/config';
|
|
20
|
+
export { UniverDocsThreadCommentPlugin } from './plugin';
|
|
@@ -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 { IUniverDocsThreadCommentConfig } from './config/config';
|
|
17
|
+
import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
18
|
+
export declare class UniverDocsThreadCommentPlugin extends Plugin {
|
|
19
|
+
private readonly _config;
|
|
20
|
+
protected _injector: Injector;
|
|
21
|
+
private readonly _configService;
|
|
22
|
+
private readonly _commandService;
|
|
23
|
+
static pluginName: string;
|
|
24
|
+
static packageName: string;
|
|
25
|
+
static version: string;
|
|
26
|
+
static type: UniverInstanceType;
|
|
27
|
+
constructor(_config: Partial<IUniverDocsThreadCommentConfig> | undefined, _injector: Injector, _configService: IConfigService, _commandService: ICommandService);
|
|
28
|
+
onStarting(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require("@univerjs/core"),require("@univerjs/docs-thread-comment"),require("@univerjs/docs/facade"),require("@univerjs/thread-comment")):typeof define==`function`&&define.amd?define([`@univerjs/core`,`@univerjs/docs-thread-comment`,`@univerjs/docs/facade`,`@univerjs/thread-comment`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCore,e.UniverDocsThreadComment,e.UniverDocsFacade,e.UniverThreadComment))})(this,function(e,t,n,r){var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:i(c(e)),u(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e));t=d(t),n=d(n),r=d(r);var f=class extends n.FDocumentTextRange{_initialize(t){this._threadCommentCommandService=t.get(e.ICommandService);let n;Object.defineProperty(this,"_threadCommentFacadeService",{get:()=>n??=t.get(r.ThreadCommentFacadeService)})}createCommentAsync(e,n={}){return this._threadCommentCommandService.executeCommand(t.CreateDocTextRangeCommentCommand.id,{...n,unitId:this._document.getId(),range:{...this.getRange(),collapsed:!1},content:e})}getComments(){let e=this.getRange(),n=this._getOverlappingCommentIds(e);return this._threadCommentFacadeService.getComments({unitIds:[this._document.getId()],subUnitIds:[t.DEFAULT_DOC_SUBUNIT_ID],anchorKinds:[r.ThreadCommentAnchorKind.DOC_TEXT_RANGE]}).filter(e=>n.has(e.root.id))}async listCommentsAsync(){let e=this.getRange(),n=this._getOverlappingCommentIds(e);return(await this._threadCommentFacadeService.listCommentsAsync({unitIds:[this._document.getId()],subUnitIds:[t.DEFAULT_DOC_SUBUNIT_ID],anchorKinds:[r.ThreadCommentAnchorKind.DOC_TEXT_RANGE]})).filter(e=>n.has(e.root.id))}_getOverlappingCommentIds(t){let n=this._document.getBody(t.segmentId).customDecorations??[];return new Set(n.filter(n=>n.type===e.CustomDecorationType.COMMENT&&n.startIndex<t.endOffset&&n.endIndex>=t.startOffset).map(e=>e.id))}};n.FDocumentTextRange.extend(f)});
|
package/lib/umd/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/core"),require("@univerjs/thread-comment"),require("@univerjs/docs")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/thread-comment`,`@univerjs/docs`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverDocsThreadComment={},e.UniverCore,e.UniverThreadComment,e.UniverDocs))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let i=`default_doc`,a={id:`docs-thread-comment.mutation.add-decoration`,type:t.CommandType.MUTATION,handler(e,n){if(!n||t.JSONX.isNoop(n.actions))return!1;let r=e.get(t.IUniverInstanceService).getUnit(n.unitId,t.UniverInstanceType.UNIVER_DOC);if(!r)return!1;let i=t.JSONX.invertWithDoc(n.actions,r.getSnapshot());return r.apply(n.actions),{...n,actions:i}}};function o(e,n,r){var i;let{startOffset:a,endOffset:o}=r;if(!Number.isInteger(a)||!Number.isInteger(o)||a<0||o<=a)return null;let s=e.get(t.IUniverInstanceService).getUnit(n,t.UniverInstanceType.UNIVER_DOC),c=s==null||(i=s.getSelfOrHeaderFooterModel(r.segmentId))==null?void 0:i.getBody();return!c||o>c.dataStream.length?null:{...r,startOffset:a,endOffset:o,collapsed:!1}}async function s(e,r){let a=o(e,r.unitId,r.range);if(!a)return null;let s=await e.get(n.IThreadCommentDataSourceService).addComment(r.comment),c={...r.comment,...s,unitId:r.unitId,subUnitId:i,startOffset:a.startOffset,endOffset:a.endOffset,segmentId:a.segmentId,collapsed:!1},l=t.BuildTextUtils.customDecoration.add({ranges:[a],id:c.id,type:t.CustomDecorationType.COMMENT}),u={unitId:r.unitId,actions:t.JSONX.getInstance().editOp(l.serialize()),segmentId:a.segmentId};return{comment:c,commentMutation:{id:n.AddCommentMutation.id,params:{unitId:r.unitId,subUnitId:i,comment:c}},decorationMutationParams:u}}let c={id:`docs.command.create-text-range-comment`,type:t.CommandType.COMMAND,async handler(e,r){var c;if(!r)return!1;let l=o(e,r.unitId,r.range);if(!l)return!1;let u=e.get(t.IUniverInstanceService).getUnit(r.unitId,t.UniverInstanceType.UNIVER_DOC),d=u==null||(c=u.getSelfOrHeaderFooterModel(l.segmentId))==null?void 0:c.getBody();if(!d)return!1;let f=r.id??(0,t.generateRandomId)(),p={id:f,threadId:r.threadId??f,unitId:r.unitId,subUnitId:i,ref:t.BuildTextUtils.transform.getPlainText(d.dataStream.slice(l.startOffset,l.endOffset)),text:(0,n.normalizeThreadCommentContent)(r.content),attachments:r.attachments??[],dT:(0,n.getDT)(r.dateTime),personId:r.personId??e.get(t.UserManagerService).getCurrentUser().userID,startOffset:l.startOffset,endOffset:l.endOffset,segmentId:l.segmentId,collapsed:!1},m=await s(e,{unitId:r.unitId,range:l,comment:p});return m?(await(0,t.sequenceExecute)([m.commentMutation,{id:a.id,params:m.decorationMutationParams}],e.get(t.ICommandService))).result:!1}};var l=`@univerjs/docs-thread-comment`,u=`1.0.0-rc.0`;let d={};function f(e,t){return function(n,r){t(n,r,e)}}function p(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let m=`DOC_${n.TC_PLUGIN_NAME}`,h=class extends t.Disposable{constructor(e,r,i){super(),this._resourceManagerService=e,this._threadCommentModel=r,this._threadCommentDataSourceService=i,this.disposeWithMe(this._resourceManagerService.registerPluginResource((0,n.createThreadCommentResourceHook)(this._threadCommentModel,this._threadCommentDataSourceService,m,[t.UniverInstanceType.UNIVER_DOC])))}};h=p([f(0,t.IResourceManagerService),f(1,(0,t.Inject)(n.ThreadCommentModel)),f(2,n.IThreadCommentDataSourceService)],h);function g(e){"@babel/helpers - typeof";return g=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},g(e)}function _(e,t){if(g(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(g(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function v(e){var t=_(e,`string`);return g(t)==`symbol`?t:t+``}function y(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let b=class extends t.Plugin{constructor(e=d,n,r,i){super(),this._config=e,this._injector=n,this._configService=r,this._commandService=i;let{...a}=(0,t.merge)({},d,this._config);this._configService.setConfig(`docs-thread-comment.config`,a)}onStarting(){this._injector.add([h]),this._injector.get(h),this.disposeWithMe(this._commandService.registerCommand(c)),this.disposeWithMe(this._commandService.registerCommand(a))}};y(b,`pluginName`,`DOC_THREAD_COMMENT_PLUGIN`),y(b,`packageName`,l),y(b,`version`,u),y(b,`type`,t.UniverInstanceType.UNIVER_DOC),b=p([(0,t.DependentOn)(r.UniverDocsPlugin,n.UniverThreadCommentPlugin),f(1,(0,t.Inject)(t.Injector)),f(2,t.IConfigService),f(3,t.ICommandService)],b),e.AddDocCommentDecorationMutation=a,e.CreateDocTextRangeCommentCommand=c,e.DEFAULT_DOC_SUBUNIT_ID=i,Object.defineProperty(e,"UniverDocsThreadCommentPlugin",{enumerable:!0,get:function(){return b}}),e.prepareDocTextRangeComment=s});
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@univerjs/docs-thread-comment",
|
|
3
|
+
"version": "1.0.0-rc.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Thread comment model integration and Facade APIs for Univer Docs.",
|
|
6
|
+
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"funding": {
|
|
9
|
+
"type": "opencollective",
|
|
10
|
+
"url": "https://opencollective.com/univer"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://univer.ai",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/dream-num/univer"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/dream-num/univer/issues"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"univer",
|
|
22
|
+
"docs",
|
|
23
|
+
"comment",
|
|
24
|
+
"thread-comment"
|
|
25
|
+
],
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"import": "./lib/es/index.js",
|
|
29
|
+
"require": "./lib/cjs/index.js",
|
|
30
|
+
"types": "./lib/types/index.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./*": {
|
|
33
|
+
"import": "./lib/es/*",
|
|
34
|
+
"require": "./lib/cjs/*",
|
|
35
|
+
"types": "./lib/types/index.d.ts"
|
|
36
|
+
},
|
|
37
|
+
"./facade": {
|
|
38
|
+
"import": "./lib/es/facade.js",
|
|
39
|
+
"require": "./lib/cjs/facade.js",
|
|
40
|
+
"types": "./lib/types/facade/index.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./lib/facade": {
|
|
43
|
+
"import": "./lib/es/facade.js",
|
|
44
|
+
"require": "./lib/cjs/facade.js",
|
|
45
|
+
"types": "./lib/types/facade/index.d.ts"
|
|
46
|
+
},
|
|
47
|
+
"./lib/*": "./lib/*"
|
|
48
|
+
},
|
|
49
|
+
"main": "./lib/es/index.js",
|
|
50
|
+
"types": "./lib/types/index.d.ts",
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"directories": {
|
|
55
|
+
"lib": "lib"
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"lib"
|
|
59
|
+
],
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@univerjs/docs": "1.0.0-rc.0",
|
|
62
|
+
"@univerjs/core": "1.0.0-rc.0",
|
|
63
|
+
"@univerjs/thread-comment": "1.0.0-rc.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"rxjs": "^7.8.2",
|
|
67
|
+
"typescript": "^6.0.3",
|
|
68
|
+
"vitest": "^5.0.0",
|
|
69
|
+
"@univerjs-infra/shared": "1.0.0-rc.0"
|
|
70
|
+
},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"test:watch": "vitest",
|
|
74
|
+
"coverage": "vitest run --coverage",
|
|
75
|
+
"typecheck": "tsc --noEmit",
|
|
76
|
+
"build:bundle": "univer-cli build",
|
|
77
|
+
"build:types": "tsc -p tsconfig.node.json",
|
|
78
|
+
"build": "pnpm run build:bundle && pnpm run build:types"
|
|
79
|
+
},
|
|
80
|
+
"module": "./lib/es/index.js"
|
|
81
|
+
}
|