gemercheung 2 年之前
父节点
当前提交
95e43a5cf8
共有 50 个文件被更改,包括 1020 次插入630 次删除
  1. 3 3
      README.md
  2. 1 1
      docs/assets/highlight.css
  3. 57 53
      docs/assets/main.js
  4. 1 1
      docs/assets/search.js
  5. 62 7
      docs/assets/style.css
  6. 二进制
      docs/assets/widgets.png
  7. 二进制
      docs/assets/widgets@2x.png
  8. 134 54
      docs/classes/_medici_core.SDK.html
  9. 4 3
      docs/enums/_medici_types.SDKPlatformType.html
  10. 4 3
      docs/functions/_medici_legacy.init.html
  11. 70 0
      docs/functions/_medici_utils.cloneDeep.html
  12. 10 7
      docs/functions/_medici_utils.getGlobalObject.html
  13. 19 11
      docs/variables/_medici_foo.meaningOfLife.html
  14. 7 4
      docs/functions/_medici_utils.hook.html
  15. 4 3
      docs/functions/_medici_web.init.html
  16. 4 3
      docs/index.html
  17. 16 15
      docs/interfaces/_medici_core.SDKConfigType.html
  18. 7 6
      docs/interfaces/_medici_core.SDKInitConfig.html
  19. 4 3
      docs/interfaces/_medici_types.BrowserTransportOptions.html
  20. 4 3
      docs/interfaces/_medici_types.GlobalEventType.html
  21. 4 3
      docs/interfaces/_medici_types.HistoryEvent.html
  22. 9 29
      docs/interfaces/_medici_types.IBaseAction.html
  23. 25 7
      docs/interfaces/_medici_types.ICustomAction.html
  24. 4 3
      docs/interfaces/_medici_types.SDKconfigType.html
  25. 9 8
      docs/interfaces/_medici_types.TrackActionOption.html
  26. 151 0
      docs/interfaces/_medici_types.TrackEntityType.html
  27. 4 4
      docs/modules.html
  28. 4 3
      docs/modules/_medici_core.html
  29. 0 59
      docs/modules/_medici_foo.html
  30. 4 3
      docs/modules/_medici_legacy.html
  31. 8 3
      docs/modules/_medici_types.html
  32. 9 4
      docs/modules/_medici_utils.html
  33. 4 3
      docs/modules/_medici_web.html
  34. 5 4
      docs/types/_medici_core.PlatformType.html
  35. 10 6
      docs/types/_medici_types.Dict.html
  36. 6 3
      docs/types/_medici_types.EventNameEnumType.html
  37. 66 0
      docs/types/_medici_types.EventReturnBooleanType.html
  38. 6 3
      docs/types/_medici_types.EventReturnType.html
  39. 6 3
      docs/types/_medici_types.TrackEventType.html
  40. 4 4
      packages/core/package.json
  41. 1 10
      packages/core/src/basicTrack.ts
  42. 0 1
      packages/core/src/history.ts
  43. 3 3
      packages/legacy/package.json
  44. 0 1
      packages/types/src/event.ts
  45. 0 1
      packages/types/src/sdk.ts
  46. 1 1
      packages/web/package.json
  47. 8 8
      play/package.json
  48. 1 8
      play/src/App.vue
  49. 4 4
      play/src/components/custom.vue
  50. 253 261
      pnpm-lock.yaml

+ 3 - 3
README.md

@@ -94,13 +94,13 @@ medici.resume();
 
 ## 点位(采集)
 
-> 主业务事件:eventType
+> 主业务事件:event
 
 ### 一次消费埋点
 
 ```js
 const res = await medici.track("BuyProduct", {
-  eventType:"click",
+  event:"click",
   ProductName: "MacBook Pro",
   ProductPrice: 123.45,
   IsAddedToFav: false,
@@ -114,7 +114,7 @@ const res = await medici.track("BuyProduct", {
 
 ```js
 medici.startTrack("BuyProduct", {
-  eventType:"click",
+  event:"click",
   maxWaitTime: 30000, //可自定义,主要是下载等行为耗时。
   ProductName: "MacBook Pro",
   ProductPrice: 123.45,

+ 1 - 1
docs/assets/highlight.css

@@ -23,7 +23,7 @@
     --dark-hl-10: #569CD6;
     --light-hl-11: #000000FF;
     --dark-hl-11: #D4D4D4;
-    --light-hl-12: #FF0000;
+    --light-hl-12: #E50000;
     --dark-hl-12: #9CDCFE;
     --light-hl-13: #0000FF;
     --dark-hl-13: #CE9178;

文件差异内容过多而无法显示
+ 57 - 53
docs/assets/main.js


文件差异内容过多而无法显示
+ 1 - 1
docs/assets/search.js


+ 62 - 7
docs/assets/style.css

@@ -2,6 +2,8 @@
     /* Light */
     --light-color-background: #f2f4f8;
     --light-color-background-secondary: #eff0f1;
+    --light-color-warning-text: #222;
+    --light-color-background-warning: #e6e600;
     --light-color-icon-background: var(--light-color-background);
     --light-color-accent: #c5c7c9;
     --light-color-text: #222;
@@ -21,6 +23,8 @@
     /* Dark */
     --dark-color-background: #2b2e33;
     --dark-color-background-secondary: #1e2024;
+    --dark-color-background-warning: #bebe00;
+    --dark-color-warning-text: #222;
     --dark-color-icon-background: var(--dark-color-background-secondary);
     --dark-color-accent: #9096a2;
     --dark-color-text: #f5f5f5;
@@ -42,6 +46,8 @@
     :root {
         --color-background: var(--light-color-background);
         --color-background-secondary: var(--light-color-background-secondary);
+        --color-background-warning: var(--light-color-background-warning);
+        --color-warning-text: var(--light-color-warning-text);
         --color-icon-background: var(--light-color-icon-background);
         --color-accent: var(--light-color-accent);
         --color-text: var(--light-color-text);
@@ -64,6 +70,8 @@
     :root {
         --color-background: var(--dark-color-background);
         --color-background-secondary: var(--dark-color-background-secondary);
+        --color-background-warning: var(--dark-color-background-warning);
+        --color-warning-text: var(--dark-color-warning-text);
         --color-icon-background: var(--dark-color-icon-background);
         --color-accent: var(--dark-color-accent);
         --color-text: var(--dark-color-text);
@@ -93,6 +101,8 @@ body {
 :root[data-theme="light"] {
     --color-background: var(--light-color-background);
     --color-background-secondary: var(--light-color-background-secondary);
+    --color-background-warning: var(--light-color-background-warning);
+    --color-warning-text: var(--light-color-warning-text);
     --color-icon-background: var(--light-color-icon-background);
     --color-accent: var(--light-color-accent);
     --color-text: var(--light-color-text);
@@ -113,6 +123,8 @@ body {
 :root[data-theme="dark"] {
     --color-background: var(--dark-color-background);
     --color-background-secondary: var(--dark-color-background-secondary);
+    --color-background-warning: var(--dark-color-background-warning);
+    --color-warning-text: var(--dark-color-warning-text);
     --color-icon-background: var(--dark-color-icon-background);
     --color-accent: var(--dark-color-accent);
     --color-text: var(--dark-color-text);
@@ -130,6 +142,11 @@ body {
     --color-scheme: var(--dark-color-scheme);
 }
 
+.always-visible,
+.always-visible .tsd-signatures {
+    display: inherit !important;
+}
+
 h1,
 h2,
 h3,
@@ -466,10 +483,9 @@ blockquote {
     .has-menu .col-menu {
         visibility: visible;
         transform: translate(0, 0);
-        display: grid;
-        align-items: center;
-        grid-template-rows: auto 1fr;
-        grid-gap: 1.5rem;
+        display: flex;
+        flex-direction: column;
+        gap: 1.5rem;
         max-height: 100vh;
         padding: 1rem 2rem;
     }
@@ -825,6 +841,15 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark {
     padding-left: 5.5rem;
 }
 
+#tsd-sidebar-links a {
+    margin-top: 0;
+    margin-bottom: 0.5rem;
+    line-height: 1.25rem;
+}
+#tsd-sidebar-links a:last-of-type {
+    margin-bottom: 0;
+}
+
 a.tsd-index-link {
     margin: 0.25rem 0;
     font-size: 1rem;
@@ -885,7 +910,7 @@ a.tsd-index-link {
     margin-right: 0.8rem;
 }
 
-@media (min-width: 1024px) {
+@media (min-width: 1025px) {
     .col-content {
         margin: 2rem auto;
     }
@@ -978,7 +1003,8 @@ a.tsd-index-link {
     right: -40px;
 }
 #tsd-search .field input,
-#tsd-search .title {
+#tsd-search .title,
+#tsd-toolbar-links a {
     transition: opacity 0.2s;
 }
 #tsd-search .results {
@@ -1022,7 +1048,8 @@ a.tsd-index-link {
     top: 0;
     opacity: 1;
 }
-#tsd-search.has-focus .title {
+#tsd-search.has-focus .title,
+#tsd-search.has-focus #tsd-toolbar-links a {
     z-index: 0;
     opacity: 0;
 }
@@ -1036,6 +1063,22 @@ a.tsd-index-link {
     display: block;
 }
 
+#tsd-toolbar-links {
+    position: absolute;
+    top: 0;
+    right: 2rem;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+}
+#tsd-toolbar-links a {
+    margin-left: 1.5rem;
+}
+#tsd-toolbar-links a:hover {
+    text-decoration: underline;
+}
+
 .tsd-signature {
     margin: 0 0 1rem 0;
     padding: 1rem 0.5rem;
@@ -1124,6 +1167,7 @@ ul.tsd-type-parameter-list h5 {
     display: flex;
     justify-content: space-between;
     height: 2.5rem;
+    margin: 0 auto;
 }
 .tsd-page-toolbar .table-cell {
     position: relative;
@@ -1133,6 +1177,11 @@ ul.tsd-type-parameter-list h5 {
 .tsd-page-toolbar .table-cell:first-child {
     width: 100%;
 }
+.tsd-page-toolbar .tsd-toolbar-icon {
+    box-sizing: border-box;
+    line-height: 0;
+    padding: 12px 0;
+}
 
 .tsd-page-toolbar--hide {
     transform: translateY(-100%);
@@ -1204,6 +1253,12 @@ img {
     text-decoration: line-through;
 }
 
+.warning {
+    padding: 1rem;
+    color: var(--color-warning-text);
+    background: var(--color-background-warning);
+}
+
 * {
     scrollbar-width: thin;
     scrollbar-color: var(--color-accent) var(--color-icon-background);

二进制
docs/assets/widgets.png


二进制
docs/assets/widgets@2x.png


文件差异内容过多而无法显示
+ 134 - 54
docs/classes/_medici_core.SDK.html


文件差异内容过多而无法显示
+ 4 - 3
docs/enums/_medici_types.SDKPlatformType.html


文件差异内容过多而无法显示
+ 4 - 3
docs/functions/_medici_legacy.init.html


文件差异内容过多而无法显示
+ 70 - 0
docs/functions/_medici_utils.cloneDeep.html


文件差异内容过多而无法显示
+ 10 - 7
docs/functions/_medici_utils.getGlobalObject.html


文件差异内容过多而无法显示
+ 19 - 11
docs/variables/_medici_foo.meaningOfLife.html


文件差异内容过多而无法显示
+ 7 - 4
docs/functions/_medici_utils.hook.html


文件差异内容过多而无法显示
+ 4 - 3
docs/functions/_medici_web.init.html


文件差异内容过多而无法显示
+ 4 - 3
docs/index.html


文件差异内容过多而无法显示
+ 16 - 15
docs/interfaces/_medici_core.SDKConfigType.html


文件差异内容过多而无法显示
+ 7 - 6
docs/interfaces/_medici_core.SDKInitConfig.html


文件差异内容过多而无法显示
+ 4 - 3
docs/interfaces/_medici_types.BrowserTransportOptions.html


文件差异内容过多而无法显示
+ 4 - 3
docs/interfaces/_medici_types.GlobalEventType.html


文件差异内容过多而无法显示
+ 4 - 3
docs/interfaces/_medici_types.HistoryEvent.html


文件差异内容过多而无法显示
+ 9 - 29
docs/interfaces/_medici_types.IBaseAction.html


文件差异内容过多而无法显示
+ 25 - 7
docs/interfaces/_medici_types.ICustomAction.html


文件差异内容过多而无法显示
+ 4 - 3
docs/interfaces/_medici_types.SDKconfigType.html


文件差异内容过多而无法显示
+ 9 - 8
docs/interfaces/_medici_types.TrackActionOption.html


文件差异内容过多而无法显示
+ 151 - 0
docs/interfaces/_medici_types.TrackEntityType.html


文件差异内容过多而无法显示
+ 4 - 4
docs/modules.html


文件差异内容过多而无法显示
+ 4 - 3
docs/modules/_medici_core.html


文件差异内容过多而无法显示
+ 0 - 59
docs/modules/_medici_foo.html


文件差异内容过多而无法显示
+ 4 - 3
docs/modules/_medici_legacy.html


文件差异内容过多而无法显示
+ 8 - 3
docs/modules/_medici_types.html


文件差异内容过多而无法显示
+ 9 - 4
docs/modules/_medici_utils.html


文件差异内容过多而无法显示
+ 4 - 3
docs/modules/_medici_web.html


文件差异内容过多而无法显示
+ 5 - 4
docs/types/_medici_core.PlatformType.html


文件差异内容过多而无法显示
+ 10 - 6
docs/types/_medici_types.Dict.html


文件差异内容过多而无法显示
+ 6 - 3
docs/types/_medici_types.EventNameEnumType.html


文件差异内容过多而无法显示
+ 66 - 0
docs/types/_medici_types.EventReturnBooleanType.html


文件差异内容过多而无法显示
+ 6 - 3
docs/types/_medici_types.EventReturnType.html


文件差异内容过多而无法显示
+ 6 - 3
docs/types/_medici_types.TrackEventType.html


+ 4 - 4
packages/core/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@medici/core",
-  "version": "0.1.0",
+  "version": "0.1.1",
   "main": "dist/index",
   "types": "dist/index",
   "files": [
@@ -18,8 +18,8 @@
     "prepublishOnly": "pnpm run build"
   },
   "dependencies": {
-    "@medici/types": "workspace:^0.0.5",
-    "@medici/utils": "workspace:^0.0.4",
+    "@medici/types": "workspace:^",
+    "@medici/utils": "workspace:^",
     "@rollup/plugin-json": "^6.0.0"
   },
   "devDependencies": {
@@ -27,7 +27,7 @@
     "rimraf": "~3.0.2",
     "rollup": "~2.77.3",
     "rollup-plugin-terser": "^7.0.2",
-    "tslib": "^2.4.0",
+    "tslib": "^2.5.0",
     "typescript": "~4.7.4"
   },
   "typedoc": {

+ 1 - 10
packages/core/src/basicTrack.ts

@@ -42,7 +42,6 @@ export class BaseTrack implements IBaseAction, ICustomAction {
             module: params.module,
             type: params.type,
             url: params.url || this._history.playload.url,
-            // eventType: params.eventType,
             event: params.event,
             referrer: params.referrer || this._history.currentRef,
             requestData: params.requestData,
@@ -84,14 +83,6 @@ export class BaseTrack implements IBaseAction, ICustomAction {
             console.log('BaseTrack-TrackEvent', event_name, event_data, url, uuid);
             this._history.playload.url = url;
             const historyPlayload = cloneDeep(this._history.playload);
-            // const payload = Object.assign(historyPlayload, {
-            //     referrer: this._history.currentRef,
-            //     event_name: event_name,
-            //     url: url,
-            //     event_data: event_data,
-            //     ...this._config,
-            // });
-
             const payload: TrackEntityType = {
                 module: event_name,
                 url: url,
@@ -186,7 +177,7 @@ export class BaseTrack implements IBaseAction, ICustomAction {
         if (!this._stopTrack) {
             const historyPlayload = cloneDeep(this._history.playload);
             const trackObj = cloneDeep(trackActionOption);
-            delete trackObj.eventType;
+            delete trackObj.event;
             delete trackObj.maxWaitTime;
 
             const payload: TrackEntityType = {

+ 0 - 1
packages/core/src/history.ts

@@ -109,7 +109,6 @@ export class IHistory {
             if (this._currentUrl !== this._currentRef) {
                 console.log('trackView', data, unused, url);
                 this._sdk.trackView(this._currentUrl, this._currentRef, this._playload.website);
-                //   trackView();
             }
         } catch (error) {
             console.log('error', error);

+ 3 - 3
packages/legacy/package.json

@@ -24,12 +24,12 @@
         "rimraf": "~3.0.2",
         "rollup": "~2.77.3",
         "rollup-plugin-terser": "^7.0.2",
-        "tslib": "^2.4.0",
+        "tslib": "^2.5.0",
         "typescript": "~4.7.4"
     },
     "dependencies": {
-        "@medici/core": "workspace:^0.1.0",
-        "@medici/utils": "workspace:^0.0.4"
+        "@medici/core": "workspace:^",
+        "@medici/utils": "workspace:^"
     },
     "typedoc": {
         "entryPoint": "./src/index.ts",

+ 0 - 1
packages/types/src/event.ts

@@ -18,7 +18,6 @@ export type EventReturnBooleanType = Promise<boolean>;
 export interface IBaseAction {
     trackView(url: string, referrer: string, uuid: string): EventReturnType;
     trackEvent(event_name: string, event_data: string, url?: string, uuid?: string): EventReturnType;
-    // sendEvent(value: string, type: string, url?: string, uuid?: string): EventReturnType;
 }
 
 export interface ICustomAction {

+ 0 - 1
packages/types/src/sdk.ts

@@ -17,7 +17,6 @@ export interface TrackEntityType {
     appId?: string;
     url?: string;
     referrer?: string;
-    eventType?: string;
     event: string;
     requestType?: string;
     TrackingType?: string;

+ 1 - 1
packages/web/package.json

@@ -22,7 +22,7 @@
     "typescript": "~4.7.4"
   },
   "dependencies": {
-    "@medici/core": "workspace:^0.1.0"
+    "@medici/core": "workspace:^"
   },
   "typedoc": {
     "entryPoint": "./src/index.ts",

+ 8 - 8
play/package.json

@@ -10,16 +10,16 @@
   },
   "dependencies": {
     "@highlightjs/vue-plugin": "^2.1.0",
-    "@medici/core": "workspace:^0.1.0",
-    "@medici/web": "workspace:^0.0.6",
-    "highlight.js": "^11.6.0",
-    "vue": "^3.2.38",
-    "vue-router": "^4.1.5"
+    "@medici/core": "workspace:^",
+    "@medici/web": "workspace:^",
+    "highlight.js": "^11.8.0",
+    "vue": "^3.2.47",
+    "vue-router": "^4.1.6"
   },
   "devDependencies": {
-    "@vitejs/plugin-vue": "^3.1.0",
-    "typescript": "^4.8.2",
-    "vite": "^3.1.0",
+    "@vitejs/plugin-vue": "^3.2.0",
+    "typescript": "^4.9.5",
+    "vite": "^3.2.6",
     "vue-tsc": "^0.38.9"
   }
 }

+ 1 - 8
play/src/App.vue

@@ -1,10 +1,9 @@
 <script setup lang="ts">
 // This starter template is using Vue 3 <script setup> SFCs
 // Check out https://vuejs.org/api/sfc-script-setup.html#script-setup
-import HelloWorld from './components/HelloWorld.vue';
+// import HelloWorld from './components/HelloWorld.vue';
 import * as Medici from '@medici/web';
 
-
 const medici = Medici.init({
     platform: 'web',
     appId: '7b5958d5-1ae6-4ad5-8a87-5fc8a4b92999',
@@ -18,12 +17,6 @@ const medici = Medici.init({
 // console.log('medici', medici);
 (window as any).medici = medici;
 
-// medici.track("BuyProduct", {
-//   eventType:"click",
-//   ProductName: "MacBook Pro",
-//   ProductPrice: 123.45,
-//   IsAddedToFav: false,
-// });
 
 const test = async () => {
     const res = await medici.track('BuyProduct', {

+ 4 - 4
play/src/components/custom.vue

@@ -3,7 +3,7 @@ import { ref } from 'vue';
 
 const t1 = `
 medici.track("BuyProduct", {
-    eventType:"click",
+    event:"click",
     productName: "MacBook Pro",
     productPrice: 123.45,
     isAddedToFav: false,
@@ -12,7 +12,7 @@ medici.track("BuyProduct", {
 `;
 const t2 = `
 medici.startTrack("BuyProduct", {
-  eventType:"click",
+  event:"click",
   maxWaitTime: 30000, //可自定义,主要是下载等行为耗时。
   productName: 'MacBook Pro',
   productPrice: 123.45,
@@ -33,7 +33,7 @@ const test = ref({
 
 const oneTimeTrack = () => {
     (window as any).medici.track('BuyProduct', {
-        eventType: 'click',
+        event: 'click',
         productName: 'MacBook Pro',
         productPrice: 123.45,
         ssAddedToFav: false,
@@ -41,7 +41,7 @@ const oneTimeTrack = () => {
 };
 const twoTimeStartTrack = () => {
     (window as any).medici.startTrack('BuyProduct', {
-        eventType: 'click',
+        event: 'click',
         maxWaitTime: 300000, //可自定义,主要是下载等行为耗时。
         productName: 'MacBook Pro',
         productPrice: 123.45,

文件差异内容过多而无法显示
+ 253 - 261
pnpm-lock.yaml