@metadev/daga-react 0.0.1

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/Changelog.md ADDED
@@ -0,0 +1,212 @@
1
+ # DAGA Changelog
2
+
3
+ List of releases and changes.
4
+
5
+ ![Daga logo](https://metadev.pro/icons/daga-logo-header.svg)
6
+
7
+ ## Next release Excalibur
8
+
9
+ - Enable configuring different looks for palette connection templates based on whether the connection type is the one currently selected or not [#197](https://github.com/metadevpro/daga/pull/197)
10
+ - Enable configuring the gap in palette elements [#197](https://github.com/metadevpro/daga/pull/197)
11
+ - Enable placing palette templates in multiple columns if they fit [#197](https://github.com/metadevpro/daga/pull/197)
12
+ - Use grab cursor style when hovering cursor on node palette templates and pointer cursor style when hovering cursor on connection palette templates [#197](https://github.com/metadevpro/daga/pull/197)
13
+ - Add node continence [#200](https://github.com/metadevpro/daga/pull/200)
14
+ - Enable defining custom shape functions for nodes in the configuration [#206](https://github.com/metadevpro/daga/pull/206)
15
+ - Fix order of diagram elements [#208](https://github.com/metadevpro/daga/pull/208)
16
+
17
+ ## v. 2.0.0 Lobera
18
+
19
+ Date: _2024-11-22_
20
+
21
+ - Allow multiple selection of nodes by secondary click and drag to draw a selection rectangle [#146](https://github.com/metadevpro/daga/issues/146) [#174](https://github.com/metadevpro/daga/pull/174)
22
+ - Make all diagram components disabled by default in diagram configuration [#174](https://github.com/metadevpro/daga/pull/174)
23
+ - Rename `exists` attribute of diagram configuration of components to `enabled` [#174](https://github.com/metadevpro/daga/pull/174)
24
+ - Move methods regarding user selection in diagram canvas (`isInUserSelection`, `addToUserSelection`, `removeFromUserSelection`, `toggleUserSelection`, `clearUserSelection`, `deleteUserSelection`, `copyUserSelectionToClipboard`, `pasteUserSelectionFromClipboard`, `setPropertyEditorSelection`) to its own `userSelection` object in the canvas [#174](https://github.com/metadevpro/daga/pull/174)
25
+ - Move methods regarding user highlight in diagram canvas (`highlight`, `unhighlight`) to its own `userHighlight` object in the canvas [#174](https://github.com/metadevpro/daga/pull/174)
26
+ - Move methods regarding context menu in diagram canvas (`openContextMenu`, `closeContextMenu`) to its own `contextMenu` object in the canvas [#174](https://github.com/metadevpro/daga/pull/174)
27
+ - Split the core of Daga functionalities from the Angular-specific parts [#150](https://github.com/metadevpro/daga/issues/150) [#175](https://github.com/metadevpro/daga/pull/175)
28
+ - Add `Move` action type to support moving multiple elements at once [#177](https://github.com/metadevpro/daga/pull/177)
29
+ - When moving a selected element, move the entire user selection [#177](https://github.com/metadevpro/daga/pull/177)
30
+ - Fix bug with undoing paste actions not removing the correct elements [#177](https://github.com/metadevpro/daga/pull/177)
31
+ - Void property editor selection when selecting multiple elements [#178](https://github.com/metadevpro/daga/pull/178)
32
+ - Extract canvas configuration to its own object within the diagram configuration [#180](https://github.com/metadevpro/daga/pull/180)
33
+ - Solve bug with infinite loop on getting an element from an element set [#181](https://github.com/metadevpro/daga/pull/181)
34
+ - Add multiple selection menu button [#182](https://github.com/metadevpro/daga/pull/182)
35
+ - Do not highlight nodes when moving nodes or drawing a multiple selection rectangle [#182](https://github.com/metadevpro/daga/pull/182)
36
+ - Rename `guessConnectionType` to `inferConnectionType` [#185](https://github.com/metadevpro/daga/pull/185)
37
+ - Rename `ActionQueue` to `ActionStack` [#185](https://github.com/metadevpro/daga/pull/185)
38
+ - Rename `zoomRate` to `zoomFactor` [#185](https://github.com/metadevpro/daga/pull/185)
39
+ - Rename `validatorChanges$` to `validatorChange$`, `diagramChanges$` to `diagramChange$` and `diagramImportantChanges$` to `diagramImportantChange$` [#185](https://github.com/metadevpro/daga/pull/185)
40
+ - When undoing or redoing user actions, perform undo or redo repeatedly until there's an effect on the diagram [#190](https://github.com/metadevpro/daga/pull/190)
41
+
42
+ ## v. 1.5.7
43
+
44
+ Date: _2024-10-16_
45
+
46
+ - Fix the selecion of layout algorithms in examples [#170](https://github.com/metadevpro/daga/pull/170)
47
+ - Add `daga-` prefixes to element classes to avoid stylesheet conflicts [#171](https://github.com/metadevpro/daga/pull/171)
48
+ - Highlight diagram elements with the error when showing an error [#171](https://github.com/metadevpro/daga/pull/171)
49
+ - Prevent selecting the same element multiple times [#172](https://github.com/metadevpro/daga/issues/172) [#173](https://github.com/metadevpro/daga/pull/173)
50
+
51
+ ## v. 1.5.6
52
+
53
+ Date: _2024-10-10_
54
+
55
+ - Filter away removed elements by default [#168](https://github.com/metadevpro/daga/pull/168)
56
+ - Generalize the margin and padding of fields to enable different amounts of margin on each side [#168](https://github.com/metadevpro/daga/pull/168)
57
+ - Enable using the - and + keys for zoom [#168](https://github.com/metadevpro/daga/pull/168)
58
+ - Enable using the arrow keys for panning [#168](https://github.com/metadevpro/daga/pull/168)
59
+
60
+ ## v. 1.5.5
61
+
62
+ Date: _2024-10-02_
63
+
64
+ - Ensure that decorators are always removed [#167](https://github.com/metadevpro/daga/pull/167)
65
+
66
+ ## v. 1.5.4
67
+
68
+ Date: _2024-09-21_
69
+
70
+ - Add diagram decorators [#164](https://github.com/metadevpro/daga/issues/164) [#166](https://github.com/metadevpro/daga/pull/166)
71
+ - Enable diagram events on diagram objects [#166](https://github.com/metadevpro/daga/pull/166)
72
+
73
+ ## v. 1.5.3
74
+
75
+ Date: _2024-09-09_
76
+
77
+ - Create interface for listening to user events on the diagram [#160](https://github.com/metadevpro/daga/issues/160) [#161](https://github.com/metadevpro/daga/pull/161)
78
+
79
+ ## v. 1.5.2
80
+
81
+ Date: _2024-08-30_
82
+
83
+ - Create new UpdateValuesAction on debounced user changes instead of only on closing the property editor [#136](https://github.com/metadevpro/daga/issues/136) [#152](https://github.com/metadevpro/daga/pull/152)
84
+ - Fix bug with failing to highlight ports due to attempting to highlight ports from a removed node instead [#156](https://github.com/metadevpro/daga/pull/156)
85
+ - Stop propagation of keydown events on input fields to prevent deleting nodes on pressing backspace while editing a node's label [#155](https://github.com/metadevpro/daga/issues/155) [#157](https://github.com/metadevpro/daga/pull/157)
86
+ - Add hasProperty method to PropertySet [#158](https://github.com/metadevpro/daga/pull/158)
87
+
88
+ ## v. 1.5.1
89
+
90
+ Date: _2024-06-19_
91
+
92
+ - Highlight elements when opening the context menu on them [#142](https://github.com/metadevpro/daga/pull/142)
93
+ - Add select all (Control+A) and invert selection (Control+I) keyboard shortcuts [#143](https://github.com/metadevpro/daga/pull/143)
94
+ - Enable adding to selection with Shift+Click as well as Control+Click [#145](https://github.com/metadevpro/daga/pull/145)
95
+ - Make context menu items focusable [#145](https://github.com/metadevpro/daga/pull/145)
96
+ - Only show context menu buttons if they can be clicked [#145](https://github.com/metadevpro/daga/pull/145)
97
+ - Select elements when opening the context menu on them [#145](https://github.com/metadevpro/daga/pull/145)
98
+ - Paste selection centered on the user's view or on the context menu location instead of in the place of the original selection [#147](https://github.com/metadevpro/daga/pull/147)
99
+ - Add diagram objects [#148](https://github.com/metadevpro/daga/pull/148)
100
+ - Enable toggling context menu in diagram configuration [#149](https://github.com/metadevpro/daga/pull/149)
101
+ - Center icons of context menu buttons [#149](https://github.com/metadevpro/daga/pull/149)
102
+
103
+ ## v. 1.5.0 Colada
104
+
105
+ Date: _2024-06-06_
106
+
107
+ - Ported to Angular 18, nx 19, node 20 [#140](https://github.com/metadevpro/daga/pull/140)
108
+ - Add context menu and clipboard functionality [#139](https://github.com/metadevpro/daga/pull/139)
109
+
110
+ ## v. 1.4.3
111
+
112
+ Date: _2024-06-04_
113
+
114
+ - Add property editor settings page [#113](https://github.com/metadevpro/daga/issues/113) [#119](https://github.com/metadevpro/daga/pull/119) [#120](https://github.com/metadevpro/daga/pull/120)
115
+ - Add `TextSet` and `OptionSet` property types [#121](https://github.com/metadevpro/daga/pull/121)
116
+ - Don't allow adding empty values in `TextList`, `TextSet` and `TextMap` property types [#121](https://github.com/metadevpro/daga/pull/121)
117
+ - Prevent overlapping connections [#122](https://github.com/metadevpro/daga/pull/122)
118
+ - Highlight a port when the pointer is close to the port while drawing a connection [#138](https://github.com/metadevpro/daga/pull/138)
119
+ - Adding support for collaborative actions.
120
+
121
+ ## v. 1.4.2
122
+
123
+ Date: _2024-04-11_
124
+
125
+ - Allow instancing nodes and connections referencing their type by its identifier rather than having to get the type from the set of types [#94](https://github.com/metadevpro/daga/pull/94)
126
+ - Use logical removal of diagram elements via the `removed` flag instead of removing them from the model [#96](https://github.com/metadevpro/daga/pull/96)
127
+ - Add `do()` method to `DiagramAction` [#96](https://github.com/metadevpro/daga/pull/96)
128
+ - Only register changed values in `UpdateValuesAction` to reduce chances of overwriting when different users edit the same `ValueSet` simultaneously [#106](https://github.com/metadevpro/daga/pull/106)
129
+ - Define and document the behavior of `ValueSet` [#106](https://github.com/metadevpro/daga/pull/106)
130
+ - When creating a new `DiagramElement` with a `ValueSet`, set the `DiagramElement`'s attributes to the `ValueSet`'s values if any of the values has an associated attribute [#106](https://github.com/metadevpro/daga/pull/106)
131
+ - Move the components of property editor to within property editor folder for better code organization [#106](https://github.com/metadevpro/daga/pull/106)
132
+ - Remove Lux dependence [#106](https://github.com/metadevpro/daga/pull/106)
133
+ - Make the `rootAttribute` of `Property` optional to make diagram configurations simpler [#106](https://github.com/metadevpro/daga/pull/106)
134
+ - Improve behavior of nested `ValueSet`s [#106](https://github.com/metadevpro/daga/pull/106)
135
+ - Fix bug with the list of options in properties of `Option` type appearing misplaced in scrolled property editors [#116](https://github.com/metadevpro/daga/pull/116)
136
+ - Make property editor not appear when collapsed [#118](https://github.com/metadevpro/daga/pull/118)
137
+
138
+ ## v. 1.4.1
139
+
140
+ Date: _2024-03-08_
141
+
142
+ - Fix bug with diagram changes not triggering validation [#91](https://github.com/metadevpro/daga/pull/91)
143
+ - Compensate for scroll when getting cursor position relative to screen [#92](https://github.com/metadevpro/daga/pull/92)
144
+
145
+ ## v. 1.4.0 Tizona
146
+
147
+ Date: _2024-03-08_
148
+
149
+ - Enable configuring which components are present in a diagram [#66](https://github.com/metadevpro/daga/pull/66)
150
+ - Add `zoom` configurable user action and enable configuring whether zooming and panning is enabled [#66](https://github.com/metadevpro/daga/pull/66)
151
+ - Rename `color` configuration property of diagram to `backgroundColor` and `color` configuration property of node to `fillColor` [#65](https://github.com/metadevpro/daga/issues/65) [#69](https://github.com/metadevpro/daga/pull/69)
152
+ - Remove `generic-diagram.json` file and add testing diagram configuration in `test-util` file instead [#69](https://github.com/metadevpro/daga/pull/69)
153
+ - Fix bug with connections with zero priority not being displayed [#70](https://github.com/metadevpro/daga/pull/70)
154
+ - Organize the configuration for each diagram component in the diagram configuration interface [#71](https://github.com/metadevpro/daga/pull/71)
155
+ - Enable configuring the location of diagram components [#71](https://github.com/metadevpro/daga/pull/71)
156
+ - Enable configuring the presence of specific buttons in the diagram buttons [#71](https://github.com/metadevpro/daga/pull/71)
157
+ - Generalize the expansion and collapse animation of the diagram buttons to an arbitrary number of buttons [#71](https://github.com/metadevpro/daga/pull/71)
158
+ - Add `fit` option to `FieldConfig` interface. Resize nodes and sections when that option is true and the size of their labels changes. [#35](https://github.com/metadevpro/daga/pull/35)
159
+ - Fix [#39](https://github.com/metadevpro/daga/issues/39) Allow delete with `backspace` key for Mac (no delete key on Mac).
160
+ - Fix [#75](https://github.com/metadevpro/daga/issues/75) Blur event in input field. Also implement autoselect all text.
161
+ - Reorganize configuration of diagram sections such that each section can be configured individually [#81](https://github.com/metadevpro/daga/pull/81)
162
+ - Resize nodes when filtering their sections [#83](https://github.com/metadevpro/daga/pull/83)
163
+ - Add methods to more easily get the priority of diagram elements and get and set the priority threshold of a canvas [#83](https://github.com/metadevpro/daga/pull/83)
164
+ - Use `not-allowed` cursor style when the user attempts to do an action that is not allowed [#41](https://github.com/metadevpro/daga/issues/41) [#85](https://github.com/metadevpro/daga/pull/85)
165
+ - Group up diagram elements by their type in the dom to ensure order of drawing of diagram elements [#84](https://github.com/metadevpro/daga/issues/84) [#86](https://github.com/metadevpro/daga/pull/86)
166
+ - Enable two way diagram model databinding [#73](https://github.com/metadevpro/daga/issues/73) [#87](https://github.com/metadevpro/daga/pull/87)
167
+ - Enable making changes to the diagram in the view without broadcasting changes to the model [#87](https://github.com/metadevpro/daga/pull/87)
168
+ - Move example-specific assets to their example asset folder [#87](https://github.com/metadevpro/daga/pull/87)
169
+ - Add a diagram's ValueSet to the DagaModel and serialize and deserialize a diagram's ValueSet when exporting and importing a diagram using the default daga exporter/importer [#87](https://github.com/metadevpro/daga/pull/87)
170
+
171
+ ## v. 1.3.1
172
+
173
+ Date: _2024.02.13_
174
+
175
+ - Add link to documentation and tutorials: <https://daga.metadev.pro/>
176
+
177
+ ## v. 1.3.0
178
+
179
+ Date: _2024.02.12_
180
+
181
+ - Add TSDoc documentation of types, methods and fields [#62](https://github.com/metadevpro/daga/pull/62)
182
+ - Creatw UserActionConfig type to represent configuration of allowed user actions [#62](https://github.com/metadevpro/daga/pull/62)
183
+ - Fix typo in README [#62](https://github.com/metadevpro/daga/pull/62)
184
+ - Use `DataSource<unknown, string>` as the type for the options of `Property` instead of `DataSource<string, string>` to allow arbitrary values [#63](https://github.com/metadevpro/daga/pull/63)
185
+ - Improved efficiency of moving the start and end ports of a connection [#64](https://github.com/metadevpro/daga/pull/64)
186
+
187
+ ## v. 1.2.0
188
+
189
+ Date: _2024.02.08_
190
+
191
+ - Enable configuring what user actions are allowed [#47](https://github.com/metadevpro/daga/issues/47) [#54](https://github.com/metadevpro/daga/pull/54)
192
+ - Add missing exports to index and clean up unused utils [#55](https://github.com/metadevpro/daga/pull/55)
193
+ - Use separate configuration defaults for `DiagramNode` and `DiagramSection` [#56](https://github.com/metadevpro/daga/pull/56)
194
+ - Add TypeDoc for automatic documentation generation [#58](https://github.com/metadevpro/daga/pull/58)
195
+ - Move all styles to a dedicated `styles` folder [#60](https://github.com/metadevpro/daga/pull/60)
196
+ - Remove unused CSS variables [#60](https://github.com/metadevpro/daga/pull/60)
197
+ - Remove ampersands from stylesheets [#60](https://github.com/metadevpro/daga/pull/60)
198
+ - Prefix Daga's CSS variables with `daga-` [#60](https://github.com/metadevpro/daga/pull/60)
199
+ - Update libraries [#60](https://github.com/metadevpro/daga/pull/60)
200
+
201
+ ## v. 1.1.0
202
+
203
+ Date: _2024.02.05_
204
+
205
+ - Refactor API for sets of elements of Diagram Model [#51](https://github.com/metadevpro/daga/pull/51)
206
+ - Make diagrams not absolutely positioned in CSS [#50](https://github.com/metadevpro/daga/issues/50), [#52](https://github.com/metadevpro/daga/pull/52)
207
+
208
+ ## v. 1.0.0
209
+
210
+ Date: _2024.02.01_
211
+
212
+ - First public version. ⚔️🚀🎉
package/LICENSE.md ADDED
@@ -0,0 +1,13 @@
1
+ # DAGA License
2
+
3
+ ![Daga logo](https://metadev.pro/icons/daga-logo-header.svg)
4
+
5
+ **Metadev** offers a dual license for [**Daga**](https://metadev.pro/products/daga/).
6
+ Feel free to [contact](https://metadev.pro/contact/) for any inquiry about it.
7
+
8
+ 1. Commercial license granted for for-profit organizations.
9
+ 2. Free license for research and educational usages.
10
+
11
+ ---
12
+
13
+ ![Metadev logo](https://metadev.pro/content/metadev-logo-600px.png)
package/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # Daga
2
+
3
+ ![Daga banner](https://metadev.pro/content/daga/daga-banner.png)
4
+
5
+ Diagramming library for models.
6
+
7
+ [Daga documentation and tutorial](https://daga.metadev.pro)
8
+ [Daga product page](https://metadev.pro/products/daga/).
9
+ Made and comercial suport by [Metadev](https://metadev.pro).
10
+
11
+ ## Diagram Example
12
+
13
+ ![Sample diagram](https://metadev.pro/img/daga/daga-diagram.svg)
14
+
15
+ ## Requirements
16
+
17
+ - Angular 18
18
+
19
+ ## Build Daga
20
+
21
+ ```bash
22
+ npm run build
23
+ ```
24
+
25
+ ## Generate Docs
26
+
27
+ ```bash
28
+ npm run doc
29
+ ```
30
+
31
+ ## Test
32
+
33
+ ```bash
34
+ npm run test
35
+ ```
36
+
37
+ ## Lint
38
+
39
+ ```bash
40
+ npm run lint
41
+ ```
42
+
43
+ ## Pack
44
+
45
+ ```bash
46
+ npm run pack-daga
47
+ ```
48
+
49
+ ## Publish in npmjs
50
+
51
+ ```bash
52
+ npm run publish-daga
53
+ ```
54
+
55
+ ## Tutorial & Documentation
56
+
57
+ - [Documentation, tutorial and samples](https://daga.metadev.pro/)
58
+
59
+ ## License
60
+
61
+ (C) 2023-2024 [Metadev S.L.](https://metadev.pro) All rights reserved.
62
+ [Dual license](LICENSE.md):
63
+
64
+ 1. Comercial licence for for-profit organizations.
65
+ 2. Free license for research & educational usages.
66
+
67
+ ![Metadev logo](https://metadev.pro/content/metadev-logo-600px.png)
package/index.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ declare global {
2
+ namespace JSX {
3
+ interface IntrinsicElements {
4
+ 'daga-diagram': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
5
+ 'daga-diagram-editor': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
6
+ 'daga-palette': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
7
+ 'daga-collapse-button': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
8
+ 'daga-diagram-buttons': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
9
+ 'daga-property-editor': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
10
+ 'daga-object-editor': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
11
+ 'daga-property-settings': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
12
+ 'daga-errors': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
13
+ }
14
+ }
15
+ }
16
+ export { DagaDiagram } from './lib/diagram/DagaDiagram';