@crombolo/backoffice-host 0.59.0 → 0.61.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/src/manifests.ts CHANGED
@@ -93,7 +93,18 @@ export function collectManifests(
93
93
  const all = [...discoverManifests(paths.vendorDir), ...frameworkManifests(paths)].filter(
94
94
  (manifest) => !omit.has(manifest.id ?? ''),
95
95
  )
96
- all.push(...extensions.map((extension) => extension.manifest))
96
+ // A described screen is drawn by the back office's own element, wherever it is mounted.
97
+ all.push(
98
+ ...extensions.map(
99
+ (extension) =>
100
+ JSON.parse(
101
+ JSON.stringify(extension.manifest).replaceAll(
102
+ `"${PLUGIN_PATH_PLACEHOLDER}/`,
103
+ `"${paths.pluginPath}/`,
104
+ ),
105
+ ) as PackageManifest,
106
+ ),
107
+ )
97
108
 
98
109
  const imports: Record<string, string> = {}
99
110
  const scopes: Record<string, Record<string, string>> = {}
package/src/registry.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
  export * from './bundle-package.ts'
7
7
  export * from './bundle-permissions.ts'
8
+ export * from './extension-roots.ts'
8
9
  export * from './extensions.ts'
9
10
  export type * from './manifests.ts'
10
11
  export * from './paths.ts'
@@ -1,34 +0,0 @@
1
- /**
2
- * What the Extensions screens say when an extension asks to run code in the back
3
- * office (story 320): it acts as whoever is signed in, it can't be kept apart
4
- * like the rest of an extension, and it is installed only from a publisher you
5
- * trust, named here with what its signature shows. Pure, so it is tested
6
- * without a browser.
7
- */
8
-
9
- /** The permission an extension's back-office code needs. */
10
- export const BACKOFFICE_CODE = 'backoffice.code'
11
-
12
- /**
13
- * @param {{ allows: string, reason?: string | null, warning?: string }} ask the permission as the server describes it
14
- * @param {string | null | undefined} publisher who published it, when the registry says
15
- * @param {{ label: string, detail: string } | undefined} signature `signatureWords`' reading of its signature
16
- */
17
- export function backOfficeCodeWords(ask, publisher, signature) {
18
- return {
19
- label: ask.allows,
20
- reason: ask.reason ?? '',
21
- warning: ask.warning ?? '',
22
- publisher: publisher ? `Published by ${publisher}.` : "Who published this isn't known.",
23
- signature: signature ? `${signature.label}. ${signature.detail}` : '',
24
- confirm: `I trust ${publisher ?? 'its publisher'} to act as anyone signed in to this back office`,
25
- }
26
- }
27
-
28
- /** The back-office code a set of asks includes, and the rest, so it is shown first and apart. */
29
- export function splitBackOfficeCode(asks) {
30
- return {
31
- code: asks.find((ask) => ask.permission === BACKOFFICE_CODE),
32
- rest: asks.filter((ask) => ask.permission !== BACKOFFICE_CODE),
33
- }
34
- }
@@ -1,51 +0,0 @@
1
- /**
2
- * The warning an extension's back-office code is granted under (story 320), with
3
- * its own confirmation, shared by the Marketplace's install and Installed's grant.
4
- */
5
- import { css, html } from '@umbraco-cms/backoffice/external/lit'
6
-
7
- /**
8
- * @param {ReturnType<typeof import('./bundles-backoffice-code-words.js').backOfficeCodeWords>} words
9
- * @param {boolean} confirmed
10
- * @param {((confirmed: boolean) => void) | undefined} onConfirm absent once it is granted: there is nothing to confirm
11
- */
12
- export function backOfficeCodeBlock(words, confirmed, onConfirm) {
13
- return html`
14
- <div class="backoffice-code" role="alert">
15
- <p class="heading"><uui-icon name="icon-alert"></uui-icon><strong>${words.label}</strong></p>
16
- ${words.reason ? html`<p class="reason">${words.reason}</p>` : ''}
17
- <p>${words.warning}</p>
18
- <p>${words.publisher} ${words.signature}</p>
19
- ${
20
- onConfirm
21
- ? html`<uui-checkbox
22
- label=${words.confirm}
23
- .checked=${confirmed}
24
- @change=${(event) => onConfirm(event.target.checked)}></uui-checkbox>`
25
- : ''
26
- }
27
- </div>
28
- `
29
- }
30
-
31
- export const backOfficeCodeStyles = css`
32
- .backoffice-code {
33
- margin: var(--uui-size-space-3) 0;
34
- padding: var(--uui-size-space-4);
35
- border: 1px solid var(--uui-color-warning-standalone, var(--uui-color-warning));
36
- border-radius: var(--uui-border-radius);
37
- background: var(--uui-color-warning-surface, var(--uui-color-surface-alt));
38
- }
39
- .backoffice-code p {
40
- margin: 0 0 var(--uui-size-space-2);
41
- }
42
- .backoffice-code .heading {
43
- display: flex;
44
- align-items: center;
45
- gap: var(--uui-size-space-2);
46
- color: var(--uui-color-warning-standalone, var(--uui-color-warning-emphasis));
47
- }
48
- .backoffice-code .reason {
49
- color: var(--uui-color-text-alt);
50
- }
51
- `