Skip to content

Commit af1ed58

Browse files
ca-dstee-re
authored andcommitted
docs(plugin-api): remove wizard section
1 parent b1e5c51 commit af1ed58

File tree

1 file changed

+5
-85
lines changed

1 file changed

+5
-85
lines changed

docs/plugin-api.md

Lines changed: 5 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ Plugins communicate user intent to OpenSCD core by dispatching the following [cu
5252
The **edit event** allows a plugin to describe the changes it wants to make to the current `doc`.
5353

5454
```typescript
55-
export type EditDetailV2<E extends Edit = Edit> = {
55+
export type EditDetailV2<E extends EditV2 = EditV2> = {
5656
edit: E;
5757
title?: string;
5858
squash?: boolean;
5959
}
6060

61-
export type EditEventV2<E extends Edit = Edit> = CustomEvent<EditDetailV2<E>>;
61+
export type EditEventV2<E extends EditV2 = EditV2> = CustomEvent<EditDetailV2<E>>;
6262

6363
export type EditEventOptions = {
6464
title?: string;
6565
squash?: boolean;
6666
}
6767

68-
export function newEditEventV2<E extends Edit>(edit: E, options: EditEventOptions): EditEventV2<E> {
68+
export function newEditEventV2<E extends EditV2>(edit: E, options: EditEventOptions): EditEventV2<E> {
6969
return new CustomEvent<E>('oscd-edit-v2', {
7070
composed: true,
7171
bubbles: true,
@@ -84,7 +84,7 @@ Its `title` property is a human-readable description of the edit.
8484

8585
The `squash` flag indicates whether the edit should be merged with the previous edit in the history.
8686

87-
#### `Edit` type
87+
#### `EditV2` type
8888
The `EditDetailV2` defined above contains an `edit` of this type:
8989

9090
```typescript
@@ -153,86 +153,6 @@ declare global {
153153
}
154154
```
155155

156-
### `WizardEvent`
157-
158-
The **wizard event** allows the plugin to request opening a modal dialog enabling the user to edit an arbitrary SCL `element`, regardless of how the dialog for editing this particular type of element looks and works.
159-
160-
```typescript
161-
/* eslint-disable no-undef */
162-
interface WizardRequestBase {
163-
subWizard?: boolean; // TODO: describe what this currently means
164-
}
165-
166-
export interface EditWizardRequest extends WizardRequestBase {
167-
element: Element;
168-
}
169-
170-
export interface CreateWizardRequest extends WizardRequestBase {
171-
parent: Element;
172-
tagName: string;
173-
}
174-
175-
export type WizardRequest = EditWizardRequest | CreateWizardRequest;
176-
177-
type EditWizardEvent = CustomEvent<EditWizardRequest>;
178-
type CreateWizardEvent = CustomEvent<CreateWizardRequest>;
179-
export type WizardEvent = EditWizardEvent | CreateWizardEvent;
180-
181-
type CloseWizardEvent = CustomEvent<WizardRequest>;
182-
183-
export function newEditWizardEvent(
184-
element: Element,
185-
subWizard?: boolean,
186-
eventInitDict?: CustomEventInit<Partial<EditWizardRequest>>
187-
): EditWizardEvent {
188-
return new CustomEvent<EditWizardRequest>('oscd-edit-wizard-request', {
189-
bubbles: true,
190-
composed: true,
191-
...eventInitDict,
192-
detail: { element, subWizard, ...eventInitDict?.detail },
193-
});
194-
}
195-
196-
export function newCreateWizardEvent(
197-
parent: Element,
198-
tagName: string,
199-
subWizard?: boolean,
200-
eventInitDict?: CustomEventInit<Partial<CreateWizardRequest>>
201-
): CreateWizardEvent {
202-
return new CustomEvent<CreateWizardRequest>('oscd-create-wizard-request', {
203-
bubbles: true,
204-
composed: true,
205-
...eventInitDict,
206-
detail: {
207-
parent,
208-
tagName,
209-
subWizard,
210-
...eventInitDict?.detail,
211-
},
212-
});
213-
}
214-
215-
export function newCloseWizardEvent(
216-
wizard: WizardRequest,
217-
eventInitDict?: CustomEventInit<Partial<WizardRequest>>
218-
): CloseWizardEvent {
219-
return new CustomEvent<WizardRequest>('oscd-close-wizard', {
220-
bubbles: true,
221-
composed: true,
222-
...eventInitDict,
223-
detail: wizard,
224-
});
225-
}
226-
227-
declare global {
228-
interface ElementEventMap {
229-
['oscd-edit-wizard-request']: EditWizardRequest;
230-
['oscd-create-wizard-request']: CreateWizardRequest;
231-
['oscd-close-wizard']: WizardEvent;
232-
}
233-
}
234-
```
235-
236156
## Theming
237157

238158
OpenSCD core sets the following CSS variables on the plugin:
@@ -256,4 +176,4 @@ OpenSCD core sets the following CSS variables on the plugin:
256176
--oscd-text-font-mono: var(--oscd-theme-text-font-mono, 'Roboto Mono');
257177
--oscd-icon-font: var(--oscd-theme-icon-font, 'Material Icons');
258178
}
259-
```
179+
```

0 commit comments

Comments
 (0)