@uxland/primary-shell 8.3.4 → 8.3.5

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.
Files changed (146) hide show
  1. package/README.md +18 -1
  2. package/package.json +6 -14
  3. package/src/UI/bootstrapper.ts +0 -14
  4. package/src/UI/components/bootstrapper.ts +0 -25
  5. package/src/UI/components/clinical-pathways-action-menu/clinical-pathways-action-menu.ts +0 -13
  6. package/src/UI/components/communication-action-menu/communication-action-menu.ts +0 -13
  7. package/src/UI/components/error-view/component.ts +0 -17
  8. package/src/UI/components/error-view/styles.css +0 -27
  9. package/src/UI/components/error-view/template.ts +0 -12
  10. package/src/UI/components/nav-divider/nav-divider.ts +0 -41
  11. package/src/UI/components/nav-divider/styles.css +0 -21
  12. package/src/UI/components/nav-divider/template.ts +0 -8
  13. package/src/UI/components/petitioner-action-menu/petitioner-action-menu.ts +0 -13
  14. package/src/UI/components/primaria-accordion/primaria-accordion.ts +0 -45
  15. package/src/UI/components/primaria-shell/constants.ts +0 -4
  16. package/src/UI/components/primaria-shell/primaria-shell.ts +0 -105
  17. package/src/UI/components/primaria-shell/shell-header/header-divider/header-divider.ts +0 -13
  18. package/src/UI/components/primaria-shell/shell-header/header-divider/styles.css +0 -5
  19. package/src/UI/components/primaria-shell/shell-header/header-divider/template.ts +0 -8
  20. package/src/UI/components/primaria-shell/shell-header/shell-header.ts +0 -71
  21. package/src/UI/components/primaria-shell/shell-header/styles.css +0 -45
  22. package/src/UI/components/primaria-shell/shell-header/template.ts +0 -37
  23. package/src/UI/components/primaria-shell/styles.css +0 -185
  24. package/src/UI/components/primaria-shell/template.ts +0 -72
  25. package/src/UI/components/sidenav-action-menu/sidenav-action-menu.ts +0 -62
  26. package/src/UI/components/sidenav-action-menu/styles.css +0 -25
  27. package/src/UI/components/sidenav-action-menu/template.ts +0 -24
  28. package/src/UI/fonts/fonts.css +0 -48
  29. package/src/UI/fonts/open-sans-v40-latin-300.woff2 +0 -0
  30. package/src/UI/fonts/open-sans-v40-latin-500.woff2 +0 -0
  31. package/src/UI/fonts/open-sans-v40-latin-600.woff2 +0 -0
  32. package/src/UI/fonts/open-sans-v40-latin-700.woff2 +0 -0
  33. package/src/UI/fonts/open-sans-v40-latin-800.woff2 +0 -0
  34. package/src/UI/fonts/open-sans-v40-latin-regular.woff2 +0 -0
  35. package/src/UI/images/Gencat_Logotip.svg +0 -70
  36. package/src/UI/images/Salut_Logotip.svg +0 -8
  37. package/src/UI/index.ts +0 -1
  38. package/src/UI/internal-views/administrative-nav-menu.ts +0 -302
  39. package/src/UI/internal-views/common-nav-menu.ts +0 -94
  40. package/src/UI/internal-views/doctor-nav-menu.ts +0 -297
  41. package/src/UI/internal-views/doctor-quick-action-menu.ts +0 -16
  42. package/src/UI/internal-views/handle-views.ts +0 -24
  43. package/src/UI/shared-components/bootstrapper.ts +0 -18
  44. package/src/UI/shared-components/index.ts +0 -1
  45. package/src/UI/shared-components/primaria-character-limit-badge/primaria-character-limit-badge.ts +0 -27
  46. package/src/UI/shared-components/primaria-character-limit-badge/styles.css +0 -8
  47. package/src/UI/shared-components/primaria-content-switcher/primaria-content-switcher.ts +0 -78
  48. package/src/UI/shared-components/primaria-nav-item/primaria-nav-item.ts +0 -71
  49. package/src/UI/shared-components/primaria-nav-item/styles.css +0 -25
  50. package/src/UI/shared-components/primaria-nav-item/template.ts +0 -27
  51. package/src/UI/shared-components/primaria-nav-tree-menu/primaria-nav-tree-menu.ts +0 -41
  52. package/src/UI/shared-components/primaria-nav-tree-menu/styles.css +0 -11
  53. package/src/UI/shared-components/primaria-nav-tree-menu/template.ts +0 -46
  54. package/src/UI/shared-components/primaria-region/index.ts +0 -1
  55. package/src/UI/shared-components/primaria-region/primaria-region.ts +0 -199
  56. package/src/UI/shared-components/primaria-text-editor/primaria-rich-text-editor.ts +0 -261
  57. package/src/UI/shared-components/primaria-text-editor/styles.css +0 -966
  58. package/src/UI/shared-components/primaria-text-editor/template.ts +0 -8
  59. package/src/UI/shared-components/primaria-text-editor/utils.ts +0 -39
  60. package/src/UI/shared-components/quick-action-item/quick-action-item.ts +0 -21
  61. package/src/UI/shared-components/quick-action-item/template.ts +0 -8
  62. package/src/UI/shared-components/typings.ts +0 -19
  63. package/src/api/activity-monitor/activity-monitor.test.ts +0 -67
  64. package/src/api/activity-monitor/activity-monitor.ts +0 -26
  65. package/src/api/api.test.ts +0 -37
  66. package/src/api/api.ts +0 -119
  67. package/src/api/broker/broker-events.ts +0 -39
  68. package/src/api/broker/broker-requests.ts +0 -20
  69. package/src/api/broker/factory.test.ts +0 -378
  70. package/src/api/broker/factory.ts +0 -151
  71. package/src/api/broker/primaria-broker.ts +0 -20
  72. package/src/api/context-manager/context-manager.test.ts +0 -86
  73. package/src/api/context-manager/context-manager.ts +0 -42
  74. package/src/api/ecap-event-manager/ecap-event-manager.test.ts +0 -100
  75. package/src/api/ecap-event-manager/ecap-event-manager.ts +0 -58
  76. package/src/api/ecap-event-manager/typings.ts +0 -6
  77. package/src/api/exit-guard-manager/exit-guard-manager.test.ts +0 -75
  78. package/src/api/exit-guard-manager/exit-guard-manager.ts +0 -31
  79. package/src/api/global-state/global-state.test.ts +0 -45
  80. package/src/api/global-state/global-state.ts +0 -38
  81. package/src/api/http-client/http-client.test.ts +0 -196
  82. package/src/api/http-client/http-client.ts +0 -97
  83. package/src/api/import-data-manager/component/component.ts +0 -29
  84. package/src/api/import-data-manager/component/styles.css +0 -79
  85. package/src/api/import-data-manager/component/template.ts +0 -49
  86. package/src/api/import-data-manager/import-data-manager-impl.test.ts +0 -364
  87. package/src/api/import-data-manager/import-data-manager-impl.ts +0 -121
  88. package/src/api/import-data-manager/import-data-manager.ts +0 -42
  89. package/src/api/import-data-manager/index.ts +0 -2
  90. package/src/api/interaction-service/confirmation-message.tsx +0 -5
  91. package/src/api/interaction-service/index.ts +0 -1
  92. package/src/api/interaction-service/interaction-service-impl.tsx +0 -260
  93. package/src/api/interaction-service/interaction-service.ts +0 -52
  94. package/src/api/interaction-service/modal-styles.css +0 -97
  95. package/src/api/localization/localization.test.ts +0 -61
  96. package/src/api/localization/localization.ts +0 -58
  97. package/src/api/notification-service/notification-service-impl.test.ts +0 -84
  98. package/src/api/notification-service/notification-service.ts +0 -6
  99. package/src/api/notification-service/notification.service-impl.ts +0 -67
  100. package/src/api/pdf-viewer-manager/constants.ts +0 -1
  101. package/src/api/pdf-viewer-manager/events.ts +0 -5
  102. package/src/api/pdf-viewer-manager/handle-views.ts +0 -32
  103. package/src/api/pdf-viewer-manager/pdf-viewer-manager.test.ts +0 -126
  104. package/src/api/pdf-viewer-manager/pdf-viewer-manager.ts +0 -96
  105. package/src/api/pdf-viewer-manager/pdf-visor/pdf-selector/pdf-selector.ts +0 -39
  106. package/src/api/pdf-viewer-manager/pdf-visor/pdf-selector/styles.css +0 -45
  107. package/src/api/pdf-viewer-manager/pdf-visor/pdf-selector/template.ts +0 -32
  108. package/src/api/pdf-viewer-manager/pdf-visor/pdf-visor.ts +0 -122
  109. package/src/api/pdf-viewer-manager/pdf-visor/styles.css +0 -29
  110. package/src/api/pdf-viewer-manager/pdf-visor/utils.ts +0 -16
  111. package/src/api/quick-action-busy-manager/quick-action-busy-manager.test.ts +0 -61
  112. package/src/api/quick-action-busy-manager/quick-action-busy-manager.ts +0 -45
  113. package/src/api/region-manager/region-manager.test.ts +0 -239
  114. package/src/api/region-manager/region-manager.ts +0 -263
  115. package/src/api/region-manager/regions.ts +0 -30
  116. package/src/api/region-manager/remove-view-idempotency.test.ts +0 -98
  117. package/src/api/session-refresh-timer/session-refresh-timer.test.ts +0 -102
  118. package/src/api/session-refresh-timer/session-refresh-timer.ts +0 -75
  119. package/src/api/token-manager/token-manager.test.ts +0 -146
  120. package/src/api/token-manager/token-manager.ts +0 -70
  121. package/src/api/user-manager/user-manager.ts +0 -79
  122. package/src/bootstrapper.ts +0 -41
  123. package/src/constants.ts +0 -1
  124. package/src/disposer.ts +0 -19
  125. package/src/features/bootstrapper.ts +0 -21
  126. package/src/features/exit/bootstrapper.ts +0 -17
  127. package/src/features/exit/handler.test.ts +0 -187
  128. package/src/features/exit/handler.ts +0 -58
  129. package/src/features/exit/request.ts +0 -10
  130. package/src/features/get-patient-cip/action.ts +0 -5
  131. package/src/features/get-user-info/backend-adapter.ts +0 -48
  132. package/src/features/get-user-info/bootstrapper.ts +0 -20
  133. package/src/features/get-user-info/handler.test.ts +0 -66
  134. package/src/features/get-user-info/handler.ts +0 -23
  135. package/src/features/get-user-info/model.ts +0 -10
  136. package/src/features/get-user-info/pds-token.ts +0 -28
  137. package/src/features/get-user-info/request.ts +0 -4
  138. package/src/features/get-visi-id/action.ts +0 -11
  139. package/src/features/navigate-to-ecap/navigate-to-ecap.ts +0 -21
  140. package/src/features/utils.ts +0 -27
  141. package/src/handle-plugins.ts +0 -82
  142. package/src/index.ts +0 -101
  143. package/src/infrastructure/ioc/container.ts +0 -14
  144. package/src/infrastructure/ioc/types.ts +0 -5
  145. package/src/locales.ts +0 -70
  146. package/src/types/custom.d.ts +0 -30
@@ -1,261 +0,0 @@
1
- import { css, html, LitElement, unsafeCSS } from "lit";
2
- import { property } from "lit/decorators.js";
3
- import Quill from "uxl-quill/dist/quill";
4
- import styles from "./styles.css?inline";
5
- import { template } from "./template";
6
- import { fixSpellCheckerIssue } from "./utils";
7
-
8
- fixSpellCheckerIssue(Quill);
9
-
10
- /**
11
- * Una opció de la barra d'eines de Quill: el nom solt (`"bold"`), un objecte de configuració
12
- * (`{ header: 1 }`) o un grup d'opcions, que és com Quill separa els blocs de la barra.
13
- */
14
- type ToolbarOption = string | Record<string, unknown> | (string | Record<string, unknown>)[];
15
-
16
- /**
17
- * Opcions de la barra d'eines que Quill espera com a objecte de configuració en lloc del nom
18
- * solt. Abans era una cadena d'`else if`.
19
- */
20
- const TOOLBAR_OPTION_ALIASES: Record<string, ToolbarOption> = {
21
- color: { color: [] },
22
- ol: { list: "ordered" },
23
- ul: { list: "bullet" },
24
- subindex: { script: "sub" },
25
- superindex: { script: "super" },
26
- // outdent: { indent: "-1" },
27
- // indent: { indent: "+1" },
28
- size: { size: ["small", false, "large", "huge"] },
29
- header: { header: [1, 2, 3, 4, 5, 6, false] },
30
- background: { background: [] },
31
- font: { font: [] },
32
- align: { align: [] },
33
- };
34
-
35
- export class PrimariaRichTextEditor extends LitElement {
36
- private textChangeTimeout: number | null = null;
37
-
38
- render() {
39
- return html` ${template(this)} `;
40
- }
41
-
42
- static styles = css`
43
- ${unsafeCSS(styles)}
44
- `;
45
-
46
- firstUpdated() {
47
- // const rte: PrimariaRichTextEditor = this;
48
- this.quill = new Quill(this.shadowRoot?.querySelector("#rte"), this._getOptions());
49
-
50
- this.quill.on("text-change", () => this._debouncedEmitTextChangeEvent());
51
-
52
- this.quill.root.addEventListener("paste", () => {
53
- this._debouncedEmitTextChangeEvent();
54
- });
55
- this.quill.on("selection-change", (range, oldRange, source) => {
56
- if (range) this.range = range;
57
- });
58
- }
59
-
60
- _debouncedEmitTextChangeEvent() {
61
- if (this.textChangeTimeout) {
62
- clearTimeout(this.textChangeTimeout);
63
- }
64
-
65
- this.textChangeTimeout = window.setTimeout(() => {
66
- this._emitTextChangeEvent();
67
- }, 200);
68
- }
69
-
70
- _emitTextChangeEvent() {
71
- const plainValue = this.quill.getText();
72
- const values = {
73
- html: this.shadowRoot?.querySelector(".ql-editor")?.innerHTML,
74
- plain: plainValue,
75
- };
76
-
77
- const textChanged = new CustomEvent("text-changed", {
78
- composed: true,
79
- detail: values,
80
- });
81
-
82
- this.dispatchEvent(textChanged);
83
- this.range = this.getCursorPosition();
84
- }
85
-
86
- @property()
87
- quill: Quill | null;
88
-
89
- @property()
90
- options: string;
91
-
92
- @property({ type: Object })
93
- range: { index: number; length: number };
94
-
95
- @property({ type: Array })
96
- availableOptions: string[] = [
97
- "bold",
98
- "italic",
99
- "underline",
100
- "strike",
101
- "blockquote",
102
- "code-block",
103
- "image",
104
- "video",
105
- "link",
106
- "color",
107
- "background",
108
- "ol",
109
- "ul",
110
- "subindex",
111
- "superindex",
112
- // 'outdent',
113
- // 'indent',
114
- "size",
115
- "header",
116
- "font",
117
- "align",
118
- // "clear",
119
- "undo",
120
- "redo",
121
- ];
122
-
123
- @property({ type: Array })
124
- availableFormats: string[] = [
125
- "background",
126
- "bold",
127
- "color",
128
- "font",
129
- "code",
130
- "italic",
131
- "link",
132
- "size",
133
- "strike",
134
- "script",
135
- "underline",
136
- "blockquote",
137
- "header",
138
- // 'indent',
139
- "list",
140
- "align",
141
- "direction",
142
- "code-block",
143
- "formula",
144
- "image",
145
- "video",
146
- ];
147
-
148
- @property()
149
- formats: string;
150
-
151
- _getOptions() {
152
- // Sense anotar, `[]` s'infereix com a `never[]` i totes les assignacions posteriors fallen.
153
- let toolbarOptions: ToolbarOption[] = [];
154
- const availableOpts = this.availableOptions;
155
- if (this.options === undefined || this.options.length === 0) {
156
- toolbarOptions = [
157
- ["bold", "italic", "underline", "strike"],
158
- ["blockquote", "code-block"],
159
- [{ header: 1 }, { header: 2 }],
160
- [{ list: "ordered" }, { list: "bullet" }],
161
- [{ script: "sub" }, { script: "super" }],
162
- // [{indent: '-1'}, {indent: '+1'}],
163
- [{ direction: "rtl" }],
164
- [{ size: ["small", false, "large", "huge", "20px"] }],
165
- [{ header: [1, 2, 3, 4, 5, 6, false] }],
166
- [{ color: [] }, { background: [] }],
167
- [{ font: [] }],
168
- [{ align: [] }],
169
- ["image"],
170
- ["video"],
171
- // ["clean"],
172
- ];
173
- } else {
174
- // Abans això filtrava amb un `splice` dins d'un `forEach`, que salta elements quan n'hi ha
175
- // dos d'invàlids seguits. Amb `filter` el resultat és el que la intenció demanava.
176
- toolbarOptions = this.options
177
- .split(",")
178
- .filter((option) => availableOpts.indexOf(option) > -1)
179
- // Les opcions amb configuració es tradueixen; la resta passen tal com són.
180
- .map((option) => TOOLBAR_OPTION_ALIASES[option] ?? option);
181
- // if (toolbarOptions.indexOf("clean") < 0) {
182
- // toolbarOptions.push("clean");
183
- // }
184
- }
185
-
186
- /* const icons = Quill.import('ui/icons');
187
- icons['undo'] = undo_icon;
188
- icons['redo'] = redo_icon; */
189
-
190
- let formats = this.availableFormats;
191
- if (this.formats) {
192
- formats = this.formats.split(",");
193
- }
194
-
195
- return {
196
- modules: {
197
- toolbar: {
198
- container: toolbarOptions,
199
- handlers: {
200
- redo() {
201
- this.quill.history.redo();
202
- },
203
- undo() {
204
- this.quill.history.undo();
205
- },
206
- },
207
- },
208
- history: {
209
- delay: 1000,
210
- maxStack: 50,
211
- userOnly: false,
212
- },
213
- keyboard: {
214
- bindings: {
215
- indent: {
216
- // highlight tab or tab at beginning of list, indent or blockquote
217
- key: "Tab",
218
- format: ["blockquote", "indent", "list"],
219
- handler(range, context) {
220
- if (
221
- (context.collapsed && context.offset !== 0) ||
222
- context.format?.list === "ordered" // disable ordered list auto-numbering on indentation
223
- )
224
- return true;
225
- this.quill.format("indent", "+1", Quill.sources.USER);
226
- return false;
227
- },
228
- },
229
- "list autofill": {
230
- key: " ",
231
- shiftKey: null,
232
- collapsed: true,
233
- format: {
234
- "code-block": false,
235
- blockquote: false,
236
- table: false,
237
- },
238
- prefix: /^\s*?(\d+\.|-|\*)$/,
239
- handler(range, context) {
240
- if (this.quill.scroll.query("list") == null) return true;
241
- const { length } = context.prefix;
242
- const line = this.quill.getLine(range.index);
243
- const offset = line[1];
244
- if (offset > length) return true;
245
- this.quill.insertText(range.index, " ", Quill.sources.USER);
246
- this.quill.setSelection(range.index - length, Quill.sources.SILENT);
247
- return false;
248
- },
249
- },
250
- },
251
- },
252
- },
253
- theme: "snow",
254
- formats: formats,
255
- };
256
- }
257
-
258
- public getCursorPosition() {
259
- return this.quill.getSelection();
260
- }
261
- }