@favish/staffbase-utils 0.8.0 → 0.9.0
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/README.md +1 -0
- package/dist/src/types/content/Channel.d.ts +70 -0
- package/dist/src/types/content/Channel.d.ts.map +1 -0
- package/dist/src/types/content/ChannelLink.d.ts +12 -0
- package/dist/src/types/content/ChannelLink.d.ts.map +1 -0
- package/dist/src/types/content/ChannelLinkParameter.d.ts +13 -0
- package/dist/src/types/content/ChannelLinkParameter.d.ts.map +1 -0
- package/dist/src/types/content/DropdownOption.d.ts +17 -0
- package/dist/src/types/content/DropdownOption.d.ts.map +1 -0
- package/dist/src/types/content/index.d.ts +5 -0
- package/dist/src/types/content/index.d.ts.map +1 -0
- package/dist/types.cjs.js +1 -0
- package/dist/types.es.mjs +0 -0
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ minimumReleaseAgeExclude:
|
|
|
25
25
|
| --- | --- |
|
|
26
26
|
| `@favish/staffbase-utils/log` | `logError`, `logWarn`, `logDebug`, `setLoggingEnabled` |
|
|
27
27
|
| `@favish/staffbase-utils/dom` | `getDynamicClasses` |
|
|
28
|
+
| `@favish/staffbase-utils/types` | `Channel`, `ChannelLink`, `ChannelLinkParameter`, `DropdownOption` (type-only) |
|
|
28
29
|
|
|
29
30
|
More modules (`/env`, `/device`, `/html`, `/links`, `/widgets`) are added per the
|
|
30
31
|
delivery roadmap; each is its own subpath so consumers only bundle what they import.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ChannelLink } from './ChannelLink';
|
|
2
|
+
/**
|
|
3
|
+
* Partial shape of a Staffbase content channel as returned by the channels API.
|
|
4
|
+
*
|
|
5
|
+
* Shared verbatim by the alerts, unacknowledged-bulletins and global-content
|
|
6
|
+
* widgets. The smart-search widget consumes a different (search-API) channel
|
|
7
|
+
* shape and keeps its own type. Marked partial because the platform may add
|
|
8
|
+
* fields; only the documented subset the widgets rely on is typed here.
|
|
9
|
+
*/
|
|
10
|
+
export interface Channel {
|
|
11
|
+
pluginID: string;
|
|
12
|
+
menuFolderIDs: string[];
|
|
13
|
+
defaultMenuFolderId: string;
|
|
14
|
+
config: {
|
|
15
|
+
localization: Record<string, {
|
|
16
|
+
title: string;
|
|
17
|
+
description: string | null;
|
|
18
|
+
}>;
|
|
19
|
+
sidebarVisible: boolean;
|
|
20
|
+
showPageBackground: boolean;
|
|
21
|
+
showAdminActions: boolean;
|
|
22
|
+
};
|
|
23
|
+
availableInPublicArea: boolean;
|
|
24
|
+
contentType: string;
|
|
25
|
+
notificationChannelsAllowed: string[] | null;
|
|
26
|
+
notificationChannelsDefault: string[];
|
|
27
|
+
postCount: number;
|
|
28
|
+
id: string;
|
|
29
|
+
spaceID: string;
|
|
30
|
+
visibleInPublicArea: boolean;
|
|
31
|
+
displayAuthor: boolean;
|
|
32
|
+
acknowledgingAllowed: boolean;
|
|
33
|
+
commentingAllowed: boolean;
|
|
34
|
+
highlightingAllowed: boolean;
|
|
35
|
+
layout: {
|
|
36
|
+
primaryMedia: string;
|
|
37
|
+
};
|
|
38
|
+
likingAllowed: boolean;
|
|
39
|
+
sharingAllowed: boolean;
|
|
40
|
+
internalSharingAllowed: boolean;
|
|
41
|
+
externalSharingAllowed: boolean;
|
|
42
|
+
lastPostPublishedAt: string;
|
|
43
|
+
commentingEnabledDefault: boolean;
|
|
44
|
+
highlightingEnabledDefault: boolean;
|
|
45
|
+
likingEnabledDefault: boolean;
|
|
46
|
+
sharingEnabledDefault: boolean;
|
|
47
|
+
acknowledgingEnabledDefault: boolean;
|
|
48
|
+
internalSharingEnabledDefault: boolean;
|
|
49
|
+
externalSharingEnabledDefault: boolean;
|
|
50
|
+
published: string;
|
|
51
|
+
created: string;
|
|
52
|
+
entityType: string;
|
|
53
|
+
updated: string;
|
|
54
|
+
links: {
|
|
55
|
+
preview: ChannelLink;
|
|
56
|
+
create_post: ChannelLink;
|
|
57
|
+
move: ChannelLink;
|
|
58
|
+
accessors: ChannelLink;
|
|
59
|
+
available_news_pages: ChannelLink;
|
|
60
|
+
get_posts: ChannelLink;
|
|
61
|
+
menu_items: ChannelLink;
|
|
62
|
+
update: ChannelLink;
|
|
63
|
+
feeds: ChannelLink;
|
|
64
|
+
delete: ChannelLink;
|
|
65
|
+
users: ChannelLink;
|
|
66
|
+
update_news_pages: ChannelLink;
|
|
67
|
+
};
|
|
68
|
+
rights: string[];
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=Channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Channel.d.ts","sourceRoot":"","sources":["../../../../src/types/content/Channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD;;;;;;;GAOG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,MAAM,EAAE;QACN,YAAY,EAAE,MAAM,CAClB,MAAM,EACN;YACE,KAAK,EAAE,MAAM,CAAA;YACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;SAC3B,CACF,CAAA;QACD,cAAc,EAAE,OAAO,CAAA;QACvB,kBAAkB,EAAE,OAAO,CAAA;QAC3B,gBAAgB,EAAE,OAAO,CAAA;KAC1B,CAAA;IACD,qBAAqB,EAAE,OAAO,CAAA;IAC9B,WAAW,EAAE,MAAM,CAAA;IACnB,2BAA2B,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC5C,2BAA2B,EAAE,MAAM,EAAE,CAAA;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,mBAAmB,EAAE,OAAO,CAAA;IAC5B,aAAa,EAAE,OAAO,CAAA;IACtB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,iBAAiB,EAAE,OAAO,CAAA;IAC1B,mBAAmB,EAAE,OAAO,CAAA;IAC5B,MAAM,EAAE;QACN,YAAY,EAAE,MAAM,CAAA;KACrB,CAAA;IACD,aAAa,EAAE,OAAO,CAAA;IACtB,cAAc,EAAE,OAAO,CAAA;IACvB,sBAAsB,EAAE,OAAO,CAAA;IAC/B,sBAAsB,EAAE,OAAO,CAAA;IAC/B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,wBAAwB,EAAE,OAAO,CAAA;IACjC,0BAA0B,EAAE,OAAO,CAAA;IACnC,oBAAoB,EAAE,OAAO,CAAA;IAC7B,qBAAqB,EAAE,OAAO,CAAA;IAC9B,2BAA2B,EAAE,OAAO,CAAA;IACpC,6BAA6B,EAAE,OAAO,CAAA;IACtC,6BAA6B,EAAE,OAAO,CAAA;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE;QACL,OAAO,EAAE,WAAW,CAAA;QACpB,WAAW,EAAE,WAAW,CAAA;QACxB,IAAI,EAAE,WAAW,CAAA;QACjB,SAAS,EAAE,WAAW,CAAA;QACtB,oBAAoB,EAAE,WAAW,CAAA;QACjC,SAAS,EAAE,WAAW,CAAA;QACtB,UAAU,EAAE,WAAW,CAAA;QACvB,MAAM,EAAE,WAAW,CAAA;QACnB,KAAK,EAAE,WAAW,CAAA;QAClB,MAAM,EAAE,WAAW,CAAA;QACnB,KAAK,EAAE,WAAW,CAAA;QAClB,iBAAiB,EAAE,WAAW,CAAA;KAC/B,CAAA;IACD,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChannelLinkParameter } from './ChannelLinkParameter';
|
|
2
|
+
/**
|
|
3
|
+
* A single HAL link on a channel (method + href, with optional parameter and
|
|
4
|
+
* form descriptors). Used for each entry of a channel's `links` map.
|
|
5
|
+
*/
|
|
6
|
+
export interface ChannelLink {
|
|
7
|
+
method: string;
|
|
8
|
+
href: string;
|
|
9
|
+
parameters?: Record<string, ChannelLinkParameter>;
|
|
10
|
+
form?: ChannelLinkParameter[];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ChannelLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelLink.d.ts","sourceRoot":"","sources":["../../../../src/types/content/ChannelLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IACjD,IAAI,CAAC,EAAE,oBAAoB,EAAE,CAAA;CAC9B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single parameter descriptor on a channel HAL link (an entry in a link's
|
|
3
|
+
* `parameters` map or `form` array). Mirrors the Staffbase channels API; the
|
|
4
|
+
* alerts, unacknowledged-bulletins and global-content widgets share this shape.
|
|
5
|
+
*/
|
|
6
|
+
export interface ChannelLinkParameter {
|
|
7
|
+
type: string;
|
|
8
|
+
id: string;
|
|
9
|
+
format?: string;
|
|
10
|
+
value?: string | number;
|
|
11
|
+
required: boolean;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ChannelLinkParameter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelLinkParameter.d.ts","sourceRoot":"","sources":["../../../../src/types/content/ChannelLinkParameter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;CAClB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Option shape for channel/article selector dropdowns.
|
|
3
|
+
*
|
|
4
|
+
* `spaceName` and `spaceId` are optional enrichment used by widgets that group
|
|
5
|
+
* options by space; widgets that do not group simply omit them. This is the
|
|
6
|
+
* superset of the alerts (id/title) and unacknowledged-bulletins (+space)
|
|
7
|
+
* variants.
|
|
8
|
+
*/
|
|
9
|
+
export interface DropdownOption {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
/** Optional space name for display in selectors. */
|
|
13
|
+
spaceName?: string;
|
|
14
|
+
/** Optional space id for enrichment. */
|
|
15
|
+
spaceId?: string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=DropdownOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownOption.d.ts","sourceRoot":"","sources":["../../../../src/types/content/DropdownOption.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/content/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAClE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@favish/staffbase-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Shared internal/host utilities for Staffbase widgets",
|
|
5
5
|
"author": "Favish <dev@favish.com>",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -42,6 +42,11 @@
|
|
|
42
42
|
"types": "./dist/src/widgets/react/index.d.ts",
|
|
43
43
|
"import": "./dist/widgets/react.es.mjs",
|
|
44
44
|
"require": "./dist/widgets/react.cjs.js"
|
|
45
|
+
},
|
|
46
|
+
"./types": {
|
|
47
|
+
"types": "./dist/src/types/content/index.d.ts",
|
|
48
|
+
"import": "./dist/types.es.mjs",
|
|
49
|
+
"require": "./dist/types.cjs.js"
|
|
45
50
|
}
|
|
46
51
|
},
|
|
47
52
|
"repository": {
|