@staffbase/widget-sdk 3.3.4 → 3.3.5
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/.github/workflows/ci.yaml +1 -1
- package/CHANGELOG.md +24 -0
- package/docs/.nojekyll +1 -0
- package/docs/BaseBlock.md +4629 -0
- package/docs/BlockAttributes.md +17 -0
- package/docs/{Interface: BlockDefinition.md → BlockDefinition.md} +25 -11
- package/docs/BlockElement.md +83 -0
- package/docs/ColorTheme.md +65 -0
- package/docs/ExternalBlockDefinition.md +46 -0
- package/docs/Home.md +32 -31
- package/docs/SBColors.md +415 -0
- package/docs/SBFileType.md +50 -0
- package/docs/SBImageEntity.md +50 -0
- package/docs/SBUserAvatar.md +36 -0
- package/docs/SBUserProfile.md +64 -0
- package/docs/UserListItem.md +36 -0
- package/docs/UserListRequestQuery.md +36 -0
- package/docs/UserListResponse.md +36 -0
- package/docs/WidgetApi.md +92 -0
- package/docs/_Sidebar.md +2 -19
- package/package.json +15 -15
- package/docs/Interface: BaseBlock.md +0 -3226
- package/docs/Interface: BlockAttributes.md +0 -11
- package/docs/Interface: BlockElement.md +0 -89
- package/docs/Interface: ColorTheme.md +0 -52
- package/docs/Interface: ExternalBlockDefinition.md +0 -38
- package/docs/Interface: SBColors.md +0 -354
- package/docs/Interface: SBFileType.md +0 -39
- package/docs/Interface: SBImageEntity.md +0 -39
- package/docs/Interface: SBUserAvatar.md +0 -27
- package/docs/Interface: SBUserProfile.md +0 -51
- package/docs/Interface: UserListItem.md +0 -27
- package/docs/Interface: UserListRequestQuery.md +0 -27
- package/docs/Interface: UserListResponse.md +0 -27
- package/docs/Interface: WidgetApi.md +0 -75
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: BlockAttributes
|
|
2
|
+
|
|
3
|
+
## Indexable
|
|
4
|
+
|
|
5
|
+
▪ [key: `string`]: `number` \| `boolean` \| `string`
|
|
6
|
+
|
|
7
|
+
## Table of contents
|
|
8
|
+
|
|
9
|
+
### Properties
|
|
10
|
+
|
|
11
|
+
- [contentLanguage](../wiki/BlockAttributes#contentlanguage)
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### contentLanguage
|
|
16
|
+
|
|
17
|
+
• **contentLanguage**: `string`
|
|
@@ -2,15 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
## Type parameters
|
|
4
4
|
|
|
5
|
-
| Name |
|
|
5
|
+
| Name | Type |
|
|
6
6
|
| :------ | :------ |
|
|
7
|
-
| `Factory` | [
|
|
7
|
+
| `Factory` | [`BlockFactory`](../wiki/Home#blockfactory) |
|
|
8
|
+
|
|
9
|
+
## Table of contents
|
|
10
|
+
|
|
11
|
+
### Properties
|
|
12
|
+
|
|
13
|
+
- [attributes](../wiki/BlockDefinition#attributes)
|
|
14
|
+
- [blockLevel](../wiki/BlockDefinition#blocklevel)
|
|
15
|
+
- [configurationSchema](../wiki/BlockDefinition#configurationschema)
|
|
16
|
+
- [factory](../wiki/BlockDefinition#factory)
|
|
17
|
+
- [iconUrl](../wiki/BlockDefinition#iconurl)
|
|
18
|
+
- [label](../wiki/BlockDefinition#label)
|
|
19
|
+
- [name](../wiki/BlockDefinition#name)
|
|
20
|
+
- [options](../wiki/BlockDefinition#options)
|
|
21
|
+
- [uiSchema](../wiki/BlockDefinition#uischema)
|
|
8
22
|
|
|
9
23
|
## Properties
|
|
10
24
|
|
|
11
25
|
### attributes
|
|
12
26
|
|
|
13
|
-
• **attributes**:
|
|
27
|
+
• **attributes**: `string`[]
|
|
14
28
|
|
|
15
29
|
DOM attributes of the element, must be in kebab-case.
|
|
16
30
|
|
|
@@ -27,11 +41,11 @@ ___
|
|
|
27
41
|
|
|
28
42
|
### configurationSchema
|
|
29
43
|
|
|
30
|
-
• **configurationSchema**: JSONSchema7
|
|
44
|
+
• **configurationSchema**: `JSONSchema7`
|
|
31
45
|
|
|
32
46
|
Schema used for defining the configuration form.
|
|
33
47
|
|
|
34
|
-
**`example`**
|
|
48
|
+
**`example`**
|
|
35
49
|
```json
|
|
36
50
|
{
|
|
37
51
|
"type": "object",
|
|
@@ -58,7 +72,7 @@ ___
|
|
|
58
72
|
|
|
59
73
|
### factory
|
|
60
74
|
|
|
61
|
-
• **factory**: Factory
|
|
75
|
+
• **factory**: `Factory`
|
|
62
76
|
|
|
63
77
|
The implementation of the web component.
|
|
64
78
|
|
|
@@ -66,7 +80,7 @@ ___
|
|
|
66
80
|
|
|
67
81
|
### iconUrl
|
|
68
82
|
|
|
69
|
-
• `Optional` **iconUrl**:
|
|
83
|
+
• `Optional` **iconUrl**: `string`
|
|
70
84
|
|
|
71
85
|
Icon displayed on the widget installation page.
|
|
72
86
|
We recommend an icon with the dimensions 32x32 px.
|
|
@@ -75,7 +89,7 @@ ___
|
|
|
75
89
|
|
|
76
90
|
### label
|
|
77
91
|
|
|
78
|
-
• `Optional` **label**:
|
|
92
|
+
• `Optional` **label**: `string`
|
|
79
93
|
|
|
80
94
|
Label displayed in the settings dialog and in the default widget preview.
|
|
81
95
|
|
|
@@ -83,7 +97,7 @@ ___
|
|
|
83
97
|
|
|
84
98
|
### name
|
|
85
99
|
|
|
86
|
-
• **name**:
|
|
100
|
+
• **name**: `string`
|
|
87
101
|
|
|
88
102
|
The tag name of the widget. It must be compatible with
|
|
89
103
|
webcomponent naming conventions.
|
|
@@ -94,7 +108,7 @@ ___
|
|
|
94
108
|
|
|
95
109
|
### options
|
|
96
110
|
|
|
97
|
-
• `Optional` **options**: ElementDefinitionOptions
|
|
111
|
+
• `Optional` **options**: `ElementDefinitionOptions`
|
|
98
112
|
|
|
99
113
|
Can be used for extending from a built-in element.
|
|
100
114
|
|
|
@@ -102,7 +116,7 @@ ___
|
|
|
102
116
|
|
|
103
117
|
### uiSchema
|
|
104
118
|
|
|
105
|
-
• `Optional` **uiSchema**: UiSchema
|
|
119
|
+
• `Optional` **uiSchema**: `UiSchema`
|
|
106
120
|
|
|
107
121
|
Schema to add more customization to the look and feel of the configuration form.
|
|
108
122
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Interface: BlockElement
|
|
2
|
+
|
|
3
|
+
## Table of contents
|
|
4
|
+
|
|
5
|
+
### Methods
|
|
6
|
+
|
|
7
|
+
- [adoptedCallback](../wiki/BlockElement#adoptedcallback)
|
|
8
|
+
- [attributeChangedCallback](../wiki/BlockElement#attributechangedcallback)
|
|
9
|
+
- [connectedCallback](../wiki/BlockElement#connectedcallback)
|
|
10
|
+
- [disconnectedCallback](../wiki/BlockElement#disconnectedcallback)
|
|
11
|
+
- [unmount](../wiki/BlockElement#unmount)
|
|
12
|
+
|
|
13
|
+
## Methods
|
|
14
|
+
|
|
15
|
+
### adoptedCallback
|
|
16
|
+
|
|
17
|
+
▸ **adoptedCallback**(): `void`
|
|
18
|
+
|
|
19
|
+
Invoked when the custom element is moved to a new document.
|
|
20
|
+
|
|
21
|
+
#### Returns
|
|
22
|
+
|
|
23
|
+
`void`
|
|
24
|
+
|
|
25
|
+
___
|
|
26
|
+
|
|
27
|
+
### attributeChangedCallback
|
|
28
|
+
|
|
29
|
+
▸ **attributeChangedCallback**(`attrName`, `oldValue`, `newValue`): `void`
|
|
30
|
+
|
|
31
|
+
Invoked when one of the attributes of the custom element is added, removed, or changed.
|
|
32
|
+
|
|
33
|
+
Note that you have to statically register the observed values with the 'observedAttributes' static getter.
|
|
34
|
+
|
|
35
|
+
#### Parameters
|
|
36
|
+
|
|
37
|
+
| Name | Type | Description |
|
|
38
|
+
| :------ | :------ | :------ |
|
|
39
|
+
| `attrName` | `string` | The changed attributes name |
|
|
40
|
+
| `oldValue` | `undefined` \| `string` | The old value |
|
|
41
|
+
| `newValue` | `undefined` \| `string` | The new value |
|
|
42
|
+
|
|
43
|
+
#### Returns
|
|
44
|
+
|
|
45
|
+
`void`
|
|
46
|
+
|
|
47
|
+
___
|
|
48
|
+
|
|
49
|
+
### connectedCallback
|
|
50
|
+
|
|
51
|
+
▸ **connectedCallback**(): `void`
|
|
52
|
+
|
|
53
|
+
Invoked when the custom element is first connected to the DOM.
|
|
54
|
+
|
|
55
|
+
#### Returns
|
|
56
|
+
|
|
57
|
+
`void`
|
|
58
|
+
|
|
59
|
+
___
|
|
60
|
+
|
|
61
|
+
### disconnectedCallback
|
|
62
|
+
|
|
63
|
+
▸ **disconnectedCallback**(): `void`
|
|
64
|
+
|
|
65
|
+
Invoked when the custom element is disconnected from the DOM.
|
|
66
|
+
|
|
67
|
+
#### Returns
|
|
68
|
+
|
|
69
|
+
`void`
|
|
70
|
+
|
|
71
|
+
___
|
|
72
|
+
|
|
73
|
+
### unmount
|
|
74
|
+
|
|
75
|
+
▸ **unmount**(): `void`
|
|
76
|
+
|
|
77
|
+
Method to unmount / revert any effects applied by rendering.
|
|
78
|
+
E.g. to be used in editor cases to remove any rendered content
|
|
79
|
+
and revert the block to its initial state.
|
|
80
|
+
|
|
81
|
+
#### Returns
|
|
82
|
+
|
|
83
|
+
`void`
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Interface: ColorTheme
|
|
2
|
+
|
|
3
|
+
The color theme allows the widget to mimic the look
|
|
4
|
+
and feel of the Staffbase ecosystem it was added to.
|
|
5
|
+
|
|
6
|
+
## Table of contents
|
|
7
|
+
|
|
8
|
+
### Properties
|
|
9
|
+
|
|
10
|
+
- [bgColor](../wiki/ColorTheme#bgcolor)
|
|
11
|
+
- [bgColorDarkened1](../wiki/ColorTheme#bgcolordarkened1)
|
|
12
|
+
- [bgColorDarkened2](../wiki/ColorTheme#bgcolordarkened2)
|
|
13
|
+
- [bgColorDarkened2Opaque](../wiki/ColorTheme#bgcolordarkened2opaque)
|
|
14
|
+
- [bgColorLum](../wiki/ColorTheme#bgcolorlum)
|
|
15
|
+
- [colors](../wiki/ColorTheme#colors)
|
|
16
|
+
- [outlineColor](../wiki/ColorTheme#outlinecolor)
|
|
17
|
+
- [textColor](../wiki/ColorTheme#textcolor)
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
### bgColor
|
|
22
|
+
|
|
23
|
+
• **bgColor**: `string`
|
|
24
|
+
|
|
25
|
+
___
|
|
26
|
+
|
|
27
|
+
### bgColorDarkened1
|
|
28
|
+
|
|
29
|
+
• `Optional` **bgColorDarkened1**: `string`
|
|
30
|
+
|
|
31
|
+
___
|
|
32
|
+
|
|
33
|
+
### bgColorDarkened2
|
|
34
|
+
|
|
35
|
+
• `Optional` **bgColorDarkened2**: `string`
|
|
36
|
+
|
|
37
|
+
___
|
|
38
|
+
|
|
39
|
+
### bgColorDarkened2Opaque
|
|
40
|
+
|
|
41
|
+
• `Optional` **bgColorDarkened2Opaque**: `string`
|
|
42
|
+
|
|
43
|
+
___
|
|
44
|
+
|
|
45
|
+
### bgColorLum
|
|
46
|
+
|
|
47
|
+
• `Optional` **bgColorLum**: `string`
|
|
48
|
+
|
|
49
|
+
___
|
|
50
|
+
|
|
51
|
+
### colors
|
|
52
|
+
|
|
53
|
+
• **colors**: [`SBColors`](../wiki/SBColors)
|
|
54
|
+
|
|
55
|
+
___
|
|
56
|
+
|
|
57
|
+
### outlineColor
|
|
58
|
+
|
|
59
|
+
• `Optional` **outlineColor**: `string`
|
|
60
|
+
|
|
61
|
+
___
|
|
62
|
+
|
|
63
|
+
### textColor
|
|
64
|
+
|
|
65
|
+
• **textColor**: `string`
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Interface: ExternalBlockDefinition<Factory\>
|
|
2
|
+
|
|
3
|
+
Defintion of the Widget.
|
|
4
|
+
|
|
5
|
+
Includes the implementation of the BlockDefinition
|
|
6
|
+
and meta information (author and version of the widget).
|
|
7
|
+
|
|
8
|
+
## Type parameters
|
|
9
|
+
|
|
10
|
+
| Name | Type |
|
|
11
|
+
| :------ | :------ |
|
|
12
|
+
| `Factory` | [`BlockFactory`](../wiki/Home#blockfactory) |
|
|
13
|
+
|
|
14
|
+
## Table of contents
|
|
15
|
+
|
|
16
|
+
### Properties
|
|
17
|
+
|
|
18
|
+
- [author](../wiki/ExternalBlockDefinition#author)
|
|
19
|
+
- [blockDefinition](../wiki/ExternalBlockDefinition#blockdefinition)
|
|
20
|
+
- [version](../wiki/ExternalBlockDefinition#version)
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
### author
|
|
25
|
+
|
|
26
|
+
• **author**: `string`
|
|
27
|
+
|
|
28
|
+
Name of the author.
|
|
29
|
+
|
|
30
|
+
___
|
|
31
|
+
|
|
32
|
+
### blockDefinition
|
|
33
|
+
|
|
34
|
+
• **blockDefinition**: [`BlockDefinition`](../wiki/BlockDefinition)<`Factory`\>
|
|
35
|
+
|
|
36
|
+
Definition of the block.
|
|
37
|
+
|
|
38
|
+
Will be registered to the staffbase app.
|
|
39
|
+
|
|
40
|
+
___
|
|
41
|
+
|
|
42
|
+
### version
|
|
43
|
+
|
|
44
|
+
• **version**: `string`
|
|
45
|
+
|
|
46
|
+
Current version of the widget.
|
package/docs/Home.md
CHANGED
|
@@ -4,37 +4,40 @@
|
|
|
4
4
|
|
|
5
5
|
### Interfaces
|
|
6
6
|
|
|
7
|
-
- [BaseBlock](../wiki/
|
|
8
|
-
- [BlockAttributes](../wiki/
|
|
9
|
-
- [BlockDefinition](../wiki/
|
|
10
|
-
- [BlockElement](../wiki/
|
|
11
|
-
- [ColorTheme](../wiki/
|
|
12
|
-
- [ExternalBlockDefinition](../wiki/
|
|
13
|
-
- [SBColors](../wiki/
|
|
14
|
-
- [SBFileType](../wiki/
|
|
15
|
-
- [SBImageEntity](../wiki/
|
|
16
|
-
- [SBUserAvatar](../wiki/
|
|
17
|
-
- [SBUserProfile](../wiki/
|
|
18
|
-
- [UserListItem](../wiki/
|
|
19
|
-
- [UserListRequestQuery](../wiki/
|
|
20
|
-
- [UserListResponse](../wiki/
|
|
21
|
-
- [WidgetApi](../wiki/
|
|
7
|
+
- [BaseBlock](../wiki/BaseBlock)
|
|
8
|
+
- [BlockAttributes](../wiki/BlockAttributes)
|
|
9
|
+
- [BlockDefinition](../wiki/BlockDefinition)
|
|
10
|
+
- [BlockElement](../wiki/BlockElement)
|
|
11
|
+
- [ColorTheme](../wiki/ColorTheme)
|
|
12
|
+
- [ExternalBlockDefinition](../wiki/ExternalBlockDefinition)
|
|
13
|
+
- [SBColors](../wiki/SBColors)
|
|
14
|
+
- [SBFileType](../wiki/SBFileType)
|
|
15
|
+
- [SBImageEntity](../wiki/SBImageEntity)
|
|
16
|
+
- [SBUserAvatar](../wiki/SBUserAvatar)
|
|
17
|
+
- [SBUserProfile](../wiki/SBUserProfile)
|
|
18
|
+
- [UserListItem](../wiki/UserListItem)
|
|
19
|
+
- [UserListRequestQuery](../wiki/UserListRequestQuery)
|
|
20
|
+
- [UserListResponse](../wiki/UserListResponse)
|
|
21
|
+
- [WidgetApi](../wiki/WidgetApi)
|
|
22
|
+
|
|
23
|
+
### Type aliases
|
|
24
|
+
|
|
25
|
+
- [BlockFactory](../wiki/Home#blockfactory)
|
|
26
|
+
- [UserListSorting](../wiki/Home#userlistsorting)
|
|
22
27
|
|
|
23
28
|
## Type aliases
|
|
24
29
|
|
|
25
30
|
### BlockFactory
|
|
26
31
|
|
|
27
|
-
Ƭ **BlockFactory**: (`Base`: () => [
|
|
32
|
+
Ƭ **BlockFactory**: (`Base`: () => [`BaseBlock`](../wiki/BaseBlock), `widgetApi`: [`WidgetApi`](../wiki/WidgetApi)) => `CustomElementConstructor`
|
|
28
33
|
|
|
29
|
-
|
|
34
|
+
#### Type declaration
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
The class itself is a subclass of `HTMLElement` of the relevant `window` object,
|
|
33
|
-
with additional functionality.
|
|
36
|
+
▸ (`Base`, `widgetApi`): `CustomElementConstructor`
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
Factory for the custom widgets.
|
|
36
39
|
|
|
37
|
-
**`example`**
|
|
40
|
+
**`example`**
|
|
38
41
|
const factory: BlockFactory = Base => {
|
|
39
42
|
|
|
40
43
|
return class CustomBlock extends Base {
|
|
@@ -46,18 +49,16 @@ with additional functionality.
|
|
|
46
49
|
}
|
|
47
50
|
};
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
▸ (`Base`: () => [*BaseBlock*](../wiki/Interface:%20BaseBlock), `widgetApi`: [*WidgetApi*](../wiki/Interface:%20WidgetApi)): CustomElementConstructor
|
|
52
|
+
##### Parameters
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
| Name | Type | Description |
|
|
55
|
+
| :------ | :------ | :------ |
|
|
56
|
+
| `Base` | () => [`BaseBlock`](../wiki/BaseBlock) | base class for the custom widgets to inherit from. The class itself is a subclass of `HTMLElement` of the relevant `window` object, with additional functionality. |
|
|
57
|
+
| `widgetApi` | [`WidgetApi`](../wiki/WidgetApi) | API providing methods for additional information by the Staffbase framework |
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
| :------ | :------ |
|
|
57
|
-
| `Base` | () => [*BaseBlock*](../wiki/Interface:%20BaseBlock) |
|
|
58
|
-
| `widgetApi` | [*WidgetApi*](../wiki/Interface:%20WidgetApi) |
|
|
59
|
+
##### Returns
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
`CustomElementConstructor`
|
|
61
62
|
|
|
62
63
|
___
|
|
63
64
|
|