@lowdefy/client 4.0.0-alpha.29 → 4.0.0-alpha.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Client.js ADDED
@@ -0,0 +1,68 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import React from 'react';
16
+ import Block from './block/Block.js';
17
+ import Context from './Context.js';
18
+ import DisplayMessage from './DisplayMessage.js';
19
+ import Head from './Head.js';
20
+ import ProgressBarController from './ProgressBarController.js';
21
+ import initLowdefyContext from './initLowdefyContext.js';
22
+ const Client = ({ auth , Components , config , resetContext ={
23
+ reset: false,
24
+ setReset: ()=>undefined
25
+ } , router , stage , types , window , })=>{
26
+ const lowdefy = initLowdefyContext({
27
+ auth,
28
+ Components,
29
+ config,
30
+ router,
31
+ stage,
32
+ types,
33
+ window
34
+ });
35
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(ProgressBarController, {
36
+ id: "lowdefy-progress-bar",
37
+ key: `${config.pageConfig.id}-progress-bar`,
38
+ lowdefy: lowdefy,
39
+ resetContext: resetContext
40
+ }), /*#__PURE__*/ React.createElement(DisplayMessage, {
41
+ id: "lowdefy-display-message",
42
+ key: `${config.pageConfig.id}-display-message`,
43
+ Component: lowdefy._internal.blockComponents.Message,
44
+ methods: {
45
+ registerMethod: (_, method)=>{
46
+ lowdefy._internal.displayMessage = method;
47
+ }
48
+ }
49
+ }), /*#__PURE__*/ React.createElement(Context, {
50
+ key: config.pageConfig.id,
51
+ config: config.pageConfig,
52
+ lowdefy: lowdefy,
53
+ resetContext: resetContext
54
+ }, (context)=>{
55
+ if (!context._internal.onInitDone) return '';
56
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Head, {
57
+ Component: Components.Head,
58
+ properties: context._internal.RootBlocks.map[config.pageConfig.blockId].eval.properties
59
+ }), /*#__PURE__*/ React.createElement(Block, {
60
+ block: context._internal.RootBlocks.map[config.pageConfig.blockId],
61
+ Blocks: context._internal.RootBlocks,
62
+ context: context,
63
+ lowdefy: lowdefy,
64
+ parentLoading: false
65
+ }));
66
+ }));
67
+ };
68
+ export default Client;
@@ -0,0 +1,45 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import React from 'react';
16
+ import getContext from '@lowdefy/engine';
17
+ import MountEvents from './MountEvents.js';
18
+ const Context = ({ children , config , lowdefy , resetContext })=>{
19
+ const context = getContext({
20
+ config,
21
+ lowdefy,
22
+ resetContext
23
+ });
24
+ return /*#__PURE__*/ React.createElement(MountEvents, {
25
+ context: context,
26
+ triggerEvent: async ()=>{
27
+ await context._internal.runOnInit(()=>{
28
+ lowdefy._internal.progress.dispatch({
29
+ type: 'increment'
30
+ });
31
+ });
32
+ },
33
+ triggerEventAsync: ()=>{
34
+ context._internal.runOnInitAsync(()=>{
35
+ lowdefy._internal.progress.dispatch({
36
+ type: 'increment'
37
+ });
38
+ });
39
+ }
40
+ }, (loadingOnInit)=>{
41
+ if (loadingOnInit) return '';
42
+ return children(context);
43
+ });
44
+ };
45
+ export default Context;
@@ -0,0 +1,29 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import React from 'react';
16
+ import { makeCssClass } from '@lowdefy/block-utils';
17
+ const DisplayMessage = ({ Component , id , methods })=>{
18
+ return /*#__PURE__*/ React.createElement(Component, {
19
+ blockId: id,
20
+ key: id,
21
+ methods: {
22
+ makeCssClass,
23
+ registerMethod: methods.registerMethod,
24
+ triggerEvent: ()=>undefined
25
+ },
26
+ properties: {}
27
+ });
28
+ };
29
+ export default DisplayMessage;
@@ -0,0 +1,52 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import React, { Component } from 'react';
16
+ import ErrorPage from './ErrorPage.js';
17
+ let ErrorBoundary = class ErrorBoundary extends Component {
18
+ static getDerivedStateFromError(error) {
19
+ return {
20
+ hasError: true,
21
+ error
22
+ };
23
+ }
24
+ render() {
25
+ const { children , description , fallback , fullPage , message , name } = this.props;
26
+ const { hasError , error } = this.state;
27
+ if (hasError) {
28
+ if (fallback) {
29
+ return fallback(error);
30
+ }
31
+ if (fullPage) {
32
+ return /*#__PURE__*/ React.createElement(ErrorPage, {
33
+ code: error.number,
34
+ description: description || error.description,
35
+ message: message || error.message,
36
+ name: name || error.name
37
+ });
38
+ }
39
+ // Throw to console but fail silently to user?
40
+ return '';
41
+ }
42
+ return children;
43
+ }
44
+ constructor(props){
45
+ super(props);
46
+ this.state = {
47
+ hasError: false,
48
+ error: null
49
+ };
50
+ }
51
+ };
52
+ export default ErrorBoundary;
@@ -0,0 +1,60 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import React from 'react';
16
+ const ErrorPage = ({ code , description , message , name })=>/*#__PURE__*/ React.createElement("div", {
17
+ style: {
18
+ height: '100%',
19
+ fontFamily: 'system-ui',
20
+ margin: 0,
21
+ display: 'flex',
22
+ justifyContent: 'center',
23
+ alignItems: 'center'
24
+ }
25
+ }, /*#__PURE__*/ React.createElement("div", {
26
+ style: {
27
+ flex: '0 1 auto',
28
+ fontSize: '4.3em',
29
+ fontWeight: '100',
30
+ paddingRight: 30
31
+ }
32
+ }, code || 500), /*#__PURE__*/ React.createElement("div", {
33
+ style: {
34
+ flex: '0 1 auto',
35
+ paddingLeft: 30,
36
+ maxWidth: 400,
37
+ borderLeft: '1px solid #aeaeae'
38
+ }
39
+ }, /*#__PURE__*/ React.createElement("div", {
40
+ style: {
41
+ fontSize: '1.3em',
42
+ fontWeight: '300',
43
+ paddingBottom: 10
44
+ }
45
+ }, name || 'Error'), /*#__PURE__*/ React.createElement("div", {
46
+ style: {
47
+ fontSize: '0.9em'
48
+ }
49
+ }, message || 'An error has occurred.'), /*#__PURE__*/ React.createElement("div", {
50
+ style: {
51
+ fontSize: '0.9em'
52
+ }
53
+ }, description), /*#__PURE__*/ React.createElement("div", {
54
+ style: {
55
+ paddingTop: 20
56
+ }
57
+ }, /*#__PURE__*/ React.createElement("a", {
58
+ href: "/"
59
+ }, "Return to home page"))));
60
+ export default ErrorPage;
package/dist/Head.js ADDED
@@ -0,0 +1,19 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import React from 'react';
16
+ const BindHead = ({ Component , properties })=>{
17
+ return /*#__PURE__*/ React.createElement(Component, null, /*#__PURE__*/ React.createElement("title", null, properties.title));
18
+ };
19
+ export default BindHead;
@@ -0,0 +1,37 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import React, { useEffect, useState } from 'react';
16
+ const MountEvents = ({ children , context , triggerEvent , triggerEventAsync })=>{
17
+ const [loading, setLoading] = useState(true);
18
+ const [error, setError] = useState(null);
19
+ useEffect(()=>{
20
+ setLoading(true);
21
+ const mount = async ()=>{
22
+ try {
23
+ await triggerEvent();
24
+ triggerEventAsync();
25
+ setLoading(false);
26
+ } catch (err) {
27
+ setError(err);
28
+ }
29
+ };
30
+ mount();
31
+ }, [
32
+ context
33
+ ]);
34
+ if (error) throw error;
35
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, children(loading));
36
+ };
37
+ export default MountEvents;
@@ -0,0 +1,82 @@
1
+ /*
2
+ Copyright 2020-2021 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import React, { useReducer, useEffect } from 'react';
16
+ import { makeCssClass } from '@lowdefy/block-utils';
17
+ const initialState = {
18
+ progress: 0,
19
+ onMounts: 0
20
+ };
21
+ function reducer(state, action) {
22
+ switch(action.type){
23
+ case 'increment':
24
+ return {
25
+ ...state,
26
+ progress: state.progress + (100 - state.progress) / 3
27
+ };
28
+ case 'increment-on-mount':
29
+ return {
30
+ ...state,
31
+ onMounts: state.onMounts + 1
32
+ };
33
+ case 'auto-increment':
34
+ return {
35
+ ...state,
36
+ progress: state.progress + (100 - state.progress) / 200
37
+ };
38
+ case 'done':
39
+ return {
40
+ progress: state.onMounts - 1 === 0 ? 100 : state.progress,
41
+ onMounts: state.onMounts - 1
42
+ };
43
+ case 'reset':
44
+ return {
45
+ progress: 0,
46
+ onMounts: 0
47
+ };
48
+ default:
49
+ throw new Error('Invalid action type for ProgressBarController reducer.');
50
+ }
51
+ }
52
+ const ProgressBarController = ({ id , lowdefy , resetContext })=>{
53
+ const [state, dispatch] = useReducer(reducer, initialState);
54
+ const ProgressBar = lowdefy._internal.blockComponents.ProgressBar;
55
+ lowdefy._internal.progress.state = state;
56
+ lowdefy._internal.progress.dispatch = dispatch;
57
+ useEffect(()=>{
58
+ const timer = state.progress < 95 && setInterval(()=>dispatch({
59
+ type: 'auto-increment'
60
+ }), 500);
61
+ return ()=>clearInterval(timer);
62
+ }, [
63
+ state
64
+ ]);
65
+ if (resetContext.reset && state.progress === 100) {
66
+ dispatch({
67
+ type: 'reset'
68
+ });
69
+ }
70
+ return /*#__PURE__*/ React.createElement(ProgressBar, {
71
+ basePath: lowdefy.basePath,
72
+ blockId: id,
73
+ components: lowdefy._internal.components,
74
+ menus: lowdefy.menus,
75
+ methods: {
76
+ makeCssClass
77
+ },
78
+ pageId: lowdefy.pageId,
79
+ properties: state
80
+ });
81
+ };
82
+ export default ProgressBarController;
@@ -0,0 +1,66 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import { type, urlQuery as urlQueryFn } from '@lowdefy/helpers';
16
+ function getCallbackUrl({ lowdefy , callbackUrl ={} }) {
17
+ const { home , pageId , urlQuery , url } = callbackUrl;
18
+ if ([
19
+ !home,
20
+ !pageId,
21
+ !url
22
+ ].filter((v)=>!v).length > 1) {
23
+ throw Error(`Invalid Link: To avoid ambiguity, only one of 'home', 'pageId' or 'url' can be defined.`);
24
+ }
25
+ const query = type.isNone(urlQuery) ? '' : `${urlQueryFn.stringify(urlQuery)}`;
26
+ if (home === true) {
27
+ return `/${lowdefy.home.configured ? '' : lowdefy.home.pageId}${query ? `?${query}` : ''}`;
28
+ }
29
+ if (type.isString(pageId)) {
30
+ return `/${pageId}${query ? `?${query}` : ''}`;
31
+ }
32
+ if (type.isString(url)) {
33
+ return `${url}${query ? `?${query}` : ''}`;
34
+ }
35
+ return undefined;
36
+ }
37
+ function createAuthMethods({ lowdefy , auth }) {
38
+ // login and logout are Lowdefy function that handle action params
39
+ // signIn and signOut are the next-auth methods
40
+ function login({ authUrl , callbackUrl , providerId , ...rest } = {}) {
41
+ if (type.isNone(providerId) && auth.authConfig.providers.length === 1) {
42
+ providerId = auth.authConfig.providers[0].id;
43
+ }
44
+ auth.signIn(providerId, {
45
+ ...rest,
46
+ callbackUrl: getCallbackUrl({
47
+ lowdefy,
48
+ callbackUrl
49
+ })
50
+ }, authUrl?.urlQuery);
51
+ }
52
+ function logout({ callbackUrl , redirect } = {}) {
53
+ auth.signOut({
54
+ callbackUrl: getCallbackUrl({
55
+ lowdefy,
56
+ callbackUrl
57
+ }),
58
+ redirect
59
+ });
60
+ }
61
+ return {
62
+ login,
63
+ logout
64
+ };
65
+ }
66
+ export default createAuthMethods;
@@ -0,0 +1,60 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import React, { useState } from 'react';
16
+ import CategorySwitch from './CategorySwitch.js';
17
+ import ErrorBoundary from '../ErrorBoundary.js';
18
+ import MountEvents from '../MountEvents.js';
19
+ const Block = ({ block , Blocks , context , lowdefy , parentLoading })=>{
20
+ const [updates, setUpdate] = useState(0);
21
+ lowdefy._internal.updaters[block.id] = ()=>setUpdate(updates + 1);
22
+ return /*#__PURE__*/ React.createElement(ErrorBoundary, null, /*#__PURE__*/ React.createElement(MountEvents, {
23
+ context: context,
24
+ triggerEvent: async ()=>{
25
+ context._internal.lowdefy._internal.progress.dispatch({
26
+ type: 'increment-on-mount',
27
+ id: block.id
28
+ });
29
+ await block.triggerEvent({
30
+ name: 'onMount',
31
+ progress: ()=>{
32
+ lowdefy._internal.progress.dispatch({
33
+ type: 'increment'
34
+ });
35
+ }
36
+ });
37
+ },
38
+ triggerEventAsync: ()=>{
39
+ block.triggerEvent({
40
+ name: 'onMountAsync',
41
+ progress: ()=>{
42
+ lowdefy._internal.progress.dispatch({
43
+ type: 'increment'
44
+ });
45
+ }
46
+ });
47
+ lowdefy._internal.progress.dispatch({
48
+ type: 'done'
49
+ });
50
+ }
51
+ }, (eventLoading)=>/*#__PURE__*/ React.createElement(CategorySwitch, {
52
+ block: block,
53
+ Blocks: Blocks,
54
+ context: context,
55
+ loading: eventLoading || parentLoading || block.eval.loading,
56
+ lowdefy: lowdefy,
57
+ updates: updates
58
+ })));
59
+ };
60
+ export default Block;
@@ -0,0 +1,116 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import React from 'react';
16
+ import { BlockLayout } from '@lowdefy/layout';
17
+ import { makeCssClass } from '@lowdefy/block-utils';
18
+ import { type } from '@lowdefy/helpers';
19
+ import Container from './Container.js';
20
+ import List from './List.js';
21
+ import LoadingBlock from './LoadingBlock.js';
22
+ const CategorySwitch = ({ block , Blocks , context , loading , lowdefy })=>{
23
+ if (!block.eval) return null; // TODO: check Renderer updates before eval is executed for the first time on lists. See #520
24
+ if (block.eval.visible === false) return /*#__PURE__*/ React.createElement("div", {
25
+ id: `vs-${block.blockId}`,
26
+ style: {
27
+ display: 'none'
28
+ }
29
+ });
30
+ const Component = lowdefy._internal.blockComponents[block.type];
31
+ if (loading && type.isObject(block.eval.skeleton)) {
32
+ return /*#__PURE__*/ React.createElement(LoadingBlock, {
33
+ blockLayout: block.eval.layout,
34
+ blockProperties: block.eval.properties,
35
+ blockStyle: block.eval.style,
36
+ context: context,
37
+ lowdefy: lowdefy,
38
+ skeleton: block.eval.skeleton
39
+ });
40
+ }
41
+ switch(Component.meta.category){
42
+ case 'list':
43
+ return /*#__PURE__*/ React.createElement(List, {
44
+ block: block,
45
+ Blocks: Blocks,
46
+ Component: Component,
47
+ context: context,
48
+ loading: loading,
49
+ lowdefy: lowdefy
50
+ });
51
+ case 'container':
52
+ return /*#__PURE__*/ React.createElement(Container, {
53
+ block: block,
54
+ Blocks: Blocks,
55
+ Component: Component,
56
+ context: context,
57
+ loading: loading,
58
+ lowdefy: lowdefy
59
+ });
60
+ case 'input':
61
+ return /*#__PURE__*/ React.createElement(BlockLayout, {
62
+ id: `bl-${block.blockId}`,
63
+ blockStyle: block.eval.style,
64
+ highlightBorders: lowdefy.lowdefyGlobal.highlightBorders,
65
+ layout: block.eval.layout,
66
+ makeCssClass: makeCssClass
67
+ }, /*#__PURE__*/ React.createElement(Component, {
68
+ methods: Object.assign(block.methods, {
69
+ makeCssClass,
70
+ registerEvent: block.registerEvent,
71
+ registerMethod: block.registerMethod,
72
+ setValue: block.setValue,
73
+ triggerEvent: block.triggerEvent
74
+ }),
75
+ basePath: lowdefy.basePath,
76
+ blockId: block.blockId,
77
+ components: lowdefy._internal.components,
78
+ events: block.eval.events,
79
+ key: block.blockId,
80
+ loading: loading,
81
+ menus: lowdefy.menus,
82
+ pageId: lowdefy.pageId,
83
+ properties: block.eval.properties,
84
+ required: block.eval.required,
85
+ validation: block.eval.validation,
86
+ value: block.value
87
+ }));
88
+ default:
89
+ return /*#__PURE__*/ React.createElement(BlockLayout, {
90
+ id: `bl-${block.blockId}`,
91
+ blockStyle: block.eval.style,
92
+ highlightBorders: lowdefy.lowdefyGlobal.highlightBorders,
93
+ layout: block.eval.layout,
94
+ makeCssClass: makeCssClass
95
+ }, /*#__PURE__*/ React.createElement(Component, {
96
+ methods: Object.assign(block.methods, {
97
+ makeCssClass,
98
+ registerEvent: block.registerEvent,
99
+ registerMethod: block.registerMethod,
100
+ triggerEvent: block.triggerEvent
101
+ }),
102
+ basePath: lowdefy.basePath,
103
+ blockId: block.blockId,
104
+ components: lowdefy._internal.components,
105
+ events: block.eval.events,
106
+ key: block.blockId,
107
+ loading: loading,
108
+ menus: lowdefy.menus,
109
+ pageId: lowdefy.pageId,
110
+ properties: block.eval.properties,
111
+ required: block.eval.required,
112
+ validation: block.eval.validation
113
+ }));
114
+ }
115
+ };
116
+ export default CategorySwitch;