@htmlbricks/hb-page-checkout 0.8.37 → 0.8.43

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/extra/docs.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { CssPart, CssVar, HtmlSlot, i18nLang, StyleSetup } from "@htmlbricks/hb-jsutils/main";
1
+ import type { CssPart, CssVar, HtmlSlot, i18nLang, StyleSetup, ComponentSetup } from "@htmlbricks/hb-jsutils/main";
2
+ import type { Component } from "../app/types/webcomponent.type";
2
3
 
3
4
  export const storybookArgs = {
4
5
  shipments: { control: { type: "array" } },
@@ -28,15 +29,60 @@ export const styleSetup: StyleSetup = {
28
29
  vars: cssVars,
29
30
  parts: cssParts,
30
31
  };
31
-
32
- export const componentSetup = {
32
+ const defaultgw: Component["gateways"][0] = {
33
+ id: "paypal",
34
+ label: "bbbb",
35
+ paypalid: "test",
36
+ };
37
+ const googlepay: Component["gateways"][0] = {
38
+ id: "google",
39
+ label: "GooglePay",
40
+ gatewayId: "example",
41
+ gatewayMerchantId: "exampleGatewayMerchantId",
42
+ };
43
+ const examples: Component[] = [
44
+ {
45
+ shipments: [],
46
+ user: {
47
+ fullName: "fdfff fffff",
48
+ addressWithNumber: "addreess 43",
49
+ city: "ff",
50
+ nationality: "effe",
51
+ zip: "3434",
52
+ fixed: true,
53
+ },
54
+ gateways: [defaultgw, googlepay],
55
+ payment: {
56
+ countryCode: "IT",
57
+ merchantName: "tizio",
58
+ currencyCode: "EU",
59
+ total: 100,
60
+ items: [
61
+ {
62
+ unitaryPrice: 2,
63
+ taxPercentage: 3,
64
+ name: "testitem",
65
+ id: "testitem",
66
+ },
67
+ {
68
+ unitaryPrice: 5,
69
+ taxPercentage: 7,
70
+ name: "testitem2",
71
+ id: "testitem2",
72
+ },
73
+ ],
74
+ },
75
+ },
76
+ ];
77
+ export const componentSetup: ComponentSetup & { examples: Component[] } = {
78
+ definitions: null,
33
79
  storybookArgs,
34
80
  styleSetup,
35
81
  htmlSlots,
36
82
  i18n: i18nLanguages,
37
- examples: [],
38
- name: "",
39
- category: "",
40
- tags: [],
83
+ examples,
84
+ name: "hb-page-checkout",
85
+ category: "page",
86
+ tags: ["page"],
41
87
  size: {},
42
88
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@htmlbricks/hb-page-checkout",
3
3
  "displayName": "Svelte Page Payment WebComponent",
4
4
  "description": "Svelte Page Payment WebComponent",
5
- "version": "0.8.37",
5
+ "version": "0.8.43",
6
6
  "main": "release/release.js",
7
7
  "publishConfig": {
8
8
  "access": "public"
@@ -20,15 +20,18 @@
20
20
  "start": "sirv dist",
21
21
  "dev": "rm -rf ./dist && rollup -c -w",
22
22
  "build": "rm -rf ./dist && rollup -c",
23
- "generate-docs": "cp $PWD/dist/docs.js $PWD/dist/docs.mjs && generate-json-from-js-object --input $PWD/dist/docs.mjs --var componentSetup --output $PWD/dist/docs.type.d.json && rm $PWD/dist/docs.mjs",
24
- "generate-schema": "ts-json-schema-generator --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent.type.d.json",
23
+ "generate-manifest": "npm run generate-schemes && manifester --dir $PWD",
24
+ "generate-component-schema": "ts-json-schema-generator --type 'Component' --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent.type.d.json",
25
+ "generate-events-schema": "ts-json-schema-generator --type 'Events' --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent_events.type.d.json",
26
+ "generate-schemes": "npm run generate-events-schema && npm run generate-component-schema",
25
27
  "copydest": "rm -rf release && mkdir -p release && mkdir -p release && cp dist/* ./release/",
26
28
  "build-extra": "tsc --moduleResolution node --module es2020 --esModuleInterop true --outDir dist --sourceMap --skipLibCheck extra/*",
27
- "build:release": "PRODUCTION=true npm run build && npm run build-extra && npm run generate-schema && npm run generate-docs && npm run copydest",
29
+ "build:release": "PRODUCTION=true npm run build && npm run build-extra && npm run generate-manifest && npm run copydest",
28
30
  "prepublish": "npm run build:release"
29
31
  },
30
32
  "devDependencies": {
31
- "@htmlbricks/hb-jsutils": "^0.8.37",
33
+ "@htmlbricks/hb-jsutils": "^0.8.43",
34
+ "@htmlbricks/manifester": "^0.0.5",
32
35
  "@rollup/plugin-alias": "^3.1.2",
33
36
  "@rollup/plugin-commonjs": "^18.0.0",
34
37
  "@rollup/plugin-json": "^4.1.0",
@@ -42,7 +45,6 @@
42
45
  "eslint": "^7.25.0",
43
46
  "eslint-plugin-jsdoc": "^33.0.0",
44
47
  "eslint-plugin-svelte3": "^3.2.0",
45
- "generate-json-from-js-object": "^0.0.17",
46
48
  "node-sass": "^6.0.1",
47
49
  "postcss": "^8.2.13",
48
50
  "postcss-load-config": "^3.0.1",
@@ -68,8 +70,8 @@
68
70
  "typescript-transform-paths": "^2.2.3"
69
71
  },
70
72
  "dependencies": {
71
- "@htmlbricks/hb-checkout": "^0.8.37",
72
- "@htmlbricks/hb-checkout-shopping-cart": "^0.8.37",
73
+ "@htmlbricks/hb-checkout": "^0.8.43",
74
+ "@htmlbricks/hb-checkout-shopping-cart": "^0.8.43",
73
75
  "dayjs": "^1.10.7",
74
76
  "debounce": "^1.2.1"
75
77
  },
@@ -80,5 +82,5 @@
80
82
  "html5-webcomponents"
81
83
  ],
82
84
  "contributors": [],
83
- "gitHead": "1a737cc2f90ff5f9c3bd06a155743e47329e8861"
85
+ "gitHead": "00bfec0d080db03f42972124577a880c9bf2570e"
84
86
  }
package/release/docs.js CHANGED
@@ -24,15 +24,61 @@ export var styleSetup = {
24
24
  vars: cssVars,
25
25
  parts: cssParts
26
26
  };
27
+ var defaultgw = {
28
+ id: "paypal",
29
+ label: "bbbb",
30
+ paypalid: "test"
31
+ };
32
+ var googlepay = {
33
+ id: "google",
34
+ label: "GooglePay",
35
+ gatewayId: "example",
36
+ gatewayMerchantId: "exampleGatewayMerchantId"
37
+ };
38
+ var examples = [
39
+ {
40
+ shipments: [],
41
+ user: {
42
+ fullName: "fdfff fffff",
43
+ addressWithNumber: "addreess 43",
44
+ city: "ff",
45
+ nationality: "effe",
46
+ zip: "3434",
47
+ fixed: true
48
+ },
49
+ gateways: [defaultgw, googlepay],
50
+ payment: {
51
+ countryCode: "IT",
52
+ merchantName: "tizio",
53
+ currencyCode: "EU",
54
+ total: 100,
55
+ items: [
56
+ {
57
+ unitaryPrice: 2,
58
+ taxPercentage: 3,
59
+ name: "testitem",
60
+ id: "testitem"
61
+ },
62
+ {
63
+ unitaryPrice: 5,
64
+ taxPercentage: 7,
65
+ name: "testitem2",
66
+ id: "testitem2"
67
+ },
68
+ ]
69
+ }
70
+ },
71
+ ];
27
72
  export var componentSetup = {
73
+ definitions: null,
28
74
  storybookArgs: storybookArgs,
29
75
  styleSetup: styleSetup,
30
76
  htmlSlots: htmlSlots,
31
77
  i18n: i18nLanguages,
32
- examples: [],
33
- name: "",
34
- category: "",
35
- tags: [],
78
+ examples: examples,
79
+ name: "hb-page-checkout",
80
+ category: "page",
81
+ tags: ["page"],
36
82
  size: {}
37
83
  };
38
84
  //# sourceMappingURL=docs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"docs.js","sourceRoot":"","sources":["../extra/docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,IAAM,aAAa,GAAG;IAC5B,SAAS,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IACzC,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACrC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACxC,gBAAgB,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;IAChD,QAAQ,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE;IAChC,4CAA4C;IAC5C,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IACxC,SAAS,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,OA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oBACC,YAAY,EAAE,CAAC;oBACf,aAAa,EAAE,CAAC;oBAChB,IAAI,EAAE,UAAU;oBAChB,EAAE,EAAE,UAAU;iBACd;gBACD;oBACC,YAAY,EAAE,CAAC;oBACf,aAAa,EAAE,CAAC;oBAChB,IAAI,EAAE,WAAW;oBACjB,EAAE,EAAE,WAAW;iBACf;aACD;SACD;KACD;CACD,CAAC;AACF,MAAM,CAAC,IAAM,cAAc,GAA+C;IACzE,WAAW,EAAE,IAAI;IACjB,aAAa,eAAA;IACb,UAAU,YAAA;IACV,SAAS,WAAA;IACT,IAAI,EAAE,aAAa;IACnB,QAAQ,UAAA;IACR,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,CAAC,MAAM,CAAC;IACd,IAAI,EAAE,EAAE;CACR,CAAC"}
@@ -0,0 +1,84 @@
1
+ export var storybookArgs = {
2
+ shipments: { control: { type: "array" } },
3
+ user: { control: { type: "object" } },
4
+ payment: { control: { type: "object" } },
5
+ paymentCompleted: { action: "paymentCompleted" },
6
+ saveUser: { action: "saveUser" },
7
+ // saveShipment: { action: "saveShipment" },
8
+ gateways: { control: { type: "array" } },
9
+ completed: { control: { type: "radio" }, options: ["yes", "no"] }
10
+ };
11
+ var cssVars = [
12
+ { name: "--hb-checkout-border", description: "", defaultValue: "0.5px solid rgba(197, 197, 197, 0.808)", valueType: "string" },
13
+ { name: "--bs-primary", valueType: "color", theme: "bootstrap", defaultValue: "#07689f" },
14
+ { name: "--bs-secondary", valueType: "color", theme: "bootstrap", defaultValue: "#c9d6df" },
15
+ { name: "--bs-success", valueType: "color", theme: "bootstrap", defaultValue: "#11d3bc" },
16
+ { name: "--bs-info", valueType: "color", theme: "bootstrap", defaultValue: "#a2d5f2" },
17
+ { name: "--bs-warning", valueType: "color", theme: "bootstrap", defaultValue: "#ffc107" },
18
+ { name: "--bs-danger", valueType: "color", theme: "bootstrap", defaultValue: "#f67280" },
19
+ ];
20
+ export var cssParts = [];
21
+ export var htmlSlots = [];
22
+ export var i18nLanguages = [];
23
+ export var styleSetup = {
24
+ vars: cssVars,
25
+ parts: cssParts
26
+ };
27
+ var defaultgw = {
28
+ id: "paypal",
29
+ label: "bbbb",
30
+ paypalid: "test"
31
+ };
32
+ var googlepay = {
33
+ id: "google",
34
+ label: "GooglePay",
35
+ gatewayId: "example",
36
+ gatewayMerchantId: "exampleGatewayMerchantId"
37
+ };
38
+ var examples = [
39
+ {
40
+ shipments: [],
41
+ user: {
42
+ fullName: "fdfff fffff",
43
+ addressWithNumber: "addreess 43",
44
+ city: "ff",
45
+ nationality: "effe",
46
+ zip: "3434",
47
+ fixed: true
48
+ },
49
+ gateways: [defaultgw, googlepay],
50
+ payment: {
51
+ countryCode: "IT",
52
+ merchantName: "tizio",
53
+ currencyCode: "EU",
54
+ total: 100,
55
+ items: [
56
+ {
57
+ unitaryPrice: 2,
58
+ taxPercentage: 3,
59
+ name: "testitem",
60
+ id: "testitem"
61
+ },
62
+ {
63
+ unitaryPrice: 5,
64
+ taxPercentage: 7,
65
+ name: "testitem2",
66
+ id: "testitem2"
67
+ },
68
+ ]
69
+ }
70
+ },
71
+ ];
72
+ export var componentSetup = {
73
+ definitions: null,
74
+ storybookArgs: storybookArgs,
75
+ styleSetup: styleSetup,
76
+ htmlSlots: htmlSlots,
77
+ i18n: i18nLanguages,
78
+ examples: examples,
79
+ name: "hb-page-checkout",
80
+ category: "page",
81
+ tags: ["page"],
82
+ size: {}
83
+ };
84
+ //# sourceMappingURL=docs.js.map
package/release/docs.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { CssPart, CssVar, HtmlSlot, i18nLang, StyleSetup } from "@htmlbricks/hb-jsutils/main";
1
+ import type { CssPart, CssVar, HtmlSlot, i18nLang, StyleSetup, ComponentSetup } from "@htmlbricks/hb-jsutils/main";
2
+ import type { Component } from "../app/types/webcomponent.type";
2
3
 
3
4
  export const storybookArgs = {
4
5
  shipments: { control: { type: "array" } },
@@ -28,15 +29,60 @@ export const styleSetup: StyleSetup = {
28
29
  vars: cssVars,
29
30
  parts: cssParts,
30
31
  };
31
-
32
- export const componentSetup = {
32
+ const defaultgw: Component["gateways"][0] = {
33
+ id: "paypal",
34
+ label: "bbbb",
35
+ paypalid: "test",
36
+ };
37
+ const googlepay: Component["gateways"][0] = {
38
+ id: "google",
39
+ label: "GooglePay",
40
+ gatewayId: "example",
41
+ gatewayMerchantId: "exampleGatewayMerchantId",
42
+ };
43
+ const examples: Component[] = [
44
+ {
45
+ shipments: [],
46
+ user: {
47
+ fullName: "fdfff fffff",
48
+ addressWithNumber: "addreess 43",
49
+ city: "ff",
50
+ nationality: "effe",
51
+ zip: "3434",
52
+ fixed: true,
53
+ },
54
+ gateways: [defaultgw, googlepay],
55
+ payment: {
56
+ countryCode: "IT",
57
+ merchantName: "tizio",
58
+ currencyCode: "EU",
59
+ total: 100,
60
+ items: [
61
+ {
62
+ unitaryPrice: 2,
63
+ taxPercentage: 3,
64
+ name: "testitem",
65
+ id: "testitem",
66
+ },
67
+ {
68
+ unitaryPrice: 5,
69
+ taxPercentage: 7,
70
+ name: "testitem2",
71
+ id: "testitem2",
72
+ },
73
+ ],
74
+ },
75
+ },
76
+ ];
77
+ export const componentSetup: ComponentSetup & { examples: Component[] } = {
78
+ definitions: null,
33
79
  storybookArgs,
34
80
  styleSetup,
35
81
  htmlSlots,
36
82
  i18n: i18nLanguages,
37
- examples: [],
38
- name: "",
39
- category: "",
40
- tags: [],
83
+ examples,
84
+ name: "hb-page-checkout",
85
+ category: "page",
86
+ tags: ["page"],
41
87
  size: {},
42
88
  };