@nocobase/app 1.5.0-beta.1 → 1.6.0-alpha.2

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/client/.umirc.ts CHANGED
@@ -80,5 +80,6 @@ export default defineConfig({
80
80
  }
81
81
  return config;
82
82
  },
83
+ extraBabelPlugins: ['react-imported-component/babel'],
83
84
  routes: [{ path: '/*', component: 'index' }],
84
85
  });
@@ -50,6 +50,7 @@ export function TestBrowser(props: TestBrowserProps) {
50
50
  routeComponents,
51
51
  pluginManager,
52
52
  rootElement: contextOpts.rootElement || document.getElementById('root'),
53
+ loadingComponent: Loading,
53
54
  publicPath,
54
55
  runtimePublicPath,
55
56
  history,
@@ -7,6 +7,7 @@ import { renderClient } from '/__w/nocobase/nocobase/node_modules/@umijs/rendere
7
7
  import { getRoutes } from './core/route';
8
8
  import { createPluginManager } from './core/plugin';
9
9
  import { createHistory } from './core/history';
10
+ import Loading from '/__w/nocobase/nocobase/packages/core/app/client/src/loading.tsx';
10
11
  import { ApplyPluginsType } from 'umi';
11
12
 
12
13
 
@@ -51,6 +52,7 @@ async function render() {
51
52
  routeComponents,
52
53
  pluginManager,
53
54
  rootElement: contextOpts.rootElement || document.getElementById('root'),
55
+ loadingComponent: Loading,
54
56
  publicPath,
55
57
  runtimePublicPath,
56
58
  history,
@@ -0,0 +1,25 @@
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
+
10
+ import React from 'react';
11
+ import { Spin } from 'antd';
12
+
13
+ export default function Loading() {
14
+ return (
15
+ <Spin
16
+ style={{
17
+ width: '100vw',
18
+ height: '100vh',
19
+ display: 'flex',
20
+ justifyContent: 'center',
21
+ alignItems: 'center',
22
+ }}
23
+ />
24
+ );
25
+ }
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[1167],{71167:function(C,D,g){var _=this&&this.__extends||function(){var r=function(n,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var i in o)o.hasOwnProperty(i)&&(e[i]=o[i])},r(n,t)};return function(n,t){r(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),v=this&&this.__assign||function(){return v=Object.assign||function(r){for(var n,t=1,e=arguments.length;t<e;t++){n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},v.apply(this,arguments)},b=this&&this.__spreadArrays||function(){for(var r=0,n=0,t=arguments.length;n<t;n++)r+=arguments[n].length;for(var e=Array(r),o=0,n=0;n<t;n++)for(var i=arguments[n],s=0,a=i.length;s<a;s++,o++)e[o]=i[s];return e},y=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},d=y(g(67294)),w=y(g(73935)),c=y(g(18446)),E=y(g(76095)),S=function(r){_(n,r);function n(t){var e=r.call(this,t)||this;e.dirtyProps=["modules","formats","bounds","theme","children"],e.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],e.state={generation:0},e.selection=null,e.onEditorChange=function(i,s,a,l){var h,u,p,f;i==="text-change"?(u=(h=e).onEditorChangeText)===null||u===void 0||u.call(h,e.editor.root.innerHTML,s,l,e.unprivilegedEditor):i==="selection-change"&&((f=(p=e).onEditorChangeSelection)===null||f===void 0||f.call(p,s,l,e.unprivilegedEditor))};var o=e.isControlled()?t.value:t.defaultValue;return e.value=o??"",e}return n.prototype.validateProps=function(t){var e;if(d.default.Children.count(t.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(d.default.Children.count(t.children)){var o=d.default.Children.only(t.children);if(((e=o)===null||e===void 0?void 0:e.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&t.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")},n.prototype.shouldComponentUpdate=function(t,e){var o=this,i;if(this.validateProps(t),!this.editor||this.state.generation!==e.generation)return!0;if("value"in t){var s=this.getEditorContents(),a=(i=t.value,i??"");this.isEqualValue(a,s)||this.setEditorContents(this.editor,a)}return t.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,t.readOnly),b(this.cleanProps,this.dirtyProps).some(function(l){return!c.default(t[l],o.props[l])})},n.prototype.shouldComponentRegenerate=function(t){var e=this;return this.dirtyProps.some(function(o){return!c.default(t[o],e.props[o])})},n.prototype.componentDidMount=function(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())},n.prototype.componentWillUnmount=function(){this.destroyEditor()},n.prototype.componentDidUpdate=function(t,e){var o=this;if(this.editor&&this.shouldComponentRegenerate(t)){var i=this.editor.getContents(),s=this.editor.getSelection();this.regenerationSnapshot={delta:i,selection:s},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==e.generation){var a=this.regenerationSnapshot,i=a.delta,l=a.selection;delete this.regenerationSnapshot,this.instantiateEditor();var h=this.editor;h.setContents(i),m(function(){return o.setEditorSelection(h,l)})}},n.prototype.instantiateEditor=function(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())},n.prototype.destroyEditor=function(){this.editor&&this.unhookEditor(this.editor)},n.prototype.isControlled=function(){return"value"in this.props},n.prototype.getEditorConfig=function(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,scrollingContainer:this.props.scrollingContainer,tabIndex:this.props.tabIndex,theme:this.props.theme}},n.prototype.getEditor=function(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor},n.prototype.createEditor=function(t,e){var o=new E.default(t,e);return e.tabIndex!=null&&this.setEditorTabIndex(o,e.tabIndex),this.hookEditor(o),o},n.prototype.hookEditor=function(t){this.unprivilegedEditor=this.makeUnprivilegedEditor(t),t.on("editor-change",this.onEditorChange)},n.prototype.unhookEditor=function(t){t.off("editor-change",this.onEditorChange)},n.prototype.getEditorContents=function(){return this.value},n.prototype.getEditorSelection=function(){return this.selection},n.prototype.isDelta=function(t){return t&&t.ops},n.prototype.isEqualValue=function(t,e){return this.isDelta(t)&&this.isDelta(e)?c.default(t.ops,e.ops):c.default(t,e)},n.prototype.setEditorContents=function(t,e){var o=this;this.value=e;var i=this.getEditorSelection();typeof e=="string"?t.setContents(t.clipboard.convert(e)):t.setContents(e),m(function(){return o.setEditorSelection(t,i)})},n.prototype.setEditorSelection=function(t,e){if(this.selection=e,e){var o=t.getLength();e.index=Math.max(0,Math.min(e.index,o-1)),e.length=Math.max(0,Math.min(e.length,o-1-e.index)),t.setSelection(e)}},n.prototype.setEditorTabIndex=function(t,e){var o,i;!((i=(o=t)===null||o===void 0?void 0:o.scroll)===null||i===void 0)&&i.domNode&&(t.scroll.domNode.tabIndex=e)},n.prototype.setEditorReadOnly=function(t,e){e?t.disable():t.enable()},n.prototype.makeUnprivilegedEditor=function(t){var e=t;return{getHTML:function(){return e.root.innerHTML},getLength:e.getLength.bind(e),getText:e.getText.bind(e),getContents:e.getContents.bind(e),getSelection:e.getSelection.bind(e),getBounds:e.getBounds.bind(e)}},n.prototype.getEditingArea=function(){if(!this.editingArea)throw new Error("Instantiating on missing editing area");var t=w.default.findDOMNode(this.editingArea);if(!t)throw new Error("Cannot find element for editing area");if(t.nodeType===3)throw new Error("Editing area cannot be a text node");return t},n.prototype.renderEditingArea=function(){var t=this,e=this.props,o=e.children,i=e.preserveWhitespace,s=this.state.generation,a={key:s,ref:function(l){t.editingArea=l}};return d.default.Children.count(o)?d.default.cloneElement(d.default.Children.only(o),a):i?d.default.createElement("pre",v({},a)):d.default.createElement("div",v({},a))},n.prototype.render=function(){var t;return d.default.createElement("div",{id:this.props.id,style:this.props.style,key:this.state.generation,className:"quill "+(t=this.props.className,t??""),onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())},n.prototype.onEditorChangeText=function(t,e,o,i){var s,a;if(this.editor){var l=this.isDelta(this.value)?i.getContents():i.getHTML();l!==this.getEditorContents()&&(this.lastDeltaChangeSet=e,this.value=l,(a=(s=this.props).onChange)===null||a===void 0||a.call(s,t,e,o,i))}},n.prototype.onEditorChangeSelection=function(t,e,o){var i,s,a,l,h,u;if(this.editor){var p=this.getEditorSelection(),f=!p&&t,O=p&&!t;c.default(t,p)||(this.selection=t,(s=(i=this.props).onChangeSelection)===null||s===void 0||s.call(i,t,e,o),f?(l=(a=this.props).onFocus)===null||l===void 0||l.call(a,t,e,o):O&&((u=(h=this.props).onBlur)===null||u===void 0||u.call(h,p,e,o)))}},n.prototype.focus=function(){this.editor&&this.editor.focus()},n.prototype.blur=function(){this.editor&&(this.selection=null,this.editor.blur())},n.displayName="React Quill",n.Quill=E.default,n.defaultProps={theme:"snow",modules:{},readOnly:!1},n}(d.default.Component);function m(r){Promise.resolve().then(r)}C.exports=S}}]);