yxuse 1.0.65 → 1.0.66

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/lib/index.cjs2.js CHANGED
@@ -1 +1 @@
1
- "use strict";var m=(t,o,e)=>new Promise((c,s)=>{var n=r=>{try{l(e.next(r))}catch(h){s(h)}},a=r=>{try{l(e.throw(r))}catch(h){s(h)}},l=r=>r.done?c(r.value):Promise.resolve(r.value).then(n,a);l((e=e.apply(t,o)).next())});const w=require("./index.cjs3.js"),S=require("./index.cjs4.js"),d=require("./index.cjs5.js"),C=require("./index.cjs6.js"),E=require("./index.cjs7.js"),V="@font-face {font-family: 'YX-TITLE';font-size: 16px; src: url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699612675710_ALIBABAPUHUITI-2-105-HEAVY.TTF') format('woff'), url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699612675710_ALIBABAPUHUITI-2-105-HEAVY.TTF') format('woff2'); font-style: normal;font-display: swap;}",_="@font-face { font-family: 'YX-SP-TITLE'; font-size: 16px; src: url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699844184489_bt.ttf') format('woff'),url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699844184489_bt.ttf') format('woff2');font-style: normal; font-display: swap;}",A="@font-face {font-family: 'YX-TEXT'; font-size: 16px;src: url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699611032932_ALIBABAPUHUITI-2-65-MEDIUM.TTF') format('woff'),url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699611032932_ALIBABAPUHUITI-2-65-MEDIUM.TTF') format('woff2'); font-style: normal; font-display: swap;}",B=V+_+A,p=()=>m(exports,null,function*(){var s;let t=T();const{data:o}=yield d.getUserThemeList();let e=t?(s=o.find(n=>n.id===t))==null?void 0:s.themeUrl:"";if(!t||!e){const a=o.find(l=>l.defaultTheme===1)||o[0];e=a.themeUrl,t=a.id}const c=yield f(e);y({themeCssVar:c,themeId:t}),L(),i.onmessage=n=>{const a=n.data;a.type==="theme"&&f(a.data.themeUrl)},console.log("主题初始化完毕!!!")}),L=()=>{const t=document.createElement("style");t.innerHTML=B,document.head.appendChild(t)},y=({themeCssVar:t,themeId:o})=>{const e=localStorage.getItem("ttcGlobalState")||"{}",c=JSON.parse(e);c.theme={themeCssVar:t,id:o},localStorage.setItem("ttcGlobalState",JSON.stringify(c))},b=t=>m(exports,null,function*(){const o=yield f(t.themeUrl);y({themeCssVar:o,themeId:t==null?void 0:t.id}),i.postMessage({type:"theme",data:t})}),g=()=>{const t=u(),o=document.documentElement;Object.keys(t).forEach(e=>{Object.keys(t[e]).forEach(c=>{const s=`--${e}-${c}`;o.style.setProperty(s,t[e][c])})})},f=t=>m(exports,null,function*(){const e=yield(yield fetch(t)).json(),c=document.documentElement;return Object.keys(e).forEach(s=>{Object.keys(e[s]).forEach(n=>{const a=`--${s}-${n}`;c.style.setProperty(a,e[s][n])})}),e}),I=()=>m(exports,null,function*(){const{data:t}=yield d.getUserThemeList(),o=t.find(c=>c.defaultTheme===1);return o?o.themeUrl:t[0].themeUrl}),T=()=>{var e;const t=localStorage.getItem("ttcGlobalState"),o=t&&((e=JSON.parse(t))==null?void 0:e.theme);return(o==null?void 0:o.id)||null},u=()=>{var e;const t=localStorage.getItem("ttcGlobalState");return(t&&((e=JSON.parse(t))==null?void 0:e.theme)).themeCssVar},U=t=>u()[t]||{},k=Object.freeze(Object.defineProperty({__proto__:null,changeTheme:b,getCurTheme:T,getCurThemeCssVar:u,getDefaultThemeUrl:I,getGroupColor:U,install:p,updateTheme:g},Symbol.toStringTag,{value:"Module"})),i=new BroadcastChannel("YXUSE_BC"),O={utils:w.utils,api:d.api,theme:k,icons:S.icons,components:C.components,directives:E.directives,BC:i};exports.BC=i;exports.changeTheme=b;exports.getCurTheme=T;exports.getCurThemeCssVar=u;exports.getDefaultThemeUrl=I;exports.getGroupColor=U;exports.index=O;exports.install=p;exports.updateTheme=g;
1
+ "use strict";var m=(t,o,e)=>new Promise((c,s)=>{var n=r=>{try{l(e.next(r))}catch(h){s(h)}},a=r=>{try{l(e.throw(r))}catch(h){s(h)}},l=r=>r.done?c(r.value):Promise.resolve(r.value).then(n,a);l((e=e.apply(t,o)).next())});const S=require("./index.cjs3.js"),C=require("./index.cjs4.js"),d=require("./index.cjs5.js"),E=require("./index.cjs6.js"),V=require("./index.cjs7.js"),_="@font-face {font-family: 'YX-TITLE';font-size: 16px; src: url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699612675710_ALIBABAPUHUITI-2-105-HEAVY.TTF') format('woff'), url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699612675710_ALIBABAPUHUITI-2-105-HEAVY.TTF') format('woff2'); font-style: normal;font-display: swap;}",A="@font-face { font-family: 'YX-SP-TITLE'; font-size: 16px; src: url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699844184489_bt.ttf') format('woff'),url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699844184489_bt.ttf') format('woff2');font-style: normal; font-display: swap;}",B="@font-face {font-family: 'YX-TEXT'; font-size: 16px;src: url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699611032932_ALIBABAPUHUITI-2-65-MEDIUM.TTF') format('woff'),url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699611032932_ALIBABAPUHUITI-2-65-MEDIUM.TTF') format('woff2'); font-style: normal; font-display: swap;}",L=_+A+B,b=()=>m(exports,null,function*(){var o;let t=p();try{const{data:e}=yield d.getUserThemeList();let c=t?(o=e.find(n=>n.id===t))==null?void 0:o.themeUrl:"";if(!t||!c){const a=e.find(l=>l.defaultTheme===1)||e[0];c=a.themeUrl,t=a.id}const s=yield f(c);g({themeCssVar:s,themeId:t}),y(),i.onmessage=n=>{const a=n.data;a.type==="theme"&&f(a.data.themeUrl)},console.log("主题初始化完毕!!!")}catch(e){y(),T()}}),y=()=>{const t=document.createElement("style");t.innerHTML=L,document.head.appendChild(t)},g=({themeCssVar:t,themeId:o})=>{const e=localStorage.getItem("ttcGlobalState")||"{}",c=JSON.parse(e);c.theme={themeCssVar:t,id:o},localStorage.setItem("ttcGlobalState",JSON.stringify(c))},I=t=>m(exports,null,function*(){const o=yield f(t.themeUrl);g({themeCssVar:o,themeId:t==null?void 0:t.id}),i.postMessage({type:"theme",data:t})}),T=()=>{const t=u(),o=document.documentElement;Object.keys(t).forEach(e=>{Object.keys(t[e]).forEach(c=>{const s=`--${e}-${c}`;o.style.setProperty(s,t[e][c])})})},f=t=>m(exports,null,function*(){const e=yield(yield fetch(t)).json(),c=document.documentElement;return Object.keys(e).forEach(s=>{Object.keys(e[s]).forEach(n=>{const a=`--${s}-${n}`;c.style.setProperty(a,e[s][n])})}),e}),U=()=>m(exports,null,function*(){const{data:t}=yield d.getUserThemeList(),o=t.find(c=>c.defaultTheme===1);return o?o.themeUrl:t[0].themeUrl}),p=()=>{var e;const t=localStorage.getItem("ttcGlobalState"),o=t&&((e=JSON.parse(t))==null?void 0:e.theme);return(o==null?void 0:o.id)||null},u=()=>{var e;const t=localStorage.getItem("ttcGlobalState");return(t&&((e=JSON.parse(t))==null?void 0:e.theme)).themeCssVar},w=t=>u()[t]||{},k=Object.freeze(Object.defineProperty({__proto__:null,changeTheme:I,getCurTheme:p,getCurThemeCssVar:u,getDefaultThemeUrl:U,getGroupColor:w,install:b,updateTheme:T},Symbol.toStringTag,{value:"Module"})),i=new BroadcastChannel("YXUSE_BC"),O={utils:S.utils,api:d.api,theme:k,icons:C.icons,components:E.components,directives:V.directives,BC:i};exports.BC=i;exports.changeTheme=I;exports.getCurTheme=p;exports.getCurThemeCssVar=u;exports.getDefaultThemeUrl=U;exports.getGroupColor=w;exports.index=O;exports.install=b;exports.updateTheme=T;
package/lib/index.es2.js CHANGED
@@ -14,38 +14,42 @@ var m = (t, o, e) => new Promise((s, a) => {
14
14
  }, l = (r) => r.done ? s(r.value) : Promise.resolve(r.value).then(c, n);
15
15
  l((e = e.apply(t, o)).next());
16
16
  });
17
- import { u as y } from "./index.es3.js";
18
- import { i as b } from "./index.es4.js";
19
- import { g as d, a as I } from "./index.es5.js";
20
- import { c as g } from "./index.es6.js";
21
- import { d as w } from "./index.es7.js";
22
- const U = "@font-face {font-family: 'YX-TITLE';font-size: 16px; src: url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699612675710_ALIBABAPUHUITI-2-105-HEAVY.TTF') format('woff'), url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699612675710_ALIBABAPUHUITI-2-105-HEAVY.TTF') format('woff2'); font-style: normal;font-display: swap;}", S = "@font-face { font-family: 'YX-SP-TITLE'; font-size: 16px; src: url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699844184489_bt.ttf') format('woff'),url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699844184489_bt.ttf') format('woff2');font-style: normal; font-display: swap;}", E = "@font-face {font-family: 'YX-TEXT'; font-size: 16px;src: url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699611032932_ALIBABAPUHUITI-2-65-MEDIUM.TTF') format('woff'),url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699611032932_ALIBABAPUHUITI-2-65-MEDIUM.TTF') format('woff2'); font-style: normal; font-display: swap;}", C = U + S + E, _ = () => m(void 0, null, function* () {
23
- var a;
24
- let t = T();
25
- const { data: o } = yield d();
26
- let e = t ? (a = o.find((c) => c.id === t)) == null ? void 0 : a.themeUrl : "";
27
- if (!t || !e) {
28
- const n = o.find((l) => l.defaultTheme === 1) || o[0];
29
- e = n.themeUrl, t = n.id;
17
+ import { u as I } from "./index.es3.js";
18
+ import { i as g } from "./index.es4.js";
19
+ import { g as p, a as w } from "./index.es5.js";
20
+ import { c as U } from "./index.es6.js";
21
+ import { d as S } from "./index.es7.js";
22
+ const E = "@font-face {font-family: 'YX-TITLE';font-size: 16px; src: url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699612675710_ALIBABAPUHUITI-2-105-HEAVY.TTF') format('woff'), url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699612675710_ALIBABAPUHUITI-2-105-HEAVY.TTF') format('woff2'); font-style: normal;font-display: swap;}", C = "@font-face { font-family: 'YX-SP-TITLE'; font-size: 16px; src: url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699844184489_bt.ttf') format('woff'),url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699844184489_bt.ttf') format('woff2');font-style: normal; font-display: swap;}", _ = "@font-face {font-family: 'YX-TEXT'; font-size: 16px;src: url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699611032932_ALIBABAPUHUITI-2-65-MEDIUM.TTF') format('woff'),url('https://yx-picture.obs.cn-north-4.myhuaweicloud.com/ttc/bucket/1699611032932_ALIBABAPUHUITI-2-65-MEDIUM.TTF') format('woff2'); font-style: normal; font-display: swap;}", A = E + C + _, V = () => m(void 0, null, function* () {
23
+ var o;
24
+ let t = b();
25
+ try {
26
+ const { data: e } = yield p();
27
+ let s = t ? (o = e.find((c) => c.id === t)) == null ? void 0 : o.themeUrl : "";
28
+ if (!t || !s) {
29
+ const n = e.find((l) => l.defaultTheme === 1) || e[0];
30
+ s = n.themeUrl, t = n.id;
31
+ }
32
+ const a = yield u(s);
33
+ T({ themeCssVar: a, themeId: t }), d(), i.onmessage = (c) => {
34
+ const n = c.data;
35
+ n.type === "theme" && u(n.data.themeUrl);
36
+ }, console.log("主题初始化完毕!!!");
37
+ } catch (e) {
38
+ d(), y();
30
39
  }
31
- const s = yield u(e);
32
- p({ themeCssVar: s, themeId: t }), A(), i.onmessage = (c) => {
33
- const n = c.data;
34
- n.type === "theme" && u(n.data.themeUrl);
35
- }, console.log("主题初始化完毕!!!");
36
- }), A = () => {
40
+ }), d = () => {
37
41
  const t = document.createElement("style");
38
- t.innerHTML = C, document.head.appendChild(t);
39
- }, p = ({ themeCssVar: t, themeId: o }) => {
42
+ t.innerHTML = A, document.head.appendChild(t);
43
+ }, T = ({ themeCssVar: t, themeId: o }) => {
40
44
  const e = localStorage.getItem("ttcGlobalState") || "{}", s = JSON.parse(e);
41
45
  s.theme = {
42
46
  themeCssVar: t,
43
47
  id: o
44
48
  }, localStorage.setItem("ttcGlobalState", JSON.stringify(s));
45
- }, V = (t) => m(void 0, null, function* () {
49
+ }, B = (t) => m(void 0, null, function* () {
46
50
  const o = yield u(t.themeUrl);
47
- p({ themeCssVar: o, themeId: t == null ? void 0 : t.id }), i.postMessage({ type: "theme", data: t });
48
- }), B = () => {
51
+ T({ themeCssVar: o, themeId: t == null ? void 0 : t.id }), i.postMessage({ type: "theme", data: t });
52
+ }), y = () => {
49
53
  const t = h(), o = document.documentElement;
50
54
  Object.keys(t).forEach((e) => {
51
55
  Object.keys(t[e]).forEach((s) => {
@@ -62,9 +66,9 @@ const U = "@font-face {font-family: 'YX-TITLE';font-size: 16px; src: url('https:
62
66
  });
63
67
  }), e;
64
68
  }), x = () => m(void 0, null, function* () {
65
- const { data: t } = yield d(), o = t.find((s) => s.defaultTheme === 1);
69
+ const { data: t } = yield p(), o = t.find((s) => s.defaultTheme === 1);
66
70
  return o ? o.themeUrl : t[0].themeUrl;
67
- }), T = () => {
71
+ }), b = () => {
68
72
  var e;
69
73
  const t = localStorage.getItem("ttcGlobalState"), o = t && ((e = JSON.parse(t)) == null ? void 0 : e.theme);
70
74
  return (o == null ? void 0 : o.id) || null;
@@ -74,30 +78,30 @@ const U = "@font-face {font-family: 'YX-TITLE';font-size: 16px; src: url('https:
74
78
  return (t && ((e = JSON.parse(t)) == null ? void 0 : e.theme)).themeCssVar;
75
79
  }, k = (t) => h()[t] || {}, L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
76
80
  __proto__: null,
77
- changeTheme: V,
78
- getCurTheme: T,
81
+ changeTheme: B,
82
+ getCurTheme: b,
79
83
  getCurThemeCssVar: h,
80
84
  getDefaultThemeUrl: x,
81
85
  getGroupColor: k,
82
- install: _,
83
- updateTheme: B
86
+ install: V,
87
+ updateTheme: y
84
88
  }, Symbol.toStringTag, { value: "Module" })), i = new BroadcastChannel("YXUSE_BC"), F = {
85
- utils: y,
86
- api: I,
89
+ utils: I,
90
+ api: w,
87
91
  theme: L,
88
- icons: b,
89
- components: g,
90
- directives: w,
92
+ icons: g,
93
+ components: U,
94
+ directives: S,
91
95
  BC: i
92
96
  };
93
97
  export {
94
98
  i as B,
95
- T as a,
99
+ b as a,
96
100
  h as b,
97
- V as c,
101
+ B as c,
98
102
  k as d,
99
103
  F as e,
100
104
  x as g,
101
- _ as i,
102
- B as u
105
+ V as i,
106
+ y as u
103
107
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yxuse",
3
- "version": "1.0.65",
3
+ "version": "1.0.66",
4
4
  "private": false,
5
5
  "keywords": [
6
6
  "yx"