@staffbase/widget-sdk 3.3.5 → 3.4.0-alpha.13
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/dist/base-block.d.ts +98 -0
- package/{index.d.ts → dist/base-block.js} +2 -11
- package/{lib/block-attributes.ts → dist/block-attributes.d.ts} +2 -3
- package/dist/block-attributes.js +13 -0
- package/dist/block-definition.d.ts +91 -0
- package/dist/block-definition.js +13 -0
- package/dist/block-element.d.ts +45 -0
- package/dist/block-element.js +13 -0
- package/{lib/block-factory.ts → dist/block-factory.d.ts} +2 -6
- package/dist/block-factory.js +13 -0
- package/{lib/external-block-definition.ts → dist/external-block-definition.d.ts} +15 -19
- package/dist/external-block-definition.js +13 -0
- package/{lib → dist}/global.d.ts +6 -9
- package/dist/global.js +13 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/{lib/widget-api-types.ts → dist/widget-api-types.d.ts} +92 -76
- package/dist/widget-api-types.js +21 -0
- package/{lib/widget-api.ts → dist/widget-api.d.ts} +18 -8
- package/dist/widget-api.js +13 -0
- package/docs/BaseBlock.md +1259 -1
- package/docs/BlockAttributes.md +4 -0
- package/docs/BlockDefinition.md +36 -0
- package/docs/BlockElement.md +20 -0
- package/docs/ColorTheme.md +32 -0
- package/docs/ExternalBlockDefinition.md +12 -0
- package/docs/Home.md +25 -0
- package/docs/IntegrationInformation.md +70 -0
- package/docs/IntegrationState.md +41 -0
- package/docs/IntegrationToken.md +30 -0
- package/docs/SBColors.md +224 -0
- package/docs/SBFileType.md +24 -0
- package/docs/SBImageEntity.md +24 -0
- package/docs/SBUserAvatar.md +16 -0
- package/docs/SBUserProfile.md +32 -0
- package/docs/UserListItem.md +16 -0
- package/docs/UserListRequestQuery.md +16 -0
- package/docs/UserListResponse.md +16 -0
- package/docs/WidgetApi.md +50 -0
- package/package.json +17 -12
- package/.commitlintrc.json +0 -28
- package/.github/CODEOWNERS +0 -1
- package/.github/workflows/ci.yaml +0 -61
- package/.github/workflows/dependency-update.yml +0 -24
- package/.husky/commit-msg +0 -6
- package/.releaserc +0 -38
- package/CHANGELOG.md +0 -295
- package/CONTRIBUTING.md +0 -10
- package/catalog-info.yaml +0 -11
- package/lib/base-block.ts +0 -110
- package/lib/block-definition.ts +0 -101
- package/lib/block-element.ts +0 -56
- package/tsconfig.json +0 -13
|
@@ -10,19 +10,17 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and
|
|
11
11
|
* limitations under the License.
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
13
|
/**
|
|
15
14
|
* File type entity
|
|
16
15
|
*/
|
|
17
16
|
export interface SBFileType {
|
|
18
|
-
default: string
|
|
19
|
-
ppt: string
|
|
20
|
-
xls: string
|
|
21
|
-
doc: string
|
|
22
|
-
pdf: string
|
|
23
|
-
img: string
|
|
17
|
+
default: string;
|
|
18
|
+
ppt: string;
|
|
19
|
+
xls: string;
|
|
20
|
+
doc: string;
|
|
21
|
+
pdf: string;
|
|
22
|
+
img: string;
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
/**
|
|
27
25
|
* Detailed colors entity definition
|
|
28
26
|
* @param clientForeground This color is meant to be used for foreground elements and is either black or white depending
|
|
@@ -37,64 +35,63 @@ export interface SBFileType {
|
|
|
37
35
|
*
|
|
38
36
|
*/
|
|
39
37
|
export interface SBColors {
|
|
40
|
-
fileType: SBFileType
|
|
41
|
-
backdrop: string
|
|
42
|
-
backgroundField: string
|
|
43
|
-
backgroundFieldLight: string
|
|
44
|
-
backgroundPrimary: string
|
|
45
|
-
backgroundSecondary: string
|
|
46
|
-
backgroundTertiary: string
|
|
47
|
-
black: string
|
|
48
|
-
borderSolid: string
|
|
49
|
-
borderTranslucent: string
|
|
50
|
-
clientForeground: string
|
|
51
|
-
clientPrimary: string
|
|
52
|
-
clientPrimaryA11y: string
|
|
53
|
-
clientSecondary: string
|
|
54
|
-
clientSecondaryA11y: string
|
|
55
|
-
textPlaceholder: string
|
|
56
|
-
textPrimary: string
|
|
57
|
-
textSecondary: string
|
|
58
|
-
textTertiary: string
|
|
59
|
-
pressedState: string
|
|
60
|
-
hoverState: string
|
|
61
|
-
backgroundBase: string
|
|
62
|
-
backgroundLevel1: string
|
|
63
|
-
backgroundLevel2: string
|
|
64
|
-
backgroundLevel3: string
|
|
65
|
-
backgroundLevel4: string
|
|
66
|
-
blue: string
|
|
67
|
-
blueDark: string
|
|
68
|
-
blueLight: string
|
|
69
|
-
green: string
|
|
70
|
-
greenDark: string
|
|
71
|
-
greenLight: string
|
|
72
|
-
grey: string
|
|
73
|
-
greyDark: string
|
|
74
|
-
greyLight: string
|
|
75
|
-
hairline: string
|
|
76
|
-
hairlineDark: string
|
|
77
|
-
neutral: string
|
|
78
|
-
neutralDark: string
|
|
79
|
-
neutralLight: string
|
|
80
|
-
orange: string
|
|
81
|
-
orangeDark: string
|
|
82
|
-
orangeLight: string
|
|
83
|
-
overlay: string
|
|
84
|
-
overlayDark: string
|
|
85
|
-
red: string
|
|
86
|
-
redDark: string
|
|
87
|
-
redLight: string
|
|
88
|
-
text: string
|
|
89
|
-
textGreyBase: string
|
|
90
|
-
textGreyLevel1: string
|
|
91
|
-
textGreyLevel2: string
|
|
92
|
-
textGreyLevel3: string
|
|
93
|
-
textGreyLevel4: string
|
|
94
|
-
textLight: string
|
|
95
|
-
warningYellow: string
|
|
38
|
+
fileType: SBFileType;
|
|
39
|
+
backdrop: string;
|
|
40
|
+
backgroundField: string;
|
|
41
|
+
backgroundFieldLight: string;
|
|
42
|
+
backgroundPrimary: string;
|
|
43
|
+
backgroundSecondary: string;
|
|
44
|
+
backgroundTertiary: string;
|
|
45
|
+
black: string;
|
|
46
|
+
borderSolid: string;
|
|
47
|
+
borderTranslucent: string;
|
|
48
|
+
clientForeground: string;
|
|
49
|
+
clientPrimary: string;
|
|
50
|
+
clientPrimaryA11y: string;
|
|
51
|
+
clientSecondary: string;
|
|
52
|
+
clientSecondaryA11y: string;
|
|
53
|
+
textPlaceholder: string;
|
|
54
|
+
textPrimary: string;
|
|
55
|
+
textSecondary: string;
|
|
56
|
+
textTertiary: string;
|
|
57
|
+
pressedState: string;
|
|
58
|
+
hoverState: string;
|
|
59
|
+
backgroundBase: string;
|
|
60
|
+
backgroundLevel1: string;
|
|
61
|
+
backgroundLevel2: string;
|
|
62
|
+
backgroundLevel3: string;
|
|
63
|
+
backgroundLevel4: string;
|
|
64
|
+
blue: string;
|
|
65
|
+
blueDark: string;
|
|
66
|
+
blueLight: string;
|
|
67
|
+
green: string;
|
|
68
|
+
greenDark: string;
|
|
69
|
+
greenLight: string;
|
|
70
|
+
grey: string;
|
|
71
|
+
greyDark: string;
|
|
72
|
+
greyLight: string;
|
|
73
|
+
hairline: string;
|
|
74
|
+
hairlineDark: string;
|
|
75
|
+
neutral: string;
|
|
76
|
+
neutralDark: string;
|
|
77
|
+
neutralLight: string;
|
|
78
|
+
orange: string;
|
|
79
|
+
orangeDark: string;
|
|
80
|
+
orangeLight: string;
|
|
81
|
+
overlay: string;
|
|
82
|
+
overlayDark: string;
|
|
83
|
+
red: string;
|
|
84
|
+
redDark: string;
|
|
85
|
+
redLight: string;
|
|
86
|
+
text: string;
|
|
87
|
+
textGreyBase: string;
|
|
88
|
+
textGreyLevel1: string;
|
|
89
|
+
textGreyLevel2: string;
|
|
90
|
+
textGreyLevel3: string;
|
|
91
|
+
textGreyLevel4: string;
|
|
92
|
+
textLight: string;
|
|
93
|
+
warningYellow: string;
|
|
96
94
|
}
|
|
97
|
-
|
|
98
95
|
/**
|
|
99
96
|
* The color theme allows the widget to mimic the look
|
|
100
97
|
* and feel of the Staffbase ecosystem it was added to.
|
|
@@ -102,14 +99,13 @@ export interface SBColors {
|
|
|
102
99
|
export interface ColorTheme {
|
|
103
100
|
bgColor: string;
|
|
104
101
|
textColor: string;
|
|
105
|
-
colors: SBColors
|
|
102
|
+
colors: SBColors;
|
|
106
103
|
bgColorDarkened1?: string;
|
|
107
|
-
bgColorDarkened2?: string
|
|
104
|
+
bgColorDarkened2?: string;
|
|
108
105
|
bgColorDarkened2Opaque?: string;
|
|
109
106
|
bgColorLum?: string;
|
|
110
107
|
outlineColor?: string;
|
|
111
108
|
}
|
|
112
|
-
|
|
113
109
|
/**
|
|
114
110
|
* Image entity definition
|
|
115
111
|
*/
|
|
@@ -121,7 +117,6 @@ export interface SBImageEntity {
|
|
|
121
117
|
url: string;
|
|
122
118
|
width: number;
|
|
123
119
|
}
|
|
124
|
-
|
|
125
120
|
/**
|
|
126
121
|
* User avatar definition
|
|
127
122
|
*/
|
|
@@ -131,7 +126,6 @@ export interface SBUserAvatar {
|
|
|
131
126
|
publicID: string;
|
|
132
127
|
thumb: SBImageEntity;
|
|
133
128
|
}
|
|
134
|
-
|
|
135
129
|
/**
|
|
136
130
|
* User profile data
|
|
137
131
|
*/
|
|
@@ -145,7 +139,6 @@ export interface SBUserProfile {
|
|
|
145
139
|
avatar?: SBUserAvatar;
|
|
146
140
|
department?: string;
|
|
147
141
|
}
|
|
148
|
-
|
|
149
142
|
/**
|
|
150
143
|
* The sorting order of the user list.
|
|
151
144
|
*
|
|
@@ -153,18 +146,16 @@ export interface SBUserProfile {
|
|
|
153
146
|
* @param created sort by date of creation descending
|
|
154
147
|
* @param updated sort by date of last update descending
|
|
155
148
|
*/
|
|
156
|
-
export type UserListSorting = 'lastname' | 'created' | 'updated';
|
|
157
|
-
|
|
149
|
+
export declare type UserListSorting = 'lastname' | 'created' | 'updated';
|
|
158
150
|
/**
|
|
159
151
|
* User list request parameters
|
|
160
152
|
*/
|
|
161
|
-
|
|
153
|
+
export interface UserListRequestQuery {
|
|
162
154
|
limit?: number;
|
|
163
155
|
offset?: number;
|
|
164
156
|
sort?: UserListSorting;
|
|
165
157
|
filter?: string;
|
|
166
158
|
}
|
|
167
|
-
|
|
168
159
|
/**
|
|
169
160
|
* Single user item
|
|
170
161
|
*/
|
|
@@ -174,7 +165,6 @@ export interface UserListItem {
|
|
|
174
165
|
lastName?: string;
|
|
175
166
|
entityType?: string;
|
|
176
167
|
}
|
|
177
|
-
|
|
178
168
|
/**
|
|
179
169
|
* Responded user list
|
|
180
170
|
*/
|
|
@@ -184,3 +174,29 @@ export interface UserListResponse {
|
|
|
184
174
|
limit: number;
|
|
185
175
|
total: number;
|
|
186
176
|
}
|
|
177
|
+
export declare type IntegrationType = "ms365";
|
|
178
|
+
/**
|
|
179
|
+
* Integration Token including the expiration time
|
|
180
|
+
*/
|
|
181
|
+
export interface IntegrationToken {
|
|
182
|
+
accessToken: string;
|
|
183
|
+
accessTokenExpiresAt?: Date;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* All available states the integration can take
|
|
187
|
+
*/
|
|
188
|
+
export declare enum IntegrationState {
|
|
189
|
+
UNAVAILABLE = "unavailable",
|
|
190
|
+
AVAILABLE = "available",
|
|
191
|
+
LOGGED_OUT = "loggedOut"
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Information about the requested Integration target
|
|
195
|
+
*/
|
|
196
|
+
export interface IntegrationInformation {
|
|
197
|
+
status: IntegrationState;
|
|
198
|
+
enabledFeatures: string[];
|
|
199
|
+
supportedFeatures: string[];
|
|
200
|
+
token?: IntegrationToken;
|
|
201
|
+
signIn?: () => void;
|
|
202
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021, Staffbase GmbH and contributors.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
* See the License for the specific language governing permissions and
|
|
11
|
+
* limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* All available states the integration can take
|
|
15
|
+
*/
|
|
16
|
+
export var IntegrationState;
|
|
17
|
+
(function (IntegrationState) {
|
|
18
|
+
IntegrationState["UNAVAILABLE"] = "unavailable";
|
|
19
|
+
IntegrationState["AVAILABLE"] = "available";
|
|
20
|
+
IntegrationState["LOGGED_OUT"] = "loggedOut";
|
|
21
|
+
})(IntegrationState || (IntegrationState = {}));
|
|
@@ -10,10 +10,7 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and
|
|
11
11
|
* limitations under the License.
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
import { ColorTheme, SBUserProfile, UserListRequestQuery, UserListResponse } from './widget-api-types';
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import { ColorTheme, IntegrationInformation, IntegrationType, SBUserProfile, UserListRequestQuery, UserListResponse } from './widget-api-types';
|
|
17
14
|
/**
|
|
18
15
|
* Widget API class.
|
|
19
16
|
*
|
|
@@ -27,7 +24,6 @@ export interface WidgetApi {
|
|
|
27
24
|
* @returns An object containing the color theme data is returned.
|
|
28
25
|
*/
|
|
29
26
|
getLegacyAppTheme(): ColorTheme;
|
|
30
|
-
|
|
31
27
|
/**
|
|
32
28
|
* Call to retrieve the user profile of the current or a specific user.
|
|
33
29
|
*
|
|
@@ -36,7 +32,6 @@ export interface WidgetApi {
|
|
|
36
32
|
* the promise is rejected.
|
|
37
33
|
*/
|
|
38
34
|
getUserInformation(userId?: string): Promise<SBUserProfile>;
|
|
39
|
-
|
|
40
35
|
/**
|
|
41
36
|
* Call to retrieve a user profile by its external ID.
|
|
42
37
|
*
|
|
@@ -45,7 +40,6 @@ export interface WidgetApi {
|
|
|
45
40
|
* the promise is rejected.
|
|
46
41
|
*/
|
|
47
42
|
getUserInformationByExternalId(externalId: string): Promise<SBUserProfile>;
|
|
48
|
-
|
|
49
43
|
/**
|
|
50
44
|
* Call to retrieve a list of users determined by the query object.
|
|
51
45
|
*
|
|
@@ -54,5 +48,21 @@ export interface WidgetApi {
|
|
|
54
48
|
* the promise is rejected.
|
|
55
49
|
*/
|
|
56
50
|
getUserList(query: UserListRequestQuery): Promise<UserListResponse>;
|
|
57
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Call to retrieve a valid token to access the Microsoft API. Includes a time value to
|
|
53
|
+
* refresh the token.
|
|
54
|
+
*
|
|
55
|
+
* @param type The name of the integration. ("ms365")
|
|
56
|
+
* @param refresh Force a refresh of the integration.
|
|
57
|
+
*
|
|
58
|
+
* @returns A promise containing the IntegrationInformation is returned. If the user session is
|
|
59
|
+
* not existing, the status is set to 'loggedOut' and the token is null. Additionally if the
|
|
60
|
+
* integration is not configured the status returns 'unavailable'.
|
|
61
|
+
*
|
|
62
|
+
* In case of an error, the promise is rejected.
|
|
63
|
+
*
|
|
64
|
+
* @deprecated Returns a IntegrationToken or null if the user is not logged in. This will be replaced
|
|
65
|
+
* completely by the IntegrationInformation, containing the token.
|
|
66
|
+
*/
|
|
67
|
+
getIntegration(type: IntegrationType, refresh?: boolean): Promise<IntegrationInformation>;
|
|
58
68
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021, Staffbase GmbH and contributors.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
* See the License for the specific language governing permissions and
|
|
11
|
+
* limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|