mkfashion-sdk 1.2.9 → 1.3.1
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/.claude/settings.local.json +7 -7
- package/.gitattributes +2 -2
- package/index.html +66 -75
- package/mkfashion-sdk-1.3.1.tgz +0 -0
- package/package.json +18 -18
- package/src/mkfashion.js +614 -627
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(curl:*)"
|
|
5
|
-
]
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(curl:*)"
|
|
5
|
+
]
|
|
6
|
+
}
|
|
7
|
+
}
|
package/.gitattributes
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
# Auto detect text files and perform LF normalization
|
|
2
|
-
* text=auto
|
|
1
|
+
# Auto detect text files and perform LF normalization
|
|
2
|
+
* text=auto
|
package/index.html
CHANGED
|
@@ -1,76 +1,67 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
} else {
|
|
70
|
-
console.log('❌ Produto SKU 306636 NÃO disponível para prova virtual');
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
</script>
|
|
74
|
-
|
|
75
|
-
</body>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<title>Integração mKFashion</title>
|
|
7
|
+
<!-- Para testar localmente, use o caminho local -->
|
|
8
|
+
<script src="./src/mkfashion.js"></script>
|
|
9
|
+
<!-- Para produção, use o CDN: -->
|
|
10
|
+
<!-- <script src="https://unpkg.com/mkfashion-sdk/src/mkfashion.js"></script> -->
|
|
11
|
+
<style>
|
|
12
|
+
.btn-provar {
|
|
13
|
+
background: #000;
|
|
14
|
+
color: #fff;
|
|
15
|
+
padding: 12px 24px;
|
|
16
|
+
border: none;
|
|
17
|
+
border-radius: 8px;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.btn-provar:hover {
|
|
24
|
+
background: #333;
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
27
|
+
</head>
|
|
28
|
+
|
|
29
|
+
<body>
|
|
30
|
+
|
|
31
|
+
<h1>Produto XYZ</h1>
|
|
32
|
+
<p>SKU: 165230</p>
|
|
33
|
+
|
|
34
|
+
<button class="btn-provar" id="btn-provar">
|
|
35
|
+
Provador Virtual
|
|
36
|
+
</button>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
// 1. Verifica disponibilidade e configura botão
|
|
40
|
+
mkfashion.isAvailable('698601899f905cb2adc13160', '0101').then(function (disponivel) {
|
|
41
|
+
if (disponivel) {
|
|
42
|
+
|
|
43
|
+
// 2. Registra callback do carrinho (ANTES de abrir)
|
|
44
|
+
mkfashion.addToCart(function (payload) {
|
|
45
|
+
console.log('Payload completo:', JSON.stringify(payload, null, 2));
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
console.log('✅ Produto SKU 306636 disponível para prova virtual');
|
|
50
|
+
var btn = document.getElementById('btn-provar');
|
|
51
|
+
btn.style.display = 'inline-block';
|
|
52
|
+
|
|
53
|
+
btn.onclick = function () {
|
|
54
|
+
mkfashion.open({
|
|
55
|
+
projectId: '698601899f905cb2adc13160',
|
|
56
|
+
identifier: '0101'
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
} else {
|
|
60
|
+
console.log('❌ Produto SKU 306636 NÃO disponível para prova virtual');
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
</body>
|
|
66
|
+
|
|
76
67
|
</html>
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mkfashion-sdk",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "SDK para integrar o provador virtual mKFashion com suporte a Wake Commerce",
|
|
5
|
-
"main": "src/mkfashion.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "echo \"Abra test.html no navegador\""
|
|
8
|
-
},
|
|
9
|
-
"keywords": [
|
|
10
|
-
"fashion",
|
|
11
|
-
"virtual",
|
|
12
|
-
"try-on",
|
|
13
|
-
"sdk",
|
|
14
|
-
"metakosmos"
|
|
15
|
-
],
|
|
16
|
-
"author": "metaKosmos",
|
|
17
|
-
"license": "MIT"
|
|
18
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "mkfashion-sdk",
|
|
3
|
+
"version": "1.3.1",
|
|
4
|
+
"description": "SDK para integrar o provador virtual mKFashion com suporte a Wake Commerce",
|
|
5
|
+
"main": "src/mkfashion.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Abra test.html no navegador\""
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"fashion",
|
|
11
|
+
"virtual",
|
|
12
|
+
"try-on",
|
|
13
|
+
"sdk",
|
|
14
|
+
"metakosmos"
|
|
15
|
+
],
|
|
16
|
+
"author": "metaKosmos",
|
|
17
|
+
"license": "MIT"
|
|
18
|
+
}
|