@nocobase/plugin-theme-editor 0.14.0-alpha.3 → 0.14.0-alpha.5
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/dist/client/index.js +1 -1
- package/dist/externalVersion.js +3 -3
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var cm=Object.defineProperty,sm=Object.defineProperties;var dm=Object.getOwnPropertyDescriptors;var Br=Object.getOwnPropertySymbols;var Zi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable;var qi=(j,o,L)=>o in j?cm(j,o,{enumerable:!0,configurable:!0,writable:!0,value:L}):j[o]=L,P=(j,o)=>{for(var L in o||(o={}))Zi.call(o,L)&&qi(j,L,o[L]);if(Br)for(var L of Br(o))Qi.call(o,L)&&qi(j,L,o[L]);return j},W=(j,o)=>sm(j,dm(o));var Fo=(j,o)=>{var L={};for(var i in j)Zi.call(j,i)&&o.indexOf(i)<0&&(L[i]=j[i]);if(j!=null&&Br)for(var i of Br(j))o.indexOf(i)<0&&Qi.call(j,i)&&(L[i]=j[i]);return L};var Xe=(j,o,L)=>new Promise((i,Ge)=>{var h=Ie=>{try{H(L.next(Ie))}catch(mo){Ge(mo)}},Ee=Ie=>{try{H(L.throw(Ie))}catch(mo){Ge(mo)}},H=Ie=>Ie.done?i(Ie.value):Promise.resolve(Ie.value).then(h,Ee);H((L=L.apply(j,o)).next())});(function(j,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("react/jsx-runtime"),require("@nocobase/client"),require("antd"),require("lodash"),require("react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("@ant-design/cssinjs"),require("react-i18next"),require("@emotion/css")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@nocobase/client","antd","lodash","react","@nocobase/utils/client","@ant-design/icons","@ant-design/cssinjs","react-i18next","@emotion/css"],o):(j=typeof globalThis!="undefined"?globalThis:j||self,o(j["@nocobase/plugin-theme-editor"]={},j.jsxRuntime,j["@nocobase/client"],j.antd,j.lodash,j.react,j["@nocobase/utils"],j["@ant-design/icons"],j["@ant-design/cssinjs"],j["react-i18next"],j["@emotion/css"]))})(this,function(j,o,L,i,Ge,h,Ee,H,Ie,mo,_o){var Ui,ji,Vi,Yi;"use strict";function Ki(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const T=Ki(h);function Dr(e){return e=Ge.cloneDeep(e),e.algorithm&&(Array.isArray(e.algorithm)?e.algorithm=e.algorithm.map(r=>Jt(r)):e.algorithm=Jt(e.algorithm)),e}function Jt(e){return typeof e=="string"?e:e.toString()===i.theme.darkAlgorithm.toString()?"darkAlgorithm":e.toString()===i.theme.compactAlgorithm.toString()?"compactAlgorithm":e.toString()}function Rt(e){var r;return e=Ge.cloneDeep(e),Ge.isString(e.config.algorithm)&&(e.config.algorithm=i.theme[e.config.algorithm]),Array.isArray((r=e.config)==null?void 0:r.algorithm)&&(e.config.algorithm=e.config.algorithm.map(t=>Ge.isString(t)?i.theme[t]:t)),e}const en=h.createContext(null),Wo=()=>h.useContext(en),on=({children:e})=>{const{data:r,error:t,run:n,refresh:a,loading:l}=L.useRequest({url:"themeConfig:list",params:{sort:"id",paginate:!1}},{manual:!0}),c=h.useMemo(()=>{var s;return(s=r==null?void 0:r.data)==null?void 0:s.map(p=>Rt(p))},[r]);return t&&Ee.error(t),o.jsx(en.Provider,{value:{data:c,error:t,run:n,refresh:a,loading:l},children:e})};on.displayName="ThemeListProvider";const rn=h.createContext(null),Hr=()=>h.useContext(rn),tn=({children:e})=>{var d,g,u,f,C,b;const r=L.useSystemSettings(),t=L.useCurrentUserContext(),{setTheme:n}=L.useGlobalTheme(),{run:a,data:l,loading:c}=Wo(),s=h.useRef(null),p=L.useAPIClient();return h.useEffect(()=>{const y=p.auth.getOption("theme");if(y)try{n(Rt(JSON.parse(y)).config)}catch(m){Ee.error(m)}},[]),h.useEffect(()=>{var y,m,S,x,k,w,M,X,Y;if(!l)return a();if(s.current=((S=(m=(y=t==null?void 0:t.data)==null?void 0:y.data)==null?void 0:m.systemSettings)==null?void 0:S.themeId)==null?(w=(k=(x=r==null?void 0:r.data)==null?void 0:x.data)==null?void 0:k.options)==null?void 0:w.themeId:(Y=(X=(M=t==null?void 0:t.data)==null?void 0:M.data)==null?void 0:X.systemSettings)==null?void 0:Y.themeId,s.current!=null){const Z=l==null?void 0:l.find(G=>G.id===s.current);Z&&(n(Z.config),p.auth.setOption("theme",JSON.stringify(Object.assign(P({},Z),{config:Dr(Z.config)}))))}else n(L.defaultTheme),p.auth.setOption("theme",null)},[p.auth,(u=(g=(d=t==null?void 0:t.data)==null?void 0:d.data)==null?void 0:g.systemSettings)==null?void 0:u.themeId,l,a,n,(b=(C=(f=r==null?void 0:r.data)==null?void 0:f.data)==null?void 0:C.options)==null?void 0:b.themeId]),c&&!l?o.jsx(i.Spin,{}):o.jsx(rn.Provider,{value:s.current,children:e})};tn.displayName="InitializeTheme";const nn=h.createContext(null),Ar=()=>h.useContext(nn),an=({children:e,open:r,setOpen:t})=>o.jsx(nn.Provider,{value:{open:r,setOpen:t},children:e});an.displayName="ThemeEditorProvider";function Xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ln={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@nocobase/client": "0.14.0-alpha.
|
|
2
|
+
"@nocobase/client": "0.14.0-alpha.5",
|
|
3
3
|
"react": "18.2.0",
|
|
4
4
|
"antd": "5.8.6",
|
|
5
5
|
"lodash": "4.17.21",
|
|
6
|
-
"@nocobase/server": "0.14.0-alpha.
|
|
6
|
+
"@nocobase/server": "0.14.0-alpha.5",
|
|
7
7
|
"@ant-design/cssinjs": "1.13.2",
|
|
8
8
|
"@ant-design/icons": "5.1.4",
|
|
9
|
-
"@nocobase/utils": "0.14.0-alpha.
|
|
9
|
+
"@nocobase/utils": "0.14.0-alpha.5",
|
|
10
10
|
"react-i18next": "11.18.6",
|
|
11
11
|
"@emotion/css": "11.11.2"
|
|
12
12
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-theme-editor",
|
|
3
|
-
"version": "0.14.0-alpha.
|
|
3
|
+
"version": "0.14.0-alpha.5",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"displayName": "Theme editor",
|
|
6
6
|
"displayName.zh-CN": "主题编辑器",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"@nocobase/test": "0.x",
|
|
31
31
|
"@nocobase/utils": "0.x"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "8e0ee4a1e5b682161e5dc9d27a309b68c5f1aa8b"
|
|
34
34
|
}
|