@ccpc/core 0.1.0 → 0.1.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/index.js +2080 -0
- package/package.json +4 -23
- package/types/display/dirty_prop.d.ts +3 -0
- package/types/display/state_object.d.ts +30 -0
- package/types/document/doc_saver.d.ts +13 -0
- package/types/document/document.d.ts +37 -0
- package/types/document/element_mgr.d.ts +28 -0
- package/types/document/i_document.d.ts +60 -0
- package/{dist → types}/document/id_pool.d.ts +3 -1
- package/types/element/db.d.ts +49 -0
- package/types/element/element.d.ts +55 -0
- package/{dist → types}/element/element_decorator.d.ts +0 -1
- package/{dist → types}/element/element_id.d.ts +1 -2
- package/types/element/i_element.d.ts +64 -0
- package/types/element/tmp_element/tmp_element.d.ts +6 -0
- package/types/element/tmp_element/tmp_element_painter.d.ts +27 -0
- package/types/grep/display/display_object.d.ts +37 -0
- package/types/grep/display/display_object_mgr.d.ts +23 -0
- package/types/grep/display/grep_display.d.ts +16 -0
- package/types/grep/gcurve2d.d.ts +15 -0
- package/types/grep/ggroup.d.ts +29 -0
- package/types/grep/gnode.d.ts +110 -0
- package/types/grep/gnode2d.d.ts +9 -0
- package/types/grep/gnode_type.d.ts +10 -0
- package/types/grep/gpoint2d.d.ts +14 -0
- package/types/grep/gpolycurve.d.ts +13 -0
- package/types/grep/gpolygon.d.ts +14 -0
- package/types/grep/grep.d.ts +15 -0
- package/types/grep/gtext2d.d.ts +14 -0
- package/types/grep/i_style.d.ts +42 -0
- package/types/grep/style_utils.d.ts +22 -0
- package/types/index.d.ts +41 -0
- package/types/model_view/i_high_light.d.ts +6 -0
- package/types/model_view/i_selection.d.ts +6 -0
- package/types/model_view/model_changed_cache.d.ts +35 -0
- package/types/model_view/model_view.d.ts +45 -0
- package/types/render/i_render.d.ts +24 -0
- package/types/render/null_render.d.ts +10 -0
- package/types/render/render_node.d.ts +68 -0
- package/types/render/render_node_util.d.ts +4 -0
- package/types/request/buildin_request/redo_request.d.ts +5 -0
- package/types/request/buildin_request/undo_request.d.ts +5 -0
- package/{dist → types}/request/i_request.d.ts +0 -1
- package/{dist → types}/request/request.d.ts +0 -1
- package/{dist → types}/request/request_decorator.d.ts +0 -1
- package/{dist → types}/request/request_mgr.d.ts +0 -1
- package/{dist → types}/toolkit/class_manager.d.ts +0 -1
- package/types/toolkit/cmath_util.d.ts +4 -0
- package/{dist → types}/toolkit/debug_util.d.ts +0 -1
- package/{dist → types}/transaction/i_transaction.d.ts +0 -1
- package/{dist → types}/transaction/i_transaction_base.d.ts +0 -1
- package/{dist → types}/transaction/i_transaction_group.d.ts +0 -1
- package/{dist → types}/transaction/transaction.d.ts +0 -1
- package/{dist → types}/transaction/transaction_base.d.ts +0 -1
- package/{dist → types}/transaction/transaction_group.d.ts +0 -1
- package/{dist → types}/transaction/transaction_mgr.d.ts +0 -1
- package/{dist → types}/transaction/undo_redo_entity.d.ts +0 -1
- package/types/types/type_define.d.ts +31 -0
- package/{dist → types}/types/type_guard.d.ts +1 -1
- package/README.md +0 -11
- package/dist/document/document.d.ts +0 -21
- package/dist/document/document.d.ts.map +0 -1
- package/dist/document/document.js +0 -53
- package/dist/document/element_mgr.d.ts +0 -11
- package/dist/document/element_mgr.d.ts.map +0 -1
- package/dist/document/element_mgr.js +0 -27
- package/dist/document/i_document.d.ts +0 -19
- package/dist/document/i_document.d.ts.map +0 -1
- package/dist/document/i_document.js +0 -1
- package/dist/document/id_pool.d.ts.map +0 -1
- package/dist/document/id_pool.js +0 -67
- package/dist/element/c_element.d.ts +0 -6
- package/dist/element/c_element.d.ts.map +0 -1
- package/dist/element/c_element.js +0 -6
- package/dist/element/element.d.ts +0 -42
- package/dist/element/element.d.ts.map +0 -1
- package/dist/element/element.js +0 -72
- package/dist/element/element_decorator.d.ts.map +0 -1
- package/dist/element/element_decorator.js +0 -40
- package/dist/element/element_id.d.ts.map +0 -1
- package/dist/element/element_id.js +0 -30
- package/dist/element/i_element.d.ts +0 -30
- package/dist/element/i_element.d.ts.map +0 -1
- package/dist/element/i_element.js +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -8
- package/dist/request/i_request.d.ts.map +0 -1
- package/dist/request/i_request.js +0 -1
- package/dist/request/request.d.ts.map +0 -1
- package/dist/request/request.js +0 -11
- package/dist/request/request_decorator.d.ts.map +0 -1
- package/dist/request/request_decorator.js +0 -10
- package/dist/request/request_mgr.d.ts.map +0 -1
- package/dist/request/request_mgr.js +0 -77
- package/dist/toolkit/class_manager.d.ts.map +0 -1
- package/dist/toolkit/class_manager.js +0 -54
- package/dist/toolkit/debug_util.d.ts.map +0 -1
- package/dist/toolkit/debug_util.js +0 -15
- package/dist/transaction/i_transaction.d.ts.map +0 -1
- package/dist/transaction/i_transaction.js +0 -1
- package/dist/transaction/i_transaction_base.d.ts.map +0 -1
- package/dist/transaction/i_transaction_base.js +0 -11
- package/dist/transaction/i_transaction_group.d.ts.map +0 -1
- package/dist/transaction/i_transaction_group.js +0 -1
- package/dist/transaction/transaction.d.ts.map +0 -1
- package/dist/transaction/transaction.js +0 -41
- package/dist/transaction/transaction_base.d.ts.map +0 -1
- package/dist/transaction/transaction_base.js +0 -32
- package/dist/transaction/transaction_group.d.ts.map +0 -1
- package/dist/transaction/transaction_group.js +0 -242
- package/dist/transaction/transaction_mgr.d.ts.map +0 -1
- package/dist/transaction/transaction_mgr.js +0 -84
- package/dist/transaction/undo_redo_entity.d.ts.map +0 -1
- package/dist/transaction/undo_redo_entity.js +0 -261
- package/dist/types/dump_type.d.ts +0 -4
- package/dist/types/dump_type.d.ts.map +0 -1
- package/dist/types/dump_type.js +0 -1
- package/dist/types/type_guard.d.ts.map +0 -1
- package/dist/types/type_guard.js +0 -1
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { IElement } from '../element/i_element';
|
|
2
|
-
export declare class ElementMgr {
|
|
3
|
-
private readonly _elements;
|
|
4
|
-
getElementById<T extends IElement>(id: number): T;
|
|
5
|
-
getAllElements(): IElement[];
|
|
6
|
-
getAllElementIds(): number[];
|
|
7
|
-
add(element: IElement, force?: boolean): boolean;
|
|
8
|
-
delete(id: number): boolean;
|
|
9
|
-
clear(): void;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=element_mgr.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"element_mgr.d.ts","sourceRoot":"","sources":["../../src/document/element_mgr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAEpD,qBAAa,UAAU;IACnB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8B;IAEjD,cAAc,CAAC,CAAC,SAAS,QAAQ,EAAE,EAAE,EAAE,MAAM,GACf,CAAC;IAG/B,cAAc,IAAI,QAAQ,EAAE;IAI5B,gBAAgB,IAAI,MAAM,EAAE;IAI5B,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAO;IAQnC,MAAM,CAAC,EAAE,EAAE,MAAM;IAIjB,KAAK;CAGf"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export class ElementMgr {
|
|
2
|
-
constructor() {
|
|
3
|
-
this._elements = new Map();
|
|
4
|
-
}
|
|
5
|
-
getElementById(id) {
|
|
6
|
-
return this._elements.get(id);
|
|
7
|
-
}
|
|
8
|
-
getAllElements() {
|
|
9
|
-
return [...this._elements.values()];
|
|
10
|
-
}
|
|
11
|
-
getAllElementIds() {
|
|
12
|
-
return [...this._elements.keys()];
|
|
13
|
-
}
|
|
14
|
-
add(element, force = true) {
|
|
15
|
-
if (!force && this._elements.has(element.id.asInt())) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
this._elements.set(element.id.asInt(), element);
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
delete(id) {
|
|
22
|
-
return this._elements.delete(id);
|
|
23
|
-
}
|
|
24
|
-
clear() {
|
|
25
|
-
this._elements.clear();
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ElementId } from '../element/element_id';
|
|
2
|
-
import type { IElement } from '../element/i_element';
|
|
3
|
-
import { RequestMgr } from '../request/request_mgr';
|
|
4
|
-
import { TransactionMgr } from '../transaction/transaction_mgr';
|
|
5
|
-
import { IConstructor } from '../types/type_guard';
|
|
6
|
-
import type { ElementMgr } from './element_mgr';
|
|
7
|
-
export interface IDocument {
|
|
8
|
-
/**对象管理器*/
|
|
9
|
-
readonly elementMgr: ElementMgr;
|
|
10
|
-
/**事务管理器*/
|
|
11
|
-
readonly transactionMgr: TransactionMgr;
|
|
12
|
-
readonly requestMgr: RequestMgr;
|
|
13
|
-
create<T extends IElement>(ctor: IConstructor<T>): T;
|
|
14
|
-
getElementById<T extends IElement>(id: ElementId | number): T | undefined;
|
|
15
|
-
/**根据id获取对象*/
|
|
16
|
-
getElementByIdEnsure<T extends IElement>(eleId: ElementId | number): T;
|
|
17
|
-
checkIfCanModifyDoc(): void;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=i_document.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i_document.d.ts","sourceRoot":"","sources":["../../src/document/i_document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,MAAM,WAAW,SAAS;IACtB,UAAU;IACV,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;IAE/B,UAAU;IACV,QAAQ,CAAC,c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/id_pool.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { ElementId } from '../element/element_id';
|
|
2
|
-
import { DebugUtil } from '../toolkit/debug_util';
|
|
3
|
-
export class IDPool {
|
|
4
|
-
constructor() {
|
|
5
|
-
this._unstablePool = [];
|
|
6
|
-
this._tmpPool = [];
|
|
7
|
-
this._currentStableIndex = 0;
|
|
8
|
-
this.reset();
|
|
9
|
-
}
|
|
10
|
-
reset(usedIds) {
|
|
11
|
-
this._unstablePool.splice(0);
|
|
12
|
-
for (let i = 0; i < IDPool.MAX_UNSTABLE_NUM; i++) {
|
|
13
|
-
const id = IDPool.MAX_UNSTABLE_OFFSET + i;
|
|
14
|
-
if (!usedIds?.has(id)) {
|
|
15
|
-
this._unstablePool.push(id);
|
|
16
|
-
if (this._unstablePool.length >= 1000) {
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
this._tmpPool.splice(0);
|
|
22
|
-
for (let i = 0; i < IDPool.MAX_TMP_NUM; i++) {
|
|
23
|
-
const id = IDPool.MAX_TMP_OFFSET + i;
|
|
24
|
-
if (!usedIds?.has(id)) {
|
|
25
|
-
this._tmpPool.push(id);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
genId(e) {
|
|
30
|
-
if (e.isTemporary()) {
|
|
31
|
-
return this.genTmpId();
|
|
32
|
-
}
|
|
33
|
-
if (!e.dontSave()) {
|
|
34
|
-
return this.genStableId();
|
|
35
|
-
}
|
|
36
|
-
return this.genUnstableId();
|
|
37
|
-
}
|
|
38
|
-
genTmpId() {
|
|
39
|
-
const id = this._tmpPool.pop();
|
|
40
|
-
if (id === undefined) {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
return new ElementId(id);
|
|
44
|
-
}
|
|
45
|
-
genUnstableId() {
|
|
46
|
-
const id = this._unstablePool.pop();
|
|
47
|
-
if (id === undefined) {
|
|
48
|
-
return undefined;
|
|
49
|
-
}
|
|
50
|
-
return new ElementId(id);
|
|
51
|
-
}
|
|
52
|
-
genStableId() {
|
|
53
|
-
const id = ++this._currentStableIndex;
|
|
54
|
-
DebugUtil.assert(id < IDPool.MAX_UNSTABLE_OFFSET, 'stable id资源已耗尽', 'wg', '2026-03-04');
|
|
55
|
-
return new ElementId(id);
|
|
56
|
-
}
|
|
57
|
-
clearStableId(startIdx) {
|
|
58
|
-
this._currentStableIndex = startIdx;
|
|
59
|
-
}
|
|
60
|
-
isStableId(id) {
|
|
61
|
-
return id < IDPool.MAX_UNSTABLE_OFFSET;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
IDPool.MAX_TMP_NUM = 1000;
|
|
65
|
-
IDPool.MAX_TMP_OFFSET = 2 ** 32 - IDPool.MAX_TMP_NUM;
|
|
66
|
-
IDPool.MAX_UNSTABLE_NUM = 1e6;
|
|
67
|
-
IDPool.MAX_UNSTABLE_OFFSET = 2 ** 32 - IDPool.MAX_UNSTABLE_NUM - IDPool.MAX_TMP_NUM;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"c_element.d.ts","sourceRoot":"","sources":["../../src/element/c_element.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;IACjB,SAAgB,EAAE,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;gBAEP,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAIvC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ElementId } from './element_id';
|
|
2
|
-
import type { IElement, IModifiedProps, T_SerializedId } from './i_element';
|
|
3
|
-
import type { IDocument } from '../document/i_document';
|
|
4
|
-
export declare class Element implements IElement {
|
|
5
|
-
/**
|
|
6
|
-
* 保存到文档中的序列化Id
|
|
7
|
-
*/
|
|
8
|
-
static serializedId: T_SerializedId;
|
|
9
|
-
private _db;
|
|
10
|
-
private _cache;
|
|
11
|
-
private _doc;
|
|
12
|
-
id: ElementId;
|
|
13
|
-
name: string;
|
|
14
|
-
constructor();
|
|
15
|
-
get db(): Record<string, unknown>;
|
|
16
|
-
get cache(): Record<string, unknown>;
|
|
17
|
-
getDoc(): IDocument;
|
|
18
|
-
setDoc(doc: IDocument): void;
|
|
19
|
-
/**
|
|
20
|
-
* 获取修改的数据
|
|
21
|
-
*/
|
|
22
|
-
getModified(): IModifiedProps[];
|
|
23
|
-
/**
|
|
24
|
-
* 数据入库
|
|
25
|
-
*/
|
|
26
|
-
commit(): void;
|
|
27
|
-
/**
|
|
28
|
-
* 数据回滚
|
|
29
|
-
*/
|
|
30
|
-
rollBack(): void;
|
|
31
|
-
/**
|
|
32
|
-
* 清空缓存
|
|
33
|
-
*/
|
|
34
|
-
private _clearCache;
|
|
35
|
-
/**
|
|
36
|
-
* 获取序列化的id
|
|
37
|
-
*/
|
|
38
|
-
getSerialId(): string;
|
|
39
|
-
isTemporary(): boolean;
|
|
40
|
-
dontSave(): boolean;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../src/element/element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAKvD,qBAAa,OAAQ,YAAW,QAAQ;IAEpC;;OAEG;IACH,OAAc,YAAY,EAAE,cAAc,CAAC;IAE3C,OAAO,CAAC,GAAG,CAA8B;IAEzC,OAAO,CAAC,MAAM,CAA8B;IAE5C,OAAO,CAAC,IAAI,CAAY;IAEjB,EAAE,YAAoB;IAEtB,IAAI,EAAE,MAAM,CAAK;;IAMxB,IAAW,EAAE,4BAEZ;IAED,IAAW,KAAK,4BAEf;IAEM,MAAM;IAIN,MAAM,CAAC,GAAG,EAAE,SAAS;IAI5B;;OAEG;IACI,WAAW,IAAI,cAAc,EAAE;IAYtC;;OAEG;IACI,MAAM;IAOb;;OAEG;IACI,QAAQ;IAIf;;OAEG;IACH,OAAO,CAAC,WAAW;IAInB;;OAEG;IACI,WAAW;IAIX,WAAW;IAIX,QAAQ,IAAI,OAAO;CAG7B"}
|
package/dist/element/element.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { ElementId } from './element_id';
|
|
2
|
-
import { DebugUtil } from '../toolkit/debug_util';
|
|
3
|
-
import { Document } from '../document/document';
|
|
4
|
-
// TODO 补充一些方法
|
|
5
|
-
export class Element {
|
|
6
|
-
constructor() {
|
|
7
|
-
this._db = {};
|
|
8
|
-
this._cache = {};
|
|
9
|
-
this.id = ElementId.INVALID;
|
|
10
|
-
this.name = '';
|
|
11
|
-
DebugUtil.assert(Document.canCreate, '创建Element必须通过Document.create方法', 'wg', '2025-11-18');
|
|
12
|
-
}
|
|
13
|
-
get db() {
|
|
14
|
-
return this._db;
|
|
15
|
-
}
|
|
16
|
-
get cache() {
|
|
17
|
-
return this._cache;
|
|
18
|
-
}
|
|
19
|
-
getDoc() {
|
|
20
|
-
return this._doc;
|
|
21
|
-
}
|
|
22
|
-
setDoc(doc) {
|
|
23
|
-
this._doc = doc;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* 获取修改的数据
|
|
27
|
-
*/
|
|
28
|
-
getModified() {
|
|
29
|
-
const result = [];
|
|
30
|
-
for (const propName in this._cache) {
|
|
31
|
-
result.push({
|
|
32
|
-
propertyName: propName,
|
|
33
|
-
oldValue: this._db[propName],
|
|
34
|
-
newValue: this._cache[propName],
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* 数据入库
|
|
41
|
-
*/
|
|
42
|
-
commit() {
|
|
43
|
-
for (const key in this._cache) {
|
|
44
|
-
this.db[key] = this._cache[key];
|
|
45
|
-
}
|
|
46
|
-
this._clearCache();
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 数据回滚
|
|
50
|
-
*/
|
|
51
|
-
rollBack() {
|
|
52
|
-
this._clearCache();
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* 清空缓存
|
|
56
|
-
*/
|
|
57
|
-
_clearCache() {
|
|
58
|
-
this._cache = {};
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* 获取序列化的id
|
|
62
|
-
*/
|
|
63
|
-
getSerialId() {
|
|
64
|
-
return this.constructor.serializedId.ctor;
|
|
65
|
-
}
|
|
66
|
-
isTemporary() {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
dontSave() {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"element_decorator.d.ts","sourceRoot":"","sources":["../../src/element/element_decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,MAC1B,CAAC,SAAS,QAAQ,EAAE,MAAM,YAAY,CAAC,CAAC,CAAC,SAmC7D,CAAA"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Document } from '../document/document';
|
|
2
|
-
export const RegisterElement = (ctorStr) => {
|
|
3
|
-
return function (Ctor) {
|
|
4
|
-
Ctor.serializedId = {
|
|
5
|
-
ctor: ctorStr,
|
|
6
|
-
};
|
|
7
|
-
Document.canCreate = true;
|
|
8
|
-
const tmpEle = new Ctor();
|
|
9
|
-
Document.canCreate = false;
|
|
10
|
-
const props = Object.keys(tmpEle).filter(key => !key.startsWith('_'));
|
|
11
|
-
props.forEach(propName => {
|
|
12
|
-
Object.defineProperty(Ctor.prototype, propName, {
|
|
13
|
-
set(value) {
|
|
14
|
-
const doc = this.getDoc();
|
|
15
|
-
const ele = doc?.getElementById(this.id);
|
|
16
|
-
if (ele) {
|
|
17
|
-
if (!ele.isTemporary()) {
|
|
18
|
-
doc.checkIfCanModifyDoc();
|
|
19
|
-
doc.transactionMgr.getCurrentUndoRedoEntity().onElementsUpdated([ele]);
|
|
20
|
-
this.cache[propName] = value;
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
this.db[propName] = value;
|
|
24
|
-
}
|
|
25
|
-
// TODO 视图更新
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
this.db[propName] = value;
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
get() {
|
|
32
|
-
if (this.cache[propName] !== undefined) {
|
|
33
|
-
return this.cache[propName];
|
|
34
|
-
}
|
|
35
|
-
return this.db[propName];
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"element_id.d.ts","sourceRoot":"","sources":["../../src/element/element_id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAElD,cAAM,SAAS;IACX,WAAkB,OAAO,cAExB;IAED,SAAS,CAAC,GAAG,EAAE,MAAM,CAAM;gBAEf,EAAE,EAAE,MAAM;IAIf,KAAK;IAIL,MAAM,CAAC,EAAE,EAAE,SAAS;IAIpB,OAAO;IAIP,QAAQ;IAIR,IAAI,IAAI,QAAQ;IAMhB,IAAI,CAAC,IAAI,EAAE,QAAQ;CAG7B;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
class ElementId {
|
|
2
|
-
static get INVALID() {
|
|
3
|
-
return new ElementId(-1);
|
|
4
|
-
}
|
|
5
|
-
constructor(id) {
|
|
6
|
-
this._id = -1;
|
|
7
|
-
this._id = id;
|
|
8
|
-
}
|
|
9
|
-
asInt() {
|
|
10
|
-
return this._id;
|
|
11
|
-
}
|
|
12
|
-
equals(id) {
|
|
13
|
-
return this._id === id.asInt();
|
|
14
|
-
}
|
|
15
|
-
isValid() {
|
|
16
|
-
return this._id && this._id > -1;
|
|
17
|
-
}
|
|
18
|
-
toString() {
|
|
19
|
-
return '' + this._id;
|
|
20
|
-
}
|
|
21
|
-
dump() {
|
|
22
|
-
return {
|
|
23
|
-
id: this._id,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
load(json) {
|
|
27
|
-
this._id = json.id;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export { ElementId };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { IDocument } from '../document/i_document';
|
|
2
|
-
import { ElementId } from './element_id';
|
|
3
|
-
export interface IElement {
|
|
4
|
-
id: ElementId;
|
|
5
|
-
name: string;
|
|
6
|
-
readonly db: Record<string, unknown>;
|
|
7
|
-
readonly cache: Record<string, unknown>;
|
|
8
|
-
getDoc(): IDocument;
|
|
9
|
-
setDoc(doc: IDocument): void;
|
|
10
|
-
getModified(): IModifiedProps[];
|
|
11
|
-
commit(): void;
|
|
12
|
-
rollBack(): void;
|
|
13
|
-
getSerialId(): string;
|
|
14
|
-
isTemporary(): boolean;
|
|
15
|
-
dontSave(): boolean;
|
|
16
|
-
}
|
|
17
|
-
export type T_SerializedId = {
|
|
18
|
-
/**类序列化的唯一标识*/
|
|
19
|
-
ctor: string;
|
|
20
|
-
};
|
|
21
|
-
export type IElementCtor<T extends IElement = IElement> = {
|
|
22
|
-
new (): T;
|
|
23
|
-
serializedId: T_SerializedId;
|
|
24
|
-
};
|
|
25
|
-
export type IModifiedProps = {
|
|
26
|
-
propertyName: string;
|
|
27
|
-
oldValue: unknown;
|
|
28
|
-
newValue: unknown;
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=i_element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i_element.d.ts","sourceRoot":"","sources":["../../src/element/i_element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,SAAS,CAAA;IAEb,IAAI,EAAE,MAAM,CAAA;IAEZ,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAEpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAEvC,MAAM,IAAI,SAAS,CAAA;IAEnB,MAAM,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAAA;IAE5B,WAAW,IAAI,cAAc,EAAE,CAAA;IAE/B,MAAM,IAAI,IAAI,CAAA;IAEd,QAAQ,IAAI,IAAI,CAAA;IAEhB,WAAW,IAAI,MAAM,CAAA;IAErB,WAAW,IAAI,OAAO,CAAA;IAEtB,QAAQ,IAAI,OAAO,CAAA;CACtB;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,cAAc;IACd,IAAI,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACtD,QAAO,CAAC,CAAA;IAER,YAAY,EAAE,cAAc,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { Element as CElement } from './element/element';
|
|
2
|
-
export { Element } from './element/element';
|
|
3
|
-
export { RegisterElement } from './element/element_decorator';
|
|
4
|
-
export type { IElement } from './element/i_element';
|
|
5
|
-
export { Document } from './document/document';
|
|
6
|
-
export type { IDocument } from './document/i_document';
|
|
7
|
-
export { ElementMgr } from './document/element_mgr';
|
|
8
|
-
export { Request } from './request/request';
|
|
9
|
-
export type { IRequest } from './request/i_request';
|
|
10
|
-
export { RequestMgr, requestMgr } from './request/request_mgr';
|
|
11
|
-
export { registerRequest } from './request/request_decorator';
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA"}
|
package/dist/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { Element as CElement } from './element/element';
|
|
2
|
-
export { Element } from './element/element';
|
|
3
|
-
export { RegisterElement } from './element/element_decorator';
|
|
4
|
-
export { Document } from './document/document';
|
|
5
|
-
export { ElementMgr } from './document/element_mgr';
|
|
6
|
-
export { Request } from './request/request';
|
|
7
|
-
export { RequestMgr, requestMgr } from './request/request_mgr';
|
|
8
|
-
export { registerRequest } from './request/request_decorator';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i_request.d.ts","sourceRoot":"","sources":["../../src/request/i_request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAEvD,MAAM,WAAW,QAAQ;IACrB,MAAM,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAAA;IAC5B,aAAa;IACb,OAAO,IAAI,OAAO,CAAA;IAElB,WAAW,IAAI,OAAO,CAAC;CAC1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/request/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,8BAAsB,OAAQ,YAAW,QAAQ;IAC7C,SAAS,CAAC,IAAI,EAAG,SAAS,CAAA;IAEnB,MAAM,CAAC,GAAG,EAAE,SAAS;aAIZ,OAAO,IAAI,OAAO;IAElC;;OAEG;IACI,WAAW,IAAI,OAAO;CAGhC"}
|
package/dist/request/request.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request_decorator.d.ts","sourceRoot":"","sources":["../../src/request/request_decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,IACrC,MAAM,YAAY,CAAC,OAAO,CAAC,UAGtC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request_mgr.d.ts","sourceRoot":"","sources":["../../src/request/request_mgr.ts"],"names":[],"mappings":"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action } from '../transaction/transaction';
|
|
4
|
-
import { TransactionGroup } from '../transaction/transaction_group';
|
|
5
|
-
/**
|
|
6
|
-
* RequestMgr 用法说明:
|
|
7
|
-
* 1) 单次请求:createReq -> executeReq(req, true)
|
|
8
|
-
* 2) 可取消请求:createReq -> executeReq(req, false) -> 后续 commit/cancel
|
|
9
|
-
* 3) 会话请求:
|
|
10
|
-
* startSession()
|
|
11
|
-
* createReq/executeReq 多次
|
|
12
|
-
* 成功 commitSession(),失败 abortSession()
|
|
13
|
-
*
|
|
14
|
-
* 约束:
|
|
15
|
-
* - 仅当 req.canTransact() 为 true 时会创建 Transaction。
|
|
16
|
-
* - abortSession/cancelReq 会回滚当前事务或事务组。
|
|
17
|
-
*/
|
|
18
|
-
export class RequestMgr {
|
|
19
|
-
constructor() {
|
|
20
|
-
/** Request 类管理器 */
|
|
21
|
-
this._requestClsMgr = new ClassManager();
|
|
22
|
-
}
|
|
23
|
-
static getInstance() {
|
|
24
|
-
if (!this._instance) {
|
|
25
|
-
this._instance = new RequestMgr();
|
|
26
|
-
}
|
|
27
|
-
return this._instance;
|
|
28
|
-
}
|
|
29
|
-
init(doc) {
|
|
30
|
-
this._doc = doc;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* 注册请求
|
|
34
|
-
*/
|
|
35
|
-
registerRequest(requestId, request) {
|
|
36
|
-
this._requestClsMgr.registerCls(requestId, request);
|
|
37
|
-
}
|
|
38
|
-
startSession(name = '') {
|
|
39
|
-
DebugUtil.assert(!this._transGroup, '请先提交上一个 request', 'wg', '2026-03-05');
|
|
40
|
-
this._transGroup = new TransactionGroup(this._doc, name);
|
|
41
|
-
}
|
|
42
|
-
commitSession() {
|
|
43
|
-
this._transGroup?.assimilate();
|
|
44
|
-
this._transGroup = undefined;
|
|
45
|
-
}
|
|
46
|
-
abortSession() {
|
|
47
|
-
this._transGroup?.rollBack();
|
|
48
|
-
this._transGroup = undefined;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* 创建请求
|
|
52
|
-
*/
|
|
53
|
-
createReq(ctor, ...args) {
|
|
54
|
-
const req = new ctor(...args);
|
|
55
|
-
req.setDoc(this._doc);
|
|
56
|
-
const reqName = this._requestClsMgr.getClsNameEnsure(ctor);
|
|
57
|
-
if (req.canTransact()) {
|
|
58
|
-
this._transaction = new Transaction(this._doc, `${reqName}-start`);
|
|
59
|
-
}
|
|
60
|
-
return req;
|
|
61
|
-
}
|
|
62
|
-
executeReq(req, commit = true) {
|
|
63
|
-
const result = req.execute();
|
|
64
|
-
if (!commit || !req.canTransact())
|
|
65
|
-
return result;
|
|
66
|
-
DebugUtil.assert(this._transaction, '请先创建一个 request', 'wg', '2026-03-05');
|
|
67
|
-
this._transaction?.commit();
|
|
68
|
-
// TODO: 视图刷新 + 事件处理
|
|
69
|
-
this._transaction = undefined;
|
|
70
|
-
return result;
|
|
71
|
-
}
|
|
72
|
-
cancelReq() {
|
|
73
|
-
this._transaction?.rollBack();
|
|
74
|
-
this._transaction = undefined;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
export const requestMgr = RequestMgr.getInstance();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"class_manager.d.ts","sourceRoot":"","sources":["../../src/toolkit/class_manager.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,YAAY,CAAC,CAAC,EAAE,CAAC;IAE1B,OAAO,CAAC,MAAM,CAAwB;IAEtC,OAAO,CAAC,MAAM,CAAwB;IACtC;;OAEG;IACI,WAAW,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IAOjC;;OAEG;IACI,MAAM,CAAC,GAAG,EAAE,CAAC;IAIb,YAAY,CAAC,GAAG,EAAE,CAAC;IAM1B;;OAEG;IACI,UAAU,CAAC,GAAG,EAAE,CAAC;IAIjB,gBAAgB,CAAC,GAAG,EAAE,CAAC;IAM9B;;OAEG;IACI,SAAS;IAIhB;;OAEG;IACI,YAAY;CAGtB"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { DebugUtil } from './debug_util';
|
|
2
|
-
/**
|
|
3
|
-
* 类管理器
|
|
4
|
-
*/
|
|
5
|
-
export class ClassManager {
|
|
6
|
-
constructor() {
|
|
7
|
-
this._kvMap = new Map();
|
|
8
|
-
this._vkMap = new Map();
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* 注册类
|
|
12
|
-
*/
|
|
13
|
-
registerCls(key, val) {
|
|
14
|
-
const ctor = this._kvMap.get(key);
|
|
15
|
-
if (ctor)
|
|
16
|
-
DebugUtil.assert(false, `${String(val)}已注册,请检查`, 'wg', '2026-03-05');
|
|
17
|
-
this._kvMap.set(key, val);
|
|
18
|
-
this._vkMap.set(val, key);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* 获取类
|
|
22
|
-
*/
|
|
23
|
-
getCls(key) {
|
|
24
|
-
return this._kvMap.get(key);
|
|
25
|
-
}
|
|
26
|
-
getClsEnsure(key) {
|
|
27
|
-
const cls = this.getCls(key);
|
|
28
|
-
DebugUtil.assert(cls, `未获取到键为${String(key)}对应的类`, 'wg', '2026-03-05');
|
|
29
|
-
return cls;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* 获取标识
|
|
33
|
-
*/
|
|
34
|
-
getClsName(val) {
|
|
35
|
-
return this._vkMap.get(val);
|
|
36
|
-
}
|
|
37
|
-
getClsNameEnsure(val) {
|
|
38
|
-
const name = this.getClsName(val);
|
|
39
|
-
DebugUtil.assert(name, `未获取到值为${String(val)}对应的标识`, 'wg', '2026-03-05');
|
|
40
|
-
return name;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* 获取所有类
|
|
44
|
-
*/
|
|
45
|
-
getAllCls() {
|
|
46
|
-
return [...this._kvMap.values()];
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 查看所有类个数
|
|
50
|
-
*/
|
|
51
|
-
getClsLength() {
|
|
52
|
-
return this._kvMap.size;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug_util.d.ts","sourceRoot":"","sources":["../../src/toolkit/debug_util.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;WACJ,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC;WAQjG,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAMjF"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export class DebugUtil {
|
|
2
|
-
static assert(value, message, name, time) {
|
|
3
|
-
if (!value) {
|
|
4
|
-
const showMesg = `${message}\n报告人:${name}\n报告时间:${time}\n点击确定可debug`;
|
|
5
|
-
// TODO 触发事件
|
|
6
|
-
throw new Error(showMesg);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
static warn(value, message, name, time) {
|
|
10
|
-
if (!value) {
|
|
11
|
-
const showMesg = `${message}\n报告人:${name}\n报告时间:${time}\n点击确定可debug`;
|
|
12
|
-
console.warn(showMesg);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i_transaction.d.ts","sourceRoot":"","sources":["../../src/transaction/i_transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IAClD,QAAQ,CAAC,cAAc,EAAE,cAAc,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AE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;CACzC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export var EN_TransactionStatus;
|
|
2
|
-
(function (EN_TransactionStatus) {
|
|
3
|
-
/**未启动*/
|
|
4
|
-
EN_TransactionStatus["NOT_STARTED"] = "not-started";
|
|
5
|
-
/**已启动*/
|
|
6
|
-
EN_TransactionStatus["STARTED"] = "started";
|
|
7
|
-
/**已提交*/
|
|
8
|
-
EN_TransactionStatus["COMMITTED"] = "committed";
|
|
9
|
-
/**已回滚*/
|
|
10
|
-
EN_TransactionStatus["ROLLED_BACK"] = "rolled_back";
|
|
11
|
-
})(EN_TransactionStatus || (EN_TransactionStatus = {}));
|