@finos/legend-extension-dsl-text 1.0.26 → 1.0.29
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/components/studio/TextElementEditor.d.ts +1 -0
- package/lib/components/studio/TextElementEditor.d.ts.map +1 -1
- package/lib/components/studio/TextElementEditor.js +3 -2
- package/lib/components/studio/TextElementEditor.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/models/metamodels/pure/model/packageableElements/text/DSLText_Text.d.ts +0 -2
- package/lib/models/metamodels/pure/model/packageableElements/text/DSLText_Text.d.ts.map +1 -1
- package/lib/models/metamodels/pure/model/packageableElements/text/DSLText_Text.js +1 -9
- package/lib/models/metamodels/pure/model/packageableElements/text/DSLText_Text.js.map +1 -1
- package/lib/package.json +3 -3
- package/lib/stores/studio/DSLText_ModifierHelper.d.ts +19 -0
- package/lib/stores/studio/DSLText_ModifierHelper.d.ts.map +1 -0
- package/lib/stores/studio/DSLText_ModifierHelper.js +23 -0
- package/lib/stores/studio/DSLText_ModifierHelper.js.map +1 -0
- package/package.json +9 -9
- package/src/components/studio/TextElementEditor.tsx +7 -2
- package/src/models/metamodels/pure/model/packageableElements/text/DSLText_Text.ts +1 -10
- package/src/stores/studio/DSLText_ModifierHelper.ts +28 -0
- package/tsconfig.json +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextElementEditor.d.ts","sourceRoot":"","sources":["../../../src/components/studio/TextElementEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"TextElementEditor.d.ts","sourceRoot":"","sources":["../../../src/components/studio/TextElementEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAqCH,eAAO,MAAM,iBAAiB;;CAsE5B,CAAC"}
|
|
@@ -22,6 +22,7 @@ import { TextEditorState } from '../../stores/studio/TextEditorState';
|
|
|
22
22
|
import { LockIcon, CaretDownIcon, DropdownMenu, MenuContent, MenuContentItem, } from '@finos/legend-art';
|
|
23
23
|
import { EDITOR_LANGUAGE } from '@finos/legend-application';
|
|
24
24
|
import { TEXT_TYPE } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
25
|
+
import { text_setContent, text_setType, } from '../../stores/studio/DSLText_ModifierHelper';
|
|
25
26
|
const getTextElementEditorLanguage = (type) => {
|
|
26
27
|
switch (type) {
|
|
27
28
|
case TEXT_TYPE.MARKDOWN:
|
|
@@ -39,9 +40,9 @@ export const TextElementEditor = observer(() => {
|
|
|
39
40
|
const isReadOnly = textEditorState.isReadOnly;
|
|
40
41
|
const typeNameRef = useRef(null);
|
|
41
42
|
const changeType = (val) => () => {
|
|
42
|
-
!isReadOnly && textElement
|
|
43
|
+
!isReadOnly && text_setType(textElement, val);
|
|
43
44
|
};
|
|
44
|
-
const changeContent = (val) => textElement
|
|
45
|
+
const changeContent = (val) => text_setContent(textElement, val);
|
|
45
46
|
useEffect(() => {
|
|
46
47
|
if (!isReadOnly) {
|
|
47
48
|
typeNameRef.current?.focus();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextElementEditor.js","sourceRoot":"","sources":["../../../src/components/studio/TextElementEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,eAAe,EACf,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EACL,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,WAAW,EACX,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,M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E,UAAU,EAAE,OAAO,EAAE;6BAC1D,YAED,eAAK,SAAS,EAAC,4CAA4C,aACzD,cAAK,SAAS,EAAC,mDAAmD,YAC/D,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,GAC9B,EACN,cAAK,SAAS,EAAC,kDAAkD,YAC/D,KAAC,aAAa,KAAG,GACb,IACF,GACO,IACX,GACF,EACN,cAAK,SAAS,EAAC,4CAA4C,YACzD,KAAC,qBAAqB,IACpB,QAAQ,EAAE,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC,EACxD,UAAU,EAAE,WAAW,CAAC,OAAO,EAC/B,WAAW,EAAE,aAAa,GAC1B,GACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/lib/index.css
CHANGED
|
@@ -23,8 +23,6 @@ export declare class Text extends PackageableElement implements Hashable {
|
|
|
23
23
|
type: TEXT_TYPE;
|
|
24
24
|
content: string;
|
|
25
25
|
constructor(name: string);
|
|
26
|
-
setType(type: TEXT_TYPE): void;
|
|
27
|
-
setContent(content: string): void;
|
|
28
26
|
protected get _elementHashCode(): string;
|
|
29
27
|
accept_PackageableElementVisitor<T>(visitor: PackageableElementVisitor<T>): T;
|
|
30
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_Text.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/model/packageableElements/text/DSLText_Text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EACL,KAAK,yBAAyB,EAC9B,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,oBAAY,SAAS;IACnB,UAAU,cAAc;IACxB,QAAQ,aAAa;CACtB;AAED,qBAAa,IAAK,SAAQ,kBAAmB,YAAW,QAAQ;IAC9D,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;gBAEJ,IAAI,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"DSLText_Text.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/model/packageableElements/text/DSLText_Text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EACL,KAAK,yBAAyB,EAC9B,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,oBAAY,SAAS;IACnB,UAAU,cAAc;IACxB,QAAQ,aAAa;CACtB;AAED,qBAAa,IAAK,SAAQ,kBAAmB,YAAW,QAAQ;IAC9D,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;gBAEJ,IAAI,EAAE,MAAM;IAaxB,cAAuB,gBAAgB,IAAI,MAAM,CAOhD;IAED,gCAAgC,CAAC,CAAC,EAChC,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACpC,CAAC;CAGL"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { observable,
|
|
16
|
+
import { observable, makeObservable, override } from 'mobx';
|
|
17
17
|
import { hashArray } from '@finos/legend-shared';
|
|
18
18
|
import { TEXT_HASH_STRUCTURE } from '../../../../../DSLText_ModelUtils';
|
|
19
19
|
import { PackageableElement, } from '@finos/legend-graph';
|
|
@@ -30,19 +30,11 @@ export class Text extends PackageableElement {
|
|
|
30
30
|
makeObservable(this, {
|
|
31
31
|
type: observable,
|
|
32
32
|
content: observable,
|
|
33
|
-
setType: action,
|
|
34
|
-
setContent: action,
|
|
35
33
|
_elementHashCode: override,
|
|
36
34
|
});
|
|
37
35
|
this.type = TEXT_TYPE.PLAIN_TEXT;
|
|
38
36
|
this.content = '';
|
|
39
37
|
}
|
|
40
|
-
setType(type) {
|
|
41
|
-
this.type = type;
|
|
42
|
-
}
|
|
43
|
-
setContent(content) {
|
|
44
|
-
this.content = content;
|
|
45
|
-
}
|
|
46
38
|
get _elementHashCode() {
|
|
47
39
|
return hashArray([
|
|
48
40
|
TEXT_HASH_STRUCTURE.TEXT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_Text.js","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/model/packageableElements/text/DSLText_Text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"DSLText_Text.js","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/model/packageableElements/text/DSLText_Text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAiB,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAEL,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,qCAAwB,CAAA;IACxB,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,OAAO,IAAK,SAAQ,kBAAkB;IAC1C,IAAI,CAAY;IAChB,OAAO,CAAS;IAEhB,YAAY,IAAY;QACtB,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,cAAc,CAA2B,IAAI,EAAE;YAC7C,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,UAAU;YACnB,gBAAgB,EAAE,QAAQ;SAC3B,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,IAAuB,gBAAgB;QACrC,OAAO,SAAS,CAAC;YACf,mBAAmB,CAAC,IAAI;YACxB,IAAI,CAAC,IAAI;YACT,IAAI,CAAC,IAAI;YACT,IAAI,CAAC,OAAO;SACb,CAAC,CAAC;IACL,CAAC;IAED,gCAAgC,CAC9B,OAAqC;QAErC,OAAO,OAAO,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;CACF"}
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-extension-dsl-text",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"description": "Legend extension for Text DSL",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"clean:cache": "rimraf \"build\"",
|
|
32
32
|
"clean:lib": "rimraf \"lib\"",
|
|
33
33
|
"dev": "npm-run-all --parallel dev:sass dev:ts",
|
|
34
|
-
"dev:sass": "sass style
|
|
34
|
+
"dev:sass": "sass style:lib --watch --load-path=../../node_modules/@finos/legend-art/scss",
|
|
35
35
|
"dev:ts": "tsc --watch --preserveWatchOutput",
|
|
36
36
|
"lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location ./build/.eslintcache --report-unused-disable-directives --parser-options=project:\"./tsconfig.json\" \"./src/**/*.{js,ts,tsx}\"",
|
|
37
37
|
"publish:prepare": "node ../../scripts/release/preparePublishContent.js",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"jest": "27.5.1",
|
|
61
61
|
"npm-run-all": "4.1.5",
|
|
62
62
|
"rimraf": "3.0.2",
|
|
63
|
-
"sass": "1.49.
|
|
63
|
+
"sass": "1.49.11",
|
|
64
64
|
"typescript": "4.6.3"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
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 { TEXT_TYPE, Text } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
17
|
+
export declare const text_setType: (text: Text, type: TEXT_TYPE) => void;
|
|
18
|
+
export declare const text_setContent: (text: Text, content: string) => void;
|
|
19
|
+
//# sourceMappingURL=DSLText_ModifierHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DSLText_ModifierHelper.d.ts","sourceRoot":"","sources":["../../../src/stores/studio/DSLText_ModifierHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EACV,SAAS,EACT,IAAI,EACL,MAAM,0EAA0E,CAAC;AAElF,eAAO,MAAM,YAAY,SAAiB,IAAI,QAAQ,SAAS,KAAG,IAEhE,CAAC;AACH,eAAO,MAAM,eAAe,SAAiB,IAAI,WAAW,MAAM,KAAG,IAEnE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
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 { action } from 'mobx';
|
|
17
|
+
export const text_setType = action((text, type) => {
|
|
18
|
+
text.type = type;
|
|
19
|
+
});
|
|
20
|
+
export const text_setContent = action((text, content) => {
|
|
21
|
+
text.content = content;
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=DSLText_ModifierHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DSLText_ModifierHelper.js","sourceRoot":"","sources":["../../../src/stores/studio/DSLText_ModifierHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAM9B,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,IAAU,EAAE,IAAe,EAAQ,EAAE;IACvE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACnB,CAAC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,IAAU,EAAE,OAAe,EAAQ,EAAE;IAC1E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACzB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-extension-dsl-text",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"description": "Legend extension for Text DSL",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"clean:cache": "rimraf \"build\"",
|
|
32
32
|
"clean:lib": "rimraf \"lib\"",
|
|
33
33
|
"dev": "npm-run-all --parallel dev:sass dev:ts",
|
|
34
|
-
"dev:sass": "sass style
|
|
34
|
+
"dev:sass": "sass style:lib --watch --load-path=../../node_modules/@finos/legend-art/scss",
|
|
35
35
|
"dev:ts": "tsc --watch --preserveWatchOutput",
|
|
36
36
|
"lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location ./build/.eslintcache --report-unused-disable-directives --parser-options=project:\"./tsconfig.json\" \"./src/**/*.{js,ts,tsx}\"",
|
|
37
37
|
"publish:prepare": "node ../../scripts/release/preparePublishContent.js",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"test:watch": "jest --watch"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@finos/legend-application": "2.0.
|
|
44
|
-
"@finos/legend-art": "0.3.
|
|
45
|
-
"@finos/legend-graph": "2.1.
|
|
46
|
-
"@finos/legend-model-storage": "0.0.
|
|
43
|
+
"@finos/legend-application": "2.0.8",
|
|
44
|
+
"@finos/legend-art": "0.3.13",
|
|
45
|
+
"@finos/legend-graph": "2.1.3",
|
|
46
|
+
"@finos/legend-model-storage": "0.0.26",
|
|
47
47
|
"@finos/legend-shared": "1.2.7",
|
|
48
|
-
"@finos/legend-studio": "5.1.
|
|
48
|
+
"@finos/legend-studio": "5.1.3",
|
|
49
49
|
"@types/react": "17.0.43",
|
|
50
50
|
"mobx": "6.5.0",
|
|
51
51
|
"mobx-react-lite": "3.3.0",
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"serializr": "2.0.5"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@finos/legend-dev-utils": "0.3.
|
|
57
|
+
"@finos/legend-dev-utils": "0.3.17",
|
|
58
58
|
"cross-env": "7.0.3",
|
|
59
59
|
"eslint": "8.12.0",
|
|
60
60
|
"jest": "27.5.1",
|
|
61
61
|
"npm-run-all": "4.1.5",
|
|
62
62
|
"rimraf": "3.0.2",
|
|
63
|
-
"sass": "1.49.
|
|
63
|
+
"sass": "1.49.11",
|
|
64
64
|
"typescript": "4.6.3"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
@@ -31,6 +31,10 @@ import {
|
|
|
31
31
|
} from '@finos/legend-art';
|
|
32
32
|
import { EDITOR_LANGUAGE } from '@finos/legend-application';
|
|
33
33
|
import { TEXT_TYPE } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
34
|
+
import {
|
|
35
|
+
text_setContent,
|
|
36
|
+
text_setType,
|
|
37
|
+
} from '../../stores/studio/DSLText_ModifierHelper';
|
|
34
38
|
|
|
35
39
|
const getTextElementEditorLanguage = (type: TEXT_TYPE): EDITOR_LANGUAGE => {
|
|
36
40
|
switch (type) {
|
|
@@ -54,9 +58,10 @@ export const TextElementEditor = observer(() => {
|
|
|
54
58
|
const changeType =
|
|
55
59
|
(val: TEXT_TYPE): (() => void) =>
|
|
56
60
|
(): void => {
|
|
57
|
-
!isReadOnly && textElement
|
|
61
|
+
!isReadOnly && text_setType(textElement, val);
|
|
58
62
|
};
|
|
59
|
-
const changeContent = (val: string): void =>
|
|
63
|
+
const changeContent = (val: string): void =>
|
|
64
|
+
text_setContent(textElement, val);
|
|
60
65
|
|
|
61
66
|
useEffect(() => {
|
|
62
67
|
if (!isReadOnly) {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { observable,
|
|
17
|
+
import { observable, makeObservable, override } from 'mobx';
|
|
18
18
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
|
19
19
|
import { TEXT_HASH_STRUCTURE } from '../../../../../DSLText_ModelUtils';
|
|
20
20
|
import {
|
|
@@ -37,8 +37,6 @@ export class Text extends PackageableElement implements Hashable {
|
|
|
37
37
|
makeObservable<Text, '_elementHashCode'>(this, {
|
|
38
38
|
type: observable,
|
|
39
39
|
content: observable,
|
|
40
|
-
setType: action,
|
|
41
|
-
setContent: action,
|
|
42
40
|
_elementHashCode: override,
|
|
43
41
|
});
|
|
44
42
|
|
|
@@ -46,13 +44,6 @@ export class Text extends PackageableElement implements Hashable {
|
|
|
46
44
|
this.content = '';
|
|
47
45
|
}
|
|
48
46
|
|
|
49
|
-
setType(type: TEXT_TYPE): void {
|
|
50
|
-
this.type = type;
|
|
51
|
-
}
|
|
52
|
-
setContent(content: string): void {
|
|
53
|
-
this.content = content;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
47
|
protected override get _elementHashCode(): string {
|
|
57
48
|
return hashArray([
|
|
58
49
|
TEXT_HASH_STRUCTURE.TEXT,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
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
|
+
|
|
17
|
+
import { action } from 'mobx';
|
|
18
|
+
import type {
|
|
19
|
+
TEXT_TYPE,
|
|
20
|
+
Text,
|
|
21
|
+
} from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
22
|
+
|
|
23
|
+
export const text_setType = action((text: Text, type: TEXT_TYPE): void => {
|
|
24
|
+
text.type = type;
|
|
25
|
+
});
|
|
26
|
+
export const text_setContent = action((text: Text, content: string): void => {
|
|
27
|
+
text.content = content;
|
|
28
|
+
});
|
package/tsconfig.json
CHANGED
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"./src/models/protocols/pure/v1/model/packageableElements/text/V1_DSLText_Text.ts",
|
|
48
48
|
"./src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.ts",
|
|
49
49
|
"./src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.ts",
|
|
50
|
+
"./src/stores/studio/DSLText_ModifierHelper.ts",
|
|
50
51
|
"./src/stores/studio/TextEditorState.ts",
|
|
51
52
|
"./src/components/studio/DSLText_LegendStudioPlugin.tsx",
|
|
52
53
|
"./src/components/studio/TextElementEditor.tsx"
|