@gem-sdk/plugin-loox 1.12.0-experimental-8f483e48 → 1.12.0-experimental-d7cbfa75
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/dist/{types/index.d.ts → components/ProductReview.d.ts} +4 -3
- package/dist/components/ProductReview.d.ts.map +1 -0
- package/dist/{esm/components → components}/ProductReview.js +3 -5
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/package.json +7 -15
- package/dist/cjs/components/ProductReview.js +0 -34
- package/dist/cjs/index.js +0 -9
- package/dist/esm/index.js +0 -5
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type ProductReviewProps = {
|
|
2
3
|
productId: string;
|
|
3
4
|
type?: 'star' | 'carousel' | 'default';
|
|
4
5
|
shop: string;
|
|
5
6
|
};
|
|
6
7
|
declare const ProductReview: React.FC<ProductReviewProps>;
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
export default ProductReview;
|
|
9
|
+
//# sourceMappingURL=ProductReview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductReview.d.ts","sourceRoot":"","sources":["../../src/components/ProductReview.tsx"],"names":[],"mappings":";AAGA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA6B/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import Script from 'next/script';
|
|
4
|
-
|
|
5
4
|
const ProductReview = ({ productId, type, shop }) => {
|
|
6
5
|
const props = useMemo(() => {
|
|
7
6
|
switch (type) {
|
|
@@ -24,7 +23,6 @@ const ProductReview = ({ productId, type, shop }) => {
|
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
}, [productId, type]);
|
|
27
|
-
return (
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsx(Script, { src: `//loox.io/widget/loox.js?shop=${shop}` }), _jsx("div", Object.assign({}, props))] }));
|
|
28
27
|
};
|
|
29
|
-
|
|
30
|
-
export { ProductReview as default };
|
|
28
|
+
export default ProductReview;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD,eAAe,aAAa,CAAC"}
|
package/dist/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/plugin-loox",
|
|
3
|
-
"version": "1.12.0-experimental-
|
|
3
|
+
"version": "1.12.0-experimental-d7cbfa75",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
|
-
"main": "dist/
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
7
8
|
"files": [
|
|
8
9
|
"dist"
|
|
9
10
|
],
|
|
@@ -13,29 +14,20 @@
|
|
|
13
14
|
"pre:publish": "node ./../../helpers/convert-publish.js -p",
|
|
14
15
|
"post:publish": "node ./../../helpers/convert-publish.js",
|
|
15
16
|
"watch": "rollup -c ./../../helpers/rollup.config.mjs -w",
|
|
16
|
-
"build": "rollup -c ./../../helpers/rollup.config.mjs --environment NODE_ENV:production",
|
|
17
|
+
"build:rollup": "rollup -c ./../../helpers/rollup.config.mjs --environment NODE_ENV:production",
|
|
18
|
+
"build": "tsc -p tsconfig.build.json",
|
|
17
19
|
"lint": "eslint ./src --ext .tsx,.ts",
|
|
18
20
|
"type-check": "yarn tsc --noEmit",
|
|
19
21
|
"test": "jest -c ./../../helpers/jest.config.ts"
|
|
20
22
|
},
|
|
21
23
|
"dependencies": {
|
|
22
|
-
"@gem-sdk/styles": "1.12.0-experimental-
|
|
24
|
+
"@gem-sdk/styles": "1.12.0-experimental-d7cbfa75"
|
|
23
25
|
},
|
|
24
26
|
"devDependencies": {
|
|
25
|
-
"@gem-sdk/core": "1.12.0-experimental-
|
|
27
|
+
"@gem-sdk/core": "1.12.0-experimental-d7cbfa75"
|
|
26
28
|
},
|
|
27
29
|
"peerDependencies": {
|
|
28
30
|
"react": "^17 || ^18",
|
|
29
31
|
"react-dom": "^17 || ^18"
|
|
30
|
-
},
|
|
31
|
-
"module": "dist/esm/index.js",
|
|
32
|
-
"types": "dist/types/index.d.ts",
|
|
33
|
-
"exports": {
|
|
34
|
-
"./package.json": "./package.json",
|
|
35
|
-
".": {
|
|
36
|
-
"import": "./dist/esm/index.js",
|
|
37
|
-
"require": "./dist/cjs/index.js",
|
|
38
|
-
"types": "./dist/types/index.d.ts"
|
|
39
|
-
}
|
|
40
32
|
}
|
|
41
33
|
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var react = require('react');
|
|
7
|
-
var Script = require('next/script');
|
|
8
|
-
|
|
9
|
-
const ProductReview = ({ productId, type, shop }) => {
|
|
10
|
-
const props = react.useMemo(() => {
|
|
11
|
-
switch (type) {
|
|
12
|
-
case 'star':
|
|
13
|
-
return {
|
|
14
|
-
'data-fetch': true,
|
|
15
|
-
className: 'loox-rating',
|
|
16
|
-
'data-id': productId,
|
|
17
|
-
};
|
|
18
|
-
case 'carousel':
|
|
19
|
-
return {
|
|
20
|
-
id: 'looxCarousel',
|
|
21
|
-
'data-show-more': true,
|
|
22
|
-
'data-product-ids': productId,
|
|
23
|
-
};
|
|
24
|
-
default:
|
|
25
|
-
return {
|
|
26
|
-
id: 'looxReviews',
|
|
27
|
-
'data-product-id': productId,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}, [productId, type]);
|
|
31
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Script, { src: `//loox.io/widget/loox.js?shop=${shop}` }), jsxRuntime.jsx("div", { ...props })] }));
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.default = ProductReview;
|
package/dist/cjs/index.js
DELETED