@nocobase/plugin-theme-editor 1.6.0-beta.8 → 1.6.0
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/LICENSE.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Updated Date: February
|
|
1
|
+
Updated Date: February 20, 2025
|
|
2
2
|
|
|
3
3
|
NocoBase License Agreement
|
|
4
4
|
|
|
@@ -88,7 +88,7 @@ Except for Third-Party Open Source Software, the Company owns all copyrights, tr
|
|
|
88
88
|
|
|
89
89
|
6.6 Can sell plugins developed for Software in the Marketplace.
|
|
90
90
|
|
|
91
|
-
6.7 The User with
|
|
91
|
+
6.7 The User with an Enterprise Edition License can sell Upper Layer Application to their clients.
|
|
92
92
|
|
|
93
93
|
6.8 Not restricted by the AGPL-3.0 agreement.
|
|
94
94
|
|
|
@@ -106,9 +106,9 @@ Except for Third-Party Open Source Software, the Company owns all copyrights, tr
|
|
|
106
106
|
|
|
107
107
|
7.4 It is not allowed to provide any form of no-code, zero-code, low-code platform SaaS products to the public using the original or modified Software.
|
|
108
108
|
|
|
109
|
-
7.5 It is not allowed for the User
|
|
109
|
+
7.5 It is not allowed for the User withot an Enterprise Edition license to sell Upper Layer Application to clients without a Commercial license.
|
|
110
110
|
|
|
111
|
-
7.6 It is not allowed for the User with
|
|
111
|
+
7.6 It is not allowed for the User with an Enterprise Edition license to sell Upper Layer Application to clients without a Commercial license with access to further development and configuration.
|
|
112
112
|
|
|
113
113
|
7.7 It is not allowed to publicly sell plugins developed for Software outside of the Marketplace.
|
|
114
114
|
|
|
@@ -126,7 +126,7 @@ Except for Third-Party Open Source Software, the Company owns all copyrights, tr
|
|
|
126
126
|
|
|
127
127
|
8.3 Can be used for commercial purposes without restrictions on the number of applications or users.
|
|
128
128
|
|
|
129
|
-
8.4 The User with
|
|
129
|
+
8.4 The User with an Enterprise Edition License can use the Commercial Plugin in Upper Layer Applications sold to their customers.
|
|
130
130
|
|
|
131
131
|
8.5 Not restricted by the AGPL-3.0 agreement.
|
|
132
132
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
export declare const ThemeSettings: () => React.JSX.Element;
|
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/utils/client"),require("@nocobase/client"),require("lodash"),require("antd"),require("@ant-design/icons"),require("@ant-design/cssinjs"),require("react"),require("@emotion/css")):"function"==typeof define&&define.amd?define("@nocobase/plugin-theme-editor",["react-i18next","@nocobase/utils/client","@nocobase/client","lodash","antd","@ant-design/icons","@ant-design/cssinjs","react","@emotion/css"],t):"object"==typeof exports?exports["@nocobase/plugin-theme-editor"]=t(require("react-i18next"),require("@nocobase/utils/client"),require("@nocobase/client"),require("lodash"),require("antd"),require("@ant-design/icons"),require("@ant-design/cssinjs"),require("react"),require("@emotion/css")):e["@nocobase/plugin-theme-editor"]=t(e["react-i18next"],e["@nocobase/utils/client"],e["@nocobase/client"],e.lodash,e.antd,e["@ant-design/icons"],e["@ant-design/cssinjs"],e.react,e["@emotion/css"])}(self,function(e,t,n,r,o,i,u,a,c){return function(){var l,s,f,d,p,m,h={7012:function(e,t,n){"use strict";n.r(t),n.d(t,{useThemeId:function(){return f}});var r=n(3772),o=n(7584),i=n(8156),u=n.n(i),a=n(8144),c=n(5725),l=n(3036),s=u().createContext({}),f=function(){return u().useContext(s)},d=function(e){var t,n,f,d=e.children,p=(0,r.useCurrentUserContext)(),m=(0,r.useGlobalTheme)().setTheme,h=(0,l.useThemeListContext)(),b=h.run,v=h.data,y=h.loading,g=(0,i.useMemo)(function(){return null==v?void 0:v.find(function(e){return e.default})},[v]),w=(0,i.useRef)(null),O=(0,r.useAPIClient)();(0,i.useEffect)(function(){var e=O.auth.getOption("theme");if(e)try{m((0,c.w)(JSON.parse(e)).config)}catch(e){(0,o.error)(e)}},[]),(0,i.useEffect)(function(){if(!v)return b();var e,t,n,o,i=null==p?void 0:null===(n=p.data)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:null===(e=t.systemSettings)||void 0===e?void 0:e.themeId;null!=i&&(o=v.find(function(e){return e.id===i})),!o&&(o=g),o?(w.current=o.id,m(o.config),O.auth.setOption("theme",JSON.stringify(Object.assign(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},o),{config:(0,a.i)(o.config)})))):(m(r.defaultTheme),O.auth.setOption("theme",null))},[O.auth,null==p?void 0:null===(f=p.data)||void 0===f?void 0:null===(n=f.data)||void 0===n?void 0:null===(t=n.systemSettings)||void 0===t?void 0:t.themeId,v,b,m,g]);var j=y&&!v||p.loading?{}:{currentThemeId:w.current,defaultThemeId:null==g?void 0:g.id};return u().createElement(s.Provider,{value:j},d)};d.displayName="InitializeTheme",t.default=d},3036:function(e,t,n){"use strict";n.r(t),n.d(t,{ThemeListProvider:function(){return s},useThemeListContext:function(){return l}});var r=n(3772),o=n(7584),i=n(8156),u=n.n(i),a=n(5725),c=(0,i.createContext)(null);c.displayName="ThemeListContext";var l=function(){return u().useContext(c)},s=function(e){var t=e.children,n=(0,r.useRequest)({url:"themeConfig:list",params:{sort:"id",paginate:!1}},{manual:!0}),l=n.data,s=n.error,f=n.run,d=n.refresh,p=n.loading,m=(0,i.useMemo)(function(){var e;return null==l?void 0:null===(e=l.data)||void 0===e?void 0:e.map(function(e){return(0,a.w)(e)})},[l]);return s&&(0,o.error)(s),u().createElement(c.Provider,{value:{data:m,error:s,run:f,refresh:d,loading:p}},t)};s.displayName="ThemeListProvider"},15:function(e,t,n){"use strict";n.d(t,{Y:function(){return l}});var r=n(3772),o=n(7584),i=n(8156);function u(e,t,n,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function c(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function l(){var e,t,n=(0,r.useAPIClient)(),l=(0,r.useCurrentUserContext)();return{updateUserThemeSettings:(0,i.useCallback)((t=(e=function(e){var t,r;return function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,function(i){switch(i.label){case 0:if(e===(null===(t=l.data.data.systemSettings)||void 0===t?void 0:t.themeId))return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.resource("users").updateTheme({values:{themeId:e}})];case 2:return i.sent(),l.mutate({data:c(a({},l.data.data),{systemSettings:c(a({},l.data.data.systemSettings||{}),{themeId:e})})}),[3,4];case 3:return r=i.sent(),(0,o.error)(r),[3,4];case 4:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){u(i,r,o,a,c,"next",e)}function c(e){u(i,r,o,a,c,"throw",e)}a(void 0)})}),function(e){return t.apply(this,arguments)}),[n,l])}}},8144:function(e,t,n){"use strict";n.d(t,{i:function(){return u}});var r=n(2721),o=n(467),i=n.n(o);function u(e){return(e=i().cloneDeep(e)).algorithm?(Array.isArray(e.algorithm)?e.algorithm=e.algorithm.map(function(e){return a(e)}).filter(Boolean):e.algorithm=a(e.algorithm),i().isEmpty(e.algorithm)&&delete e.algorithm,e):e}function a(e){return"string"==typeof e?e:e.toString()===r.theme.darkAlgorithm.toString()?"darkAlgorithm":e.toString()===r.theme.compactAlgorithm.toString()?"compactAlgorithm":void 0}},5725:function(e,t,n){"use strict";n.d(t,{w:function(){return u}});var r=n(2721),o=n(467),i=n.n(o);function u(e){var t;return e=i().cloneDeep(e),i().isString(e.config.algorithm)&&(e.config.algorithm=r.theme[e.config.algorithm]),Array.isArray(null===(t=e.config)||void 0===t?void 0:t.algorithm)&&(e.config.algorithm=e.config.algorithm.map(function(e){return i().isString(e)?r.theme[e]:e})),e}},573:function(e,t,n){"use strict";n.d(t,{$:function(){return i},A:function(){return o}});var r=n(3238),o="theme-editor";function i(){return(0,r.useTranslation)([o,"client"],{nsMode:"fallback"})}},3581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},1143:function(e){"use strict";e.exports=u},482:function(e){"use strict";e.exports=i},4964:function(e){"use strict";e.exports=c},3772:function(e){"use strict";e.exports=n},7584:function(e){"use strict";e.exports=t},2721:function(e){"use strict";e.exports=o},467:function(e){"use strict";e.exports=r},8156:function(e){"use strict";e.exports=a},3238:function(t){"use strict";t.exports=e}},b={};function v(e){var t=b[e];if(void 0!==t)return t.exports;var n=b[e]={exports:{}};return h[e](n,n.exports,v),n.exports}v.m=h,v.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return v.d(t,{a:t}),t},v.d=function(e,t){for(var n in t)v.o(t,n)&&!v.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},v.f={},v.e=function(e){return Promise.all(Object.keys(v.f).reduce(function(t,n){return v.f[n](e,t),t},[]))},v.u=function(e){return""+({171:"49db08b28208ffa6",506:"7c36603b4fb35f3c",916:"f0f46c0d5e9d3ae0",933:"d7a691fdba42ac3b",964:"862ac7919b43871b"})[e]+".js"},v.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),v.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l={},s="@nocobase/plugin-theme-editor:",v.l=function(e,t,n,r){if(l[e]){l[e].push(t);return}if(void 0!==n){for(var o,i,u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c=u[a];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==s+n){o=c;break}}}!o&&(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,v.nc&&o.setAttribute("nonce",v.nc),o.setAttribute("data-webpack",s+n),o.src=e),l[e]=[t];var f=function(t,n){o.onerror=o.onload=null,clearTimeout(d);var r=l[e];if(delete l[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),i&&document.head.appendChild(o)},v.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},v.nc=void 0,v.p=(!(f=window.__nocobase_public_path__||"/").endsWith("/")&&(f+="/"),f+"static/plugins/@nocobase/plugin-theme-editor/dist/client/"),d={909:0},v.f.j=function(e,t){var n=v.o(d,e)?d[e]:void 0;if(0!==n){if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=d[e]=[t,r]});t.push(n[2]=r);var o=v.p+v.u(e),i=Error();v.l(o,function(t){if(v.o(d,e)&&(0!==(n=d[e])&&(d[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}}},p=function(e,t){var n=t[0],r=t[1],o=t[2],i,u,a=0;if(n.some(function(e){return 0!==d[e]})){for(i in r)v.o(r,i)&&(v.m[i]=r[i]);o&&o(v)}for(e&&e(t);a<n.length;a++)u=n[a],v.o(d,u)&&d[u]&&d[u][0](),d[u]=0},(m=self.webpackChunk_nocobase_plugin_theme_editor=self.webpackChunk_nocobase_plugin_theme_editor||[]).forEach(p.bind(null,0)),m.push=p.bind(null,m.push.bind(m));var y={};return!function(){"use strict";v.r(y),v.d(y,{PluginThemeEditorClient:function(){return A},default:function(){return q}});var e=v("3772"),t=v("2721"),n=v("467"),r=v.n(n),o=v("8156"),i=v.n(o),u=v("7584"),a=v("7012"),c=v("3036"),l=v("573"),s=v("15");function f(){var t=(0,l.$)().t,n=(0,c.useThemeListContext)(),r=n.run,f=n.error,d=n.data,p=(0,s.Y)().updateUserThemeSettings,m=(0,a.useThemeId)().currentThemeId,h=(0,o.useMemo)(function(){return null==d?void 0:d.filter(function(e){return e.optional}).map(function(e){return{label:t(e.config.name),value:e.id}})},[d,t]);return((0,o.useEffect)(function(){!d&&r()},[]),f)?((0,u.error)(f),null):i().createElement(e.SelectWithTitle,{title:t("Theme"),options:h,defaultValue:m,onChange:function(e){p(e)}})}var d=v(3581);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t,n,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function h(e,t,n){return(h=j()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&w(o,n.prototype),o}).apply(null,arguments)}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t="function"==typeof Map?new Map:void 0;return(O=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return h(e,arguments,g(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),w(r,e)})(e)}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function P(){var e,t,n=(e=["\n overflow: hidden;\n border-left: 1px solid ",";\n animation: 0.1s ease-out 0s 1 slideInFromRight;\n @keyframes slideInFromRight {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return P=function(){return n},n}var x=(0,e.lazy)(function(){return d("imported_-1bkn1ue_component",Promise.resolve().then(v.bind(v,7012)))}),S=(0,e.lazy)(function(){return d("imported_-16ae68t_component",v.e("964").then(v.bind(v,4950)))},"ThemeEditorProvider").ThemeEditorProvider,_=(0,e.lazy)(function(){return d("imported_-19lv318_component",Promise.all([v.e("933"),v.e("916"),v.e("506")]).then(v.bind(v,8390)))}),T=(0,e.lazy)(function(){return d("imported_-ofsaik_component",Promise.resolve().then(v.bind(v,3036)))},"ThemeListProvider").ThemeListProvider,E=(0,e.lazy)(function(){return d("imported_-1mfft73_component",Promise.all([v.e("933"),v.e("916"),v.e("171")]).then(v.bind(v,7362)))}),k=(0,e.createStyles)(function(e){var t=e.css,n=e.token;return{editor:t(P(),n.colorBorderSecondary)}}),C=i().memo(function(n){var u,a,c,l=(0,e.useCurrentUserSettingsMenu)().addMenuItem,s=(0,o.useMemo)(function(){return{key:"theme",eventKey:"theme",label:i().createElement(f,null)}},[]);var d=(u=i().useState(!1),a=2,function(e){if(Array.isArray(e))return e}(u)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],u=!0,a=!1;try{for(o=o.call(e);!(u=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);u=!0);}catch(e){a=!0,r=e}finally{try{!u&&null!=o.return&&o.return()}finally{if(a)throw r}}return i}}(u,2)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}}(u,a)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=d[0],h=d[1],b=(0,e.useGlobalTheme)(),v=b.theme,y=b.setTheme,g=k().styles;(0,o.useEffect)(function(){l(s,{before:"divider_3"})},[l,s]);var w=(0,o.useMemo)(function(){return m?{transform:"rotate(0)",flexGrow:1,width:0,height:"100%"}:{flexGrow:1,width:0,height:"100%"}},[m]),O=i().createElement("div",{style:{display:"flex",overflow:"hidden",height:"100%"}},i().createElement("div",{style:w},n.children),m?i().createElement("div",{className:g.editor},i().createElement(E,{onThemeChange:y})):null);return!(null==v?void 0:null===(c=v.token)||void 0===c?void 0:c.motionUnit)&&r().set(v,"token.motionUnit",e.defaultTheme.token.motionUnit),i().createElement(t.ConfigProvider,{theme:v},i().createElement(T,null,i().createElement(x,null,i().createElement(S,{open:m,setOpen:h},O))))});C.displayName="CustomThemeProvider";var A=function(e){var t,n,r;function o(){var e,t,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),e=this,t=o,n=arguments,t=g(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,j()?Reflect.construct(t,n||[],g(e).constructor):t.apply(e,n))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(o,e),t=o,n=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,function(e){return t.app.use(C),t.app.pluginSettingsManager.add(l.A,{title:'{{t("Theme editor", {ns:"'.concat(l.A,'"})}}'),icon:"BgColorsOutlined",Component:_,aclSnippet:"pm.theme-editor.themes"}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function u(e){m(i,r,o,u,a,"next",e)}function a(e){m(i,r,o,u,a,"throw",e)}u(void 0)})})()}}],b(t.prototype,n),o}(O(e.Plugin)),q=A}(),y}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@emotion/css"),require("@nocobase/utils/client"),require("@nocobase/client"),require("lodash"),require("antd"),require("@ant-design/cssinjs"),require("@ant-design/icons"),require("react")):"function"==typeof define&&define.amd?define("@nocobase/plugin-theme-editor",["react-i18next","@emotion/css","@nocobase/utils/client","@nocobase/client","lodash","antd","@ant-design/cssinjs","@ant-design/icons","react"],t):"object"==typeof exports?exports["@nocobase/plugin-theme-editor"]=t(require("react-i18next"),require("@emotion/css"),require("@nocobase/utils/client"),require("@nocobase/client"),require("lodash"),require("antd"),require("@ant-design/cssinjs"),require("@ant-design/icons"),require("react")):e["@nocobase/plugin-theme-editor"]=t(e["react-i18next"],e["@emotion/css"],e["@nocobase/utils/client"],e["@nocobase/client"],e.lodash,e.antd,e["@ant-design/cssinjs"],e["@ant-design/icons"],e.react)}(self,function(e,t,n,r,o,i,u,a,c){return function(){var l,s,f,d,p,m,h={7012:function(e,t,n){"use strict";n.r(t),n.d(t,{useThemeId:function(){return f}});var r=n(3772),o=n(7584),i=n(8156),u=n.n(i),a=n(8144),c=n(5725),l=n(3036),s=u().createContext({}),f=function(){return u().useContext(s)},d=function(e){var t,n,f,d=e.children,p=(0,r.useCurrentUserContext)(),m=(0,r.useGlobalTheme)().setTheme,h=(0,l.useThemeListContext)(),b=h.run,v=h.data,y=h.loading,g=(0,i.useMemo)(function(){return null==v?void 0:v.find(function(e){return e.default})},[v]),w=(0,i.useRef)(null),O=(0,r.useAPIClient)();(0,i.useEffect)(function(){var e=O.auth.getOption("theme");if(e)try{m((0,c.w)(JSON.parse(e)).config)}catch(e){(0,o.error)(e)}},[]),(0,i.useEffect)(function(){if(!v)return b();var e,t,n,o,i=null==p?void 0:null===(n=p.data)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:null===(e=t.systemSettings)||void 0===e?void 0:e.themeId;null!=i&&(o=v.find(function(e){return e.id===i})),!o&&(o=g),o?(w.current=o.id,m(o.config),O.auth.setOption("theme",JSON.stringify(Object.assign(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},o),{config:(0,a.i)(o.config)})))):(m(r.defaultTheme),O.auth.setOption("theme",null))},[O.auth,null==p?void 0:null===(f=p.data)||void 0===f?void 0:null===(n=f.data)||void 0===n?void 0:null===(t=n.systemSettings)||void 0===t?void 0:t.themeId,v,b,m,g]);var j=y&&!v||p.loading?{}:{currentThemeId:w.current,defaultThemeId:null==g?void 0:g.id};return u().createElement(s.Provider,{value:j},d)};d.displayName="InitializeTheme",t.default=d},3036:function(e,t,n){"use strict";n.r(t),n.d(t,{ThemeListProvider:function(){return s},useThemeListContext:function(){return l}});var r=n(3772),o=n(7584),i=n(8156),u=n.n(i),a=n(5725),c=(0,i.createContext)(null);c.displayName="ThemeListContext";var l=function(){return u().useContext(c)},s=function(e){var t=e.children,n=(0,r.useRequest)({url:"themeConfig:list",params:{sort:"id",paginate:!1}},{manual:!0}),l=n.data,s=n.error,f=n.run,d=n.refresh,p=n.loading,m=(0,i.useMemo)(function(){var e;return null==l?void 0:null===(e=l.data)||void 0===e?void 0:e.map(function(e){return(0,a.w)(e)})},[l]);return s&&(0,o.error)(s),u().createElement(c.Provider,{value:{data:m,error:s,run:f,refresh:d,loading:p}},t)};s.displayName="ThemeListProvider"},15:function(e,t,n){"use strict";n.d(t,{Y:function(){return l}});var r=n(3772),o=n(7584),i=n(8156);function u(e,t,n,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function c(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function l(){var e,t,n=(0,r.useAPIClient)(),l=(0,r.useCurrentUserContext)();return{updateUserThemeSettings:(0,i.useCallback)((t=(e=function(e){var t;return function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,n.resource("users").updateTheme({values:{themeId:e}})];case 1:return r.sent(),l.mutate({data:c(a({},l.data.data),{systemSettings:c(a({},l.data.data.systemSettings||{}),{themeId:e})})}),[3,3];case 2:return t=r.sent(),console.log(o.error),(0,o.error)(t),[3,3];case 3:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){u(i,r,o,a,c,"next",e)}function c(e){u(i,r,o,a,c,"throw",e)}a(void 0)})}),function(e){return t.apply(this,arguments)}),[n,l])}}},8144:function(e,t,n){"use strict";n.d(t,{i:function(){return u}});var r=n(2721),o=n(467),i=n.n(o);function u(e){return(e=i().cloneDeep(e)).algorithm?(Array.isArray(e.algorithm)?e.algorithm=e.algorithm.map(function(e){return a(e)}).filter(Boolean):e.algorithm=a(e.algorithm),i().isEmpty(e.algorithm)&&delete e.algorithm,e):e}function a(e){return"string"==typeof e?e:e.toString()===r.theme.darkAlgorithm.toString()?"darkAlgorithm":e.toString()===r.theme.compactAlgorithm.toString()?"compactAlgorithm":void 0}},5725:function(e,t,n){"use strict";n.d(t,{w:function(){return u}});var r=n(2721),o=n(467),i=n.n(o);function u(e){var t;return e=i().cloneDeep(e),i().isString(e.config.algorithm)&&(e.config.algorithm=r.theme[e.config.algorithm]),Array.isArray(null===(t=e.config)||void 0===t?void 0:t.algorithm)&&(e.config.algorithm=e.config.algorithm.map(function(e){return i().isString(e)?r.theme[e]:e})),e}},573:function(e,t,n){"use strict";n.d(t,{$:function(){return i},A:function(){return o}});var r=n(3238),o="theme-editor";function i(){return(0,r.useTranslation)([o,"client"],{nsMode:"fallback"})}},3581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},1143:function(e){"use strict";e.exports=u},482:function(e){"use strict";e.exports=a},4964:function(e){"use strict";e.exports=t},3772:function(e){"use strict";e.exports=r},7584:function(e){"use strict";e.exports=n},2721:function(e){"use strict";e.exports=i},467:function(e){"use strict";e.exports=o},8156:function(e){"use strict";e.exports=c},3238:function(t){"use strict";t.exports=e}},b={};function v(e){var t=b[e];if(void 0!==t)return t.exports;var n=b[e]={exports:{}};return h[e](n,n.exports,v),n.exports}v.m=h,v.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return v.d(t,{a:t}),t},v.d=function(e,t){for(var n in t)v.o(t,n)&&!v.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},v.f={},v.e=function(e){return Promise.all(Object.keys(v.f).reduce(function(t,n){return v.f[n](e,t),t},[]))},v.u=function(e){return""+({171:"49db08b28208ffa6",506:"7c36603b4fb35f3c",916:"f0f46c0d5e9d3ae0",933:"d7a691fdba42ac3b",964:"862ac7919b43871b"})[e]+".js"},v.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),v.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l={},s="@nocobase/plugin-theme-editor:",v.l=function(e,t,n,r){if(l[e]){l[e].push(t);return}if(void 0!==n){for(var o,i,u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c=u[a];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==s+n){o=c;break}}}!o&&(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,v.nc&&o.setAttribute("nonce",v.nc),o.setAttribute("data-webpack",s+n),o.src=e),l[e]=[t];var f=function(t,n){o.onerror=o.onload=null,clearTimeout(d);var r=l[e];if(delete l[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),i&&document.head.appendChild(o)},v.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},v.nc=void 0,v.p=(!(f=window.__nocobase_public_path__||"/").endsWith("/")&&(f+="/"),f+"static/plugins/@nocobase/plugin-theme-editor/dist/client/"),d={909:0},v.f.j=function(e,t){var n=v.o(d,e)?d[e]:void 0;if(0!==n){if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=d[e]=[t,r]});t.push(n[2]=r);var o=v.p+v.u(e),i=Error();v.l(o,function(t){if(v.o(d,e)&&(0!==(n=d[e])&&(d[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}}},p=function(e,t){var n=t[0],r=t[1],o=t[2],i,u,a=0;if(n.some(function(e){return 0!==d[e]})){for(i in r)v.o(r,i)&&(v.m[i]=r[i]);o&&o(v)}for(e&&e(t);a<n.length;a++)u=n[a],v.o(d,u)&&d[u]&&d[u][0](),d[u]=0},(m=self.webpackChunk_nocobase_plugin_theme_editor=self.webpackChunk_nocobase_plugin_theme_editor||[]).forEach(p.bind(null,0)),m.push=p.bind(null,m.push.bind(m));var y={};return!function(){"use strict";v.r(y),v.d(y,{PluginThemeEditorClient:function(){return A},default:function(){return q}});var e=v("3772"),t=v("2721"),n=v("467"),r=v.n(n),o=v("8156"),i=v.n(o),u=v("573"),a=v("7584"),c=v("7012"),l=v("3036"),s=v("15"),f=function(){var t=(0,u.$)().t,n=(0,l.useThemeListContext)(),r=n.run,f=n.error,d=n.data,p=(0,s.Y)().updateUserThemeSettings,m=(0,c.useThemeId)().currentThemeId,h=(0,o.useMemo)(function(){return null==d?void 0:d.filter(function(e){return e.optional}).map(function(e){return{label:t(e.config.name),value:e.id}})},[d,t]);return((0,o.useEffect)(function(){!d&&r()},[]),f)?((0,a.error)(f),null):i().createElement(e.SchemaSettingsSelectItem,{title:t("Theme"),options:h,value:m,onChange:function(e){p(e)}})},d=v(3581);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t,n,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function h(e,t,n){return(h=j()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&w(o,n.prototype),o}).apply(null,arguments)}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t="function"==typeof Map?new Map:void 0;return(O=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return h(e,arguments,g(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),w(r,e)})(e)}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function P(){var e,t,n=(e=["\n overflow: hidden;\n border-left: 1px solid ",";\n animation: 0.1s ease-out 0s 1 slideInFromRight;\n @keyframes slideInFromRight {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return P=function(){return n},n}var x=(0,e.lazy)(function(){return d("imported_-1bkn1ue_component",Promise.resolve().then(v.bind(v,7012)))}),S=(0,e.lazy)(function(){return d("imported_-16ae68t_component",v.e("964").then(v.bind(v,4950)))},"ThemeEditorProvider").ThemeEditorProvider,_=(0,e.lazy)(function(){return d("imported_-19lv318_component",Promise.all([v.e("933"),v.e("916"),v.e("506")]).then(v.bind(v,8390)))}),T=(0,e.lazy)(function(){return d("imported_-ofsaik_component",Promise.resolve().then(v.bind(v,3036)))},"ThemeListProvider").ThemeListProvider,E=(0,e.lazy)(function(){return d("imported_-1mfft73_component",Promise.all([v.e("933"),v.e("916"),v.e("171")]).then(v.bind(v,7362)))}),k=(0,e.createStyles)(function(e){var t=e.css,n=e.token;return{editor:t(P(),n.colorBorderSecondary)}}),C=i().memo(function(n){var u,a,c,l=(u=i().useState(!1),a=2,function(e){if(Array.isArray(e))return e}(u)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],u=!0,a=!1;try{for(o=o.call(e);!(u=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);u=!0);}catch(e){a=!0,r=e}finally{try{!u&&null!=o.return&&o.return()}finally{if(a)throw r}}return i}}(u,2)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}}(u,a)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=l[0],f=l[1],d=(0,e.useGlobalTheme)(),m=d.theme,h=d.setTheme,b=k().styles,v=(0,o.useMemo)(function(){return s?{transform:"rotate(0)",flexGrow:1,width:0,height:"100%"}:{flexGrow:1,width:0,height:"100%"}},[s]),y=i().createElement("div",{style:{display:"flex",overflow:"hidden",height:"100%"}},i().createElement("div",{style:v},n.children),s?i().createElement("div",{className:b.editor},i().createElement(E,{onThemeChange:h})):null);return!(null==m?void 0:null===(c=m.token)||void 0===c?void 0:c.motionUnit)&&r().set(m,"token.motionUnit",e.defaultTheme.token.motionUnit),i().createElement(t.ConfigProvider,{theme:m},i().createElement(T,null,i().createElement(x,null,i().createElement(S,{open:s,setOpen:f},y))))});C.displayName="CustomThemeProvider";var A=function(e){var t,n,r;function o(){var e,t,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),e=this,t=o,n=arguments,t=g(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,j()?Reflect.construct(t,n||[],g(e).constructor):t.apply(e,n))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(o,e),t=o,n=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,function(e){return t.app.use(C),t.app.pluginSettingsManager.add(u.A,{title:'{{t("Theme editor", {ns:"'.concat(u.A,'"})}}'),icon:"BgColorsOutlined",Component:_,aclSnippet:"pm.theme-editor.themes"}),t.app.addUserCenterSettingsItem({name:"theme",sort:310,Component:f}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function u(e){m(i,r,o,u,a,"next",e)}function a(e){m(i,r,o,u,a,"throw",e)}u(void 0)})})()}}],b(t.prototype,n),o}(O(e.Plugin)),q=A}(),y}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.6.0
|
|
11
|
+
"@nocobase/client": "1.6.0",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"antd": "5.12.8",
|
|
14
14
|
"lodash": "4.17.21",
|
|
15
|
-
"@nocobase/server": "1.6.0
|
|
15
|
+
"@nocobase/server": "1.6.0",
|
|
16
16
|
"@ant-design/cssinjs": "1.21.1",
|
|
17
|
-
"@ant-design/icons": "5.
|
|
18
|
-
"@nocobase/utils": "1.6.0
|
|
17
|
+
"@ant-design/icons": "5.6.1",
|
|
18
|
+
"@nocobase/utils": "1.6.0",
|
|
19
19
|
"react-i18next": "11.18.6",
|
|
20
|
-
"@nocobase/actions": "1.6.0
|
|
21
|
-
"@nocobase/database": "1.6.0
|
|
20
|
+
"@nocobase/actions": "1.6.0",
|
|
21
|
+
"@nocobase/database": "1.6.0",
|
|
22
22
|
"@emotion/css": "11.13.0"
|
|
23
23
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Theme": "Tema",
|
|
3
|
+
"Local": "Locale",
|
|
4
|
+
"Dark theme": "Tema scuro",
|
|
5
|
+
"Optional": "Opzionale",
|
|
6
|
+
"Non-optional": "Non opzionale",
|
|
7
|
+
"Current": "Corrente",
|
|
8
|
+
"Default": "Predefinito",
|
|
9
|
+
"Theme Editor": "Editor Tema",
|
|
10
|
+
"Save": "Salva",
|
|
11
|
+
"Close": "Chiudi",
|
|
12
|
+
"Edit": "Modifica",
|
|
13
|
+
"Export": "Esporta",
|
|
14
|
+
"edit Theme Config": "modifica Configurazione Tema",
|
|
15
|
+
"The theme of the JSON format is incorrect": "Il tema del formato JSON non è corretto",
|
|
16
|
+
"Edited successfully": "Modifica riuscita",
|
|
17
|
+
"Saved successfully": "Salvataggio riuscito",
|
|
18
|
+
"Initializing Editor...": "Inizializzazione Editor...",
|
|
19
|
+
"Save theme": "Salva tema",
|
|
20
|
+
"Please set a name for this theme": "Imposta un nome per questo tema",
|
|
21
|
+
"Please input the theme name": "Inserisci il nome del tema"
|
|
22
|
+
}
|
package/dist/server/plugin.js
CHANGED
|
@@ -44,7 +44,7 @@ class PluginThemeEditorServer extends import_server.Plugin {
|
|
|
44
44
|
this.app.acl.allow("users", "updateTheme", "loggedIn");
|
|
45
45
|
this.app.acl.allow("themeConfig", "list", "public");
|
|
46
46
|
this.app.acl.registerSnippet({
|
|
47
|
-
name: `pm.${this.name}.
|
|
47
|
+
name: `pm.${this.name}.themes`,
|
|
48
48
|
actions: ["themeConfig:*"]
|
|
49
49
|
});
|
|
50
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-theme-editor",
|
|
3
|
-
"version": "1.6.0
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"homepage": "https://docs.nocobase.com/handbook/theme-editor",
|
|
6
6
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/theme-editor",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@nocobase/test": "1.x",
|
|
33
33
|
"@nocobase/utils": "1.x"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "7422d72a4e515a11300860028a26030ed5732135",
|
|
36
36
|
"keywords": [
|
|
37
37
|
"System management"
|
|
38
38
|
]
|