@crombolo/backoffice-host 0.60.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/package.json +3 -3
- package/plugin/app-preview/umbraco-package.json +1 -1
- package/plugin/branding/localization-en.js +1 -2
- package/plugin/bundles-activity-words.js +72 -0
- package/plugin/bundles-activity.js +171 -0
- package/plugin/bundles-client.js +30 -6
- package/plugin/bundles-installed.js +179 -69
- package/plugin/bundles-level-words.js +79 -0
- package/plugin/bundles-level.js +91 -0
- package/plugin/bundles-marketplace.js +64 -84
- package/plugin/content-strip-items.js +5 -13
- package/plugin/extension-screen-model.js +124 -0
- package/plugin/extension-screen.js +551 -0
- package/plugin/localizations/umbraco-package.json +1 -1
- package/plugin/seo/umbraco-package.json +1 -1
- package/plugin/settings-section.js +1 -31
- package/plugin/sign-in/umbraco-package.json +1 -1
- package/plugin/template-picker.js +3 -3
- package/plugin/umbraco-package.json +4 -34
- package/src/bundle-package.ts +105 -13
- package/src/bundle-permissions.ts +152 -6
- package/src/extension-roots.ts +128 -0
- package/src/extensions.ts +24 -1
- package/src/index.ts +1 -0
- package/src/manifests.ts +12 -1
- package/src/registry.ts +1 -0
- package/plugin/bundles-backoffice-code-words.js +0 -34
- package/plugin/bundles-backoffice-code.js +0 -51
package/src/registry.ts
CHANGED
|
@@ -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
|
-
`
|