@formancy/report-builder-angular 0.1.0 → 0.2.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/NOTICE
CHANGED
|
@@ -7,3 +7,11 @@ This product is distributed under the Formancy Report Source-Available Licence
|
|
|
7
7
|
This product includes software developed by the formancy project
|
|
8
8
|
(https://github.com/sharkysan/formancy.ai), licensed under the Apache License,
|
|
9
9
|
Version 2.0. Those packages keep their licence; nothing here changes it.
|
|
10
|
+
|
|
11
|
+
@formancy/report-render-pdf includes the Liberation Sans fonts, version
|
|
12
|
+
2.1.5, Regular and Bold, in its fonts directory and, as base64, in its
|
|
13
|
+
browser build. Digitized data copyright (c) 2010 Google Corporation, with
|
|
14
|
+
Reserved Font Arimo, Tinos and Cousine. Copyright (c) 2012 Red Hat, Inc.,
|
|
15
|
+
with Reserved Font Name Liberation. They are licensed under the SIL Open
|
|
16
|
+
Font License, Version 1.1, whose text travels with them as
|
|
17
|
+
fonts/LICENSE-LiberationSans.txt; nothing here changes it.
|
package/README.md
CHANGED
|
@@ -61,9 +61,10 @@ Exactly the structure report-builder-core's README sets out under *What a
|
|
|
61
61
|
builder renders*, which the React builder renders too: a region named
|
|
62
62
|
"Report editor" with a bar above the panes (the title and the toolbar, with
|
|
63
63
|
its four pane buttons), the outline pane with the place chooser floating
|
|
64
|
-
over it, the design view
|
|
65
|
-
|
|
66
|
-
core's catalogue in English,
|
|
64
|
+
over it, the design view -- or the host's view in its place -- the
|
|
65
|
+
properties and the problems sharing the third column, and a bar below with
|
|
66
|
+
the live region. Every name comes from the core's catalogue in English,
|
|
67
|
+
Swiss German and Swiss French.
|
|
67
68
|
|
|
68
69
|
What is Angular's own:
|
|
69
70
|
|
|
@@ -75,6 +76,32 @@ What is Angular's own:
|
|
|
75
76
|
is in the document. Every action comes from one of the builder's own
|
|
76
77
|
listeners, which marks the view for check, so a render follows even an
|
|
77
78
|
action that changed nothing.
|
|
79
|
+
- **The host's view is a template.** A host whose editor was made with a
|
|
80
|
+
view of its own gives it as `<ng-template reportHostView>`, and the builder
|
|
81
|
+
stamps it into the design view's place while the editor's `view` is the
|
|
82
|
+
host's
|
|
83
|
+
([0029](../../docs/decisions/0029-the-preview-stands-in-the-design-views-place-where-it-does-not-fit-beside-the-builder.md)):
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<report-builder [editor]="editor">
|
|
87
|
+
<ng-template reportHostView><app-preview /></ng-template>
|
|
88
|
+
</report-builder>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
A template, not projected content, because Angular makes projected
|
|
92
|
+
content once whether its slot is drawn or not: the host's view lives only
|
|
93
|
+
while it is drawn, and the toolbar's Design view destroys it. The builder
|
|
94
|
+
stamps it with `@angular/core` alone, since `NgTemplateOutlet` is
|
|
95
|
+
`@angular/common`'s, which is not this package's peer. A key pressed in
|
|
96
|
+
it is the host's.
|
|
97
|
+
- **Images a person adds** need nothing of the host but the editor's
|
|
98
|
+
store (`createReportEditor`'s `images`, [0033](../../docs/decisions/0033-a-person-adds-an-image-in-either-builder-and-the-host-keeps-its-bytes.md)): the palette draws Add
|
|
99
|
+
image… last, and beside it the hidden file input, an `<input>` the
|
|
100
|
+
`ReportImageChooser` directive holds, which Add image… opens in the same
|
|
101
|
+
click once `chooseImage` is done; the file chosen is taken, the input
|
|
102
|
+
cleared, and handed to `editor.addImage`. The report's own properties
|
|
103
|
+
list its images, each with its Remove, which puts the keyboard on the
|
|
104
|
+
first field only once the image is gone (`ReportEditorRoot.attempt`).
|
|
78
105
|
- **Drag and drop is HTML's**, from the palette, from a canvas box or from an
|
|
79
106
|
outline row, onto the sheet (the nearest place, `targetNear`, read inside
|
|
80
107
|
the sheet's border) or onto a row (before or after it, `targetBeside`). A
|
|
@@ -103,7 +130,8 @@ and the parts inside it:
|
|
|
103
130
|
Each part is an attribute on the element it is, so the DOM has no wrapper
|
|
104
131
|
elements the React builder lacks. The bars, the panes' headers, the Report
|
|
105
132
|
button and the problems' count are `<report-builder>`'s template, not parts;
|
|
106
|
-
a host that arranges the parts itself writes its own
|
|
133
|
+
a host that arranges the parts itself writes its own, and draws its own
|
|
134
|
+
view where the state's `view` says, in place of `reportCanvas`. The parts inject
|
|
107
135
|
`ReportEditorRoot`, which holds the state as a signal and the editor's words.
|
|
108
136
|
It also routes key presses through `actionForKey`, dispatches, and moves
|
|
109
137
|
focus. `injectEditorState(editorSignal)` is the same signal for a host's own
|
|
@@ -140,8 +168,9 @@ under jsdom with zoneless change detection, as an application on Angular 22
|
|
|
140
168
|
runs.
|
|
141
169
|
|
|
142
170
|
- **Every `BUILDER_SCENARIOS` scenario**, in English, Swiss German and Swiss
|
|
143
|
-
French. Each step finds elements by role and accessible name only,
|
|
144
|
-
|
|
171
|
+
French. Each step finds elements by role and accessible name only, but an
|
|
172
|
+
`upload`, which finds the hidden file input beside Add image… in the DOM,
|
|
173
|
+
since it has no role; and each scenario ends with axe over the whole page at WCAG 2.2 AA, as formancy.ai's
|
|
145
174
|
conformance suite audits. A scenario left out, or a kind of step never
|
|
146
175
|
taken, fails the file.
|
|
147
176
|
- **The accessible tree:** every element a person operates or reads is
|
|
@@ -161,8 +190,22 @@ runs.
|
|
|
161
190
|
it among them. Each property of every component kind is found by its role
|
|
162
191
|
and name, and axe runs on each selection in turn.
|
|
163
192
|
- **The stylesheet's hooks:** the parts rendered are exactly `REPORT_PARTS`,
|
|
164
|
-
the
|
|
165
|
-
|
|
193
|
+
the design view's and the host's view's together, since the two are never
|
|
194
|
+
drawn at once; the `data-*` states are exactly those `REPORT_ATTRIBUTES`
|
|
195
|
+
lists, and the classes are only the workbench's.
|
|
196
|
+
- **The host's view**: a bare region in the design view's place, with the
|
|
197
|
+
middle pane's `data-pane`, its own part, no workbench class and only the
|
|
198
|
+
host's view in it, stamped while the region is drawn and destroyed with
|
|
199
|
+
it. That test reads the DOM, for the reason the hooks' tests do.
|
|
200
|
+
- **Images**: `image-chooser.test.ts` gives the file input `files` and a
|
|
201
|
+
`value` that behave as a browser's, where clearing the value empties the
|
|
202
|
+
files, and holds the file taken before the input is cleared, the input
|
|
203
|
+
cleared, a chooser closed without a file doing nothing, the keyboard on
|
|
204
|
+
Add image… while an image is added and after, Enter and a click opening
|
|
205
|
+
the chooser, no chooser where the editor takes no file, nothing drawn
|
|
206
|
+
without a store, and the host's types offered; `properties.test.ts` holds
|
|
207
|
+
the image rows. Space is not fired here; the Studio's browser gate
|
|
208
|
+
presses it (`apps/studio/scripts/gate-images.mjs`).
|
|
166
209
|
- **The dependency closure:** the manifest, the installed tree and every
|
|
167
210
|
import the published entry reaches. No React anywhere, and nothing imported
|
|
168
211
|
that is not declared.
|