few-ticket-widget 1.0.0
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/embed-ticket-widget.js +39 -0
- package/dist/react-ticket-widget.js +34 -0
- package/package.json +28 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
(function () {
|
|
5
|
+
function create(options) {
|
|
6
|
+
const container = document.getElementById(options.id);
|
|
7
|
+
if (!container) return;
|
|
8
|
+
|
|
9
|
+
const {
|
|
10
|
+
eventSlug,
|
|
11
|
+
theme = 'light',
|
|
12
|
+
height = 700,
|
|
13
|
+
baseUrl = 'https://fewticket.com'
|
|
14
|
+
} = options;
|
|
15
|
+
|
|
16
|
+
const iframeURL =
|
|
17
|
+
baseUrl +
|
|
18
|
+
'/checkout/' +
|
|
19
|
+
encodeURIComponent(eventSlug) +
|
|
20
|
+
'?theme=' +
|
|
21
|
+
encodeURIComponent(theme);
|
|
22
|
+
|
|
23
|
+
const iframe = document.createElement('iframe');
|
|
24
|
+
iframe.src = iframeURL;
|
|
25
|
+
iframe.style.width = '100%';
|
|
26
|
+
iframe.style.height = height + 'px';
|
|
27
|
+
iframe.style.border = '0';
|
|
28
|
+
|
|
29
|
+
container.style.border = '1px solid #e5e5e5';
|
|
30
|
+
container.style.borderRadius = '8px';
|
|
31
|
+
container.style.overflow = 'hidden';
|
|
32
|
+
|
|
33
|
+
container.appendChild(iframe);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
window.TicketWidget = { create };
|
|
37
|
+
})();
|
|
38
|
+
|
|
39
|
+
})();
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
var TicketWidget = function TicketWidget(_ref) {
|
|
6
|
+
var eventSlug = _ref.eventSlug,
|
|
7
|
+
_ref$theme = _ref.theme,
|
|
8
|
+
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
9
|
+
_ref$width = _ref.width,
|
|
10
|
+
width = _ref$width === void 0 ? '100%' : _ref$width,
|
|
11
|
+
_ref$height = _ref.height,
|
|
12
|
+
height = _ref$height === void 0 ? 700 : _ref$height,
|
|
13
|
+
_ref$baseUrl = _ref.baseUrl,
|
|
14
|
+
baseUrl = _ref$baseUrl === void 0 ? 'https://fewticket.com' : _ref$baseUrl;
|
|
15
|
+
var iframeURL = "".concat(baseUrl, "/checkout/").concat(encodeURIComponent(eventSlug), "?theme=").concat(encodeURIComponent(theme));
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
style: {
|
|
18
|
+
width: width,
|
|
19
|
+
border: '1px solid #e5e5e5',
|
|
20
|
+
borderRadius: '8px',
|
|
21
|
+
overflow: 'hidden'
|
|
22
|
+
}
|
|
23
|
+
}, /*#__PURE__*/React.createElement("iframe", {
|
|
24
|
+
src: iframeURL,
|
|
25
|
+
style: {
|
|
26
|
+
width: '100%',
|
|
27
|
+
height: height,
|
|
28
|
+
border: '0'
|
|
29
|
+
},
|
|
30
|
+
allow: "payment"
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
module.exports = TicketWidget;
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "few-ticket-widget",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "dist/react-ticket-widget.js",
|
|
5
|
+
"files": ["dist"],
|
|
6
|
+
"types": "src/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"build": "rollup -c"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [],
|
|
12
|
+
"author": "",
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"description": "",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"react": "^19.2.3",
|
|
17
|
+
"react-dom": "^19.2.3"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@babel/core": "^7.28.6",
|
|
21
|
+
"@babel/preset-env": "^7.28.6",
|
|
22
|
+
"@babel/preset-react": "^7.28.5",
|
|
23
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
24
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
25
|
+
"@types/react": "^19.2.8",
|
|
26
|
+
"rollup": "^4.55.1"
|
|
27
|
+
}
|
|
28
|
+
}
|