Skip to content

Commit d02d767

Browse files
authored
Merge pull request #7621 from umbraco/forms/17-rc
Forms: Add 17 RC release notes and backoffice extension points
2 parents 4f2e6f9 + ec4bc19 commit d02d767

File tree

5 files changed

+184
-38
lines changed

5 files changed

+184
-38
lines changed

16/umbraco-forms/developer/extending/README.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,65 @@
11
# Extending
22

3-
Umbraco Forms functionality can be extended in different ways. In this section we focus on techniques available to a back-end/C# developer.
3+
Umbraco Forms functionality can be extended in different ways.
44

55
For front-end extensions, specifically via theming, see the [Themes](../themes.md) section.
66

7+
## Extending the Backoffice
8+
Umbraco Forms publishes an NPM package called `@umbraco-forms/backoffice` that holds typings and other niceties to build extensions.
9+
10+
{% hint style="warning" %}
11+
Ensure that you install the version of the Backoffice package that is compatible with your Umbraco Forms installation. You can find the appropriate version on the [`@umbraco-forms/backoffice` npm page](https://www.npmjs.com/package/@umbraco-forms/backoffice).
12+
{% endhint %}
13+
14+
You can install this package by running the command:
15+
16+
```bash
17+
npm install -D @umbraco-forms/[email protected]
18+
```
19+
20+
This will add a package to your devDependencies containing the TypeScript definitions for Umbraco Forms.
21+
22+
### TSConfig
23+
24+
Make sure to configure your TypeScript compiler so it includes the Global Types from the package. This enables you to utilize the declared Extension Types. If your project uses other Packages that provide their Extension Types, list those as well.
25+
26+
In your `tsconfig.json` file, add the array `types` inside `compilerOptions`, with the entry of `@umbraco-forms/backoffice`:
27+
28+
```json
29+
{
30+
"compilerOptions": {
31+
...
32+
"types": [
33+
...
34+
"@umbraco-forms/backoffice"
35+
]
36+
}
37+
}
38+
```
39+
40+
### Take extra care when using Vite
41+
42+
It is important that this namespace is ignored in your bundler. If you are using Vite, you can add the following to your `vite.config.ts` file:
43+
44+
```ts
45+
import { defineConfig } from "vite";
46+
47+
export default defineConfig({
48+
// other config
49+
// ...
50+
// add this to your config
51+
build: {
52+
rollupOptions: {
53+
external: [/^@umbraco/],
54+
},
55+
}
56+
});
57+
```
58+
59+
This ensures that the Umbraco Backoffice packages are not bundled with your package.
60+
61+
Read more about using Vite with Umbraco in the [Vite Package Setup](https://docs.umbraco.com/umbraco-cms/customizing/development-flow/vite-package-setup) article.
62+
763
## Developing Custom Providers
864

965
Although the Forms package comes with many fields, workflows and other built-in types, you can still create and develop your own if needed.

16/umbraco-forms/developer/extending/adding-a-fieldtype.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,18 @@ With Forms 14+, aspects of the presentation and functionality of the custom fiel
172172

173173
To create custom backoffice components for Umbraco 14, it's recommended to use a front-end build setup using Vite, TypeScript, and Lit. For more information, see the [Extension with Vite, TypeScript, and Lit](https://app.gitbook.com/s/G1Byxw7XfiZAj8zDMCTD/tutorials/creating-your-first-extension#extension-with-vite-typescript-and-lit) article.
174174

175+
The examples here are using the `@umbraco-forms/backoffice` package to get access to Forms-specific types and contexts. It is recommended to install this package as a development dependency in your project.
176+
177+
{% hint style="warning" %}
178+
Ensure that you install the version of the Backoffice package that is compatible with your Umbraco Forms installation. You can find the appropriate version on the [`@umbraco-forms/backoffice` npm page](https://www.npmjs.com/package/@umbraco-forms/backoffice).
179+
{% endhint %}
180+
181+
```bash
182+
npm install -D @umbraco-forms/[email protected]
183+
```
184+
185+
This will add a package to your devDependencies containing the TypeScript definitions for Umbraco Forms.
186+
175187
To display a name and description on a custom field, you need to register a JavaScript file as shown in the [Localization](https://app.gitbook.com/s/7MBVdnTbFiAgWuRsHpNS/customizing/extending-overview/extension-types/localization) article.
176188

177189
### Field Preview
@@ -240,14 +252,14 @@ And it is registered via a manifest:
240252
import MyFieldPreviewSliderElement from './slider-preview.element.js';
241253

242254
const sliderPreviewManifest = {
243-
type: "formsFieldPreview",
244-
alias: "My.FieldPreview.Slider",
245-
name: "Forms UUI Slider Field Preview",
246-
api: MyFieldPreviewSliderElement,
247-
element: () => import('./slider-preview.element.js')
248-
};
249-
250-
export const manifests = [sliderPreviewManifest];
255+
type: "formsFieldPreview",
256+
alias: "My.FieldPreview.Slider",
257+
name: "Forms UUI Slider Field Preview",
258+
api: MyFieldPreviewSliderElement,
259+
element: () => import('./slider-preview.element.js')
260+
};
261+
262+
export const manifests = [sliderPreviewManifest];
251263
```
252264

253265
### Field Editor
@@ -403,20 +415,23 @@ The following code shows the structure for these converter elements.
403415

404416
```javascript
405417
import type { UmbPropertyValueData } from "@umbraco-cms/backoffice/property";
418+
import type { FormsSettingValueConverterApi, Setting } from "@umbraco-forms/backoffice";
406419

407-
export class SliderSettingValueConverter {
408-
409-
async getSettingValueForEditor(setting, alias: string, value: string) {
420+
export class SliderSettingValueConverter
421+
implements FormsSettingValueConverterApi {
422+
async getSettingValueForEditor(setting: Setting, alias: string, value: string) {
410423
return Promise.resolve(value);
411424
}
412425

413-
async getSettingValueForPersistence(setting, valueData: UmbPropertyValueData) {
414-
return Promise.resolve(valueData.value);
426+
async getSettingValueForPersistence(setting: Setting, valueData: UmbPropertyValueData) {
427+
return Promise.resolve(valueData.value?.toString() || "");
415428
}
416429

417-
async getSettingPropertyConfig(setting, alias: string, values: UmbPropertyValueData[]) {
430+
async getSettingPropertyConfig(setting: Setting, alias: string, values: UmbPropertyValueData[]) {
418431
return Promise.resolve([]);
419432
}
433+
434+
destroy(): void { }
420435
}
421436
```
422437

17/umbraco-forms/developer/extending/README.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,65 @@
11
# Extending
22

3-
Umbraco Forms functionality can be extended in different ways. In this section we focus on techniques available to a back-end/C# developer.
3+
Umbraco Forms functionality can be extended in different ways.
44

55
For front-end extensions, specifically via theming, see the [Themes](../themes.md) section.
66

7+
## Extending the Backoffice
8+
Umbraco Forms publishes an NPM package called `@umbraco-forms/backoffice` that holds typings and other niceties to build extensions.
9+
10+
{% hint style="warning" %}
11+
Ensure that you install the version of the Backoffice package that is compatible with your Umbraco Forms installation. You can find the appropriate version on the [`@umbraco-forms/backoffice` npm page](https://www.npmjs.com/package/@umbraco-forms/backoffice).
12+
{% endhint %}
13+
14+
You can install this package by running the command:
15+
16+
```bash
17+
npm install -D @umbraco-forms/[email protected]
18+
```
19+
20+
This will add a package to your devDependencies containing the TypeScript definitions for Umbraco Forms.
21+
22+
### TSConfig
23+
24+
Make sure to configure your TypeScript compiler so it includes the Global Types from the package. This enables you to utilize the declared Extension Types. If your project uses other Packages that provide their Extension Types, list those as well.
25+
26+
In your `tsconfig.json` file, add the array `types` inside `compilerOptions`, with the entry of `@umbraco-forms/backoffice`:
27+
28+
```json
29+
{
30+
"compilerOptions": {
31+
...
32+
"types": [
33+
...
34+
"@umbraco-forms/backoffice"
35+
]
36+
}
37+
}
38+
```
39+
40+
### Take extra care when using Vite
41+
42+
It is important that this namespace is ignored in your bundler. If you are using Vite, you can add the following to your `vite.config.ts` file:
43+
44+
```ts
45+
import { defineConfig } from "vite";
46+
47+
export default defineConfig({
48+
// other config
49+
// ...
50+
// add this to your config
51+
build: {
52+
rollupOptions: {
53+
external: [/^@umbraco/],
54+
},
55+
}
56+
});
57+
```
58+
59+
This ensures that the Umbraco Backoffice packages are not bundled with your package.
60+
61+
Read more about using Vite with Umbraco in the [Vite Package Setup](https://docs.umbraco.com/umbraco-cms/customizing/development-flow/vite-package-setup) article.
62+
763
## Developing Custom Providers
864

965
Although the Forms package comes with many fields, workflows and other built-in types, you can still create and develop your own if needed.

17/umbraco-forms/developer/extending/adding-a-fieldtype.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,18 @@ With Forms 14+, aspects of the presentation and functionality of the custom fiel
172172

173173
To create custom backoffice components for Umbraco 14, it's recommended to use a front-end build setup using Vite, TypeScript, and Lit. For more information, see the [Extension with Vite, TypeScript, and Lit](https://app.gitbook.com/s/G1Byxw7XfiZAj8zDMCTD/tutorials/creating-your-first-extension#extension-with-vite-typescript-and-lit) article.
174174

175+
The examples here are using the `@umbraco-forms/backoffice` package to get access to Forms-specific types and contexts. It is recommended to install this package as a development dependency in your project.
176+
177+
{% hint style="warning" %}
178+
Ensure that you install the version of the Backoffice package that is compatible with your Umbraco Forms installation. You can find the appropriate version on the [`@umbraco-forms/backoffice` npm page](https://www.npmjs.com/package/@umbraco-forms/backoffice).
179+
{% endhint %}
180+
181+
```bash
182+
npm install -D @umbraco-forms/[email protected]
183+
```
184+
185+
This will add a package to your devDependencies containing the TypeScript definitions for Umbraco Forms.
186+
175187
To display a name and description on a custom field, you need to register a JavaScript file as shown in the [Localization](https://app.gitbook.com/s/7MBVdnTbFiAgWuRsHpNS/customizing/extending-overview/extension-types/localization) article.
176188

177189
### Field Preview
@@ -181,29 +193,24 @@ The alias of the preview to use is defined on the field type via the `PreviewVie
181193
A preview for our slider, representing the selected setting values could look as follows:
182194

183195
```javascript
184-
import { UmbElementMixin } from "@umbraco-cms/backoffice/element-api";
185196
import {
186-
LitElement,
187197
css,
188198
customElement,
189199
html,
190200
property,
191201
} from "@umbraco-cms/backoffice/external/lit";
202+
import { FormsFieldPreviewBaseElement } from "@umbraco-forms/backoffice";
192203

193204
const elementName = "my-field-preview-slider";
194205

195206
@customElement(elementName)
196-
export class MyFieldPreviewSliderElement extends UmbElementMixin(LitElement) {
207+
export class MyFieldPreviewSliderElement extends FormsFieldPreviewBaseElement {
197208
@property()
198209
settings = {};
199210

200211
@property({ type: Array })
201212
prevalues = [];
202213

203-
getSettingValue(key: string) {
204-
return this.settings[key];
205-
}
206-
207214
render() {
208215
return html`<div
209216
style="background-color:${this.getSettingValue("BgColor")}"
@@ -238,16 +245,16 @@ And it is registered via a manifest:
238245

239246
```javascript
240247
import MyFieldPreviewSliderElement from './slider-preview.element.js';
248+
import { ManifestFormsFieldPreview } from '@umbraco-forms/backoffice';
241249

242-
const sliderPreviewManifest = {
243-
type: "formsFieldPreview",
244-
alias: "My.FieldPreview.Slider",
245-
name: "Forms UUI Slider Field Preview",
246-
api: MyFieldPreviewSliderElement,
247-
element: () => import('./slider-preview.element.js')
248-
};
250+
const sliderPreviewManifest: ManifestFormsFieldPreview = {
251+
type: "formsFieldPreview",
252+
alias: "My.FieldPreview.Slider",
253+
name: "Forms UUI Slider Field Preview",
254+
element: MyFieldPreviewSliderElement
255+
};
249256

250-
export const manifests = [sliderPreviewManifest];
257+
export const manifests = [sliderPreviewManifest];
251258
```
252259

253260
### Field Editor
@@ -403,29 +410,33 @@ The following code shows the structure for these converter elements.
403410

404411
```javascript
405412
import type { UmbPropertyValueData } from "@umbraco-cms/backoffice/property";
413+
import type { FormsSettingValueConverterApi, Setting } from "@umbraco-forms/backoffice";
406414

407-
export class SliderSettingValueConverter {
408-
409-
async getSettingValueForEditor(setting, alias: string, value: string) {
415+
export class SliderSettingValueConverter
416+
implements FormsSettingValueConverterApi {
417+
async getSettingValueForEditor(setting: Setting, alias: string, value: string) {
410418
return Promise.resolve(value);
411419
}
412420

413-
async getSettingValueForPersistence(setting, valueData: UmbPropertyValueData) {
414-
return Promise.resolve(valueData.value);
421+
async getSettingValueForPersistence(setting: Setting, valueData: UmbPropertyValueData) {
422+
return Promise.resolve(valueData.value?.toString() || "");
415423
}
416424

417-
async getSettingPropertyConfig(setting, alias: string, values: UmbPropertyValueData[]) {
425+
async getSettingPropertyConfig(setting: Setting, alias: string, values: UmbPropertyValueData[]) {
418426
return Promise.resolve([]);
419427
}
428+
429+
destroy(): void { }
420430
}
421431
```
422432
423433
It's registered as follows. The `propertyEditorUiAlias` matches with the property editor UI that requires the conversions.
424434
425435
```javascript
426436
import { SliderSettingValueConverter } from "./slider-setting-value-converter.api";
437+
import { ManifestFormsSettingValueConverterPreview } from "@umbraco-forms/backoffice";
427438

428-
const sliderValueConverterManifest = {
439+
const sliderValueConverterManifest: ManifestFormsSettingValueConverterPreview = {
429440
type: "formsSettingValueConverter",
430441
alias: "My.SettingValueConverter.Slider",
431442
name: "Slider Value Converter",

17/umbraco-forms/release-notes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ If you are upgrading to a new major version, you can find information about the
1616

1717
This section contains the release notes for Umbraco Forms 17 including all changes for this version.
1818

19+
### 17.0.0-rc2 (November 13th 2025)
20+
21+
* Update dependencies to 17.0.0-rc2
22+
23+
### 17.0.0-rc1 (October 30th 2025)
24+
25+
* Update dependencies to 17.0.0-rc1
26+
1927
## Legacy release notes
2028

2129
You can find the release notes for versions out of support in the [Legacy documentation on GitHub](https://github.com/umbraco/UmbracoDocs/blob/umbraco-eol-versions/12/umbraco-forms/release-notes.md) and [Umbraco Forms Package page](https://our.umbraco.com/packages/developer-tools/umbraco-forms/).

0 commit comments

Comments
 (0)