Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@volvo-cars/ced-os-react-components

Package Overview
Dependencies
Maintainers
0
Versions
199
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volvo-cars/ced-os-react-components - npm Package Compare versions

Comparing version 2.5.8 to 2.5.9

lib/bin/support-content-to-html.js

9

package.json
{
"name": "@volvo-cars/ced-os-react-components",
"version": "2.5.8",
"version": "2.5.9",
"description": "Set of components for developing UIs in the onboarding and support apps",

@@ -21,5 +21,10 @@ "keywords": [],

"types": "lib/types",
"bin": {
"support-content-to-html": "./lib/bin/support-content-to-html.js"
},
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.mjs",
"exports": {
".": {
"import": "./lib/esm/index.js",
"import": "./lib/esm/index.mjs",
"require": "./lib/cjs/index.js"

@@ -26,0 +31,0 @@ },

@@ -18,3 +18,2 @@ # Support Web Components

### Publish

@@ -36,3 +35,3 @@

2. For each iteration use `npm version prerelease` to create new pre-release version with bumped prefix, eg `2.0.0-rc.0`
3. To promote the pre-release to a release run `npm version major`
3. To promote the pre-release to a release run `npm version major`

@@ -47,3 +46,2 @@ ## Usage

### Install from Github package registry

@@ -68,3 +66,2 @@

### Example usage

@@ -76,9 +73,8 @@

- Load the styles of the components and base theme `@volvo-cars/ced-os-react-components/lib/index.css`
- Load the styles of the theme(s) to be used.
- Load the styles of the theme(s) to be used.
- `@volvo-cars/ced-os-react-components/lib/theme-polestar.css`
- `@volvo-cars/ced-os-react-components/lib/theme-volvo.css`, and add the class
- Alternatively override custom properties (variables) on `.dcs-base-theme` in your own styles to create a custom theme (See all variables in [lib/theme-base.css](lib/theme-base.css)).
- The theme `classNames` are applied automatically - `.dcs-base-theme` for base styles and if either "volvo" or "polestar"
is passed to the `theme` prop the respective theme className of `dcs-volvo-theme` or `dcs-polestar-theme` is set.
- The theme `classNames` are applied automatically - `.dcs-base-theme` for base styles and if either "volvo" or "polestar"
is passed to the `theme` prop the respective theme className of `dcs-volvo-theme` or `dcs-polestar-theme` is set.

@@ -97,4 +93,4 @@ #### JSONArticle

return (
<JSONArticle data-article-id={articleId} data={content} theme="volvo" config={{
<JSONArticle data-article-id={articleId} data={content} theme="volvo" config={{
locale: 'en-GB', // optional - will set correct direction based on locale

@@ -108,3 +104,3 @@ linkComponent: (props)=> {/* optional custom link component eg. next/link */}

}
}} />
}} />
);

@@ -116,10 +112,31 @@ };

If you want to use the renderer without creating a full JS project, with NPM etc, you can use the standalone solution.
If you want to use the renderer without creating a full JS project, with NPM etc, you can use the standalone solution.
[Example here](https://volvo-cars.github.io/ced-onboarding-support-components/standalone-example.html).
[Example here](https://volvo-cars.github.io/ced-onboarding-support-components/standalone-example.html).
Include the `standalone-example.iife.js` and `standalone-example.css` files found in the npm package under `@volvo-cars/ced-onboarding-support-components/lib`, in the [HTML template file](src/standalone/standalone-example.ejs), make sure to make the following replacements:
* `article: null` must be replaced with `article: '<article>'`, where `article` is the (JSON representation) of an article. It must contain an `externalId`. It must also contain the content of the document, i.e. a `title` and optionally also a `description` and `body`. These fields may be directly on the `article` object itself, or nested inside of `article.content` or `article.jsonContent`.
* `articleLinkClicked: null` may be replaced with `articleLinkClicked: function(articleId, targetId) { ... }`, where the function will be called whenever the user clicks a link to another article. The function takes two arguments: the ID of the article being linked to, as well as (optionally) the ID of the target element (will typically just be `null`). If `articleLinkClicked` is left as `null`, it will default to working as a normal link, such that if the current URL is `foo/bar/articleId1`, and the user clicks a link to an article with ID `articleId2`, it will navigate to `foo/bar/articleId2` (or `foo/bar/articleId2#targetId`, if `targetId` is not null).
* `linkClicked: null` may be replaced with `linkClicked: function(href) { ... }`, where the function will be called whenever the user clicks on an external link. The function takes one argument: the URL of the link target. If `linkClicked` is left as null, it will default to simply navigating to the link.
- `article: null` must be replaced with `article: '<article>'`, where `article` is the (JSON representation) of an article. It must contain an `externalId`. It must also contain the content of the document, i.e. a `title` and optionally also a `description` and `body`. These fields may be directly on the `article` object itself, or nested inside of `article.content` or `article.jsonContent`.
- `articleLinkClicked: null` may be replaced with `articleLinkClicked: function(articleId, targetId) { ... }`, where the function will be called whenever the user clicks a link to another article. The function takes two arguments: the ID of the article being linked to, as well as (optionally) the ID of the target element (will typically just be `null`). If `articleLinkClicked` is left as `null`, it will default to working as a normal link, such that if the current URL is `foo/bar/articleId1`, and the user clicks a link to an article with ID `articleId2`, it will navigate to `foo/bar/articleId2` (or `foo/bar/articleId2#targetId`, if `targetId` is not null).
- `linkClicked: null` may be replaced with `linkClicked: function(href) { ... }`, where the function will be called whenever the user clicks on an external link. The function takes one argument: the URL of the link target. If `linkClicked` is left as null, it will default to simply navigating to the link.
### Command line usage (CLI)
Run directly using `npx` without install
```
npx @volvo-cars/ced-os-react-components [JSON file path or JSON string] [options]
```
Or install globally and then use the command
```
support-content-to-html [JSON file path or JSON string] [options]
```
**Options:**
`--file=[input filename]` - The file contents is used as input to render
`--out=[output filename]` - The render result is written to a file
`--json=[JSON string]` - The string is used as input to render
`--clean` Option to remove all classnames
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc