New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@actbase/react-daum-postcode

Package Overview
Dependencies
Maintainers
5
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@actbase/react-daum-postcode - npm Package Compare versions

Comparing version 0.9.6 to 0.9.7

152

lib/app.js

@@ -1,99 +0,59 @@

"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _tslib = require("tslib");
var React = _interopRequireWildcard(require("react"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var getJSApi = function getJSApi() {
return new Promise(function (resolve, reject) {
var _a, _b;
if (typeof window === 'undefined') reject({
message: 'unsupported platform'
}); // @ts-ignore
var postcodeSDK = (_a = window.daum) === null || _a === void 0 ? void 0 : _a.Postcode;
if (postcodeSDK) {
resolve(postcodeSDK);
return;
}
var jsapi = document.createElement('script');
jsapi.type = 'text/javascript';
jsapi.src = '//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js';
var s = document.getElementsByTagName('script')[0];
(_b = s === null || s === void 0 ? void 0 : s.parentNode) === null || _b === void 0 ? void 0 : _b.insertBefore(jsapi, s); // @ts-ignore
jsapi.onload = function () {
return resolve(window.daum.Postcode);
};
jsapi.onabort = jsapi.onerror = reject;
});
};
var Postcode = function Postcode(_a) {
var onSelected = _a.onSelected,
onClose = _a.onClose,
jsOptions = _a.jsOptions,
style = _a.style;
var layer = React.useRef(null);
var loadData = React.useCallback(function () {
return (0, _tslib.__awaiter)(void 0, void 0, void 0, function () {
var Postcode;
return (0, _tslib.__generator)(this, function (_a) {
switch (_a.label) {
case 0:
return [4
/*yield*/
, getJSApi()];
case 1:
Postcode = _a.sent();
if (Postcode) {
// @ts-ignore
new window.daum.Postcode((0, _tslib.__assign)((0, _tslib.__assign)({}, jsOptions), {
oncomplete: function oncomplete(data) {
console.log('oncomplete');
onSelected(data);
},
onclose: onClose || function () {
if (layer.current) {
loadData();
}
}
})).embed(layer.current);
}
return [2
/*return*/
];
import { __assign, __awaiter, __generator } from "tslib";
import * as React from 'react';
var getJSApi = function () {
return new Promise(function (resolve, reject) {
var _a, _b;
if (typeof window === 'undefined')
reject({ message: 'unsupported platform' });
// @ts-ignore
var postcodeSDK = (_a = window.daum) === null || _a === void 0 ? void 0 : _a.Postcode;
if (postcodeSDK) {
resolve(postcodeSDK);
return;
}
});
var jsapi = document.createElement('script');
jsapi.type = 'text/javascript';
jsapi.src = '//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js';
var s = document.getElementsByTagName('script')[0];
(_b = s === null || s === void 0 ? void 0 : s.parentNode) === null || _b === void 0 ? void 0 : _b.insertBefore(jsapi, s);
// @ts-ignore
jsapi.onload = function () { return resolve(window.daum.Postcode); };
jsapi.onabort = jsapi.onerror = reject;
});
}, []);
React.useEffect(function () {
loadData()["catch"](console.warn);
}, [loadData]); // @ts-ignore
return React.createElement("div", {
ref: layer,
style: style
});
};
var _default = Postcode;
exports["default"] = _default;
var Postcode = function (_a) {
var onSelected = _a.onSelected, onClose = _a.onClose, jsOptions = _a.jsOptions, style = _a.style;
var layer = React.useRef(null);
var loadData = React.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
var Postcode;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
console.log('...loadData');
return [4 /*yield*/, getJSApi()];
case 1:
Postcode = _a.sent();
if (Postcode) {
// @ts-ignore
new window.daum.Postcode(__assign(__assign({}, jsOptions), { oncomplete: function (data) {
console.log('oncomplete');
onSelected(data);
}, onclose: function () {
console.log(layer.current);
if (layer.current) {
loadData();
}
} })).embed(layer.current);
}
return [2 /*return*/];
}
});
}); }, []);
React.useEffect(function () {
loadData()["catch"](console.warn);
}, [loadData]);
// @ts-ignore
return React.createElement("div", { ref: layer, style: style });
};
export default Postcode;
//# sourceMappingURL=app.js.map

@@ -1,80 +0,38 @@

"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _tslib = require("tslib");
var React = _interopRequireWildcard(require("react"));
var _reactNativeWebview = _interopRequireDefault(require("react-native-webview"));
var _reactNative = require("react-native");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
import { __assign, __rest } from "tslib";
import * as React from 'react';
import WebView from 'react-native-webview';
import { Linking, View } from 'react-native';
var html = "\n<!DOCTYPE html>\n<html lang=\"ko\">\n<head>\n\t<meta charset=\"utf-8\">\n\t<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no\">\n\t<style> \n\t * { box-sizing: border-box }\n\t html, body { width: 100%; height: 100%; margin:0px; padding: 0px; background-color: #ececec; } \n </style>\n</head>\n<body>\n\t<div id=\"layer\" style=\"width:100%; min-height: 100%;\"></div>\n\t<script type=\"text/javascript\">\n function callback() {\n\t\t\tvar element_layer = document.getElementById('layer');\n\t\t\telement_layer.innerHTML = \"\";\n new daum.Postcode({\n ...window.options,\n onsearch: function () {\n window.scrollTo(0, 0);\n },\n oncomplete: function(data) {\n window.ReactNativeWebView.postMessage(JSON.stringify(data));\n },\n onresize: function(size) {\n document.getElementById('layer').style.height = size.height + 'px';\n },\n onclose: function() {\n callback();\n },\n width : '100%',\n height: '100%',\n }).embed(element_layer);\n }\n\t\tfunction initOnReady(options) {\n \twindow.options = options;\n\t\t\tvar s = document.createElement('script');\n\t\t\ts.type = 'text/javascript'; s.src = 'https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js';\n\t\t\ts.onreadystatechange = callback; s.onload = callback;\n\t\t\tvar x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);\n }\n\t</script>\n</body>\n</html>\n";
var Postcode = function Postcode(props) {
var jsOptions = props.jsOptions,
onSelected = props.onSelected,
onError = props.onError,
style = props.style,
otherProps = (0, _tslib.__rest)(props, ["jsOptions", "onSelected", "onError", "style"]);
var injectedJavaScript = React.useMemo(function () {
return "initOnReady(" + JSON.stringify(jsOptions) + ");void(0);";
}, [jsOptions]);
var onMessage = React.useCallback(function (_a) {
var nativeEvent = _a.nativeEvent;
try {
nativeEvent.data && onSelected && onSelected(JSON.parse(nativeEvent.data));
} catch (e) {
onError(e);
}
}, [onSelected]);
return React.createElement(_reactNative.View, {
style: style
}, React.createElement(_reactNativeWebview["default"], (0, _tslib.__assign)({
mixedContentMode: 'compatibility',
androidLayerType: "hardware",
renderToHardwareTextureAndroid: true,
useWebKit: true
}, otherProps, {
source: {
html: html,
baseUrl: 'https://postcode.map.daum.net'
},
onMessage: onMessage,
injectedJavaScript: injectedJavaScript,
onShouldStartLoadWithRequest: function onShouldStartLoadWithRequest(request) {
var _a, _b, _c, _d;
var isPostcode = !((_a = request.url) === null || _a === void 0 ? void 0 : _a.startsWith('https://postcode.map.daum.net/guide')) && (!((_b = request.url) === null || _b === void 0 ? void 0 : _b.startsWith('http')) || ((_c = request.url) === null || _c === void 0 ? void 0 : _c.startsWith('https://postcode.map.daum.net')) || ((_d = request.url) === null || _d === void 0 ? void 0 : _d.startsWith('http://postcode.map.daum.net')));
if (!isPostcode) {
_reactNative.Linking.openURL(request.url);
return false;
} else {
return true;
}
}
})));
var Postcode = function (props) {
var jsOptions = props.jsOptions, onSelected = props.onSelected, onError = props.onError, style = props.style, otherProps = __rest(props, ["jsOptions", "onSelected", "onError", "style"]);
var injectedJavaScript = React.useMemo(function () { return "initOnReady(" + JSON.stringify(jsOptions) + ");void(0);"; }, [jsOptions]);
var onMessage = React.useCallback(function (_a) {
var nativeEvent = _a.nativeEvent;
try {
nativeEvent.data && onSelected && onSelected(JSON.parse(nativeEvent.data));
}
catch (e) {
onError(e);
}
}, [onSelected]);
return (React.createElement(View, { style: style },
React.createElement(WebView, __assign({ mixedContentMode: 'compatibility', androidLayerType: "hardware", renderToHardwareTextureAndroid: true, useWebKit: true }, otherProps, { source: { html: html, baseUrl: 'https://postcode.map.daum.net' }, onMessage: onMessage, injectedJavaScript: injectedJavaScript, onShouldStartLoadWithRequest: function (request) {
var _a, _b, _c, _d;
var isPostcode = !((_a = request.url) === null || _a === void 0 ? void 0 : _a.startsWith('https://postcode.map.daum.net/guide')) &&
(!((_b = request.url) === null || _b === void 0 ? void 0 : _b.startsWith('http')) || ((_c = request.url) === null || _c === void 0 ? void 0 : _c.startsWith('https://postcode.map.daum.net')) || ((_d = request.url) === null || _d === void 0 ? void 0 : _d.startsWith('http://postcode.map.daum.net')));
if (!isPostcode) {
Linking.openURL(request.url);
return false;
}
else {
return true;
}
} }))));
};
Postcode.defaultProps = {
jsOptions: {
hideMapBtn: true
}
jsOptions: {
hideMapBtn: true
}
};
var _default = Postcode;
exports["default"] = _default;
export default Postcode;
//# sourceMappingURL=app.native.js.map

@@ -1,15 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = exports.Postcode = void 0;
var _app = _interopRequireDefault(require("./app"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var Postcode = _app["default"];
exports.Postcode = Postcode;
var _default = Postcode;
exports["default"] = _default;
import app from './app';
export var Postcode = app;
export default Postcode;
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

"use strict";
//# sourceMappingURL=types.js.map
{
"name": "@actbase/react-daum-postcode",
"version": "0.9.6",
"version": "0.9.7",
"description": "다음 우편번호찾기 for React, React-Native",

@@ -12,2 +12,3 @@ "main": "lib/index.js",

"prepublish": "npm run build",
"localinstall": "npm run build && rm -rf /Users/suhanmoon/Projects/bankmall/bankmall-front/node_modules/@actbase/react-daum-postcode/lib && cp -r ./lib /Users/suhanmoon/Projects/bankmall/bankmall-front/node_modules/@actbase/react-daum-postcode",
"test": "echo \"Error: no test specified\" && exit 1"

@@ -14,0 +15,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc