@univerjs/core 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +8 -8
- package/lib/es/index.js +3929 -3912
- package/lib/types/docs/data-model/document-data-model.d.ts +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/instance/instance.service.d.ts +13 -3
- package/lib/types/services/lifecycle/lifecycle.service.d.ts +1 -0
- package/lib/types/sheets/empty-snapshot.d.ts +1 -1
- package/lib/umd/index.js +9 -9
- package/package.json +5 -5
|
@@ -61,5 +61,6 @@ export declare class DocumentDataModel extends DocumentDataModelSimple {
|
|
|
61
61
|
sliceBody(startOffset: number, endOffset: number, type?: SliceBodyType): Nullable<IDocumentBody>;
|
|
62
62
|
private _initializeHeaderFooterModel;
|
|
63
63
|
updateDocumentId(unitId: string): void;
|
|
64
|
+
getPlainText(): string;
|
|
64
65
|
}
|
|
65
66
|
export {};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
export { getPlainText } from './docs/data-model/text-x/build-utils/parse';
|
|
16
17
|
export type { INumfmt } from './shared/types/numfmt.type';
|
|
17
18
|
export { debounce, get, merge, mergeWith, set } from 'lodash-es';
|
|
18
19
|
export { textDiff } from './shared/text-diff';
|
|
@@ -32,12 +32,21 @@ export interface IUniverInstanceService {
|
|
|
32
32
|
unitDisposed$: Observable<UnitModel>;
|
|
33
33
|
/** Subscribe to curtain type of units' disposing. */
|
|
34
34
|
getTypeOfUnitDisposed$<T extends UnitModel>(type: UnitType): Observable<T>;
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* An observable value that emits the id of the focused unit. A Univer app instance
|
|
37
|
+
* can only have 1 focused unit.
|
|
38
|
+
*
|
|
39
|
+
* You can use `getFocusedUnit` to get the currently focused unit, and
|
|
40
|
+
* `focusUnit` to focus a unit.
|
|
41
|
+
*/
|
|
36
42
|
focused$: Observable<Nullable<string>>;
|
|
37
43
|
/** Focus a unit. */
|
|
38
44
|
focusUnit(unitId: string | null): void;
|
|
45
|
+
/** Get the currently focused unit. */
|
|
39
46
|
getFocusedUnit(): Nullable<UnitModel>;
|
|
47
|
+
/** @deprecated Use `getCurrentUnitOfType` instead. */
|
|
40
48
|
getCurrentUnitForType<T extends UnitModel>(type: UnitType): Nullable<T>;
|
|
49
|
+
getCurrentUnitOfType<T extends UnitModel>(type: UnitType): Nullable<T>;
|
|
41
50
|
setCurrentUnitForType(unitId: string): void;
|
|
42
51
|
getCurrentTypeOfUnit$<T extends UnitModel>(type: UnitType): Observable<Nullable<T>>;
|
|
43
52
|
/** Create a unit with snapshot info. */
|
|
@@ -74,6 +83,7 @@ export declare class UniverInstanceService extends Disposable implements IUniver
|
|
|
74
83
|
readonly currentUnits$: Observable<Map<number, Nullable<UnitModel<object, number>>>>;
|
|
75
84
|
getCurrentTypeOfUnit$<T>(type: number): Observable<Nullable<T>>;
|
|
76
85
|
getCurrentUnitForType<T extends UnitModel>(type: UnitType): Nullable<T>;
|
|
86
|
+
getCurrentUnitOfType<T extends UnitModel>(type: UnitType): Nullable<T>;
|
|
77
87
|
setCurrentUnitForType(unitId: string): void;
|
|
78
88
|
private readonly _unitAdded$;
|
|
79
89
|
readonly unitAdded$: Observable<UnitModel<object, number>>;
|
|
@@ -102,7 +112,7 @@ export declare class UniverInstanceService extends Disposable implements IUniver
|
|
|
102
112
|
getFocusedUnit(): Nullable<UnitModel>;
|
|
103
113
|
getUnitType(unitId: string): UniverInstanceType;
|
|
104
114
|
disposeUnit(unitId: string): boolean;
|
|
105
|
-
private
|
|
106
|
-
private
|
|
115
|
+
private _tryResetCurrentOnRemoval;
|
|
116
|
+
private _tryResetFocusOnRemoval;
|
|
107
117
|
private _getUnitById;
|
|
108
118
|
}
|
|
@@ -16,6 +16,7 @@ export declare class LifecycleService extends Disposable {
|
|
|
16
16
|
get stage(): LifecycleStages;
|
|
17
17
|
set stage(stage: LifecycleStages);
|
|
18
18
|
dispose(): void;
|
|
19
|
+
onStage(stage: LifecycleStages): Promise<void>;
|
|
19
20
|
/**
|
|
20
21
|
* Subscribe to lifecycle changes and all previous stages and the current
|
|
21
22
|
* stage will be emitted immediately.
|