@nocobase/plugin-theme-editor 1.6.0-beta.1 → 1.6.0-beta.10

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: October 15, 2024
1
+ Updated Date: February 20, 2025
2
2
 
3
3
  NocoBase License Agreement
4
4
 
@@ -78,7 +78,7 @@ Except for Third-Party Open Source Software, the Company owns all copyrights, tr
78
78
 
79
79
  6.1 Obtain a permanent commercial license of the Software.
80
80
 
81
- 6.2 Get 12 months of upgrade and exclusive technical support.
81
+ 6.2 Get software upgrades and exclusive technical support during the upgrade validity period.
82
82
 
83
83
  6.3 The licensed Software can be used for commercial purposes with no restrictions on the number of applications and users.
84
84
 
@@ -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 a Professional or Enterprise Edition License can sell Upper Layer Application to their clients.
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,13 +106,15 @@ 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 with a Standard Edition license to sell Upper Layer Application to clients without a Commercial license.
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 to publicly sell plugins developed for Software outside of the Marketplace.
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
- 7.7 If there is a violation of the above obligations or the terms of this Agreement, the rights owned by the User will be immediately terminated, the paid fees will not be refunded, and the Company reserves the right to pursue the User's legal responsibility.
113
+ 7.7 It is not allowed to publicly sell plugins developed for Software outside of the Marketplace.
114
114
 
115
- 7.8 If there are other agreements in the contract for the above obligations, the contract agreement shall prevail.
115
+ 7.8 If there is a violation of the above obligations or the terms of this Agreement, the rights owned by the User will be immediately terminated, the paid fees will not be refunded, and the Company reserves the right to pursue the User's legal responsibility.
116
+
117
+ 7.9 If there are other agreements in the contract for the above obligations, the contract agreement shall prevail.
116
118
 
117
119
  ======================================
118
120
  8. Rights of Commercial Plugin License
@@ -120,11 +122,11 @@ Except for Third-Party Open Source Software, the Company owns all copyrights, tr
120
122
 
121
123
  8.1 Obtain a permanent Commercial Plugin License for the Commercial Plugin.
122
124
 
123
- 8.2 Receive 12 months of upgrades and exclusive technical support.
125
+ 8.2 Get plugins upgrades and exclusive technical support during the upgrade validity period.
124
126
 
125
127
  8.3 Can be used for commercial purposes without restrictions on the number of applications or users.
126
128
 
127
- 8.4 The User with a Professional or Enterprise Edition License can use the Commercial Plugin in Upper Layer Applications sold to their customers.
129
+ 8.4 The User with an Enterprise Edition License can use the Commercial Plugin in Upper Layer Applications sold to their customers.
128
130
 
129
131
  8.5 Not restricted by the AGPL-3.0 agreement.
130
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;
@@ -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("@nocobase/utils/client"),require("@nocobase/client"),require("antd"),require("lodash"),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","antd","lodash","@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("antd"),require("lodash"),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.antd,e.lodash,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=r},467:function(e){"use strict";e.exports=o},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("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 S=(0,e.lazy)(function(){return d("imported_-1bkn1ue_component",Promise.resolve().then(v.bind(v,7012)))}),x=(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(S,null,i().createElement(x,{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}()});
@@ -8,16 +8,16 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.6.0-beta.1",
11
+ "@nocobase/client": "1.6.0-beta.10",
12
12
  "react": "18.2.0",
13
13
  "antd": "5.12.8",
14
14
  "lodash": "4.17.21",
15
- "@nocobase/server": "1.6.0-beta.1",
15
+ "@nocobase/server": "1.6.0-beta.10",
16
16
  "@ant-design/cssinjs": "1.21.1",
17
17
  "@ant-design/icons": "5.2.6",
18
- "@nocobase/utils": "1.6.0-beta.1",
18
+ "@nocobase/utils": "1.6.0-beta.10",
19
19
  "react-i18next": "11.18.6",
20
- "@nocobase/actions": "1.6.0-beta.1",
21
- "@nocobase/database": "1.6.0-beta.1",
20
+ "@nocobase/actions": "1.6.0-beta.10",
21
+ "@nocobase/database": "1.6.0-beta.10",
22
22
  "@emotion/css": "11.13.0"
23
23
  };
@@ -33,6 +33,7 @@ var import_database = require("@nocobase/database");
33
33
  var theme_config_default = (0, import_database.defineCollection)({
34
34
  name: "themeConfig",
35
35
  dumpRules: "required",
36
+ migrationRules: ["overwrite", "schema-only"],
36
37
  fields: [
37
38
  // 主题配置内容,一个 JSON 字符串
38
39
  {
@@ -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}.themeConfig`,
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-beta.1",
3
+ "version": "1.6.0-beta.10",
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": "69a79d1ed9660beb14ee956ec634f0c6d142acfa",
35
+ "gitHead": "72684ad7261e46b67969ecc4db0f1bcbea545a8d",
36
36
  "keywords": [
37
37
  "System management"
38
38
  ]