@tuya-sat/sdf-main-sdk 0.0.92 → 0.0.93

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "main.css": "auto/main.css",
3
3
  "main.js": "auto/main.bundle.js",
4
- "node_modules_web-vitals_dist_web-vitals_js.e56efb17.chunk.js": "auto/node_modules_web-vitals_dist_web-vitals_js.e56efb17.chunk.js",
4
+ "131.80be18f8.chunk.js": "auto/131.80be18f8.chunk.js",
5
5
  "static/img/reLogin.png": "auto/static/img/294142da390c5af23324.png",
6
6
  "static/img/emptyPage.png": "auto/static/img/daa00e3565343b2c9c18.png",
7
7
  "static/img/expira.png": "auto/static/img/ddf3e1f8ec8350445a4a.png",
@@ -11,5 +11,5 @@
11
11
  "zh.json": "auto/zh.json",
12
12
  "main.css.map": "auto/main.css.map",
13
13
  "main.bundle.js.map": "auto/main.bundle.js.map",
14
- "node_modules_web-vitals_dist_web-vitals_js.e56efb17.chunk.js.map": "auto/node_modules_web-vitals_dist_web-vitals_js.e56efb17.chunk.js.map"
14
+ "131.80be18f8.chunk.js.map": "auto/131.80be18f8.chunk.js.map"
15
15
  }
@@ -24,3 +24,5 @@ export declare const isOpenGt: () => boolean;
24
24
  export declare const isMessageCt: () => boolean;
25
25
  export declare const processLoadAssetInCss: (apps: any, url: any, args: any) => any;
26
26
  export declare const initSdfConfig: () => void;
27
+ export declare const cookieSetting: any;
28
+ export declare const initCCM: () => void;
@@ -1,5 +1,5 @@
1
1
  import type { Theme, UserColorConfigWithThemeAndMenu } from './base';
2
- export declare function hexToRgba(chex: string, opacity: number): string;
2
+ export declare function hexToRgba(ahex: string, opacity: number): string;
3
3
  export default function changeMenuCssVariable({ menuColor, theme, prefix, }: {
4
4
  menuColor: UserColorConfigWithThemeAndMenu | null;
5
5
  theme: Theme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-sat/sdf-main-sdk",
3
- "version": "0.0.92",
3
+ "version": "0.0.93",
4
4
  "main": "./dist/main.bundle.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
package/webpack.config.js CHANGED
@@ -1,66 +1,66 @@
1
- const path = require('path');
2
- const webpack = require('webpack');
3
- const fs = require('fs');
1
+ const path = require("path");
2
+ const webpack = require("webpack");
3
+ const fs = require("fs");
4
4
  const BundleAnalyzerPlugin =
5
- require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
5
+ require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
6
6
 
7
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
8
- const CopyPlugin = require('copy-webpack-plugin');
7
+ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
8
+ const CopyPlugin = require("copy-webpack-plugin");
9
9
  const REACT_APP_THEME_CSS_JS = fs.readFileSync(
10
- 'src/micro-script/theme/theme-css/static.js',
11
- 'utf-8'
10
+ "src/micro-script/theme/theme-css/static.js",
11
+ "utf-8"
12
12
  );
13
- const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
13
+ const { WebpackManifestPlugin } = require("webpack-manifest-plugin");
14
14
 
15
15
  module.exports = {
16
- mode: 'development',
17
- devtool: 'source-map',
18
- entry: path.join(__dirname, '/src/index.tsx'),
19
- target: ['web', 'es5'],
16
+ mode: "production",
17
+ devtool: "source-map",
18
+ entry: path.join(__dirname, "/src/index.tsx"),
19
+ target: ["web", "es5"],
20
20
  output: {
21
- filename: '[name].bundle.js',
22
- chunkFilename: '[name].[hash:8].chunk.js',
23
- path: path.join(__dirname, '/dist'),
21
+ filename: "[name].bundle.js",
22
+ chunkFilename: "[name].[hash:8].chunk.js",
23
+ path: path.join(__dirname, "/dist"),
24
24
  library: {
25
- name: '_SDF',
26
- type: 'umd',
25
+ name: "_SDF",
26
+ type: "umd",
27
27
  },
28
28
  clean: true,
29
- assetModuleFilename: 'static/img/[hash][ext]',
29
+ assetModuleFilename: "static/img/[hash][ext]",
30
30
  },
31
31
  externals: {
32
- react: 'react',
33
- antd: 'antd',
34
- moment: 'moment',
35
- '@tuya-sat/galaxy': '@tuya-sat/galaxy',
36
- axios: 'axios',
32
+ react: "react",
33
+ antd: "antd",
34
+ moment: "moment",
35
+ "@tuya-sat/galaxy": "@tuya-sat/galaxy",
36
+ axios: "axios",
37
37
  },
38
38
  resolve: {
39
- extensions: ['.js', '.tsx', '.ts'],
39
+ extensions: [".js", ".tsx", ".ts"],
40
40
  fallback: {
41
- url: require.resolve('url/'),
41
+ url: require.resolve("url/"),
42
42
  },
43
43
  },
44
44
  plugins: [
45
45
  // new BundleAnalyzerPlugin(),
46
46
  new webpack.ProvidePlugin({
47
- process: 'process/browser',
48
- Buffer: ['buffer', 'Buffer'],
47
+ process: "process/browser",
48
+ Buffer: ["buffer", "Buffer"],
49
49
  }),
50
50
  new webpack.DefinePlugin({
51
- 'process.env': {
51
+ "process.env": {
52
52
  REACT_APP_THEME_CSS_JS: JSON.stringify(REACT_APP_THEME_CSS_JS),
53
53
  },
54
54
  }),
55
55
  new CopyPlugin({
56
56
  patterns: [
57
57
  {
58
- from: path.join(process.cwd(), 'src/lang/zh.json'),
59
- to: path.join(process.cwd(), 'dist/zh.json'),
58
+ from: path.join(process.cwd(), "src/lang/zh.json"),
59
+ to: path.join(process.cwd(), "dist/zh.json"),
60
60
  },
61
61
  {
62
- from: path.join(process.cwd(), 'src/lang/en.json'),
63
- to: path.join(process.cwd(), 'dist/en.json'),
62
+ from: path.join(process.cwd(), "src/lang/en.json"),
63
+ to: path.join(process.cwd(), "dist/en.json"),
64
64
  },
65
65
  ],
66
66
  }),
@@ -68,9 +68,9 @@ module.exports = {
68
68
  new WebpackManifestPlugin(),
69
69
  ],
70
70
  resolve: {
71
- extensions: ['.ts', '.tsx', '.js', 'jsx'],
71
+ extensions: [".ts", ".tsx", ".js", "jsx"],
72
72
  alias: {
73
- '@': path.resolve(__dirname, 'src'),
73
+ "@": path.resolve(__dirname, "src"),
74
74
  },
75
75
  },
76
76
  module: {
@@ -78,47 +78,47 @@ module.exports = {
78
78
  {
79
79
  test: /.(ts|tsx)$/,
80
80
  use: {
81
- loader: 'babel-loader',
81
+ loader: "babel-loader",
82
82
  options: {
83
83
  presets: [
84
84
  [
85
- '@babel/preset-env',
85
+ "@babel/preset-env",
86
86
  {
87
- useBuiltIns: 'usage',
87
+ useBuiltIns: "usage",
88
88
  corejs: 3,
89
89
  },
90
90
  ],
91
- ['@babel/preset-react', { runtime: 'automatic' }],
92
- '@babel/preset-typescript',
91
+ ["@babel/preset-react", { runtime: "automatic" }],
92
+ "@babel/preset-typescript",
93
93
  ],
94
94
  },
95
95
  },
96
96
  },
97
97
  {
98
98
  test: /\.(png|jpe?g|gif|svg)?$/,
99
- type: 'asset/resource',
99
+ type: "asset/resource",
100
100
  },
101
101
  {
102
102
  test: /.(css|less)$/,
103
103
  use: [
104
104
  MiniCssExtractPlugin.loader,
105
- 'css-loader',
105
+ "css-loader",
106
106
  {
107
- loader: 'postcss-loader',
107
+ loader: "postcss-loader",
108
108
  options: {
109
109
  postcssOptions: {
110
- plugins: ['autoprefixer'],
110
+ plugins: ["autoprefixer"],
111
111
  },
112
112
  },
113
113
  },
114
114
  {
115
- loader: 'less-loader',
115
+ loader: "less-loader",
116
116
  options: {
117
117
  lessOptions: {
118
118
  modifyVars: {
119
- 'ant-prefix': 'main',
120
- 'macro-entry-name': 'custom-light',
121
- 'macro-variable-location': 'antd/lib/style/variable',
119
+ "ant-prefix": "main",
120
+ "macro-entry-name": "custom-light",
121
+ "macro-variable-location": "antd/lib/style/variable",
122
122
  },
123
123
  javascriptEnabled: true,
124
124
  },
@@ -1,24 +0,0 @@
1
- "use strict";
2
- (self["webpackChunk_SDF"] = self["webpackChunk_SDF"] || []).push([["node_modules_web-vitals_dist_web-vitals_js"],{
3
-
4
- /***/ "./node_modules/web-vitals/dist/web-vitals.js":
5
- /*!****************************************************!*\
6
- !*** ./node_modules/web-vitals/dist/web-vitals.js ***!
7
- \****************************************************/
8
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9
-
10
- __webpack_require__.r(__webpack_exports__);
11
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12
- /* harmony export */ "getCLS": function() { return /* binding */ s; },
13
- /* harmony export */ "getFCP": function() { return /* binding */ l; },
14
- /* harmony export */ "getFID": function() { return /* binding */ L; },
15
- /* harmony export */ "getLCP": function() { return /* binding */ T; },
16
- /* harmony export */ "getTTFB": function() { return /* binding */ b; }
17
- /* harmony export */ });
18
- var e,t,n,i,a=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v1-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},r=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},o=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},c=function(e){addEventListener("pageshow",(function(t){t.persisted&&e(t)}),!0)},u="function"==typeof WeakSet?new WeakSet:new Set,f=function(e,t,n){var i;return function(){t.value>=0&&(n||u.has(t)||"hidden"===document.visibilityState)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},s=function(e,t){var n,i=a("CLS",0),u=function(e){e.hadRecentInput||(i.value+=e.value,i.entries.push(e),n())},s=r("layout-shift",u);s&&(n=f(e,i,t),o((function(){s.takeRecords().map(u),n()})),c((function(){i=a("CLS",0),n=f(e,i,t)})))},m=-1,p=function(){return"hidden"===document.visibilityState?0:1/0},v=function(){o((function(e){var t=e.timeStamp;m=t}),!0)},d=function(){return m<0&&(m=p(),v(),c((function(){setTimeout((function(){m=p(),v()}),0)}))),{get timeStamp(){return m}}},l=function(e,t){var n,i=d(),o=a("FCP"),s=function(e){"first-contentful-paint"===e.name&&(p&&p.disconnect(),e.startTime<i.timeStamp&&(o.value=e.startTime,o.entries.push(e),u.add(o),n()))},m=performance.getEntriesByName("first-contentful-paint")[0],p=m?null:r("paint",s);(m||p)&&(n=f(e,o,t),m&&s(m),c((function(i){o=a("FCP"),n=f(e,o,t),requestAnimationFrame((function(){requestAnimationFrame((function(){o.value=performance.now()-i.timeStamp,u.add(o),n()}))}))})))},h={passive:!0,capture:!0},S=new Date,y=function(i,a){e||(e=a,t=i,n=new Date,w(removeEventListener),g())},g=function(){if(t>=0&&t<n-S){var a={entryType:"first-input",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};i.forEach((function(e){e(a)})),i=[]}},E=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){y(e,t),a()},i=function(){a()},a=function(){removeEventListener("pointerup",n,h),removeEventListener("pointercancel",i,h)};addEventListener("pointerup",n,h),addEventListener("pointercancel",i,h)}(t,e):y(t,e)}},w=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,E,h)}))},L=function(n,s){var m,p=d(),v=a("FID"),l=function(e){e.startTime<p.timeStamp&&(v.value=e.processingStart-e.startTime,v.entries.push(e),u.add(v),m())},h=r("first-input",l);m=f(n,v,s),h&&o((function(){h.takeRecords().map(l),h.disconnect()}),!0),h&&c((function(){var r;v=a("FID"),m=f(n,v,s),i=[],t=-1,e=null,w(addEventListener),r=l,i.push(r),g()}))},T=function(e,t){var n,i=d(),s=a("LCP"),m=function(e){var t=e.startTime;t<i.timeStamp&&(s.value=t,s.entries.push(e)),n()},p=r("largest-contentful-paint",m);if(p){n=f(e,s,t);var v=function(){u.has(s)||(p.takeRecords().map(m),p.disconnect(),u.add(s),n())};["keydown","click"].forEach((function(e){addEventListener(e,v,{once:!0,capture:!0})})),o(v,!0),c((function(i){s=a("LCP"),n=f(e,s,t),requestAnimationFrame((function(){requestAnimationFrame((function(){s.value=performance.now()-i.timeStamp,u.add(s),n()}))}))}))}},b=function(e){var t,n=a("TTFB");t=function(){try{var t=performance.getEntriesByType("navigation")[0]||function(){var e=performance.timing,t={entryType:"navigation",startTime:0};for(var n in e)"navigationStart"!==n&&"toJSON"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();if(n.value=n.delta=t.responseStart,n.value<0)return;n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("pageshow",t)};
19
-
20
-
21
- /***/ })
22
-
23
- }]);
24
- //# sourceMappingURL=node_modules_web-vitals_dist_web-vitals_js.e56efb17.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node_modules_web-vitals_dist_web-vitals_js.e56efb17.chunk.js","mappings":";;;;;;;;;;;;;;;;;AAAA,4BAA4B,OAAO,sIAAsI,iBAAiB,IAAI,wDAAwD,gEAAgE,2CAA2C,6BAA6B,GAAG,kBAAkB,mBAAmB,KAAK,WAAW,iBAAiB,oBAAoB,yJAAyJ,4EAA4E,eAAe,yCAAyC,kBAAkB,MAAM,oEAAoE,MAAM,kBAAkB,kIAAkI,iBAAiB,iCAAiC,2DAA2D,uBAAuB,6BAA6B,2BAA2B,iBAAiB,wBAAwB,IAAI,mBAAmB,gDAAgD,cAAc,eAAe,kBAAkB,IAAI,MAAM,cAAc,qCAAqC,uBAAuB,UAAU,KAAK,KAAK,gBAAgB,WAAW,iBAAiB,qCAAqC,qIAAqI,mFAAmF,2CAA2C,wDAAwD,kCAAkC,mDAAmD,GAAG,GAAG,IAAI,IAAI,sBAAsB,4BAA4B,mDAAmD,cAAc,gBAAgB,OAAO,iIAAiI,uBAAuB,KAAK,SAAS,eAAe,iBAAiB,gEAAgE,oCAAoC,iBAAiB,WAAW,cAAc,IAAI,cAAc,+EAA+E,wEAAwE,cAAc,eAAe,wEAAwE,gBAAgB,GAAG,iBAAiB,qCAAqC,gGAAgG,sBAAsB,4BAA4B,sCAAsC,uBAAuB,MAAM,6EAA6E,GAAG,iBAAiB,qCAAqC,kBAAkB,iDAAiD,mCAAmC,MAAM,WAAW,iBAAiB,gEAAgE,yCAAyC,sBAAsB,mBAAmB,EAAE,0BAA0B,wDAAwD,kCAAkC,mDAAmD,GAAG,GAAG,IAAI,eAAe,kBAAkB,aAAa,IAAI,gEAAgE,4BAA4B,oCAAoC,8FAA8F,SAAS,GAAG,oDAAoD,mBAAmB,WAAW,kFAAuJ","sources":["webpack://_SDF/./node_modules/web-vitals/dist/web-vitals.js"],"sourcesContent":["var e,t,n,i,a=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:\"v1-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12)}},r=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if(\"first-input\"===e&&!(\"PerformanceEventTiming\"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},o=function(e,t){var n=function n(i){\"pagehide\"!==i.type&&\"hidden\"!==document.visibilityState||(e(i),t&&(removeEventListener(\"visibilitychange\",n,!0),removeEventListener(\"pagehide\",n,!0)))};addEventListener(\"visibilitychange\",n,!0),addEventListener(\"pagehide\",n,!0)},c=function(e){addEventListener(\"pageshow\",(function(t){t.persisted&&e(t)}),!0)},u=\"function\"==typeof WeakSet?new WeakSet:new Set,f=function(e,t,n){var i;return function(){t.value>=0&&(n||u.has(t)||\"hidden\"===document.visibilityState)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},s=function(e,t){var n,i=a(\"CLS\",0),u=function(e){e.hadRecentInput||(i.value+=e.value,i.entries.push(e),n())},s=r(\"layout-shift\",u);s&&(n=f(e,i,t),o((function(){s.takeRecords().map(u),n()})),c((function(){i=a(\"CLS\",0),n=f(e,i,t)})))},m=-1,p=function(){return\"hidden\"===document.visibilityState?0:1/0},v=function(){o((function(e){var t=e.timeStamp;m=t}),!0)},d=function(){return m<0&&(m=p(),v(),c((function(){setTimeout((function(){m=p(),v()}),0)}))),{get timeStamp(){return m}}},l=function(e,t){var n,i=d(),o=a(\"FCP\"),s=function(e){\"first-contentful-paint\"===e.name&&(p&&p.disconnect(),e.startTime<i.timeStamp&&(o.value=e.startTime,o.entries.push(e),u.add(o),n()))},m=performance.getEntriesByName(\"first-contentful-paint\")[0],p=m?null:r(\"paint\",s);(m||p)&&(n=f(e,o,t),m&&s(m),c((function(i){o=a(\"FCP\"),n=f(e,o,t),requestAnimationFrame((function(){requestAnimationFrame((function(){o.value=performance.now()-i.timeStamp,u.add(o),n()}))}))})))},h={passive:!0,capture:!0},S=new Date,y=function(i,a){e||(e=a,t=i,n=new Date,w(removeEventListener),g())},g=function(){if(t>=0&&t<n-S){var a={entryType:\"first-input\",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};i.forEach((function(e){e(a)})),i=[]}},E=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,t){var n=function(){y(e,t),a()},i=function(){a()},a=function(){removeEventListener(\"pointerup\",n,h),removeEventListener(\"pointercancel\",i,h)};addEventListener(\"pointerup\",n,h),addEventListener(\"pointercancel\",i,h)}(t,e):y(t,e)}},w=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(t){return e(t,E,h)}))},L=function(n,s){var m,p=d(),v=a(\"FID\"),l=function(e){e.startTime<p.timeStamp&&(v.value=e.processingStart-e.startTime,v.entries.push(e),u.add(v),m())},h=r(\"first-input\",l);m=f(n,v,s),h&&o((function(){h.takeRecords().map(l),h.disconnect()}),!0),h&&c((function(){var r;v=a(\"FID\"),m=f(n,v,s),i=[],t=-1,e=null,w(addEventListener),r=l,i.push(r),g()}))},T=function(e,t){var n,i=d(),s=a(\"LCP\"),m=function(e){var t=e.startTime;t<i.timeStamp&&(s.value=t,s.entries.push(e)),n()},p=r(\"largest-contentful-paint\",m);if(p){n=f(e,s,t);var v=function(){u.has(s)||(p.takeRecords().map(m),p.disconnect(),u.add(s),n())};[\"keydown\",\"click\"].forEach((function(e){addEventListener(e,v,{once:!0,capture:!0})})),o(v,!0),c((function(i){s=a(\"LCP\"),n=f(e,s,t),requestAnimationFrame((function(){requestAnimationFrame((function(){s.value=performance.now()-i.timeStamp,u.add(s),n()}))}))}))}},b=function(e){var t,n=a(\"TTFB\");t=function(){try{var t=performance.getEntriesByType(\"navigation\")[0]||function(){var e=performance.timing,t={entryType:\"navigation\",startTime:0};for(var n in e)\"navigationStart\"!==n&&\"toJSON\"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();if(n.value=n.delta=t.responseStart,n.value<0)return;n.entries=[t],e(n)}catch(e){}},\"complete\"===document.readyState?setTimeout(t,0):addEventListener(\"pageshow\",t)};export{s as getCLS,l as getFCP,L as getFID,T as getLCP,b as getTTFB};\n"],"names":[],"sourceRoot":""}