@telia-ace/knowledge-widget-components-related-guide-list 1.0.23 → 1.0.24-next.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/LICENSE.txt +5 -5
- package/README.md +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/related-guide-list-component.d.ts +10 -10
- package/dist/related-guide-list.cf209a10.js.map +1 -1
- package/dist/related-guide-list.d.ts +6 -6
- package/package.json +13 -13
package/LICENSE.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Copyright © 2021, Telia Company AB. All rights reserved.
|
|
2
|
-
|
|
3
|
-
THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
|
|
4
|
-
THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
|
|
5
|
-
AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
|
|
1
|
+
Copyright © 2021, Telia Company AB. All rights reserved.
|
|
2
|
+
|
|
3
|
+
THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
|
|
4
|
+
THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
|
|
5
|
+
AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
|
|
6
6
|
http://www.humany.com/legal
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# `@telia-ace/knowledge-widget-components-related-guide-list`
|
|
2
|
-
|
|
3
|
-
Related guide list component for ACE Knowledge Widgets.
|
|
1
|
+
# `@telia-ace/knowledge-widget-components-related-guide-list`
|
|
2
|
+
|
|
3
|
+
Related guide list component for ACE Knowledge Widgets.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import RelatedGuideListComponent from './related-guide-list-component';
|
|
2
|
-
export default RelatedGuideListComponent;
|
|
1
|
+
import RelatedGuideListComponent from './related-guide-list-component';
|
|
2
|
+
export default RelatedGuideListComponent;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/related-guide-list-component.ts"],"sourcesContent":["import {\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/related-guide-list-component.ts"],"sourcesContent":["import {\n FavoriteProperties,\n MetaDataProperties,\n} from '@telia-ace/knowledge-widget-component-utilities';\nimport { createEventSubscriber, extendComponent } from '@telia-ace/knowledge-widget-core';\nimport { DataClient, DataType } from '@telia-ace/knowledge-widget-types-grid';\nimport { createReactComponent } from '@telia-ace/knowledge-widget-ui';\nimport { Container } from '@webprovisions/platform';\n\nexport type RelatedGuideListComponentProps = {\n header: string;\n items?: any[]; // internal\n showFavoriteToggle?: boolean;\n tags?: boolean;\n} & FavoriteProperties &\n MetaDataProperties;\n\nconst RelatedGuideListComponent = (container: Container) => {\n return createReactComponent(\n container,\n 'related-guide-list',\n import('./related-guide-list'),\n (component) => {\n const { events } = container.get('$widget');\n const [subscribe, unsubscribe] = createEventSubscriber(events);\n\n const fetch = (params: { [key: string]: string }) => {\n component.writeProperties({ loading: true, error: undefined });\n component.actions.dispatch('fetch', { params });\n };\n\n component.actions.create('fetch', ({ items = [] }) => {\n return component.actions.dispatch('fetched', {\n items,\n loading: true,\n });\n });\n\n component.actions.create('fetched', (input) => {\n return component.writeProperties({ ...input, loading: false });\n });\n\n container.getAsync('router').then((router) => {\n const { params } = router.getRouteData();\n fetch(params);\n });\n subscribe('router:changed', (_, { current }) => {\n fetch(current.routeData.params);\n });\n return () => {\n unsubscribe();\n };\n }\n ).then(() => {\n return extendComponent(container, 'related-guide-list', (component) => {\n component.actions.watch('related-guide-list.fetch', (input, next) => {\n const {\n params: { guide, connection },\n } = input;\n if (!guide) {\n return next(input);\n }\n const { header } = component.properties() as RelatedGuideListComponentProps;\n\n return container.getAsync('dataClient').then((dataClient: DataClient) => {\n return dataClient\n .fetch(DataType.Guide, {\n connection,\n guideId: guide,\n })\n .then(({ related }) => {\n return next({ ...input, items: related || [] });\n })\n .catch((e: any) => {\n return next(input);\n });\n });\n });\n });\n });\n};\n\nexport default RelatedGuideListComponent;\n"],"names":["RelatedGuideListComponent","container","createReactComponent","component","events","subscribe","unsubscribe","createEventSubscriber","fetch","params","items","input","__spreadProps","__spreadValues","router","_","current","extendComponent","next","guide","connection","dataClient","DataType","related","e"],"mappings":";;;;;;;;;;;;;;;AAiBM,MAAAA,IAA4B,CAACC,MACxBC;AAAA,EACHD;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,CAACE,MAAc;AACX,UAAM,EAAE,QAAAC,EAAW,IAAAH,EAAU,IAAI,SAAS,GACpC,CAACI,GAAWC,CAAW,IAAIC,EAAsBH,CAAM,GAEvDI,IAAQ,CAACC,MAAsC;AACjD,MAAAN,EAAU,gBAAgB,EAAE,SAAS,IAAM,OAAO,QAAW,GAC7DA,EAAU,QAAQ,SAAS,SAAS,EAAE,QAAAM,EAAQ,CAAA;AAAA,IAAA;AAGxC,WAAAN,EAAA,QAAQ,OAAO,SAAS,CAAC,EAAE,OAAAO,IAAQ,CAAA,QAClCP,EAAU,QAAQ,SAAS,WAAW;AAAA,MACzC,OAAAO;AAAA,MACA,SAAS;AAAA,IAAA,CACZ,CACJ,GAEDP,EAAU,QAAQ,OAAO,WAAW,CAACQ,MAC1BR,EAAU,gBAAgBS,EAAAC,EAAA,IAAKF,IAAL,EAAY,SAAS,KAAO,CAChE,GAEDV,EAAU,SAAS,QAAQ,EAAE,KAAK,CAACa,MAAW;AAC1C,YAAM,EAAE,QAAAL,EAAA,IAAWK,EAAO,aAAa;AACvC,MAAAN,EAAMC,CAAM;AAAA,IAAA,CACf,GACDJ,EAAU,kBAAkB,CAACU,GAAG,EAAE,SAAAC,QAAc;AACtC,MAAAR,EAAAQ,EAAQ,UAAU,MAAM;AAAA,IAAA,CACjC,GACM,MAAM;AACG,MAAAV;IAAA;AAAA,EAEpB;AACJ,EAAE,KAAK,MACIW,EAAgBhB,GAAW,sBAAsB,CAACE,MAAc;AACnE,EAAAA,EAAU,QAAQ,MAAM,4BAA4B,CAACQ,GAAOO,MAAS;AAC3D,UAAA;AAAA,MACF,QAAQ,EAAE,OAAAC,GAAO,YAAAC,EAAW;AAAA,IAC5B,IAAAT;AACJ,WAAKQ,KAGchB,EAAU,WAAW,GAEjCF,EAAU,SAAS,YAAY,EAAE,KAAK,CAACoB,MACnCA,EACF,MAAMC,EAAS,OAAO;AAAA,MACnB,YAAAF;AAAA,MACA,SAASD;AAAA,IACZ,CAAA,EACA,KAAK,CAAC,EAAE,SAAAI,QACEL,EAAKN,EAAAC,EAAA,IAAKF,IAAL,EAAY,OAAOY,KAAW,KAAI,CACjD,EACA,MAAM,CAACC,MACGN,EAAKP,CAAK,CACpB,CACR,KAhBUO,EAAKP,CAAK;AAAA,EAgBpB,CACJ;AAAA,CACJ,CACJ;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FavoriteProperties, MetaDataProperties } from '@telia-ace/knowledge-widget-component-utilities';
|
|
2
|
-
import { Container } from '@webprovisions/platform';
|
|
3
|
-
export declare type RelatedGuideListComponentProps = {
|
|
4
|
-
header: string;
|
|
5
|
-
items?: any[];
|
|
6
|
-
showFavoriteToggle?: boolean;
|
|
7
|
-
tags?: boolean;
|
|
8
|
-
} & FavoriteProperties & MetaDataProperties;
|
|
9
|
-
declare const RelatedGuideListComponent: (container: Container) => Promise<void>;
|
|
10
|
-
export default RelatedGuideListComponent;
|
|
1
|
+
import { FavoriteProperties, MetaDataProperties } from '@telia-ace/knowledge-widget-component-utilities';
|
|
2
|
+
import { Container } from '@webprovisions/platform';
|
|
3
|
+
export declare type RelatedGuideListComponentProps = {
|
|
4
|
+
header: string;
|
|
5
|
+
items?: any[];
|
|
6
|
+
showFavoriteToggle?: boolean;
|
|
7
|
+
tags?: boolean;
|
|
8
|
+
} & FavoriteProperties & MetaDataProperties;
|
|
9
|
+
declare const RelatedGuideListComponent: (container: Container) => Promise<void>;
|
|
10
|
+
export default RelatedGuideListComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"related-guide-list.cf209a10.js","sources":["../src/related-guide-list.tsx"],"sourcesContent":["import { Guide } from '@telia-ace/knowledge-widget-core';\
|
|
1
|
+
{"version":3,"file":"related-guide-list.cf209a10.js","sources":["../src/related-guide-list.tsx"],"sourcesContent":["import { Guide } from '@telia-ace/knowledge-widget-core';\nimport {\n contentBox,\n createEmptyComponent,\n GuideList,\n useContainer,\n useProperties,\n useRouteData,\n} from '@telia-ace/knowledge-widget-ui';\nimport { appendClassNames, createParams, formatUrl } from '@telia-ace/widget-utilities';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { RelatedGuideListComponentProps } from './related-guide-list-component';\n\ntype Props = {\n className: string;\n};\n\nconst RelatedGuideList: React.FC<Props> = ({ className, ...other }) => {\n const { name, params } = useRouteData();\n const container = useContainer();\n const {\n showFavoriteToggle = false,\n items,\n header,\n metadata,\n tags,\n addFavoriteTooltip,\n removeFavoriteCancelLabel,\n removeFavoriteConfirmLabel,\n removeFavoriteHeader,\n removeFavoriteLabel,\n removeFavoriteTooltip,\n metadataByLabel,\n metadataModifiedLabel,\n metadataPublishedLabel,\n } = useProperties<RelatedGuideListComponentProps>();\n\n if (!items || !items.length) {\n return createEmptyComponent(container, {\n ...other,\n className: appendClassNames(className, 'humany-related-guide-list'),\n });\n }\n\n return (\n <StyledGuideList\n {...other}\n className={appendClassNames(className, 'humany-related-guide-list')}\n header={header}\n items={items}\n paramMappers={{\n guide: ({ id, title }: Guide) =>\n createParams({\n ...params,\n guide: id,\n uriName: formatUrl(title),\n connection: undefined,\n }),\n }}\n showTags={tags}\n showFavoriteToggle={showFavoriteToggle}\n addFavoriteTooltip={addFavoriteTooltip}\n removeFavoriteCancelLabel={removeFavoriteCancelLabel}\n removeFavoriteConfirmLabel={removeFavoriteConfirmLabel}\n removeFavoriteHeader={removeFavoriteHeader}\n removeFavoriteLabel={removeFavoriteLabel}\n removeFavoriteTooltip={removeFavoriteTooltip}\n metadata={{\n ...metadata,\n modifiedLabel: metadataModifiedLabel,\n publishedLabel: metadataPublishedLabel,\n byLabel: metadataByLabel,\n }}\n routing={{\n guide: name,\n }}\n />\n );\n};\n\nexport default RelatedGuideList;\n\nconst StyledGuideList = styled(GuideList)<any>`\n ${contentBox}\n li:last-child {\n margin: 0;\n }\n`;\n"],"names":["RelatedGuideList","_a","_b","className","other","__objRest","name","params","useRouteData","container","useContainer","showFavoriteToggle","items","header","metadata","tags","addFavoriteTooltip","removeFavoriteCancelLabel","removeFavoriteConfirmLabel","removeFavoriteHeader","removeFavoriteLabel","removeFavoriteTooltip","metadataByLabel","metadataModifiedLabel","metadataPublishedLabel","useProperties","createEmptyComponent","__spreadProps","__spreadValues","appendClassNames","React","StyledGuideList","id","title","createParams","formatUrl","styled","GuideList","contentBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,IAAoC,CAACC,MAA4B;AAA5B,MAAAC,IAAAD,GAAE,aAAAE,MAAFD,GAAgBE,IAAAC,EAAhBH,GAAgB,CAAd;AACzC,QAAM,EAAE,MAAAI,GAAM,QAAAC,EAAO,IAAIC,EAAa,GAChCC,IAAYC,KACZ;AAAA,IACF,oBAAAC,IAAqB;AAAA,IACrB,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,4BAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,wBAAAC;AAAA,MACAC,EAA8C;AAElD,SAAI,CAACb,KAAS,CAACA,EAAM,SACVc,EAAqBjB,GAAWkB,EAAAC,EAAA,IAChCxB,IADgC;AAAA,IAEnC,WAAWyB,EAAiB1B,GAAW,2BAA2B;AAAA,EAAA,EACrE,IAIA,gBAAA2B,EAAA,cAAAC,GAAAJ,EAAAC,EAAA,IACOxB,IADP;AAAA,IAEG,WAAWyB,EAAiB1B,GAAW,2BAA2B;AAAA,IAClE,QAAAU;AAAA,IACA,OAAAD;AAAA,IACA,cAAc;AAAA,MACV,OAAO,CAAC,EAAE,IAAAoB,GAAI,OAAAC,EAAA,MACVC,EAAaP,EAAAC,EAAA,IACNrB,IADM;AAAA,QAET,OAAOyB;AAAA,QACP,SAASG,EAAUF,CAAK;AAAA,QACxB,YAAY;AAAA,MAAA,EACf;AAAA,IACT;AAAA,IACA,UAAUlB;AAAA,IACV,oBAAAJ;AAAA,IACA,oBAAAK;AAAA,IACA,2BAAAC;AAAA,IACA,4BAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,UAAUM,EAAAC,EAAA,IACHd,IADG;AAAA,MAEN,eAAeS;AAAA,MACf,gBAAgBC;AAAA,MAChB,SAASF;AAAA,IACb;AAAA,IACA,SAAS;AAAA,MACL,OAAOhB;AAAA,IACX;AAAA,EAAA,EACJ;AAER,GAIMyB,IAAkBK,EAAOC,CAAS;AAAA,MAClCC;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare type Props = {
|
|
3
|
-
className: string;
|
|
4
|
-
};
|
|
5
|
-
declare const RelatedGuideList: React.
|
|
6
|
-
export default RelatedGuideList;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Props = {
|
|
3
|
+
className: string;
|
|
4
|
+
};
|
|
5
|
+
declare const RelatedGuideList: React.FC<Props>;
|
|
6
|
+
export default RelatedGuideList;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-related-guide-list",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24-next.0",
|
|
4
4
|
"description": "Related guide list component for ACE Knowledge Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -26,22 +26,22 @@
|
|
|
26
26
|
},
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@telia-ace/knowledge-widget-component-utilities": "^1.0.
|
|
30
|
-
"@telia-ace/knowledge-widget-core": "^1.0.
|
|
31
|
-
"@telia-ace/knowledge-widget-types-grid": "^1.0.
|
|
32
|
-
"@telia-ace/knowledge-widget-ui": "^1.0.
|
|
33
|
-
"@telia-ace/widget-utilities": "^1.0.
|
|
29
|
+
"@telia-ace/knowledge-widget-component-utilities": "^1.0.24-next.0",
|
|
30
|
+
"@telia-ace/knowledge-widget-core": "^1.0.20-next.1",
|
|
31
|
+
"@telia-ace/knowledge-widget-types-grid": "^1.0.31-next.1",
|
|
32
|
+
"@telia-ace/knowledge-widget-ui": "^1.0.26-next.1",
|
|
33
|
+
"@telia-ace/widget-utilities": "^1.0.5-next.1",
|
|
34
34
|
"@webprovisions/platform": "^1.1.2"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"react": "^
|
|
38
|
-
"react-dom": "^
|
|
39
|
-
"styled-components": "^
|
|
37
|
+
"react": "^18.2.0",
|
|
38
|
+
"react-dom": "^18.2.0",
|
|
39
|
+
"styled-components": "^5.3.6"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/react": "^
|
|
43
|
-
"@types/react-dom": "^
|
|
44
|
-
"@types/styled-components": "^5.1.
|
|
42
|
+
"@types/react": "^18.0.21",
|
|
43
|
+
"@types/react-dom": "^18.0.6",
|
|
44
|
+
"@types/styled-components": "^5.1.26"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "a81b35116f1f922623477a03097a1435db43a5ff"
|
|
47
47
|
}
|