2
0
mirror of https://github.com/smartxworks/sunmao-ui.git synced 2025-03-25 21:20:38 +08:00

1660 Commits

Author SHA1 Message Date
xzdry
d6aba768a3 refactor(arco/Tabs): remove placehoder
In some cases, tabs may not always have slots, so there is no need for placeholders here
2022-09-05 10:42:27 +08:00
xzdry
da5d342ef6 feat(arco/Table): add slot key 2022-09-05 09:31:07 +08:00
yz-yu
27bc77129e
Merge pull request from smartxworks/build/dyanmic-import
Optimize bundle size
2022-09-03 21:51:52 +08:00
tanbowensg
caf7eb2eeb
Merge pull request from smartxworks/feat/slot
add slot key
2022-09-01 15:49:01 +08:00
yz-yu
c5fbcdf9af
Merge pull request from smartxworks/feat/highlight-hover
feat(mask): highlight component in canvas when user hover it in tree
2022-09-01 15:36:06 +08:00
xzdry
1d6dc154fc feat(arco-lib/table): add default value 2022-09-01 13:17:29 +08:00
Bowen Tan
0bcfff673e feat(mask): highlight component in canvas when user hover it in tree 2022-09-01 10:22:25 +08:00
xzdry
9cb7ffcaad feat(arco-lib): add slot key 2022-09-01 09:58:50 +08:00
Bowen Tan
8e2a7d580f Merge branch 'develop' into build/dyanmic-import
* develop:
  fix(ValidationTrait): don't clear existing errors
  fix(StateManager): fix the can't deep eval the nest array issues
  feat(runtime): add style for ErrorBoundary
  feat(runtime): add ErrorBoundary to ImplWrapper
  refactor(runtime): refactor utilMethodFactory type
  refactor(runtime): add slot receiver to app services
  refactor(runtime): temporary hack the list component with the new slot system
  refactor(runtime): remove slot props from event trait
  perf(runtime): implement slot receiver to avoid of re-render when passing fallback elements
  perf(runtime): refactor the slot's props and fallback implementation
  fix(SpaceWidget): fix padding display misalignment
  fix: fix selecting component would change the properties' values issue
  refactor: remove the shared package from core
  fix: fix the `exampleProperties` type errors

# Conflicts:
#	packages/chakra-ui-lib/src/index.ts
2022-08-31 14:09:21 +08:00
tanbowensg
83173e85bd
Merge pull request from smartxworks/fix/windlike-dev
fix(ValidationTrait): don't clear existing errors
2022-08-31 14:05:55 +08:00
tanbowensg
064d8d7031
Merge pull request from smartxworks/refactor/util-method
refactor(runtime): refactor utilMethodFactory type
2022-08-30 16:24:08 +08:00
MrWindlike
d9cc0aaf6b fix(ValidationTrait): don't clear existing errors 2022-08-30 11:43:54 +08:00
yz-yu
e05407f653
Merge pull request from smartxworks/feat/runtime-error-boundary
feat(runtime): add ErrorBoundary to ImplWrapper
2022-08-26 13:01:22 +08:00
yz-yu
a17f92aaa3
Merge pull request from smartxworks/fix/windlike-dev
fix(StateManager): fix the can't deep eval the nest array issues
2022-08-26 13:01:04 +08:00
MrWindlike
c72e29b467 fix(StateManager): fix the can't deep eval the nest array issues 2022-08-26 11:38:19 +08:00
Bowen Tan
7ea0acea20 feat(runtime): add style for ErrorBoundary 2022-08-25 11:02:49 +08:00
Bowen Tan
5d2a64f575 feat(runtime): add ErrorBoundary to ImplWrapper 2022-08-25 10:48:04 +08:00
Bowen Tan
81c6d03b54 refactor(runtime): refactor utilMethodFactory type 2022-08-24 14:42:15 +08:00
tanbowensg
dcd7dd6424
Merge pull request from smartxworks/slot-fallback
use the new data path to pass slot props and fallback elements
2022-08-23 18:28:58 +08:00
Bowen Tan
bcc5b2fd7b build(ci.yml): upgrade node version in ci 2022-08-23 17:09:17 +08:00
Bowen Tan
6d06bb8514 refactor(*): beautify code 2022-08-23 15:22:02 +08:00
Bowen Tan
373cfb9ba9 refactor(editor): replace codemirror with react-codemirror2 2022-08-23 13:56:44 +08:00
Yanzhen Yu
5b01477c62 refactor(runtime): add slot receiver to app services 2022-08-23 10:41:04 +08:00
Yanzhen Yu
1c505334c7 refactor(runtime): temporary hack the list component with the new slot system 2022-08-23 10:28:08 +08:00
Yanzhen Yu
b1012217ee refactor(runtime): remove slot props from event trait 2022-08-23 10:28:08 +08:00
Yanzhen Yu
ef2669992f perf(runtime): implement slot receiver to avoid of re-render when passing fallback elements
The slot receiver is a magic hole of sunmao's runtime.
In sunmao, we support pass props and fallback elements to a slot.
But if we pass them as React component's props,
it will cause re-render since most of them could not use a shallow equal checker.

Also, in sunmao's runtime, we are not using a traditional React render mechanism.
Instead, we keep most of the components not be rendered and only subscribe to related state updates.

To continue with our design,
we need a way to render slot's fallback elements without passing the elements as props.
This is where the slot receiver comes.
It contains a map and an event emitter, when a slot need render,
it will attach the fallback elements to the map and send a signal via the emitter.
When the Receiver component receive a signal, it will force render the fallback elements.

related: 
2022-08-23 10:28:06 +08:00
Yanzhen Yu
b5df69f21c perf(runtime): refactor the slot's props and fallback implementation
The main idea of this patch is to set slot props to a reactive store
instead of passing them as React props to the slot children elements.

Same as other state management in sunmao, the component will subscribe
to the slot store to get the latest value of slot props.

Same as component id, we need a way to identify every slot props in the store.
So we add a new parameter key to the `getSlot` function,
where [component id, slot name, key] will be a unique identifier.

Another challenge is to subscribe the slot store in a efficient way.
Currently we are using vue's reactivity system, which need set `deep: true`
to observe multiple value during effect.

By setting `deep: true`, if we write code like `const $slot = slotStore[slotKey]`,
it will subscribe all the sub-fields of this slot key be cause we 'access' the property.

The solution is to implement a redirector Proxy.
With the redirector, expression `$slot.a.b` will be redirect to `slotStore[slotKey].a.b`.

related to: 
2022-08-23 10:26:18 +08:00
Bowen Tan
ab60a14972 build(expressionEditor): dynamic import expression editor 2022-08-19 16:35:30 +08:00
Bowen Tan
42f965bf4d build(vite-plugins): add type
fix(hh): hhhh
2022-08-19 15:56:35 +08:00
Bowen Tan
8155525ee8 build(runtime): refactor runtime build 2022-08-19 15:55:59 +08:00
Bowen Tan
b2fb394031 build(dyamic-import): make some editor files dynamic import 2022-08-19 14:02:58 +08:00
tanbowensg
dd5aae9932
Merge pull request from smartxworks/fix/dry
fix(SpaceWidget): fix padding display misalignment
2022-08-19 11:14:17 +08:00
Bowen Tan
1a084e115d build(dynamic-import): editor-sdk dynamic import succussfully 2022-08-18 16:28:05 +08:00
Bowen Tan
5dcde6c377 build(dynamic-import): dynamic import component success 2022-08-17 17:57:44 +08:00
xzdry
cd71cf74d2 fix(SpaceWidget): fix padding display misalignment 2022-08-17 17:50:40 +08:00
tanbowensg
bd451fec39
Merge pull request from smartxworks/fix/windlike-dev
fix: fix selecting component would change the properties' values issue
2022-08-17 10:30:42 +08:00
MrWindlike
a3f0c24e48 fix: fix selecting component would change the properties' values issue 2022-08-17 10:09:24 +08:00
tanbowensg
87074162c9
Merge pull request from smartxworks/fix/windlike-dev
fix: fix the `exampleProperties` type errors
2022-08-16 15:39:06 +08:00
MrWindlike
c718e0ca22 refactor: remove the shared package from core 2022-08-16 14:53:41 +08:00
Bowen Tan
e76b1571a6 Merge branch 'develop' into build/visualize
* develop:
  refactor(runtime): remove full import of lodash
  fix: fix clicking outside can't close the popover widget
  fix(PopoverWidget): compatible with the React 16
  feat(Select): add title to select option
  fix(stateManager): don't console.error expression errors by default
  feat(booleanWidget): auto convert non-boolean value to boolean
  feat(numberWidget): auto convert non-number value to number
  feat(expressionWidget): don't auto convert string to other type
  feat(stateManager): don't auto convert string to number or boolean
  feat(ArrayWidget): arrayWidget will try to eval value before render it

# Conflicts:
#	yarn.lock
2022-08-16 14:50:27 +08:00
yz-yu
3094e7e90c
Merge pull request from smartxworks/build/lodash
refactor(runtime): remove full import of lodash
2022-08-16 11:57:51 +08:00
MrWindlike
5216fd1e3c fix: fix the exampleProperties type errors 2022-08-16 11:52:16 +08:00
Bowen Tan
d272576087 build(chakra): split chakra widgets and lib 2022-08-16 10:49:17 +08:00
Bowen Tan
789058e1e3 refactor(runtime): remove full import of lodash 2022-08-15 18:30:04 +08:00
yz-yu
1ecbb7ff64
Merge pull request from smartxworks/fix/windlike-dev
fix: fix clicking outside can't close the popover widget
2022-08-12 10:57:40 +08:00
Bowen Tan
2f0ff46278 build(arco): split arco's lib and widgets 2022-08-12 10:49:47 +08:00
MrWindlike
08bec57287 fix: fix clicking outside can't close the popover widget
when clicking the outside node which would stop propagation, it can't close the popover widget
2022-08-11 10:28:00 +08:00
Bowen Tan
adf789811b build(visualize): add visualize 2022-08-10 11:08:46 +08:00
tanbowensg
dc9c921838
Merge pull request from smartxworks/arco/select
feat(Select): add title to select option
2022-08-10 10:33:59 +08:00
yz-yu
97ee05f0fd
Merge pull request from smartxworks/fix/windlike-dev
fix(PopoverWidget): compatible with the React 16
2022-08-09 09:50:51 +08:00