Skip to content

Commit 58c7906

Browse files
committed
first commit
0 parents  commit 58c7906

21 files changed

+1009
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 OSS Groupp
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
![alt text](https://raw.githubusercontent.com/ossgroupp/osspim-content-transformer/HEAD/media/logo.png 'Pie with slice')
2+
3+
# OSSPIM Content Transformer
4+
5+
Validation, parsing and transforming for [OSSPIM Content](https://ossgroup.com/developers/react-components/osspim-content-transformer). Makes it easy to build React Commerce solutions with [Product Information Management](https://ossgroup.com/product/product-information-management) powered by [OSSPIM](https://ossgroup.com) that enable [Fast Ecommerce API](https://ossgroup.com/product/graphql-commerce-api).
6+
7+
## Install
8+
9+
```
10+
yarn add @osspim/content-transformer
11+
```
12+
13+
## Validate
14+
15+
```
16+
import validator from '@osspim/content-transformer';
17+
18+
const isValid = validator.isModelValid(myModel);
19+
const validationDetails = validator.isModelValidVerbose(myModel);
20+
```
21+
22+
## toHTML
23+
24+
```
25+
import toHTML from '@osspim/content-transformer/toHTML';
26+
27+
toHtml(contentModel);
28+
```
29+
30+
## toText
31+
32+
```
33+
import toText from '@osspim/content-transformer/toText';
34+
35+
toText(contentModel);
36+
```
37+
38+
## React
39+
40+
See [@osspim/react-content-transformer](https://www.npmjs.com/package/@osspim/react-content-transformer)
41+
# content-transformer

develop.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const { toText } = require('./src');
2+
3+
const model = [
4+
{
5+
"kind": "block",
6+
"type": "paragraph",
7+
"metadata": {},
8+
"children": [
9+
{
10+
"kind": "inline",
11+
"metadata": {},
12+
"textContent": "The only really good place to buy lumber is at a store where the lumber has already been cut and attached together in the form of furniture finished and put inside boxes."
13+
}
14+
]
15+
}
16+
];
17+
18+
console.log(toText(model));

fromHTML.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./src/converters/html/fromHTML');

node_modules/isarray/LICENSE

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/isarray/README.md

+38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/isarray/index.js

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/isarray/package.json

+48
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"name": "@osspim/content-transformer",
3+
"version": "9.0.1",
4+
"description": "Validation and parsing for OSSPIM rich text content",
5+
"main": "src/index.js",
6+
"engines": {
7+
"node": ">=12"
8+
},
9+
"scripts": {
10+
"lint": "eslint src",
11+
"test": "jest",
12+
"test:watch": "jest --watch",
13+
"prepare": "npm run validate",
14+
"dev": "nodemon ./develop",
15+
"dev:inspect": "nodemon --inspect-brk ./develop",
16+
"validate": "npm run lint && npm run test",
17+
"prepush": "npm run validate",
18+
"release": "release-it"
19+
},
20+
"repository": {
21+
"type": "git",
22+
"url": "[email protected]:ossgroupp/osspim-content-transformer.git"
23+
},
24+
"keywords": [],
25+
"author": "",
26+
"license": "MIT",
27+
"bugs": {
28+
"url": "https://github.com/ossgroupp/osspim-content-transformer/issues"
29+
},
30+
"homepage": "https://github.com/ossgroupp/osspim-content-transformer#readme",
31+
"devDependencies": {
32+
"conventional-changelog": "^3.1.24",
33+
"eslint": "^7.24.0",
34+
"eslint-config-prettier": "^8.2.0",
35+
"eslint-plugin-import": "^2.22.1",
36+
"eslint-plugin-prettier": "^3.3.1",
37+
"husky": "^0.14.3",
38+
"jest": "^24.9.0",
39+
"nodemon": "^1.17.5",
40+
"prettier": "^2.2.1",
41+
"release-it": "7.6.1"
42+
},
43+
"dependencies": {
44+
"is-my-json-valid": "^2.17.2",
45+
"isarray": "^2.0.4",
46+
"ow": "^0.4.0",
47+
"parse5": "^6.0.1"
48+
},
49+
"browserslist": [
50+
"> 0.5%",
51+
"IE 10",
52+
"iOS > 8",
53+
"Safari > 8"
54+
],
55+
"eslintConfig": {
56+
"extends": [
57+
"prettier"
58+
],
59+
"plugins": [
60+
"prettier"
61+
],
62+
"env": {
63+
"es2020": true,
64+
"browser": true,
65+
"node": true,
66+
"jest": true
67+
},
68+
"rules": {
69+
"no-plusplus": 0,
70+
"import/prefer-default-export": 0
71+
}
72+
}
73+
}

react.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict';
2+
3+
Object.defineProperty(exports, '__esModule', {
4+
value: true
5+
});
6+
exports.default = DeprecatedContentTransformer;
7+
8+
function DeprecatedContentTransformer() {
9+
throw new Error(
10+
'@osspim/content-transformer/react has moved to @osspim/react-content-transformer'
11+
);
12+
}

0 commit comments

Comments
 (0)