@sunggang/ui-lib 0.2.40 → 0.2.42

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/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- export { n as BaseTable, s as BigCalender, B as Button, u as CustomSelect, C as CustomUpload, m as DataTable, k as DateRangePicker, t as DnDCalendar, i as DropDown, D as DropImage, L as LiffContext, w as LiffProvider, R as ReactDateRange, o as Regex, S as Spin, j as Switch, T as TabsPanel, U as UiLibrary, l as buttonVariants, q as decryptByEcPay, r as encryptByEcPay, x as useLiffContext, p as verifyId, v as verifyTaxId } from './index.esm2.js';
1
+ export { n as BaseTable, q as BigCalender, B as Button, s as CustomSelect, C as CustomUpload, m as DataTable, k as DateRangePicker, r as DnDCalendar, i as DropDown, D as DropImage, L as LiffContext, t as LiffProvider, R as ReactDateRange, o as Regex, S as Spin, j as Switch, T as TabsPanel, U as UiLibrary, l as buttonVariants, u as useLiffContext, p as verifyId, v as verifyTaxId } from './index.esm2.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@iconify/react';
@@ -20,4 +20,3 @@ import 'date-fns/format/index.js';
20
20
  import '@tanstack/react-table';
21
21
  import '@radix-ui/react-dropdown-menu';
22
22
  import '@radix-ui/react-icons';
23
- import 'crypto';
package/index.esm2.js CHANGED
@@ -20,7 +20,6 @@ import format$1 from 'date-fns/format/index.js';
20
20
  import { useReactTable, getCoreRowModel, getPaginationRowModel, getSortedRowModel, getFilteredRowModel, flexRender } from '@tanstack/react-table';
21
21
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
22
22
  import { ChevronRightIcon, CheckIcon, DotFilledIcon } from '@radix-ui/react-icons';
23
- import crypto$1 from 'crypto';
24
23
 
25
24
  var styles = {};
26
25
 
@@ -20998,29 +20997,6 @@ var verifyTaxId = function(idStr) {
20998
20997
  return isLegal;
20999
20998
  };
21000
20999
 
21001
- var decryptByEcPay = function(data, hashKey, hashIV) {
21002
- var decipher = crypto$1.createDecipheriv("aes-128-cbc", Buffer.from(hashKey), Buffer.from(hashIV));
21003
- decipher.setAutoPadding(true); // 使用 PKCS7 填充模式
21004
- var decrypted = decipher.update(data, "base64", "utf8");
21005
- decrypted += decipher.final("utf8");
21006
- // 步驟 3: 解析解密後的資料
21007
- var decodedData = decodeURIComponent(decrypted);
21008
- var decoded = JSON.parse(decodedData);
21009
- return decoded;
21010
- };
21011
- var encryptByEcPay = function(data, hashKey, hashIV) {
21012
- // 步驟 1: 轉換資料為 JSON 字串
21013
- var jsonData = JSON.stringify(data);
21014
- // 步驟 2: URLEncode 編碼
21015
- var urlEncodedData = window.encodeURIComponent(jsonData);
21016
- // 步驟 3: AES 加密
21017
- var cipher = crypto$1.createCipheriv("aes-128-cbc", Buffer.from(hashKey), Buffer.from(hashIV));
21018
- cipher.setAutoPadding(true); // 使用 PKCS7 填充模式
21019
- var encrypted = cipher.update(urlEncodedData, "utf8", "base64");
21020
- encrypted += cipher.final("base64");
21021
- return encrypted;
21022
- };
21023
-
21024
21000
  function _objectWithoutProperties(e, t) {
21025
21001
  if (null == e) return {};
21026
21002
  var o, r, i = _objectWithoutPropertiesLoose(e, t);
@@ -43670,7 +43646,7 @@ var LiffProvider = function(param) {
43670
43646
  }();
43671
43647
  // 登入初始化函數
43672
43648
  var loginInit = function() {
43673
- var _ref = _async_to_generator(function(token, liff) {
43649
+ var _ref = _async_to_generator(function(token) {
43674
43650
  var _resData_data, _resData_data1, response, resData, _resData_data2, loginToken, err;
43675
43651
  return _ts_generator(this, function(_state) {
43676
43652
  switch(_state.label){
@@ -43686,8 +43662,9 @@ var LiffProvider = function(param) {
43686
43662
  fetchAPI(loginUrl, {
43687
43663
  token: token,
43688
43664
  queryParams: _object_spread({
43689
- access_token: token,
43690
- ignore_check_add_friend: ignoreCheckAddFriend ? "true" : "false"
43665
+ access_token: token
43666
+ }, ignoreCheckAddFriend && {
43667
+ ignore_check_add_friend: "true"
43691
43668
  }, inviteCode && {
43692
43669
  invite_code: inviteCode
43693
43670
  })
@@ -43726,7 +43703,7 @@ var LiffProvider = function(param) {
43726
43703
  }
43727
43704
  });
43728
43705
  });
43729
- return function loginInit(token, liff) {
43706
+ return function loginInit(token) {
43730
43707
  return _ref.apply(this, arguments);
43731
43708
  };
43732
43709
  }();
@@ -43791,7 +43768,7 @@ var LiffProvider = function(param) {
43791
43768
  ];
43792
43769
  return [
43793
43770
  4,
43794
- loginInit(lineToken, liff)
43771
+ loginInit(lineToken)
43795
43772
  ];
43796
43773
  case 3:
43797
43774
  _state.sent();
@@ -43859,6 +43836,7 @@ var LiffProvider = function(param) {
43859
43836
  _state.label = 3;
43860
43837
  case 3:
43861
43838
  isValid = _tmp;
43839
+ console.log("token isValid: ", isValid);
43862
43840
  return [
43863
43841
  4,
43864
43842
  initializeLiff(isValid)
@@ -43917,4 +43895,4 @@ var useLiffContext = function() {
43917
43895
  return context;
43918
43896
  };
43919
43897
 
43920
- export { Button as B, CustomUpload as C, DropImage as D, LiffContext as L, ReactDateRange as R, Spin as S, TabsPanel as T, UiLibrary as U, __spreadArray as _, __read as a, __extends as b, __assign as c, __makeTemplateObject as d, __awaiter as e, __generator as f, commonjsGlobal as g, __values as h, DropDown as i, Switch as j, DateRangePicker as k, buttonVariants as l, DataTable as m, BaseTable as n, Regex as o, verifyId as p, decryptByEcPay as q, encryptByEcPay as r, BigCalender as s, DnDCalendar as t, CustomSelect as u, verifyTaxId as v, LiffProvider as w, useLiffContext as x };
43898
+ export { Button as B, CustomUpload as C, DropImage as D, LiffContext as L, ReactDateRange as R, Spin as S, TabsPanel as T, UiLibrary as U, __spreadArray as _, __read as a, __extends as b, __assign as c, __makeTemplateObject as d, __awaiter as e, __generator as f, commonjsGlobal as g, __values as h, DropDown as i, Switch as j, DateRangePicker as k, buttonVariants as l, DataTable as m, BaseTable as n, Regex as o, verifyId as p, BigCalender as q, DnDCalendar as r, CustomSelect as s, LiffProvider as t, useLiffContext as u, verifyTaxId as v };
package/index.esm3.js CHANGED
@@ -20,7 +20,6 @@ import 'date-fns/format/index.js';
20
20
  import '@tanstack/react-table';
21
21
  import '@radix-ui/react-dropdown-menu';
22
22
  import '@radix-ui/react-icons';
23
- import 'crypto';
24
23
 
25
24
  /* eslint-disable no-prototype-builtins */ function _instanceof$4(left, right) {
26
25
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunggang/ui-lib",
3
- "version": "0.2.40",
3
+ "version": "0.2.42",
4
4
  "dependencies": {
5
5
  "@iconify/react": "^4.1.1",
6
6
  "@mdx-js/react": "^3.0.1",
@@ -1,2 +0,0 @@
1
- export declare const decryptByEcPay: (data: string, hashKey: string, hashIV: string) => string;
2
- export declare const encryptByEcPay: (data: string, hashKey: string, hashIV: string) => string;
@@ -1,4 +1,3 @@
1
1
  import Regex from './Regex';
2
2
  export { Regex };
3
3
  export { verifyTaxId, verifyId } from './verify';
4
- export * from './crypto';
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  type LiffContextType = {
3
3
  liffObject: any;
4
4
  loginData: any;
5
+ userInfo?: any;
5
6
  accessToken: string;
6
7
  liffError: string | null;
7
8
  initializeLiff: () => Promise<void>;