@staffbase/widget-sdk 3.4.0-beta.5 → 3.4.0-beta.6

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.
Files changed (70) hide show
  1. package/dist/base-block.d.ts +98 -0
  2. package/{index.d.ts → dist/base-block.js} +2 -11
  3. package/{lib/block-attributes.ts → dist/block-attributes.d.ts} +2 -3
  4. package/dist/block-attributes.js +13 -0
  5. package/dist/block-definition.d.ts +91 -0
  6. package/dist/block-definition.js +13 -0
  7. package/dist/block-element.d.ts +45 -0
  8. package/dist/block-element.js +13 -0
  9. package/{lib/block-factory.ts → dist/block-factory.d.ts} +2 -6
  10. package/dist/block-factory.js +13 -0
  11. package/{lib/external-block-definition.ts → dist/external-block-definition.d.ts} +15 -19
  12. package/dist/external-block-definition.js +13 -0
  13. package/{lib → dist}/global.d.ts +6 -9
  14. package/dist/global.js +13 -0
  15. package/dist/index.d.ts +9 -0
  16. package/dist/index.js +9 -0
  17. package/{lib/widget-api-types.ts → dist/widget-api-types.d.ts} +76 -99
  18. package/dist/widget-api-types.js +21 -0
  19. package/{lib/widget-api.ts → dist/widget-api.d.ts} +0 -7
  20. package/dist/widget-api.js +13 -0
  21. package/docs/.nojekyll +1 -0
  22. package/docs/BaseBlock.md +5887 -0
  23. package/docs/BlockAttributes.md +21 -0
  24. package/docs/BlockDefinition.md +167 -0
  25. package/docs/BlockElement.md +103 -0
  26. package/docs/ColorTheme.md +97 -0
  27. package/docs/ExternalBlockDefinition.md +58 -0
  28. package/docs/Home.md +56 -30
  29. package/docs/IntegrationInformation.md +70 -0
  30. package/docs/IntegrationState.md +41 -0
  31. package/docs/IntegrationToken.md +30 -0
  32. package/docs/SBColors.md +639 -0
  33. package/docs/SBFileType.md +74 -0
  34. package/docs/SBImageEntity.md +74 -0
  35. package/docs/SBUserAvatar.md +52 -0
  36. package/docs/SBUserProfile.md +96 -0
  37. package/docs/UserListItem.md +52 -0
  38. package/docs/UserListRequestQuery.md +52 -0
  39. package/docs/UserListResponse.md +52 -0
  40. package/docs/WidgetApi.md +142 -0
  41. package/docs/_Sidebar.md +2 -19
  42. package/package.json +22 -17
  43. package/.commitlintrc.json +0 -28
  44. package/.github/CODEOWNERS +0 -1
  45. package/.github/workflows/ci.yaml +0 -61
  46. package/.github/workflows/dependency-update.yml +0 -24
  47. package/.husky/commit-msg +0 -6
  48. package/.releaserc +0 -38
  49. package/CHANGELOG.md +0 -273
  50. package/CONTRIBUTING.md +0 -10
  51. package/catalog-info.yaml +0 -11
  52. package/docs/Interface: BaseBlock.md +0 -3226
  53. package/docs/Interface: BlockAttributes.md +0 -11
  54. package/docs/Interface: BlockDefinition.md +0 -117
  55. package/docs/Interface: BlockElement.md +0 -89
  56. package/docs/Interface: ColorTheme.md +0 -52
  57. package/docs/Interface: ExternalBlockDefinition.md +0 -38
  58. package/docs/Interface: SBColors.md +0 -354
  59. package/docs/Interface: SBFileType.md +0 -39
  60. package/docs/Interface: SBImageEntity.md +0 -39
  61. package/docs/Interface: SBUserAvatar.md +0 -27
  62. package/docs/Interface: SBUserProfile.md +0 -51
  63. package/docs/Interface: UserListItem.md +0 -27
  64. package/docs/Interface: UserListRequestQuery.md +0 -27
  65. package/docs/Interface: UserListResponse.md +0 -27
  66. package/docs/Interface: WidgetApi.md +0 -75
  67. package/lib/base-block.ts +0 -110
  68. package/lib/block-definition.ts +0 -101
  69. package/lib/block-element.ts +0 -56
  70. 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
- export interface UserListRequestQuery {
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,42 +174,29 @@ export interface UserListResponse {
184
174
  limit: number;
185
175
  total: number;
186
176
  }
187
-
188
-
189
- export type IntegrationType = "ms365"
190
-
177
+ export declare type IntegrationType = "ms365";
191
178
  /**
192
179
  * Integration Token including the expiration time
193
180
  */
194
181
  export interface IntegrationToken {
195
- // the token to access the api of the integration
196
182
  accessToken: string;
197
-
198
- // date when the access token expires
199
183
  accessTokenExpiresAt?: Date;
200
184
  }
201
-
202
185
  /**
203
186
  * All available states the integration can take
204
187
  */
205
- export enum IntegrationState {
206
- UNAVAILABLE = 'unavailable',
207
- AVAILABLE = 'available',
208
- LOGGED_OUT = 'loggedOut',
188
+ export declare enum IntegrationState {
189
+ UNAVAILABLE = "unavailable",
190
+ AVAILABLE = "available",
191
+ LOGGED_OUT = "loggedOut"
209
192
  }
210
-
211
193
  /**
212
194
  * Information about the requested Integration target
213
195
  */
214
196
  export interface IntegrationInformation {
215
- // The status of the integration
216
- status: IntegrationState
217
- // All features enabled for the current slug
218
- enabledFeatures: string[],
219
- // All features supported by the integration
220
- supportedFeatures: string[],
221
- // The integration token
222
- token?: IntegrationToken,
223
- // A function to trigger the sign-in flow of the integration
224
- signIn?: () => void
197
+ status: IntegrationState;
198
+ enabledFeatures: string[];
199
+ supportedFeatures: string[];
200
+ token?: IntegrationToken;
201
+ signIn?: () => void;
225
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
13
  import { ColorTheme, IntegrationInformation, IntegrationType, SBUserProfile, UserListRequestQuery, UserListResponse } from './widget-api-types';
15
-
16
-
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,7 +48,6 @@ export interface WidgetApi {
54
48
  * the promise is rejected.
55
49
  */
56
50
  getUserList(query: UserListRequestQuery): Promise<UserListResponse>;
57
-
58
51
  /**
59
52
  * Call to retrieve a valid token to access the Microsoft API. Includes a time value to
60
53
  * refresh the token.
@@ -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 {};
package/docs/.nojekyll ADDED
@@ -0,0 +1 @@
1
+ TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.