@formicoidea/labre-framework-edgy 0.41.0 → 0.42.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 +384 -0
- package/dist/commands.d.ts +3 -0
- package/dist/commands.js +114 -1
- package/dist/element-view.d.ts +20 -22
- package/dist/element-view.js +27 -116
- package/dist/node/node-renderer.js +2 -2
- package/dist/templates/index.js +1 -1
- package/dist/toolbar/config.d.ts +5 -11
- package/dist/toolbar/config.js +54 -39
- package/dist/toolbar/edgy-senior-button.d.ts +2 -0
- package/dist/toolbar/edgy-senior-button.js +6 -2
- package/dist/toolbar/node-config.d.ts +14 -0
- package/dist/toolbar/node-config.js +12 -1
- package/dist/translations.js +1 -2
- package/dist/view.js +21 -21
- package/package.json +2 -3
- package/dist/legend.d.ts +0 -11
- package/dist/legend.js +0 -133
package/LICENSE
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
# Mozilla Public License Version 2.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) TOEVERYTHING PTE. LTD. and its affiliates.
|
|
4
|
+
|
|
5
|
+
1. Definitions
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
1.1. "Contributor"
|
|
10
|
+
means each individual or legal entity that creates, contributes to
|
|
11
|
+
the creation of, or owns Covered Software.
|
|
12
|
+
|
|
13
|
+
1.2. "Contributor Version"
|
|
14
|
+
means the combination of the Contributions of others (if any) used
|
|
15
|
+
by a Contributor and that particular Contributor's Contribution.
|
|
16
|
+
|
|
17
|
+
1.3. "Contribution"
|
|
18
|
+
means Covered Software of a particular Contributor.
|
|
19
|
+
|
|
20
|
+
1.4. "Covered Software"
|
|
21
|
+
means Source Code Form to which the initial Contributor has attached
|
|
22
|
+
the notice in Exhibit A, the Executable Form of such Source Code
|
|
23
|
+
Form, and Modifications of such Source Code Form, in each case
|
|
24
|
+
including portions thereof.
|
|
25
|
+
|
|
26
|
+
1.5. "Incompatible With Secondary Licenses"
|
|
27
|
+
means
|
|
28
|
+
|
|
29
|
+
(a) that the initial Contributor has attached the notice described
|
|
30
|
+
in Exhibit B to the Covered Software; or
|
|
31
|
+
|
|
32
|
+
(b) that the Covered Software was made available under the terms of
|
|
33
|
+
version 1.1 or earlier of the License, but not also under the
|
|
34
|
+
terms of a Secondary License.
|
|
35
|
+
|
|
36
|
+
1.6. "Executable Form"
|
|
37
|
+
means any form of the work other than Source Code Form.
|
|
38
|
+
|
|
39
|
+
1.7. "Larger Work"
|
|
40
|
+
means a work that combines Covered Software with other material, in
|
|
41
|
+
a separate file or files, that is not Covered Software.
|
|
42
|
+
|
|
43
|
+
1.8. "License"
|
|
44
|
+
means this document.
|
|
45
|
+
|
|
46
|
+
1.9. "Licensable"
|
|
47
|
+
means having the right to grant, to the maximum extent possible,
|
|
48
|
+
whether at the time of the initial grant or subsequently, any and
|
|
49
|
+
all of the rights conveyed by this License.
|
|
50
|
+
|
|
51
|
+
1.10. "Modifications"
|
|
52
|
+
means any of the following:
|
|
53
|
+
|
|
54
|
+
(a) any file in Source Code Form that results from an addition to,
|
|
55
|
+
deletion from, or modification of the contents of Covered
|
|
56
|
+
Software; or
|
|
57
|
+
|
|
58
|
+
(b) any new file in Source Code Form that contains any Covered
|
|
59
|
+
Software.
|
|
60
|
+
|
|
61
|
+
1.11. "Patent Claims" of a Contributor
|
|
62
|
+
means any patent claim(s), including without limitation, method,
|
|
63
|
+
process, and apparatus claims, in any patent Licensable by such
|
|
64
|
+
Contributor that would be infringed, but for the grant of the
|
|
65
|
+
License, by the making, using, selling, offering for sale, having
|
|
66
|
+
made, import, or transfer of either its Contributions or its
|
|
67
|
+
Contributor Version.
|
|
68
|
+
|
|
69
|
+
1.12. "Secondary License"
|
|
70
|
+
means either the GNU General Public License, Version 2.0, the GNU
|
|
71
|
+
Lesser General Public License, Version 2.1, the GNU Affero General
|
|
72
|
+
Public License, Version 3.0, or any later versions of those
|
|
73
|
+
licenses.
|
|
74
|
+
|
|
75
|
+
1.13. "Source Code Form"
|
|
76
|
+
means the form of the work preferred for making modifications.
|
|
77
|
+
|
|
78
|
+
1.14. "You" (or "Your")
|
|
79
|
+
means an individual or a legal entity exercising rights under this
|
|
80
|
+
License. For legal entities, "You" includes any entity that
|
|
81
|
+
controls, is controlled by, or is under common control with You. For
|
|
82
|
+
purposes of this definition, "control" means (a) the power, direct
|
|
83
|
+
or indirect, to cause the direction or management of such entity,
|
|
84
|
+
whether by contract or otherwise, or (b) ownership of more than
|
|
85
|
+
fifty percent (50%) of the outstanding shares or beneficial
|
|
86
|
+
ownership of such entity.
|
|
87
|
+
|
|
88
|
+
2. License Grants and Conditions
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
2.1. Grants
|
|
93
|
+
|
|
94
|
+
Each Contributor hereby grants You a world-wide, royalty-free,
|
|
95
|
+
non-exclusive license:
|
|
96
|
+
|
|
97
|
+
(a) under intellectual property rights (other than patent or trademark)
|
|
98
|
+
Licensable by such Contributor to use, reproduce, make available,
|
|
99
|
+
modify, display, perform, distribute, and otherwise exploit its
|
|
100
|
+
Contributions, either on an unmodified basis, with Modifications, or
|
|
101
|
+
as part of a Larger Work; and
|
|
102
|
+
|
|
103
|
+
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
|
104
|
+
for sale, have made, import, and otherwise transfer either its
|
|
105
|
+
Contributions or its Contributor Version.
|
|
106
|
+
|
|
107
|
+
2.2. Effective Date
|
|
108
|
+
|
|
109
|
+
The licenses granted in Section 2.1 with respect to any Contribution
|
|
110
|
+
become effective for each Contribution on the date the Contributor first
|
|
111
|
+
distributes such Contribution.
|
|
112
|
+
|
|
113
|
+
2.3. Limitations on Grant Scope
|
|
114
|
+
|
|
115
|
+
The licenses granted in this Section 2 are the only rights granted under
|
|
116
|
+
this License. No additional rights or licenses will be implied from the
|
|
117
|
+
distribution or licensing of Covered Software under this License.
|
|
118
|
+
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
|
119
|
+
Contributor:
|
|
120
|
+
|
|
121
|
+
(a) for any code that a Contributor has removed from Covered Software;
|
|
122
|
+
or
|
|
123
|
+
|
|
124
|
+
(b) for infringements caused by: (i) Your and any other third party's
|
|
125
|
+
modifications of Covered Software, or (ii) the combination of its
|
|
126
|
+
Contributions with other software (except as part of its Contributor
|
|
127
|
+
Version); or
|
|
128
|
+
|
|
129
|
+
(c) under Patent Claims infringed by Covered Software in the absence of
|
|
130
|
+
its Contributions.
|
|
131
|
+
|
|
132
|
+
This License does not grant any rights in the trademarks, service marks,
|
|
133
|
+
or logos of any Contributor (except as may be necessary to comply with
|
|
134
|
+
the notice requirements in Section 3.4).
|
|
135
|
+
|
|
136
|
+
2.4. Subsequent Licenses
|
|
137
|
+
|
|
138
|
+
No Contributor makes additional grants as a result of Your choice to
|
|
139
|
+
distribute the Covered Software under a subsequent version of this
|
|
140
|
+
License (see Section 10.2) or under the terms of a Secondary License (if
|
|
141
|
+
permitted under the terms of Section 3.3).
|
|
142
|
+
|
|
143
|
+
2.5. Representation
|
|
144
|
+
|
|
145
|
+
Each Contributor represents that the Contributor believes its
|
|
146
|
+
Contributions are its original creation(s) or it has sufficient rights
|
|
147
|
+
to grant the rights to its Contributions conveyed by this License.
|
|
148
|
+
|
|
149
|
+
2.6. Fair Use
|
|
150
|
+
|
|
151
|
+
This License is not intended to limit any rights You have under
|
|
152
|
+
applicable copyright doctrines of fair use, fair dealing, or other
|
|
153
|
+
equivalents.
|
|
154
|
+
|
|
155
|
+
2.7. Conditions
|
|
156
|
+
|
|
157
|
+
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
|
158
|
+
in Section 2.1.
|
|
159
|
+
|
|
160
|
+
3. Responsibilities
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
3.1. Distribution of Source Form
|
|
165
|
+
|
|
166
|
+
All distribution of Covered Software in Source Code Form, including any
|
|
167
|
+
Modifications that You create or to which You contribute, must be under
|
|
168
|
+
the terms of this License. You must inform recipients that the Source
|
|
169
|
+
Code Form of the Covered Software is governed by the terms of this
|
|
170
|
+
License, and how they can obtain a copy of this License. You may not
|
|
171
|
+
attempt to alter or restrict the recipients' rights in the Source Code
|
|
172
|
+
Form.
|
|
173
|
+
|
|
174
|
+
3.2. Distribution of Executable Form
|
|
175
|
+
|
|
176
|
+
If You distribute Covered Software in Executable Form then:
|
|
177
|
+
|
|
178
|
+
(a) such Covered Software must also be made available in Source Code
|
|
179
|
+
Form, as described in Section 3.1, and You must inform recipients of
|
|
180
|
+
the Executable Form how they can obtain a copy of such Source Code
|
|
181
|
+
Form by reasonable means in a timely manner, at a charge no more
|
|
182
|
+
than the cost of distribution to the recipient; and
|
|
183
|
+
|
|
184
|
+
(b) You may distribute such Executable Form under the terms of this
|
|
185
|
+
License, or sublicense it under different terms, provided that the
|
|
186
|
+
license for the Executable Form does not attempt to limit or alter
|
|
187
|
+
the recipients' rights in the Source Code Form under this License.
|
|
188
|
+
|
|
189
|
+
3.3. Distribution of a Larger Work
|
|
190
|
+
|
|
191
|
+
You may create and distribute a Larger Work under terms of Your choice,
|
|
192
|
+
provided that You also comply with the requirements of this License for
|
|
193
|
+
the Covered Software. If the Larger Work is a combination of Covered
|
|
194
|
+
Software with a work governed by one or more Secondary Licenses, and the
|
|
195
|
+
Covered Software is not Incompatible With Secondary Licenses, this
|
|
196
|
+
License permits You to additionally distribute such Covered Software
|
|
197
|
+
under the terms of such Secondary License(s), so that the recipient of
|
|
198
|
+
the Larger Work may, at their option, further distribute the Covered
|
|
199
|
+
Software under the terms of either this License or such Secondary
|
|
200
|
+
License(s).
|
|
201
|
+
|
|
202
|
+
3.4. Notices
|
|
203
|
+
|
|
204
|
+
You may not remove or alter the substance of any license notices
|
|
205
|
+
(including copyright notices, patent notices, disclaimers of warranty,
|
|
206
|
+
or limitations of liability) contained within the Source Code Form of
|
|
207
|
+
the Covered Software, except that You may alter any license notices to
|
|
208
|
+
the extent required to remedy known factual inaccuracies.
|
|
209
|
+
|
|
210
|
+
3.5. Application of Additional Terms
|
|
211
|
+
|
|
212
|
+
You may choose to offer, and to charge a fee for, warranty, support,
|
|
213
|
+
indemnity or liability obligations to one or more recipients of Covered
|
|
214
|
+
Software. However, You may do so only on Your own behalf, and not on
|
|
215
|
+
behalf of any Contributor. You must make it absolutely clear that any
|
|
216
|
+
such warranty, support, indemnity, or liability obligation is offered by
|
|
217
|
+
You alone, and You hereby agree to indemnify every Contributor for any
|
|
218
|
+
liability incurred by such Contributor as a result of warranty, support,
|
|
219
|
+
indemnity or liability terms You offer. You may include additional
|
|
220
|
+
disclaimers of warranty and limitations of liability specific to any
|
|
221
|
+
jurisdiction.
|
|
222
|
+
|
|
223
|
+
4. Inability to Comply Due to Statute or Regulation
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
If it is impossible for You to comply with any of the terms of this
|
|
228
|
+
License with respect to some or all of the Covered Software due to
|
|
229
|
+
statute, judicial order, or regulation then You must: (a) comply with
|
|
230
|
+
the terms of this License to the maximum extent possible; and (b)
|
|
231
|
+
describe the limitations and the code they affect. Such description must
|
|
232
|
+
be placed in a text file included with all distributions of the Covered
|
|
233
|
+
Software under this License. Except to the extent prohibited by statute
|
|
234
|
+
or regulation, such description must be sufficiently detailed for a
|
|
235
|
+
recipient of ordinary skill to be able to understand it.
|
|
236
|
+
|
|
237
|
+
5. Termination
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
5.1. The rights granted under this License will terminate automatically
|
|
242
|
+
if You fail to comply with any of its terms. However, if You become
|
|
243
|
+
compliant, then the rights granted under this License from a particular
|
|
244
|
+
Contributor are reinstated (a) provisionally, unless and until such
|
|
245
|
+
Contributor explicitly and finally terminates Your grants, and (b) on an
|
|
246
|
+
ongoing basis, if such Contributor fails to notify You of the
|
|
247
|
+
non-compliance by some reasonable means prior to 60 days after You have
|
|
248
|
+
come back into compliance. Moreover, Your grants from a particular
|
|
249
|
+
Contributor are reinstated on an ongoing basis if such Contributor
|
|
250
|
+
notifies You of the non-compliance by some reasonable means, this is the
|
|
251
|
+
first time You have received notice of non-compliance with this License
|
|
252
|
+
from such Contributor, and You become compliant prior to 30 days after
|
|
253
|
+
Your receipt of the notice.
|
|
254
|
+
|
|
255
|
+
5.2. If You initiate litigation against any entity by asserting a patent
|
|
256
|
+
infringement claim (excluding declaratory judgment actions,
|
|
257
|
+
counter-claims, and cross-claims) alleging that a Contributor Version
|
|
258
|
+
directly or indirectly infringes any patent, then the rights granted to
|
|
259
|
+
You by any and all Contributors for the Covered Software under Section
|
|
260
|
+
2.1 of this License shall terminate.
|
|
261
|
+
|
|
262
|
+
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
|
263
|
+
end user license agreements (excluding distributors and resellers) which
|
|
264
|
+
have been validly granted by You or Your distributors under this License
|
|
265
|
+
prior to termination shall survive termination.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
- *
|
|
270
|
+
- 6. Disclaimer of Warranty \*
|
|
271
|
+
- ------------------------- \*
|
|
272
|
+
- *
|
|
273
|
+
- Covered Software is provided under this License on an "as is" \*
|
|
274
|
+
- basis, without warranty of any kind, either expressed, implied, or \*
|
|
275
|
+
- statutory, including, without limitation, warranties that the \*
|
|
276
|
+
- Covered Software is free of defects, merchantable, fit for a \*
|
|
277
|
+
- particular purpose or non-infringing. The entire risk as to the \*
|
|
278
|
+
- quality and performance of the Covered Software is with You. \*
|
|
279
|
+
- Should any Covered Software prove defective in any respect, You \*
|
|
280
|
+
- (not any Contributor) assume the cost of any necessary servicing, \*
|
|
281
|
+
- repair, or correction. This disclaimer of warranty constitutes an \*
|
|
282
|
+
- essential part of this License. No use of any Covered Software is \*
|
|
283
|
+
- authorized under this License except under this disclaimer. \*
|
|
284
|
+
- *
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
- *
|
|
291
|
+
- 7. Limitation of Liability \*
|
|
292
|
+
- -------------------------- \*
|
|
293
|
+
- *
|
|
294
|
+
- Under no circumstances and under no legal theory, whether tort \*
|
|
295
|
+
- (including negligence), contract, or otherwise, shall any \*
|
|
296
|
+
- Contributor, or anyone who distributes Covered Software as \*
|
|
297
|
+
- permitted above, be liable to You for any direct, indirect, \*
|
|
298
|
+
- special, incidental, or consequential damages of any character \*
|
|
299
|
+
- including, without limitation, damages for lost profits, loss of \*
|
|
300
|
+
- goodwill, work stoppage, computer failure or malfunction, or any \*
|
|
301
|
+
- and all other commercial damages or losses, even if such party \*
|
|
302
|
+
- shall have been informed of the possibility of such damages. This \*
|
|
303
|
+
- limitation of liability shall not apply to liability for death or \*
|
|
304
|
+
- personal injury resulting from such party's negligence to the \*
|
|
305
|
+
- extent applicable law prohibits such limitation. Some \*
|
|
306
|
+
- jurisdictions do not allow the exclusion or limitation of \*
|
|
307
|
+
- incidental or consequential damages, so this exclusion and \*
|
|
308
|
+
- limitation may not apply to You. \*
|
|
309
|
+
- *
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
8. Litigation
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
Any litigation relating to this License may be brought only in the
|
|
318
|
+
courts of a jurisdiction where the defendant maintains its principal
|
|
319
|
+
place of business and such litigation shall be governed by laws of that
|
|
320
|
+
jurisdiction, without reference to its conflict-of-law provisions.
|
|
321
|
+
Nothing in this Section shall prevent a party's ability to bring
|
|
322
|
+
cross-claims or counter-claims.
|
|
323
|
+
|
|
324
|
+
9. Miscellaneous
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
This License represents the complete agreement concerning the subject
|
|
329
|
+
matter hereof. If any provision of this License is held to be
|
|
330
|
+
unenforceable, such provision shall be reformed only to the extent
|
|
331
|
+
necessary to make it enforceable. Any law or regulation which provides
|
|
332
|
+
that the language of a contract shall be construed against the drafter
|
|
333
|
+
shall not be used to construe this License against a Contributor.
|
|
334
|
+
|
|
335
|
+
10. Versions of the License
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
10.1. New Versions
|
|
340
|
+
|
|
341
|
+
Mozilla Foundation is the license steward. Except as provided in Section
|
|
342
|
+
10.3, no one other than the license steward has the right to modify or
|
|
343
|
+
publish new versions of this License. Each version will be given a
|
|
344
|
+
distinguishing version number.
|
|
345
|
+
|
|
346
|
+
10.2. Effect of New Versions
|
|
347
|
+
|
|
348
|
+
You may distribute the Covered Software under the terms of the version
|
|
349
|
+
of the License under which You originally received the Covered Software,
|
|
350
|
+
or under the terms of any subsequent version published by the license
|
|
351
|
+
steward.
|
|
352
|
+
|
|
353
|
+
10.3. Modified Versions
|
|
354
|
+
|
|
355
|
+
If you create software not governed by this License, and you want to
|
|
356
|
+
create a new license for such software, you may create and use a
|
|
357
|
+
modified version of this License if you rename the license and remove
|
|
358
|
+
any references to the name of the license steward (except to note that
|
|
359
|
+
such modified license differs from this License).
|
|
360
|
+
|
|
361
|
+
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
|
362
|
+
Licenses
|
|
363
|
+
|
|
364
|
+
If You choose to distribute Source Code Form that is Incompatible With
|
|
365
|
+
Secondary Licenses under the terms of this version of the License, the
|
|
366
|
+
notice described in Exhibit B of this License must be attached.
|
|
367
|
+
|
|
368
|
+
## Exhibit A - Source Code Form License Notice
|
|
369
|
+
|
|
370
|
+
This Source Code Form is subject to the terms of the Mozilla Public
|
|
371
|
+
License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
372
|
+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
373
|
+
|
|
374
|
+
If it is not possible or desirable to put the notice in a particular
|
|
375
|
+
file, then You may include the notice in a location (such as a LICENSE
|
|
376
|
+
file in a relevant directory) where a recipient would be likely to look
|
|
377
|
+
for such a notice.
|
|
378
|
+
|
|
379
|
+
You may add additional accurate notices of copyright ownership.
|
|
380
|
+
|
|
381
|
+
## Exhibit B - "Incompatible With Secondary Licenses" Notice
|
|
382
|
+
|
|
383
|
+
This Source Code Form is "Incompatible With Secondary Licenses", as
|
|
384
|
+
defined by the Mozilla Public License, v. 2.0.
|
package/dist/commands.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { ChromeWording } from '@formicoidea/labre-core/shared/services';
|
|
1
2
|
import type { CommandDescriptor } from '@formicoidea/labre-core/std';
|
|
2
3
|
import type { TemplateResult } from 'lit';
|
|
4
|
+
/** For `translations.ts`'s manifest. */
|
|
5
|
+
export declare const EDGY_LEGEND_CHROME_WORDINGS: readonly ChromeWording[];
|
|
3
6
|
export declare const edgyCommands: CommandDescriptor[];
|
|
4
7
|
export declare const edgyCommandIcons: Record<string, TemplateResult>;
|
package/dist/commands.js
CHANGED
|
@@ -1,6 +1,99 @@
|
|
|
1
1
|
import { GfxControllerIdentifier } from '@formicoidea/labre-core/std/gfx';
|
|
2
2
|
import { activateEdgyRelation, createEdgyBoard, createEdgyBox, createEdgyDynamic, createEdgyFacets, createEdgyPeople, } from './actions.js';
|
|
3
|
-
import {
|
|
3
|
+
import { EDGY_DYNAMIC_NODES, EDGY_ZONE_FILL, EDGY_ZONES, edgyElementLabel, edgyElementLabelKey, } from './metamodel.js';
|
|
4
|
+
import { NODE_FILL, NODE_STROKE } from './node/consts.js';
|
|
5
|
+
import { EDGY_ROLE } from './roles.js';
|
|
6
|
+
import { edgyActivityIcon, edgyBoardIcon, edgyDynamicIcon, edgyFacetsIcon, edgyObjectIcon, edgyOutcomeIcon, edgyPeopleIcon, edgyRelationIcon, edgyToolbarIcon, } from './toolbar/icons.js';
|
|
7
|
+
/**
|
|
8
|
+
* The EDGY toolbox as commands. Before PF3 these seven artefacts existed ONLY
|
|
9
|
+
* as hard-coded buttons, so EDGY was entirely invisible to Settings ›
|
|
10
|
+
* Shortcuts; they are all bindable now, all keyless by default (`docs/adr/0008`).
|
|
11
|
+
*
|
|
12
|
+
* An eighth entry joined them on the PO recette of 26/08/2026, and it is the
|
|
13
|
+
* first EDGY command that arms a TOOL rather than dropping an artefact:
|
|
14
|
+
* `addRelation`. Until it landed the 24 typed relations of the metamodel could
|
|
15
|
+
* only be born of the "EDGY dynamic" template, so a practitioner drawing their
|
|
16
|
+
* own board had no way of saying "this Process requires that Asset" — see
|
|
17
|
+
* `../relation.ts` for why there is one entry and not twenty-two.
|
|
18
|
+
*/
|
|
19
|
+
/* ── The legend, SUBSCRIBED rather than tabulated (`docs/adr/0026`) ────── */
|
|
20
|
+
/**
|
|
21
|
+
* The three intersection elements share ONE section: Organisation, Product and
|
|
22
|
+
* Brand are not three facets, they are the three lenses between them, and the
|
|
23
|
+
* diagram says so by drawing them in the overlaps. The key is the one the
|
|
24
|
+
* facets seed already carries.
|
|
25
|
+
*/
|
|
26
|
+
const SECTION_INTERSECTIONS = [
|
|
27
|
+
'com.labre.edgy.seed.intersections-title',
|
|
28
|
+
'Intersections',
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* The two section titles that name a GROUPING of roles rather than a role —
|
|
32
|
+
* "Base elements" and "Relations" — so each mints a key of its own where the
|
|
33
|
+
* facets and the intersections reuse the metamodel's seeds.
|
|
34
|
+
*/
|
|
35
|
+
const SECTION_BASE = [
|
|
36
|
+
'com.labre.edgy.legend.section.base-elements',
|
|
37
|
+
'Base elements',
|
|
38
|
+
];
|
|
39
|
+
const SECTION_RELATIONS = [
|
|
40
|
+
'com.labre.edgy.legend.section.relations',
|
|
41
|
+
'Relations',
|
|
42
|
+
];
|
|
43
|
+
/** For `translations.ts`'s manifest. */
|
|
44
|
+
export const EDGY_LEGEND_CHROME_WORDINGS = [
|
|
45
|
+
SECTION_BASE,
|
|
46
|
+
SECTION_RELATIONS,
|
|
47
|
+
];
|
|
48
|
+
/**
|
|
49
|
+
* One row per official element of `zone`, in the metamodel's own order, in the
|
|
50
|
+
* fill the diagram PAINTS that zone with — derived, never restated, so a
|
|
51
|
+
* thirteenth element gets its row the same way it gets its role.
|
|
52
|
+
*/
|
|
53
|
+
function zoneEntries(zone, section) {
|
|
54
|
+
return Object.entries(EDGY_DYNAMIC_NODES)
|
|
55
|
+
.filter(([, node]) => node.zone === zone)
|
|
56
|
+
.map(([name]) => ({
|
|
57
|
+
role: EDGY_ROLE[name],
|
|
58
|
+
row: { swatch: 'square', color: EDGY_ZONE_FILL[zone] },
|
|
59
|
+
section,
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The twelve official elements, all twelve subscribed by ONE command.
|
|
64
|
+
*
|
|
65
|
+
* They are stamped in exactly one place — the "EDGY dynamic" template
|
|
66
|
+
* (`templates/dynamic.ts`) — and there is no "add a Content" gesture to hang
|
|
67
|
+
* them off individually: twelve more catalogue entries for gestures the
|
|
68
|
+
* framework does not offer would blow the senior sub-menu's cap for nothing.
|
|
69
|
+
* So this is the case `CommandDescriptor.legend` is a LIST for, and the case
|
|
70
|
+
* `CommandLegendEntry.section` exists for: one command, twelve rows, four
|
|
71
|
+
* sub-titles.
|
|
72
|
+
*
|
|
73
|
+
* A facet's section says the facet's own name, so it reuses the key the
|
|
74
|
+
* metamodel's seeds already carry: the legend and the facets diagram say
|
|
75
|
+
* "Identity" with one key, not two.
|
|
76
|
+
*/
|
|
77
|
+
const DYNAMIC_LEGEND = EDGY_ZONES.flatMap(zone => zoneEntries(zone.id, zone.group === 'facet'
|
|
78
|
+
? [edgyElementLabelKey(zone.id), edgyElementLabel(zone.id)]
|
|
79
|
+
: SECTION_INTERSECTIONS));
|
|
80
|
+
/**
|
|
81
|
+
* One of the four base elements, listed only when one is on the board BARE.
|
|
82
|
+
*
|
|
83
|
+
* `exact` is what makes "bare" true. Detection is otherwise an ancestor walk,
|
|
84
|
+
* and the twelve official elements specialise these four — Content is an
|
|
85
|
+
* object, Story an activity — so an "Object" row would appear on a board
|
|
86
|
+
* carrying nothing but Contents, keyed to a white swatch that is drawn nowhere
|
|
87
|
+
* on it. White because that is the fill the palette gives them.
|
|
88
|
+
*/
|
|
89
|
+
function baseEntry(kind) {
|
|
90
|
+
return {
|
|
91
|
+
role: EDGY_ROLE[kind],
|
|
92
|
+
exact: true,
|
|
93
|
+
row: { swatch: 'square', color: NODE_FILL },
|
|
94
|
+
section: SECTION_BASE,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
4
97
|
const SPECS = [
|
|
5
98
|
{
|
|
6
99
|
id: 'addFacets',
|
|
@@ -16,6 +109,7 @@ const SPECS = [
|
|
|
16
109
|
iconKey: 'edgy.dynamic',
|
|
17
110
|
category: 'diagrams',
|
|
18
111
|
element: 'template:dynamic',
|
|
112
|
+
legend: DYNAMIC_LEGEND,
|
|
19
113
|
run: createEdgyDynamic,
|
|
20
114
|
},
|
|
21
115
|
{
|
|
@@ -33,6 +127,7 @@ const SPECS = [
|
|
|
33
127
|
iconKey: 'edgy.people',
|
|
34
128
|
category: 'elements',
|
|
35
129
|
element: 'node:people',
|
|
130
|
+
legend: baseEntry('people'),
|
|
36
131
|
run: createEdgyPeople,
|
|
37
132
|
},
|
|
38
133
|
{
|
|
@@ -41,6 +136,7 @@ const SPECS = [
|
|
|
41
136
|
iconKey: 'edgy.outcome',
|
|
42
137
|
category: 'elements',
|
|
43
138
|
element: 'node:outcome',
|
|
139
|
+
legend: baseEntry('outcome'),
|
|
44
140
|
run: std => createEdgyBox(std, 'outcome'),
|
|
45
141
|
},
|
|
46
142
|
{
|
|
@@ -49,6 +145,7 @@ const SPECS = [
|
|
|
49
145
|
iconKey: 'edgy.object',
|
|
50
146
|
category: 'elements',
|
|
51
147
|
element: 'node:object',
|
|
148
|
+
legend: baseEntry('object'),
|
|
52
149
|
run: std => createEdgyBox(std, 'object'),
|
|
53
150
|
},
|
|
54
151
|
{
|
|
@@ -57,6 +154,7 @@ const SPECS = [
|
|
|
57
154
|
iconKey: 'edgy.activity',
|
|
58
155
|
category: 'elements',
|
|
59
156
|
element: 'node:activity',
|
|
157
|
+
legend: baseEntry('activity'),
|
|
60
158
|
run: std => createEdgyBox(std, 'activity'),
|
|
61
159
|
},
|
|
62
160
|
{
|
|
@@ -67,6 +165,17 @@ const SPECS = [
|
|
|
67
165
|
category: 'relations',
|
|
68
166
|
kind: 'tool',
|
|
69
167
|
element: 'connector:relation',
|
|
168
|
+
// ONE row for the whole relation family, keyed on the PARENT role: a board
|
|
169
|
+
// carrying "content expresses purpose" carries `edgy:expresses`, which IS a
|
|
170
|
+
// relation, and that is all the legend has to say. Twenty-two rows naming
|
|
171
|
+
// the verbs would restate the metamodel rather than document the drawing —
|
|
172
|
+
// and the verb travels on the link itself, visible, where it belongs.
|
|
173
|
+
legend: {
|
|
174
|
+
role: EDGY_ROLE.relation,
|
|
175
|
+
// The stroke `activateEdgyRelation` arms the connector tool with.
|
|
176
|
+
row: { swatch: 'line', color: NODE_STROKE },
|
|
177
|
+
section: SECTION_RELATIONS,
|
|
178
|
+
},
|
|
70
179
|
run: std => activateEdgyRelation(std.get(GfxControllerIdentifier)),
|
|
71
180
|
},
|
|
72
181
|
];
|
|
@@ -91,6 +200,7 @@ export const edgyCommands = SPECS.map((spec, order) => ({
|
|
|
91
200
|
availability: 'always',
|
|
92
201
|
run: spec.run,
|
|
93
202
|
telemetry: { framework: 'edgy', element: spec.element, board: spec.board },
|
|
203
|
+
...(spec.legend ? { legend: spec.legend } : {}),
|
|
94
204
|
}));
|
|
95
205
|
export const edgyCommandIcons = {
|
|
96
206
|
'edgy.facets': edgyFacetsIcon,
|
|
@@ -101,4 +211,7 @@ export const edgyCommandIcons = {
|
|
|
101
211
|
'edgy.object': edgyObjectIcon,
|
|
102
212
|
'edgy.activity': edgyActivityIcon,
|
|
103
213
|
'edgy.relation': edgyRelationIcon,
|
|
214
|
+
// The senior button's 56×56 glyph, so `FrameworkDescriptor.iconKey` resolves
|
|
215
|
+
// through `getCommandIcon`.
|
|
216
|
+
'edgy.toolbar': edgyToolbarIcon,
|
|
104
217
|
};
|
package/dist/element-view.d.ts
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
|
+
import type { EditableBackgroundLabel } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
import { FrameworkBackgroundView } from '@formicoidea/labre-core/blocks/surface';
|
|
1
3
|
import type { EdgyFacetsElementModel } from '@formicoidea/labre-core/model';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The EDGY facets diagram's view: the shared background gesture, aimed by this
|
|
6
|
+
* framework's own label layout.
|
|
7
|
+
*
|
|
8
|
+
* The three facet names are NOT declared in a `FrameworkBackgroundDef` — the
|
|
9
|
+
* diagram is a Venn figure fitted into a reference space, and its labels hang
|
|
10
|
+
* off the circles rather than off a plot — so the hit test stays here, mapped
|
|
11
|
+
* with the SAME fit the renderer used. Everything above it (where a
|
|
12
|
+
* double-click is allowed to land, the in-place `<input>`, the commit that
|
|
13
|
+
* refuses to write an untouched value) comes from
|
|
14
|
+
* {@link FrameworkBackgroundView}, which is where this diagram's own copy of it
|
|
15
|
+
* went — see issue #355.
|
|
16
|
+
*/
|
|
17
|
+
export declare class EdgyView extends FrameworkBackgroundView<EdgyFacetsElementModel> {
|
|
6
18
|
static type: string;
|
|
7
|
-
/** The in-place `<input>` used to edit a label, or null when idle. */
|
|
8
|
-
private _labelEditor;
|
|
9
|
-
onCreated(): void;
|
|
10
|
-
onDestroyed(): void;
|
|
11
|
-
/** The editable facet label under a MODEL-space point, or null. */
|
|
12
|
-
private _labelAt;
|
|
13
19
|
/**
|
|
14
|
-
*
|
|
15
|
-
* three facet labels
|
|
16
|
-
*
|
|
17
|
-
* Same seam Wardley uses, for the same reason: the pointer router asks the
|
|
18
|
-
* VIEW, so a framework declares its own gesture zones next to the code that
|
|
19
|
-
* draws them, and the model layer keeps a hit test that only says what a
|
|
20
|
-
* click SELECTS.
|
|
20
|
+
* A diagram is SELECTED by its border (`EdgyFacetsElementModel`), and the
|
|
21
|
+
* three facet labels widen that for the pointer — the base class' doing; this
|
|
22
|
+
* method only says where they are.
|
|
21
23
|
*/
|
|
22
|
-
|
|
23
|
-
/** Double-click on a label → edit its text in place. */
|
|
24
|
-
private _onDblClick;
|
|
25
|
-
private _openLabelEditor;
|
|
26
|
-
private _closeLabelEditor;
|
|
24
|
+
protected labelAt(lx: number, ly: number, w: number, h: number): EditableBackgroundLabel | null;
|
|
27
25
|
}
|
|
28
26
|
/**
|
|
29
27
|
* Resize gating: the resize handles are hidden unless `model.resizeEnabled` is
|
package/dist/element-view.js
CHANGED
|
@@ -1,40 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { GfxElementModelView, GfxViewInteractionExtension, } from '@formicoidea/labre-core/std/gfx';
|
|
1
|
+
import { FrameworkBackgroundView } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
import { GfxViewInteractionExtension } from '@formicoidea/labre-core/std/gfx';
|
|
4
3
|
import { cropLabeledScale, refScale } from './consts.js';
|
|
5
|
-
import { getEdgyLabelHits, hitTestEdgyLabel
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { getEdgyLabelHits, hitTestEdgyLabel } from './label-layout.js';
|
|
5
|
+
/**
|
|
6
|
+
* The EDGY facets diagram's view: the shared background gesture, aimed by this
|
|
7
|
+
* framework's own label layout.
|
|
8
|
+
*
|
|
9
|
+
* The three facet names are NOT declared in a `FrameworkBackgroundDef` — the
|
|
10
|
+
* diagram is a Venn figure fitted into a reference space, and its labels hang
|
|
11
|
+
* off the circles rather than off a plot — so the hit test stays here, mapped
|
|
12
|
+
* with the SAME fit the renderer used. Everything above it (where a
|
|
13
|
+
* double-click is allowed to land, the in-place `<input>`, the commit that
|
|
14
|
+
* refuses to write an untouched value) comes from
|
|
15
|
+
* {@link FrameworkBackgroundView}, which is where this diagram's own copy of it
|
|
16
|
+
* went — see issue #355.
|
|
17
|
+
*/
|
|
18
|
+
export class EdgyView extends FrameworkBackgroundView {
|
|
12
19
|
static { this.type = 'edgy'; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
super.onDestroyed();
|
|
20
|
-
}
|
|
21
|
-
/** The editable facet label under a MODEL-space point, or null. */
|
|
22
|
-
_labelAt(mx, my) {
|
|
20
|
+
/**
|
|
21
|
+
* A diagram is SELECTED by its border (`EdgyFacetsElementModel`), and the
|
|
22
|
+
* three facet labels widen that for the pointer — the base class' doing; this
|
|
23
|
+
* method only says where they are.
|
|
24
|
+
*/
|
|
25
|
+
labelAt(lx, ly, w, h) {
|
|
23
26
|
// No labels shown → nothing to edit (and the cropped mapping differs).
|
|
24
27
|
if (!this.model.showLabels)
|
|
25
28
|
return null;
|
|
26
|
-
const [bx, by, w, h] = this.model.deserializedXYWH;
|
|
27
|
-
// Convert the model-space point into element-local coordinates, undoing the
|
|
28
|
-
// element rotation around its center.
|
|
29
|
-
let lx = mx - bx;
|
|
30
|
-
let ly = my - by;
|
|
31
|
-
const rot = this.model.rotate ?? 0;
|
|
32
|
-
if (rot) {
|
|
33
|
-
const center = [bx + w / 2, by + h / 2];
|
|
34
|
-
const [ux, uy] = rotatePoint([mx, my], center, -rot);
|
|
35
|
-
lx = ux - bx;
|
|
36
|
-
ly = uy - by;
|
|
37
|
-
}
|
|
38
29
|
// Map element-local coords into the fixed reference space the labels live
|
|
39
30
|
// in — with the SAME fit the renderer used (cropped or letterboxed).
|
|
40
31
|
const { s, ox, oy } = this.model.cropToCircles
|
|
@@ -42,91 +33,11 @@ export class EdgyView extends GfxElementModelView {
|
|
|
42
33
|
: refScale(w, h);
|
|
43
34
|
const rx = (lx - ox) / s;
|
|
44
35
|
const ry = (ly - oy) / s;
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* The diagram is SELECTED by its border (`EdgyFacetsElementModel`), but its
|
|
49
|
-
* three facet labels must still receive the double-click that renames them.
|
|
50
|
-
*
|
|
51
|
-
* Same seam Wardley uses, for the same reason: the pointer router asks the
|
|
52
|
-
* VIEW, so a framework declares its own gesture zones next to the code that
|
|
53
|
-
* draws them, and the model layer keeps a hit test that only says what a
|
|
54
|
-
* click SELECTS.
|
|
55
|
-
*/
|
|
56
|
-
includesPoint(x, y, options, host) {
|
|
57
|
-
if (super.includesPoint(x, y, options, host))
|
|
58
|
-
return true;
|
|
59
|
-
return this._labelAt(x, y) !== null;
|
|
60
|
-
}
|
|
61
|
-
/** Double-click on a label → edit its text in place. */
|
|
62
|
-
_onDblClick(e) {
|
|
63
|
-
if (this.model.isLocked())
|
|
64
|
-
return;
|
|
65
|
-
const [mx, my] = this.gfx.viewport.toModelCoord(e.x, e.y);
|
|
66
|
-
const hit = this._labelAt(mx, my);
|
|
36
|
+
const hit = hitTestEdgyLabel(getEdgyLabelHits(this.model), rx, ry);
|
|
67
37
|
if (!hit)
|
|
68
|
-
return;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
_openLabelEditor(field, e) {
|
|
72
|
-
this._closeLabelEditor();
|
|
73
|
-
const input = document.createElement('input');
|
|
74
|
-
input.value = String(this.model[field] ?? '');
|
|
75
|
-
Object.assign(input.style, {
|
|
76
|
-
position: 'fixed',
|
|
77
|
-
left: `${e.raw.clientX}px`,
|
|
78
|
-
top: `${e.raw.clientY}px`,
|
|
79
|
-
transform: 'translate(-50%, -50%)',
|
|
80
|
-
zIndex: '10000',
|
|
81
|
-
minWidth: '140px',
|
|
82
|
-
padding: '3px 8px',
|
|
83
|
-
font: '14px Inter, sans-serif',
|
|
84
|
-
color: 'var(--affine-text-primary-color, #1f2328)',
|
|
85
|
-
background: 'var(--affine-background-overlay-panel-color, #ffffff)',
|
|
86
|
-
border: '1px solid var(--affine-primary-color, #1e96eb)',
|
|
87
|
-
borderRadius: '6px',
|
|
88
|
-
boxShadow: 'var(--affine-shadow-2, 0 2px 8px rgba(0,0,0,0.18))',
|
|
89
|
-
outline: 'none',
|
|
90
|
-
});
|
|
91
|
-
document.body.append(input);
|
|
92
|
-
this._labelEditor = input;
|
|
93
|
-
// Mark the element as "editing" so the global edgeless key handlers
|
|
94
|
-
// (delete, escape, etc.) don't act on it while the user types.
|
|
95
|
-
this.gfx.selection.set({ elements: [this.model.id], editing: true });
|
|
96
|
-
input.focus();
|
|
97
|
-
input.select();
|
|
98
|
-
const commit = () => {
|
|
99
|
-
if (this._labelEditor !== input)
|
|
100
|
-
return;
|
|
101
|
-
const value = input.value;
|
|
102
|
-
this._closeLabelEditor();
|
|
103
|
-
this.gfx.std.store.captureSync();
|
|
104
|
-
this.gfx.std
|
|
105
|
-
.get(EdgelessCRUDIdentifier)
|
|
106
|
-
.updateElement(this.model.id, { [field]: value });
|
|
107
|
-
};
|
|
108
|
-
input.addEventListener('keydown', ev => {
|
|
109
|
-
ev.stopPropagation();
|
|
110
|
-
if (ev.key === 'Enter') {
|
|
111
|
-
ev.preventDefault();
|
|
112
|
-
commit();
|
|
113
|
-
}
|
|
114
|
-
else if (ev.key === 'Escape') {
|
|
115
|
-
ev.preventDefault();
|
|
116
|
-
this._closeLabelEditor();
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
input.addEventListener('blur', commit);
|
|
120
|
-
}
|
|
121
|
-
_closeLabelEditor() {
|
|
122
|
-
if (!this._labelEditor)
|
|
123
|
-
return;
|
|
124
|
-
const input = this._labelEditor;
|
|
125
|
-
this._labelEditor = null;
|
|
126
|
-
input.remove();
|
|
127
|
-
if (this.isConnected) {
|
|
128
|
-
this.gfx.selection.set({ elements: [this.model.id], editing: false });
|
|
129
|
-
}
|
|
38
|
+
return null;
|
|
39
|
+
// The facet names carry a hard default, so the drawn words ARE the prop.
|
|
40
|
+
return { prop: hit.field, text: String(this.model[hit.field] ?? '') };
|
|
130
41
|
}
|
|
131
42
|
}
|
|
132
43
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementRendererExtension, } from '@formicoidea/labre-core/blocks/surface';
|
|
1
|
+
import { ElementRendererExtension, taggedPath2D, } from '@formicoidea/labre-core/blocks/surface';
|
|
2
2
|
import { shape as shapeRenderer } from '@formicoidea/labre-core/gfx/shape';
|
|
3
3
|
import { DefaultTheme } from '@formicoidea/labre-core/model';
|
|
4
4
|
import { PERSON_GLYPH_PATHS, PERSON_GLYPH_VIEWBOX } from './consts.js';
|
|
@@ -33,7 +33,7 @@ export const edgyNode = (model, ctx, matrix, renderer, rc, bound) => {
|
|
|
33
33
|
ctx.translate(-PERSON_GLYPH_VIEWBOX / 2, -PERSON_GLYPH_VIEWBOX / 2);
|
|
34
34
|
ctx.fillStyle = color;
|
|
35
35
|
for (const d of PERSON_GLYPH_PATHS) {
|
|
36
|
-
ctx.fill(
|
|
36
|
+
ctx.fill(taggedPath2D(d));
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
export const EdgyNodeRendererExtension = ElementRendererExtension('edgyNode', edgyNode);
|
package/dist/templates/index.js
CHANGED
|
@@ -518,7 +518,7 @@ const ATTRS = 'width="100%" height="100%" viewBox="0 0 135 80" xmlns="http://www
|
|
|
518
518
|
* `build` takes the OPTIONAL inserting editor: called with none, at module
|
|
519
519
|
* load, for the English `content`; called again with the real `std` as
|
|
520
520
|
* {@link Template.localize}, so the two builds read the very same layout and
|
|
521
|
-
* differ only in the words a seed resolves to (`docs/adr/
|
|
521
|
+
* differ only in the words a seed resolves to (`docs/adr/0023`).
|
|
522
522
|
*/
|
|
523
523
|
function tpl(name, preview, build, nameKey) {
|
|
524
524
|
return {
|
package/dist/toolbar/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ChromeWording, type ToolbarContext } from '@formicoidea/labre-core/shared/services';
|
|
1
|
+
import { type ChromeWording, type ToolbarContext, type ToolbarModuleConfig } from '@formicoidea/labre-core/shared/services';
|
|
2
2
|
import { type TemplateResult } from 'lit';
|
|
3
3
|
/** Every wording above, for `translations.ts`'s manifest contribution. */
|
|
4
4
|
export declare const EDGY_TOOLBAR_WORDINGS: readonly ChromeWording[];
|
|
@@ -17,11 +17,6 @@ export declare const edgyToolbarConfig: {
|
|
|
17
17
|
icon: TemplateResult;
|
|
18
18
|
active(ctx: ToolbarContext): boolean;
|
|
19
19
|
run(ctx: ToolbarContext): void;
|
|
20
|
-
}, {
|
|
21
|
-
id: string;
|
|
22
|
-
tooltipWording: ChromeWording;
|
|
23
|
-
icon: TemplateResult<1>;
|
|
24
|
-
run(ctx: ToolbarContext): void;
|
|
25
20
|
}];
|
|
26
21
|
readonly when: (ctx: ToolbarContext) => boolean;
|
|
27
22
|
};
|
|
@@ -41,12 +36,11 @@ export declare const edgyBoardToolbarConfig: {
|
|
|
41
36
|
icon: TemplateResult;
|
|
42
37
|
active(ctx: ToolbarContext): boolean;
|
|
43
38
|
run(ctx: ToolbarContext): void;
|
|
44
|
-
}, {
|
|
45
|
-
id: string;
|
|
46
|
-
tooltipWording: ChromeWording;
|
|
47
|
-
icon: TemplateResult<1>;
|
|
48
|
-
run(ctx: ToolbarContext): void;
|
|
49
39
|
}];
|
|
50
40
|
readonly when: (ctx: ToolbarContext) => boolean;
|
|
51
41
|
};
|
|
52
42
|
export declare const edgyBoardToolbarExtension: import("@formicoidea/labre-core/store").ExtensionType;
|
|
43
|
+
export declare const edgyToolingToolbarConfig: ToolbarModuleConfig;
|
|
44
|
+
export declare const edgyBoardToolingToolbarConfig: ToolbarModuleConfig;
|
|
45
|
+
export declare const edgyToolingToolbarExtension: import("@formicoidea/labre-core/store").ExtensionType;
|
|
46
|
+
export declare const edgyBoardToolingToolbarExtension: import("@formicoidea/labre-core/store").ExtensionType;
|
package/dist/toolbar/config.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { EdgelessCRUDIdentifier } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
-
import { createAutoLegend, dddLegendIcon } from '@formicoidea/labre-ddd-shared';
|
|
1
|
+
import { EdgelessCRUDIdentifier, legendToolbarAction, validationToolbarConfig, } from '@formicoidea/labre-core/blocks/surface';
|
|
3
2
|
import { EdgyBoardElementModel, EdgyFacetsElementModel, } from '@formicoidea/labre-core/model';
|
|
4
|
-
import {
|
|
3
|
+
import { BOARD_RESIZE_TOGGLE, ToolbarModuleExtension, } from '@formicoidea/labre-core/shared/services';
|
|
5
4
|
import { BlockFlavourIdentifier } from '@formicoidea/labre-core/std';
|
|
6
5
|
import { html } from 'lit';
|
|
7
|
-
import { EDGY_AUTO_LEGEND } from '../legend.js';
|
|
8
6
|
/** The two toolbar tooltips this file used to hard-code as English literals. */
|
|
9
7
|
const FACET_LABELS_TOGGLE = [
|
|
10
8
|
'com.labre.edgy.toolbar.facet-labels',
|
|
@@ -96,46 +94,12 @@ function booleanToggle(Model, id, tooltip, icon, prop) {
|
|
|
96
94
|
},
|
|
97
95
|
};
|
|
98
96
|
}
|
|
99
|
-
/**
|
|
100
|
-
* The legend action, shared by the two EDGY backgrounds: both frame the same
|
|
101
|
-
* notation, so both answer the same question — "what is actually drawn here" —
|
|
102
|
-
* with the same table ({@link EDGY_AUTO_LEGEND}) and the same box.
|
|
103
|
-
*
|
|
104
|
-
* Registered ALWAYS-ON (`EdgyRenderViewExtension`) with the toggles it sits
|
|
105
|
-
* next to: a legend is real, editable elements written into the document, so
|
|
106
|
-
* generating one is authoring, not tooling a flag may take away
|
|
107
|
-
* (`docs/adr/0009`).
|
|
108
|
-
*/
|
|
109
|
-
function legendAction(Model, id) {
|
|
110
|
-
return {
|
|
111
|
-
id,
|
|
112
|
-
tooltipWording: BOARD_LEGEND_NOTATION,
|
|
113
|
-
icon: dddLegendIcon,
|
|
114
|
-
run(ctx) {
|
|
115
|
-
const background = ctx.getSurfaceModelsByType(Model)[0];
|
|
116
|
-
if (!background)
|
|
117
|
-
return;
|
|
118
|
-
createAutoLegend(ctx.std, background, EDGY_AUTO_LEGEND);
|
|
119
|
-
ctx.std.getOptional(TelemetryProvider)?.track('FrameworkLegendCreated', {
|
|
120
|
-
// The WIRE value from `frameworks.ts` (`telemetryKey`), which for EDGY
|
|
121
|
-
// happens to be the module id itself. Same field set as Wardley's and
|
|
122
|
-
// the three DDD legend buttons, so the four are comparable.
|
|
123
|
-
framework: 'edgy',
|
|
124
|
-
element: 'legend',
|
|
125
|
-
page: 'whiteboard editor',
|
|
126
|
-
segment: 'element toolbar',
|
|
127
|
-
module: 'edgy toolbar',
|
|
128
|
-
});
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
97
|
export const edgyToolbarConfig = {
|
|
133
98
|
actions: [
|
|
134
99
|
booleanToggle(EdgyFacetsElementModel, 'a.toggle-resize', BOARD_RESIZE_TOGGLE, ResizeIcon, 'resizeEnabled'),
|
|
135
100
|
booleanToggle(EdgyFacetsElementModel, 'b.toggle-labels', FACET_LABELS_TOGGLE, LabelsIcon, 'showLabels'),
|
|
136
101
|
// No spotlight toggle here: the hover spotlight is BOARD logic and lives on
|
|
137
102
|
// the EDGY board toolbar below. The Venn only carries APPEARANCE (#195).
|
|
138
|
-
legendAction(EdgyFacetsElementModel, 'c.legend'),
|
|
139
103
|
],
|
|
140
104
|
when: ctx => ctx.getSurfaceModelsByType(EdgyFacetsElementModel).length > 0,
|
|
141
105
|
};
|
|
@@ -147,7 +111,6 @@ export const edgyBoardToolbarConfig = {
|
|
|
147
111
|
actions: [
|
|
148
112
|
booleanToggle(EdgyBoardElementModel, 'a.toggle-resize', BOARD_RESIZE_TOGGLE, ResizeIcon, 'resizeEnabled'),
|
|
149
113
|
booleanToggle(EdgyBoardElementModel, 'b.toggle-spotlight', HOVER_SPOTLIGHT_TOGGLE, SpotlightIcon, 'spotlightEnabled'),
|
|
150
|
-
legendAction(EdgyBoardElementModel, 'c.legend'),
|
|
151
114
|
],
|
|
152
115
|
when: ctx => ctx.getSurfaceModelsByType(EdgyBoardElementModel).length > 0,
|
|
153
116
|
};
|
|
@@ -155,3 +118,55 @@ export const edgyBoardToolbarExtension = ToolbarModuleExtension({
|
|
|
155
118
|
id: BlockFlavourIdentifier('affine:surface:edgyBoard'),
|
|
156
119
|
config: edgyBoardToolbarConfig,
|
|
157
120
|
});
|
|
121
|
+
/**
|
|
122
|
+
* A background's flag-gated row, WHOLE: the legend button and the Validation
|
|
123
|
+
* dropdown, in ONE module — registered by `EdgyViewExtension` on the `custom:`
|
|
124
|
+
* flavour slot of each of the two frames.
|
|
125
|
+
*
|
|
126
|
+
* ## Why one module and not two
|
|
127
|
+
*
|
|
128
|
+
* `renderToolbar` merges exactly four slots per element and
|
|
129
|
+
* `ToolbarModuleExtension` binds by DI variant, so a second module claiming
|
|
130
|
+
* `custom:affine:surface:edgy` throws `DuplicateServiceDefinitionError` before
|
|
131
|
+
* the editor finishes setting up. The always-on module above holds the
|
|
132
|
+
* APPEARANCE toggles a stored board must keep; these two entries are gated by
|
|
133
|
+
* the same flag and appear together or not at all.
|
|
134
|
+
*
|
|
135
|
+
* ## Why the legend moved out of the always-on half
|
|
136
|
+
*
|
|
137
|
+
* It used to sit with the toggles, argued as authoring. `docs/adr/0026` (which
|
|
138
|
+
* amends `docs/adr/0009`) reverses that reading: GENERATING a legend is
|
|
139
|
+
* tooling — it is the framework telling you what its notation means — while the
|
|
140
|
+
* legend it wrote is content, made of plain shapes, text and this pack's own
|
|
141
|
+
* always-on renderers, and keeps being painted with the flag off.
|
|
142
|
+
*
|
|
143
|
+
* `c.legend` and not the factory's default `b.`: the sort is lexicographic and
|
|
144
|
+
* both frames already spend `a.` and `b.` on their toggles.
|
|
145
|
+
*/
|
|
146
|
+
function toolingConfig(Model) {
|
|
147
|
+
return {
|
|
148
|
+
actions: [
|
|
149
|
+
legendToolbarAction({
|
|
150
|
+
id: 'c.legend',
|
|
151
|
+
Model,
|
|
152
|
+
owner: 'edgy',
|
|
153
|
+
framework: 'edgy',
|
|
154
|
+
}),
|
|
155
|
+
// The generic dropdown, not an EDGY variant of it: the config names no
|
|
156
|
+
// framework — it reads the registered rules and profiles — so this is the
|
|
157
|
+
// very same object wardley, bpmn, the context map and C4 register.
|
|
158
|
+
...validationToolbarConfig.actions,
|
|
159
|
+
],
|
|
160
|
+
when: (ctx) => ctx.getSurfaceModelsByType(Model).length > 0,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
export const edgyToolingToolbarConfig = toolingConfig(EdgyFacetsElementModel);
|
|
164
|
+
export const edgyBoardToolingToolbarConfig = toolingConfig(EdgyBoardElementModel);
|
|
165
|
+
export const edgyToolingToolbarExtension = ToolbarModuleExtension({
|
|
166
|
+
id: BlockFlavourIdentifier('custom:affine:surface:edgy'),
|
|
167
|
+
config: edgyToolingToolbarConfig,
|
|
168
|
+
});
|
|
169
|
+
export const edgyBoardToolingToolbarExtension = ToolbarModuleExtension({
|
|
170
|
+
id: BlockFlavourIdentifier('custom:affine:surface:edgyBoard'),
|
|
171
|
+
config: edgyBoardToolingToolbarConfig,
|
|
172
|
+
});
|
|
@@ -10,6 +10,8 @@ export declare class EdgelessEdgySeniorButton extends EdgelessEdgySeniorButton_b
|
|
|
10
10
|
enableActiveBackground: boolean;
|
|
11
11
|
type: typeof EmptyTool;
|
|
12
12
|
private _toggleMenu;
|
|
13
|
+
/** Lit while one of THIS framework's artefacts is armed. See the Wardley one. */
|
|
14
|
+
private get _armed();
|
|
13
15
|
render(): import("lit-html").TemplateResult<1>;
|
|
14
16
|
}
|
|
15
17
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DefaultTool } from '@formicoidea/labre-core/blocks/surface';
|
|
2
2
|
import { EmptyTool } from '@formicoidea/labre-core/gfx/pointer';
|
|
3
3
|
import { translateKey } from '@formicoidea/labre-core/shared/services';
|
|
4
|
-
import { EdgelessToolbarToolMixin } from '@formicoidea/labre-core/widgets/edgeless-toolbar';
|
|
4
|
+
import { armedArtefact, EdgelessToolbarToolMixin, } from '@formicoidea/labre-core/widgets/edgeless-toolbar';
|
|
5
5
|
import { SignalWatcher } from '@formicoidea/labre-core/global/lit';
|
|
6
6
|
import { css, html, LitElement } from 'lit';
|
|
7
7
|
import { edgyToolbarIcon } from './icons.js';
|
|
@@ -72,6 +72,10 @@ export class EdgelessEdgySeniorButton extends EdgelessToolbarToolMixin(SignalWat
|
|
|
72
72
|
const menu = this.createPopper('edgeless-edgy-menu', this);
|
|
73
73
|
menu.element.edgeless = this.edgeless;
|
|
74
74
|
}
|
|
75
|
+
/** Lit while one of THIS framework's artefacts is armed. See the Wardley one. */
|
|
76
|
+
get _armed() {
|
|
77
|
+
return armedArtefact(this.gfx)?.owner === 'edgy';
|
|
78
|
+
}
|
|
75
79
|
render() {
|
|
76
80
|
return html `<edgeless-toolbar-button
|
|
77
81
|
class="edgy-button"
|
|
@@ -79,7 +83,7 @@ export class EdgelessEdgySeniorButton extends EdgelessToolbarToolMixin(SignalWat
|
|
|
79
83
|
? ''
|
|
80
84
|
: translateKey(this.edgeless.std, 'com.labre.framework.edgy', 'EDGY')}
|
|
81
85
|
.tooltipOffset=${4}
|
|
82
|
-
.active=${!!this.popper}
|
|
86
|
+
.active=${!!this.popper || this._armed}
|
|
83
87
|
@click=${this._toggleMenu}
|
|
84
88
|
>
|
|
85
89
|
<div class="edgy-root">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FrameworkPalette, NamedPalette } from '@formicoidea/labre-core/components/color-picker';
|
|
1
2
|
import { type ChromeWording } from '@formicoidea/labre-core/shared/services';
|
|
2
3
|
/**
|
|
3
4
|
* The twelve EDGY swatches' own names, resolved by `resolvePaletteLabel`
|
|
@@ -23,4 +24,17 @@ export declare const EDGY_PALETTE_WORDING_ORGANISATION_LIGHT: ChromeWording;
|
|
|
23
24
|
export declare const EDGY_PALETTE_WORDING_BRAND_LIGHT: ChromeWording;
|
|
24
25
|
export declare const EDGY_PALETTE_WORDING_PRODUCT_LIGHT: ChromeWording;
|
|
25
26
|
export declare const EDGY_PALETTE_WORDINGS: readonly ChromeWording[];
|
|
27
|
+
/**
|
|
28
|
+
* From the default editor palette we keep ONLY the neutrals (greys, white,
|
|
29
|
+
* black, transparent) — the historical colours are dropped in favour of the
|
|
30
|
+
* EDGY swatches above.
|
|
31
|
+
*/
|
|
32
|
+
export declare const EDGY_PALETTE_LIST: NamedPalette[];
|
|
33
|
+
/**
|
|
34
|
+
* EDGY's page of the colour pickers' carousel (`docs/adr/0027`) — the same
|
|
35
|
+
* list its node picker is seeded with, offered on every other picker too.
|
|
36
|
+
* Registered from the FLAG-GATED view extension: offering hues is tooling
|
|
37
|
+
* (`docs/adr/0009`).
|
|
38
|
+
*/
|
|
39
|
+
export declare const EDGY_FRAMEWORK_PALETTE: FrameworkPalette;
|
|
26
40
|
export declare const edgyNodeToolbarExtension: import("@formicoidea/labre-core/store").ExtensionType;
|
|
@@ -142,10 +142,21 @@ const EDGY_PALETTES = [
|
|
|
142
142
|
* black, transparent) — the historical colours are dropped in favour of the
|
|
143
143
|
* EDGY swatches above.
|
|
144
144
|
*/
|
|
145
|
-
const EDGY_PALETTE_LIST = [
|
|
145
|
+
export const EDGY_PALETTE_LIST = [
|
|
146
146
|
...EDGY_PALETTES,
|
|
147
147
|
...neutralPalettes(),
|
|
148
148
|
];
|
|
149
|
+
/**
|
|
150
|
+
* EDGY's page of the colour pickers' carousel (`docs/adr/0027`) — the same
|
|
151
|
+
* list its node picker is seeded with, offered on every other picker too.
|
|
152
|
+
* Registered from the FLAG-GATED view extension: offering hues is tooling
|
|
153
|
+
* (`docs/adr/0009`).
|
|
154
|
+
*/
|
|
155
|
+
export const EDGY_FRAMEWORK_PALETTE = {
|
|
156
|
+
framework: 'edgy',
|
|
157
|
+
labelWording: ['com.labre.framework.edgy', 'EDGY'],
|
|
158
|
+
palettes: EDGY_PALETTE_LIST,
|
|
159
|
+
};
|
|
149
160
|
/**
|
|
150
161
|
* EDGY fill / stroke colour picker — identical to the shape one but seeded with
|
|
151
162
|
* the EDGY palette swatches (`.palettes`).
|
package/dist/translations.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { collectTranslationKeys, commandCategoryTranslationEntries, commandTranslationEntries, mergeTranslationEntries, } from '@formicoidea/labre-core/std';
|
|
2
|
-
import { edgyCommands } from './commands.js';
|
|
3
|
-
import { EDGY_LEGEND_CHROME_WORDINGS } from './legend.js';
|
|
2
|
+
import { edgyCommands, EDGY_LEGEND_CHROME_WORDINGS } from './commands.js';
|
|
4
3
|
import { EDGY_DYNAMIC_NODES, EDGY_DYNAMIC_VERBS, EDGY_ZONES, edgyElementLabel, edgyElementLabelKey, edgyVerbSeedKey, } from './metamodel.js';
|
|
5
4
|
import { NODE_LABEL, nodeLabelKey } from './node/consts.js';
|
|
6
5
|
import { EDGY_NUDGES } from './nudges.js';
|
package/dist/view.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { QualityNudgeExtension, ReadingProfileExtension, SpotlightHostExtension, ValidationProfileExtension, ValidationRuleExtension,
|
|
2
|
-
import {
|
|
1
|
+
import { QualityNudgeExtension, ReadingProfileExtension, SpotlightHostExtension, ValidationProfileExtension, ValidationRuleExtension, } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
import { FrameworkPaletteExtension } from '@formicoidea/labre-core/components/color-picker';
|
|
3
3
|
import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
|
|
4
4
|
import { TemplateCategoryExtension } from '@formicoidea/labre-core/gfx/template';
|
|
5
|
-
import {
|
|
5
|
+
import { CommandExtension } from '@formicoidea/labre-core/std';
|
|
6
6
|
import { RoleVocabularyExtension } from '@formicoidea/labre-core/std/gfx';
|
|
7
7
|
import { edgyCommandIcons, edgyCommands } from './commands.js';
|
|
8
8
|
import { effects } from './effects.js';
|
|
@@ -19,8 +19,8 @@ import { EdgyFacetsRendererExtension } from './element-renderer.js';
|
|
|
19
19
|
import { EdgyInteraction, EdgyView } from './element-view.js';
|
|
20
20
|
import { EdgyNodeRendererExtension } from './node/node-renderer.js';
|
|
21
21
|
import { EdgyNodeView } from './node/node-view.js';
|
|
22
|
-
import { edgyBoardToolbarExtension, edgyToolbarExtension, } from './toolbar/config.js';
|
|
23
|
-
import { edgyNodeToolbarExtension } from './toolbar/node-config.js';
|
|
22
|
+
import { edgyBoardToolbarExtension, edgyBoardToolingToolbarExtension, edgyToolbarExtension, edgyToolingToolbarExtension, } from './toolbar/config.js';
|
|
23
|
+
import { EDGY_FRAMEWORK_PALETTE, edgyNodeToolbarExtension, } from './toolbar/node-config.js';
|
|
24
24
|
import { edgySeniorTool } from './toolbar/senior-tool.js';
|
|
25
25
|
/**
|
|
26
26
|
* EDGY rendering — ALWAYS registered, independent of any flag. Disabling `edgy`
|
|
@@ -88,22 +88,17 @@ export class EdgyViewExtension extends ViewExtensionProvider {
|
|
|
88
88
|
// including the two the PO deliberately kept out of `rules.ts` on
|
|
89
89
|
// 26/08/2026 (see `./nudges.ts`).
|
|
90
90
|
context.register(QualityNudgeExtension(EDGY_NUDGES));
|
|
91
|
-
// The Validation dropdown on a selected
|
|
92
|
-
// A SECOND module on the same element,
|
|
93
|
-
// (the pattern `gfx/wardley` uses on
|
|
94
|
-
// registered always-on because a
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
context.register(ToolbarModuleExtension({
|
|
103
|
-
id: BlockFlavourIdentifier(flavour),
|
|
104
|
-
config: validationToolbarConfig,
|
|
105
|
-
}));
|
|
106
|
-
}
|
|
91
|
+
// The LEGEND button and the Validation dropdown on a selected
|
|
92
|
+
// background's contextual toolbar. A SECOND module on the same element,
|
|
93
|
+
// through the `custom:` flavour slot (the pattern `gfx/wardley` uses on
|
|
94
|
+
// its map): the rendering toolbars are registered always-on because a
|
|
95
|
+
// stored board must keep its appearance toggles, while asking the
|
|
96
|
+
// framework what its notation means, and choosing how hard to check the
|
|
97
|
+
// board, are both tooling and belong here (`docs/adr/0026`). One module
|
|
98
|
+
// per frame and not one shared object, because the button has to know
|
|
99
|
+
// WHICH background it is documenting.
|
|
100
|
+
context.register(edgyToolingToolbarExtension);
|
|
101
|
+
context.register(edgyBoardToolingToolbarExtension);
|
|
107
102
|
// The resolver that turns a hand-drawn `edgy:relation` into the verb the
|
|
108
103
|
// metamodel gives its two ends. It belongs HERE and not in the always-on
|
|
109
104
|
// extension above, and the test is the one `docs/adr/0009` asks: does it
|
|
@@ -122,6 +117,11 @@ export class EdgyViewExtension extends ViewExtensionProvider {
|
|
|
122
117
|
// profile, so it goes with the flag without either side naming the other.
|
|
123
118
|
context.register(ReadingProfileExtension(EDGY_READING));
|
|
124
119
|
context.register(edgySeniorTool);
|
|
120
|
+
// EDGY's page of the colour pickers' carousel (`docs/adr/0027`). Here,
|
|
121
|
+
// beside the senior tool, because offering hues is TOOLING — the colours
|
|
122
|
+
// already painted on a stored board are content and do not move
|
|
123
|
+
// (`docs/adr/0009`).
|
|
124
|
+
context.register(FrameworkPaletteExtension(EDGY_FRAMEWORK_PALETTE));
|
|
125
125
|
// The Templates-panel category — tooling, so it goes with the flag (#244).
|
|
126
126
|
context.register(TemplateCategoryExtension(edgyTemplateCategory));
|
|
127
127
|
// The eight EDGY commands: the sub-menu renders them, Settings ›
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-framework-edgy",
|
|
3
3
|
"description": "Labre edgy framework for @formicoidea/labre-core.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.42.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@formicoidea/labre-core": "0.
|
|
35
|
-
"@formicoidea/labre-ddd-shared": "0.41.0",
|
|
34
|
+
"@formicoidea/labre-core": "0.42.0",
|
|
36
35
|
"@preact/signals-core": "^1.8.0",
|
|
37
36
|
"lit": "^3.2.0",
|
|
38
37
|
"yjs": "^13.6.21"
|
package/dist/legend.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type AutoLegendSpec } from '@formicoidea/labre-ddd-shared';
|
|
2
|
-
import { type ChromeWording } from '@formicoidea/labre-core/shared/services';
|
|
3
|
-
/**
|
|
4
|
-
* The two section titles above that are this framework's OWN word rather than
|
|
5
|
-
* a role's — `titleKey` reuses a role's key where the section says a role's
|
|
6
|
-
* name (the facets, the intersections), but "Base elements" and "Relations"
|
|
7
|
-
* name a GROUPING of roles, so each mints a key of its own. For
|
|
8
|
-
* `translations.ts`'s manifest.
|
|
9
|
-
*/
|
|
10
|
-
export declare const EDGY_LEGEND_CHROME_WORDINGS: readonly ChromeWording[];
|
|
11
|
-
export declare const EDGY_AUTO_LEGEND: AutoLegendSpec;
|
package/dist/legend.js
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { roleLabel, } from '@formicoidea/labre-ddd-shared';
|
|
2
|
-
import { BOARD_LEGEND_TITLE, } from '@formicoidea/labre-core/shared/services';
|
|
3
|
-
import { EDGY_DYNAMIC_NODES, EDGY_ZONE_FILL, EDGY_ZONES, edgyElementLabel, edgyElementLabelKey, } from './metamodel.js';
|
|
4
|
-
import { NODE_FILL, NODE_STROKE } from './node/consts.js';
|
|
5
|
-
import { EDGY_ROLE, EDGY_ROLES } from './roles.js';
|
|
6
|
-
/**
|
|
7
|
-
* What an EDGY background's automatic legend can say — a TABLE, and nothing
|
|
8
|
-
* else: the scan, the placement and the box are `createAutoLegend`'s job, the
|
|
9
|
-
* same generic the three DDD backgrounds were given
|
|
10
|
-
* (`@labre/affine-gfx-ddd-shared`, `shared/legend-auto.ts`). EDGY takes a
|
|
11
|
-
* dependency on that package for the generic and the box prefab alone; moving
|
|
12
|
-
* them to a neutral home would be the tidier answer and is not worth the churn
|
|
13
|
-
* of this fix.
|
|
14
|
-
*
|
|
15
|
-
* Every row is DERIVED — from the metamodel (`./metamodel.ts`: which elements
|
|
16
|
-
* exist, which zone each belongs to, what colour that zone is drawn in) and
|
|
17
|
-
* from the role vocabulary's own labels (`./roles.ts`). Nothing here is
|
|
18
|
-
* restated: a thirteenth element added to the metamodel gets its legend row the
|
|
19
|
-
* same way it gets its role, with no edit to this file.
|
|
20
|
-
*
|
|
21
|
-
* ## The order
|
|
22
|
-
*
|
|
23
|
-
* By ZONE, and the order of the table carries it: the three facets first
|
|
24
|
-
* (Identity, Architecture, Experience), then the three intersections in one
|
|
25
|
-
* section, then the four base elements, then the relations — which is the
|
|
26
|
-
* reading order of {@link EDGY_ZONES} and, before it, of the Venn itself.
|
|
27
|
-
*/
|
|
28
|
-
/** One row per official element of `zone`, in the metamodel's own order. */
|
|
29
|
-
function zoneEntries(zone) {
|
|
30
|
-
return Object.entries(EDGY_DYNAMIC_NODES)
|
|
31
|
-
.filter(([, node]) => node.zone === zone)
|
|
32
|
-
.map(([name]) => ({
|
|
33
|
-
role: EDGY_ROLE[name],
|
|
34
|
-
row: {
|
|
35
|
-
swatch: 'square',
|
|
36
|
-
// The zone's fill, which IS what the diagram paints the element with.
|
|
37
|
-
color: EDGY_ZONE_FILL[zone],
|
|
38
|
-
label: roleLabel(EDGY_ROLES, EDGY_ROLE[name]),
|
|
39
|
-
},
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* A facet's section title says the facet's own name, so it reuses the key the
|
|
44
|
-
* metamodel's seeds already carry (`edgyElementLabelKey`): the legend and the
|
|
45
|
-
* facets diagram say "Identity" with one key, not two.
|
|
46
|
-
*/
|
|
47
|
-
const FACET_SECTIONS = EDGY_ZONES.filter(zone => zone.group === 'facet').map(zone => ({
|
|
48
|
-
title: edgyElementLabel(zone.id),
|
|
49
|
-
titleKey: edgyElementLabelKey(zone.id),
|
|
50
|
-
entries: zoneEntries(zone.id),
|
|
51
|
-
}));
|
|
52
|
-
/**
|
|
53
|
-
* The three intersection elements in ONE section: Organisation, Product and
|
|
54
|
-
* Brand are not three facets, they are the three lenses between them, and the
|
|
55
|
-
* diagram says so by drawing them in the overlaps. Each keeps its own colour.
|
|
56
|
-
*/
|
|
57
|
-
const INTERSECTIONS_SECTION = {
|
|
58
|
-
title: 'Intersections',
|
|
59
|
-
titleKey: 'com.labre.edgy.seed.intersections-title',
|
|
60
|
-
entries: EDGY_ZONES.filter(zone => zone.group === 'intersection').flatMap(zone => zoneEntries(zone.id)),
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* The four base elements, listed only when one is on the board BARE — an
|
|
64
|
-
* element the user dropped from the toolbox and left as a People, an Outcome,
|
|
65
|
-
* an Object or an Activity, without saying which of the twelve it is. White,
|
|
66
|
-
* because that is the fill the palette gives them (`node/consts.ts`).
|
|
67
|
-
*
|
|
68
|
-
* `exact` is what makes "bare" true. Detection is otherwise an ancestor walk,
|
|
69
|
-
* and the twelve official elements specialise these four — Content is an
|
|
70
|
-
* object, Story an activity — so an "Object" row would appear on a board
|
|
71
|
-
* carrying nothing but Contents, keyed to a white swatch that is drawn nowhere
|
|
72
|
-
* on it. The relation entry below keeps the walk, because there the parent row
|
|
73
|
-
* IS the fair summary: a board carrying `edgy:expresses` carries a relation.
|
|
74
|
-
*/
|
|
75
|
-
const BASE_SECTION = {
|
|
76
|
-
title: 'Base elements',
|
|
77
|
-
titleKey: 'com.labre.edgy.legend.section.base-elements',
|
|
78
|
-
entries: ['people', 'outcome', 'object', 'activity'].map(kind => ({
|
|
79
|
-
role: EDGY_ROLE[kind],
|
|
80
|
-
exact: true,
|
|
81
|
-
row: {
|
|
82
|
-
swatch: 'square',
|
|
83
|
-
color: NODE_FILL,
|
|
84
|
-
label: roleLabel(EDGY_ROLES, EDGY_ROLE[kind]),
|
|
85
|
-
},
|
|
86
|
-
})),
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* ONE row for the whole relation family, keyed on the PARENT role: a board
|
|
90
|
-
* carrying "content expresses purpose" carries `edgy:expresses`, which is a
|
|
91
|
-
* relation, and that is all the legend has to say. Twenty-two rows naming the
|
|
92
|
-
* verbs would restate the metamodel rather than document the drawing — and the
|
|
93
|
-
* verb travels on the link itself, visible, where it belongs.
|
|
94
|
-
*/
|
|
95
|
-
const RELATIONS_SECTION = {
|
|
96
|
-
title: 'Relations',
|
|
97
|
-
titleKey: 'com.labre.edgy.legend.section.relations',
|
|
98
|
-
entries: [
|
|
99
|
-
{
|
|
100
|
-
role: EDGY_ROLE.relation,
|
|
101
|
-
row: {
|
|
102
|
-
swatch: 'line',
|
|
103
|
-
// The stroke `activateEdgyRelation` arms the connector tool with.
|
|
104
|
-
color: NODE_STROKE,
|
|
105
|
-
label: roleLabel(EDGY_ROLES, EDGY_ROLE.relation),
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
],
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* The two section titles above that are this framework's OWN word rather than
|
|
112
|
-
* a role's — `titleKey` reuses a role's key where the section says a role's
|
|
113
|
-
* name (the facets, the intersections), but "Base elements" and "Relations"
|
|
114
|
-
* name a GROUPING of roles, so each mints a key of its own. For
|
|
115
|
-
* `translations.ts`'s manifest.
|
|
116
|
-
*/
|
|
117
|
-
export const EDGY_LEGEND_CHROME_WORDINGS = [
|
|
118
|
-
['com.labre.edgy.legend.section.base-elements', 'Base elements'],
|
|
119
|
-
['com.labre.edgy.legend.section.relations', 'Relations'],
|
|
120
|
-
];
|
|
121
|
-
export const EDGY_AUTO_LEGEND = {
|
|
122
|
-
// The shared DDD auto-legend box's own generic chrome, resolved through
|
|
123
|
-
// the same key every board that has one reuses — see `AutoLegendSpec.title`.
|
|
124
|
-
title: BOARD_LEGEND_TITLE[1],
|
|
125
|
-
titleKey: BOARD_LEGEND_TITLE[0],
|
|
126
|
-
roles: EDGY_ROLES,
|
|
127
|
-
sections: [
|
|
128
|
-
...FACET_SECTIONS,
|
|
129
|
-
INTERSECTIONS_SECTION,
|
|
130
|
-
BASE_SECTION,
|
|
131
|
-
RELATIONS_SECTION,
|
|
132
|
-
],
|
|
133
|
-
};
|