@crombolo/backoffice-host 0.13.2 → 0.14.4

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 (45) hide show
  1. package/assets/device.js +180 -0
  2. package/assets/login.js +89 -2
  3. package/assets/remote-approval.js +134 -0
  4. package/package.json +2 -2
  5. package/plugin/assistant/umbraco-package.json +1 -1
  6. package/plugin/branding/branding.js +9 -14
  7. package/plugin/branding/localization-en.js +11 -0
  8. package/plugin/branding/theme.css +2 -0
  9. package/plugin/localizations/ar.js +3 -39
  10. package/plugin/localizations/bs.js +3 -29
  11. package/plugin/localizations/cs.js +3 -24
  12. package/plugin/localizations/cy.js +3 -32
  13. package/plugin/localizations/da.js +3 -41
  14. package/plugin/localizations/de.js +3 -27
  15. package/plugin/localizations/es.js +3 -19
  16. package/plugin/localizations/fr.js +3 -26
  17. package/plugin/localizations/hr.js +3 -29
  18. package/plugin/localizations/it.js +3 -29
  19. package/plugin/localizations/ja.js +3 -11
  20. package/plugin/localizations/ko.js +3 -11
  21. package/plugin/localizations/nb.js +3 -18
  22. package/plugin/localizations/nl.js +3 -29
  23. package/plugin/localizations/pl.js +3 -11
  24. package/plugin/localizations/pt-br.js +0 -10
  25. package/plugin/localizations/pt.js +3 -39
  26. package/plugin/localizations/ru.js +3 -9
  27. package/plugin/localizations/sv.js +3 -20
  28. package/plugin/localizations/tr.js +3 -26
  29. package/plugin/localizations/uk.js +3 -9
  30. package/plugin/localizations/umbraco-package.json +22 -2
  31. package/plugin/localizations/vi.js +3 -42
  32. package/plugin/localizations/zh-tw.js +0 -6
  33. package/plugin/localizations/zh.js +0 -6
  34. package/plugin/seo/umbraco-package.json +1 -1
  35. package/plugin/sign-in/entry.js +20 -0
  36. package/plugin/sign-in/sign-in-dialog.js +127 -0
  37. package/plugin/sign-in/umbraco-package.json +15 -0
  38. package/plugin/signed-in-devices.js +90 -0
  39. package/plugin/two-factor-setup.js +147 -0
  40. package/plugin/umbraco-package.json +79 -27
  41. package/plugin/welcome-dashboard.js +2 -5
  42. package/plugin/workflow-designer.js +245 -170
  43. package/src/login-assets.ts +5 -2
  44. package/src/shell.ts +65 -1
  45. package/plugin/branding/sysinfo.js +0 -89
@@ -1,89 +0,0 @@
1
- /**
2
- * The System information modal, reached from the header logo popover.
3
- *
4
- * It names the product in four places that no localisation key covers: three
5
- * row labels built as plain strings in `sysinfo.element.js`, and the heading it
6
- * puts above the text it copies to the clipboard.
7
- *
8
- * The rows are corrected at their source rather than in the DOM. The element
9
- * assembles every row into one string and assigns it to `_systemInformation`, a
10
- * lit reactive property, so wrapping that property's setter corrects the rows
11
- * before they are ever rendered — no observer, and no reaching into a shadow
12
- * root. The clipboard heading is prepended inside a private method that nothing
13
- * can reach, so that one is taken on the way out to the clipboard instead.
14
- */
15
-
16
- /**
17
- * The exact phrases to correct. Spelled out rather than replacing the product
18
- * name wherever it appears, because the same text carries the browser's user
19
- * agent and the current URL — a blanket replacement would rewrite whatever a
20
- * site happens to have in its address.
21
- */
22
- const PHRASES = [
23
- 'Umbraco build version',
24
- 'Umbraco assembly version',
25
- 'Umbraco client version',
26
- 'Umbraco system information',
27
- ]
28
-
29
- /** A fixed point: its own output contains none of the phrases, so re-applying it changes nothing. */
30
- export function rebrandSysinfo(text) {
31
- if (typeof text !== 'string') return text
32
- let corrected = text
33
- for (const phrase of PHRASES) {
34
- corrected = corrected.replaceAll(phrase, phrase.replace('Umbraco', 'Crombolo'))
35
- }
36
- return corrected
37
- }
38
-
39
- /** True when the string is the modal's clipboard payload rather than someone's own copy. */
40
- export function isSysinfoClipboardText(text) {
41
- return typeof text === 'string' && text.includes('Umbraco system information')
42
- }
43
-
44
- /**
45
- * Wraps the reactive property's setter. Does nothing at all if the accessor is
46
- * not where lit puts it, so an upstream change costs the correction and never
47
- * an error.
48
- */
49
- function patchRows(element) {
50
- const accessor = Object.getOwnPropertyDescriptor(element?.prototype ?? {}, '_systemInformation')
51
- if (!accessor?.get || !accessor?.set) return false
52
- Object.defineProperty(element.prototype, '_systemInformation', {
53
- ...accessor,
54
- get() {
55
- return accessor.get.call(this)
56
- },
57
- set(value) {
58
- accessor.set.call(this, rebrandSysinfo(value))
59
- },
60
- })
61
- return true
62
- }
63
-
64
- /**
65
- * Corrects the heading on its way to the clipboard. Installed only once the
66
- * modal's element exists — so a session that never opens System information
67
- * never patches anything — and it passes every other string through untouched.
68
- */
69
- function patchClipboard() {
70
- const clipboard = navigator.clipboard
71
- if (typeof clipboard?.writeText !== 'function') return
72
- const write = clipboard.writeText.bind(clipboard)
73
- try {
74
- clipboard.writeText = (text) =>
75
- write(isSysinfoClipboardText(text) ? rebrandSysinfo(text) : text)
76
- } catch {
77
- // A read-only `writeText` leaves the copied heading stale, which is the
78
- // one thing here worth less than a working copy button.
79
- }
80
- }
81
-
82
- export const onInit = () => {
83
- customElements
84
- .whenDefined('umb-sysinfo')
85
- .then((element) => {
86
- if (patchRows(element)) patchClipboard()
87
- })
88
- .catch(() => {})
89
- }