diff --git a/.pnp.cjs b/.pnp.cjs index 3de0d0697..3c070f1b5 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -34,6 +34,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "name": "lowdefy", "reference": "workspace:packages/cli" }, + { + "name": "@lowdefy/client", + "reference": "workspace:packages/client" + }, { "name": "@lowdefy/docs", "reference": "workspace:packages/docs" @@ -194,6 +198,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@lowdefy/blocks-loaders", ["workspace:packages/plugins/blocks/blocks-loaders"]], ["@lowdefy/blocks-markdown", ["workspace:packages/plugins/blocks/blocks-markdown"]], ["@lowdefy/build", ["workspace:packages/build"]], + ["@lowdefy/client", ["workspace:packages/client"]], ["@lowdefy/connection-axios-http", ["workspace:packages/plugins/connections/connection-axios-http"]], ["@lowdefy/connection-elasticsearch", ["workspace:packages/plugins/connections/connection-elasticsearch"]], ["@lowdefy/connection-google-sheets", ["workspace:packages/plugins/connections/connection-google-sheets"]], @@ -263,17 +268,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ], "linkType": "SOFT", }], - ["virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:4.7.0", { - "packageLocation": "./.yarn/__virtual__/@ant-design-icons-virtual-168cfd14dd/0/cache/@ant-design-icons-npm-4.7.0-8ad06c46c5-4264d38e6b.zip/node_modules/@ant-design/icons/", + ["virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:4.7.0", { + "packageLocation": "./.yarn/__virtual__/@ant-design-icons-virtual-7e3863ece0/0/cache/@ant-design-icons-npm-4.7.0-8ad06c46c5-4264d38e6b.zip/node_modules/@ant-design/icons/", "packageDependencies": [ - ["@ant-design/icons", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:4.7.0"], + ["@ant-design/icons", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:4.7.0"], ["@ant-design/colors", "npm:6.0.0"], ["@ant-design/icons-svg", "npm:4.2.1"], ["@babel/runtime", "npm:7.16.7"], ["@types/react", null], ["@types/react-dom", null], ["classnames", "npm:2.3.1"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -2825,7 +2830,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageLocation": "./packages/utils/block-utils/", "packageDependencies": [ ["@lowdefy/block-utils", "workspace:packages/utils/block-utils"], - ["@ant-design/icons", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:4.7.0"], ["@emotion/css", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:11.7.1"], ["@emotion/jest", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:11.7.1"], ["@lowdefy/helpers", "workspace:packages/utils/helpers"], @@ -2835,7 +2839,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@testing-library/dom", "npm:8.11.3"], ["@testing-library/react", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:13.0.0-alpha.4"], ["@testing-library/user-event", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:14.0.0-alpha.14"], - ["classnames", "npm:2.3.1"], ["copyfiles", "npm:2.4.1"], ["dompurify", "npm:2.3.5"], ["jest", "virtual:babee6e81435a5d101529cd67f2c6b175f4db37a4ab0b58df15adf73dd11be8917ac14caf44ab4e6882a92c61661055072365b349016e85173e049f006fc2305#npm:27.5.1"], @@ -2851,7 +2854,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageLocation": "./packages/plugins/blocks/blocks-antd/", "packageDependencies": [ ["@lowdefy/blocks-antd", "workspace:packages/plugins/blocks/blocks-antd"], - ["@ant-design/icons", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:4.7.0"], + ["@ant-design/icons", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:4.7.0"], ["@emotion/jest", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:11.7.1"], ["@lowdefy/block-dev", "workspace:packages/utils/block-dev"], ["@lowdefy/block-utils", "workspace:packages/utils/block-utils"], @@ -3058,6 +3061,34 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT", }] ]], + ["@lowdefy/client", [ + ["workspace:packages/client", { + "packageLocation": "./packages/client/", + "packageDependencies": [ + ["@lowdefy/client", "workspace:packages/client"], + ["@ant-design/icons", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:4.7.0"], + ["@emotion/jest", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:11.7.1"], + ["@lowdefy/block-utils", "workspace:packages/utils/block-utils"], + ["@lowdefy/engine", "workspace:packages/engine"], + ["@lowdefy/helpers", "workspace:packages/utils/helpers"], + ["@lowdefy/layout", "workspace:packages/layout"], + ["@swc/cli", "virtual:babee6e81435a5d101529cd67f2c6b175f4db37a4ab0b58df15adf73dd11be8917ac14caf44ab4e6882a92c61661055072365b349016e85173e049f006fc2305#npm:0.1.55"], + ["@swc/core", "npm:1.2.135"], + ["@swc/jest", "virtual:babee6e81435a5d101529cd67f2c6b175f4db37a4ab0b58df15adf73dd11be8917ac14caf44ab4e6882a92c61661055072365b349016e85173e049f006fc2305#npm:0.2.17"], + ["@testing-library/dom", "npm:8.11.3"], + ["@testing-library/react", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:13.0.0-alpha.4"], + ["@testing-library/user-event", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:14.0.0-alpha.14"], + ["classnames", "npm:2.3.1"], + ["copyfiles", "npm:2.4.1"], + ["jest", "virtual:babee6e81435a5d101529cd67f2c6b175f4db37a4ab0b58df15adf73dd11be8917ac14caf44ab4e6882a92c61661055072365b349016e85173e049f006fc2305#npm:27.5.1"], + ["jest-serializer-html", "npm:7.1.0"], + ["jest-transform-yaml", "npm:1.0.0"], + ["react", "npm:17.0.2"], + ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] + ], + "linkType": "SOFT", + }] + ]], ["@lowdefy/connection-axios-http", [ ["workspace:packages/plugins/connections/connection-axios-http", { "packageLocation": "./packages/plugins/connections/connection-axios-http/", @@ -3491,14 +3522,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageLocation": "./packages/server/", "packageDependencies": [ ["@lowdefy/server", "workspace:packages/server"], - ["@lowdefy/actions-core", "workspace:packages/plugins/actions/actions-core"], ["@lowdefy/api", "workspace:packages/api"], - ["@lowdefy/block-utils", "workspace:packages/utils/block-utils"], ["@lowdefy/blocks-antd", "workspace:packages/plugins/blocks/blocks-antd"], ["@lowdefy/blocks-basic", "workspace:packages/plugins/blocks/blocks-basic"], ["@lowdefy/blocks-loaders", "workspace:packages/plugins/blocks/blocks-loaders"], ["@lowdefy/build", "workspace:packages/build"], - ["@lowdefy/engine", "workspace:packages/engine"], + ["@lowdefy/client", "workspace:packages/client"], ["@lowdefy/helpers", "workspace:packages/utils/helpers"], ["@lowdefy/layout", "workspace:packages/layout"], ["@lowdefy/node-utils", "workspace:packages/utils/node-utils"], @@ -3524,8 +3553,8 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageLocation": "./packages/server-dev/", "packageDependencies": [ ["@lowdefy/server-dev", "workspace:packages/server-dev"], + ["@lowdefy/actions-core", "workspace:packages/plugins/actions/actions-core"], ["@lowdefy/api", "workspace:packages/api"], - ["@lowdefy/block-utils", "workspace:packages/utils/block-utils"], ["@lowdefy/blocks-antd", "workspace:packages/plugins/blocks/blocks-antd"], ["@lowdefy/blocks-basic", "workspace:packages/plugins/blocks/blocks-basic"], ["@lowdefy/blocks-color-selectors", "workspace:packages/plugins/blocks/blocks-color-selectors"], @@ -3533,6 +3562,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@lowdefy/blocks-loaders", "workspace:packages/plugins/blocks/blocks-loaders"], ["@lowdefy/blocks-markdown", "workspace:packages/plugins/blocks/blocks-markdown"], ["@lowdefy/build", "workspace:packages/build"], + ["@lowdefy/client", "workspace:packages/client"], ["@lowdefy/connection-axios-http", "workspace:packages/plugins/connections/connection-axios-http"], ["@lowdefy/engine", "workspace:packages/engine"], ["@lowdefy/helpers", "workspace:packages/utils/helpers"], @@ -5319,7 +5349,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageDependencies": [ ["antd", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:4.18.2"], ["@ant-design/colors", "npm:6.0.0"], - ["@ant-design/icons", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:4.7.0"], + ["@ant-design/icons", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:4.7.0"], ["@ant-design/react-slick", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:0.28.4"], ["@babel/runtime", "npm:7.16.7"], ["@ctrl/tinycolor", "npm:3.4.0"], @@ -5361,7 +5391,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["rc-tree-select", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:5.0.0-alpha.4"], ["rc-trigger", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:5.2.10"], ["rc-upload", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:4.3.3"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"], ["scroll-into-view-if-needed", "npm:2.2.29"] @@ -15138,7 +15168,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["classnames", "npm:2.3.1"], ["dom-align", "npm:1.12.2"], ["lodash", "npm:4.17.21"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"], ["resize-observer-polyfill", "npm:1.5.1"] @@ -15171,7 +15201,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["classnames", "npm:2.3.1"], ["rc-select", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:14.0.0-alpha.26"], ["rc-tree", "virtual:5cbeddbd8d40fd27744ac5bdca3d9c78264e0215780f1acaec203007d4b8b9a2b8d7ca06c3ba60bc09f45c2b2a6810a13a3fc52fd1d0d749ad27d151bb04a198#npm:5.4.3"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15229,7 +15259,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-motion", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:2.4.4"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"], ["shallowequal", "npm:1.1.0"] @@ -15260,7 +15290,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-motion", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:2.4.4"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15289,7 +15319,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react", null], ["@types/react-dom", null], ["classnames", "npm:2.3.1"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15326,7 +15356,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-trigger", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:5.2.10"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15347,7 +15377,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-trigger", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:5.2.10"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15376,7 +15406,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react", null], ["@types/react-dom", null], ["async-validator", "npm:4.0.7"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15406,7 +15436,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-dialog", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:8.6.0"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15435,7 +15465,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react", null], ["@types/react-dom", null], ["classnames", "npm:2.3.1"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15467,7 +15497,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["rc-menu", "virtual:9b08d0103ed0c41ecbb29b80c7f0952f56690458541bdc3b40a8f6e2141ab5571d8e667fc0cbc7e816e99c60fd695931aea6d23c3e10f2a63ed283fcb22856fc#npm:9.3.2"], ["rc-textarea", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:0.3.7"], ["rc-trigger", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:5.2.10"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15506,7 +15536,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["rc-motion", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:2.4.4"], ["rc-overflow", "virtual:f3201355e275fc367612b99835082bfe45b71743479bb8e7dc6b1a0e6ec3b97ac5d71b86ce2047f12fdd63e0e5db39a42431dac4589da3fdb850f063190fb24a#npm:1.2.2"], ["rc-trigger", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:5.2.10"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"], ["shallowequal", "npm:1.1.0"] @@ -15530,7 +15560,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["rc-motion", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:2.4.4"], ["rc-overflow", "virtual:f3201355e275fc367612b99835082bfe45b71743479bb8e7dc6b1a0e6ec3b97ac5d71b86ce2047f12fdd63e0e5db39a42431dac4589da3fdb850f063190fb24a#npm:1.2.2"], ["rc-trigger", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:5.2.10"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"], ["shallowequal", "npm:1.1.0"] @@ -15560,7 +15590,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react", null], ["@types/react-dom", null], ["classnames", "npm:2.3.1"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15590,7 +15620,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-motion", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:2.4.4"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15620,7 +15650,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-resize-observer", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:1.2.0"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15681,7 +15711,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["dayjs", "npm:1.10.7"], ["moment", "npm:2.29.1"], ["rc-trigger", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:5.2.10"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"], ["shallowequal", "npm:1.1.0"] @@ -15711,7 +15741,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react", null], ["@types/react-dom", null], ["classnames", "npm:2.3.1"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15740,7 +15770,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react", null], ["@types/react-dom", null], ["classnames", "npm:2.3.1"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15769,7 +15799,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react", null], ["@types/react-dom", null], ["classnames", "npm:2.3.1"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"], ["resize-observer-polyfill", "npm:1.5.1"] @@ -15802,7 +15832,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["rc-motion", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:2.4.4"], ["rc-overflow", "virtual:f3201355e275fc367612b99835082bfe45b71743479bb8e7dc6b1a0e6ec3b97ac5d71b86ce2047f12fdd63e0e5db39a42431dac4589da3fdb850f063190fb24a#npm:1.2.2"], ["rc-trigger", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:5.2.10"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["rc-virtual-list", "virtual:d0ef4ef4df8c18d930d669f36c367285d6797d2976508bea42f22f1b9ec914504bc240ade5dc2e1948c03a2acd136deb6f35e8e33b5236018dd4348224dd538a#npm:3.4.2"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] @@ -15833,7 +15863,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-tooltip", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:5.1.1"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"], ["shallowequal", "npm:1.1.0"] @@ -15863,7 +15893,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react", null], ["@types/react-dom", null], ["classnames", "npm:2.3.1"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15892,7 +15922,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react", null], ["@types/react-dom", null], ["classnames", "npm:2.3.1"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15922,7 +15952,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-resize-observer", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:1.2.0"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"], ["shallowequal", "npm:1.1.0"] @@ -15955,7 +15985,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["rc-dropdown", "virtual:6177bf62ab342574edbf06853562f14ff0b0d4374742901464f5854325cb786053de94a4bdd4f1901a8f06b14b9e1cd8aa9d26d5858f1f39508db3264a529fcb#npm:3.3.0"], ["rc-menu", "virtual:9b08d0103ed0c41ecbb29b80c7f0952f56690458541bdc3b40a8f6e2141ab5571d8e667fc0cbc7e816e99c60fd695931aea6d23c3e10f2a63ed283fcb22856fc#npm:9.3.2"], ["rc-resize-observer", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:1.2.0"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -15985,7 +16015,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-resize-observer", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:1.2.0"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"], ["shallowequal", "npm:1.1.0"] @@ -16051,7 +16081,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-motion", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:2.4.4"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["rc-virtual-list", "virtual:d0ef4ef4df8c18d930d669f36c367285d6797d2976508bea42f22f1b9ec914504bc240ade5dc2e1948c03a2acd136deb6f35e8e33b5236018dd4348224dd538a#npm:3.4.2"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] @@ -16073,7 +16103,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-motion", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:2.4.4"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["rc-virtual-list", "virtual:d0ef4ef4df8c18d930d669f36c367285d6797d2976508bea42f22f1b9ec914504bc240ade5dc2e1948c03a2acd136deb6f35e8e33b5236018dd4348224dd538a#npm:3.4.2"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] @@ -16105,7 +16135,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["classnames", "npm:2.3.1"], ["rc-select", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:14.0.0-alpha.26"], ["rc-tree", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:5.3.8"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -16136,7 +16166,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["classnames", "npm:2.3.1"], ["rc-align", "virtual:a0cde20e0292ef25046285d3616cd7818b95042e3e1ad7ee881431733a28b26e007e8954fb488816772fc720a44a1a192eb293856137e3207c3ad080e640b018#npm:4.0.11"], ["rc-motion", "virtual:f494f6d4e058cb1c8a3b456f6099aff9bd740d65abfc014377b7a3f1e34fcb35eb64a962e127c8bfbedaa0555175b6f2cdc47011e32e2fb5f081d7d32f526c78#npm:2.4.4"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -16165,7 +16195,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react", null], ["@types/react-dom", null], ["classnames", "npm:2.3.1"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], @@ -16186,10 +16216,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ], "linkType": "SOFT", }], - ["virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0", { - "packageLocation": "./.yarn/__virtual__/rc-util-virtual-c6747a1499/0/cache/rc-util-npm-5.17.0-4477bf5307-c6f083742e.zip/node_modules/rc-util/", + ["virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0", { + "packageLocation": "./.yarn/__virtual__/rc-util-virtual-5738260a62/0/cache/rc-util-npm-5.17.0-4477bf5307-c6f083742e.zip/node_modules/rc-util/", "packageDependencies": [ - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["@babel/runtime", "npm:7.16.7"], ["@types/react", null], ["@types/react-dom", null], @@ -16223,7 +16253,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/react-dom", null], ["classnames", "npm:2.3.1"], ["rc-resize-observer", "virtual:caddce747241c88958e039daadd2596eb7c11034e7ef35655f4f28f4496d3c6f1fc47b71417570ca9d8f270e1029349bbe942266aaa5cde8b29aef95b1038892#npm:1.2.0"], - ["rc-util", "virtual:168cfd14dd9e71b0423112848f69380ff1f0f5dffd5be83d150031464f8b398ca894fd5b87337ea7fc74ec2ed290ef92e6bd13f03f172c30eabf0a35fb94d97e#npm:5.17.0"], + ["rc-util", "virtual:7e3863ece061dda54214da8dfaaa3f3663891078cb856975c7f9148a6d7b3bd1799941ca573699ce564591ced647a40f68190f57334e0215ccb39d95b04e29d6#npm:5.17.0"], ["react", "npm:17.0.2"], ["react-dom", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:17.0.2"] ], diff --git a/packages/build/src/build/writePluginImports/writeStyleImports.js b/packages/build/src/build/writePluginImports/writeStyleImports.js index 8eed082cc..049897155 100644 --- a/packages/build/src/build/writePluginImports/writeStyleImports.js +++ b/packages/build/src/build/writePluginImports/writeStyleImports.js @@ -17,7 +17,7 @@ import { nunjucksFunction } from '@lowdefy/nunjucks'; const template = `@import '@lowdefy/layout/style.less'; -@import '@lowdefy/block-utils/style.less'; +@import '@lowdefy/client/style.less'; {% for style in styles -%} @import '{{ style }}'; {% endfor -%} diff --git a/packages/cli/src/commands/init/lowdefyFile.js b/packages/cli/src/commands/init/lowdefyFile.js index 7f4d8b4dd..004649e45 100644 --- a/packages/cli/src/commands/init/lowdefyFile.js +++ b/packages/cli/src/commands/init/lowdefyFile.js @@ -38,7 +38,7 @@ pages: title: Welcome to your Lowdefy app subTitle: We are excited to see what you are going to build icon: - name: AiTwoToneHeart + name: AiOutlineHeart color: '#f00' areas: extra: diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md new file mode 100644 index 000000000..e69de29bb diff --git a/packages/client/README.md b/packages/client/README.md new file mode 100644 index 000000000..ba461ef3d --- /dev/null +++ b/packages/client/README.md @@ -0,0 +1,3 @@ +# @lowdefy/client + +Lowdefy Client diff --git a/packages/client/jest.config.js b/packages/client/jest.config.js new file mode 100644 index 000000000..2814fbcdd --- /dev/null +++ b/packages/client/jest.config.js @@ -0,0 +1,16 @@ +export default { + clearMocks: true, + collectCoverage: true, + collectCoverageFrom: ['src/**/*.js'], + coverageDirectory: 'coverage', + coveragePathIgnorePatterns: ['/dist/', '/src/test', '/src/index.js'], + coverageReporters: [['lcov', { projectRoot: '../..' }], 'text', 'clover'], + errorOnDeprecated: true, + testEnvironment: 'jsdom', + testPathIgnorePatterns: ['/dist/', '/src/test'], + transform: { + '^.+\\.(t|j)sx?$': ['@swc/jest', { configFile: '../../.swcrc.test' }], + '\\.yaml$': 'jest-transform-yaml', + }, + snapshotSerializers: ['@emotion/jest/serializer', 'jest-serializer-html'], +}; diff --git a/packages/client/package.json b/packages/client/package.json new file mode 100644 index 000000000..f4f7e6d31 --- /dev/null +++ b/packages/client/package.json @@ -0,0 +1,70 @@ +{ + "name": "@lowdefy/client", + "version": "4.0.0-alpha.8", + "license": "Apache-2.0", + "description": "Lowdefy Client", + "homepage": "https://lowdefy.com", + "keywords": [ + "lowdefy" + ], + "bugs": { + "url": "https://github.com/lowdefy/lowdefy/issues" + }, + "contributors": [ + { + "name": "Sam Tolmay", + "url": "https://github.com/SamTolmay" + }, + { + "name": "Gerrie van Wyk", + "url": "https://github.com/Gervwyk" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/lowdefy/lowdefy.git" + }, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": "./dist/*" + }, + "files": [ + "dist/*" + ], + "scripts": { + "build": "yarn swc", + "clean": "rm -rf dist", + "copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"", + "prepare": "yarn build", + "swc": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start && yarn copyfiles", + "test:watch": "jest --coverage --watch", + "test": "jest --coverage" + }, + "dependencies": { + "@ant-design/icons": "4.7.0", + "@lowdefy/block-utils": "4.0.0-alpha.8", + "@lowdefy/engine": "4.0.0-alpha.8", + "@lowdefy/helpers": "4.0.0-alpha.8", + "@lowdefy/layout": "4.0.0-alpha.8", + "classnames": "2.3.1", + "react": "17.0.2", + "react-dom": "17.0.2" + }, + "devDependencies": { + "@emotion/jest": "11.7.1", + "@swc/cli": "0.1.55", + "@swc/core": "1.2.135", + "@swc/jest": "0.2.17", + "@testing-library/dom": "8.11.3", + "@testing-library/react": "13.0.0-alpha.4", + "@testing-library/user-event": "14.0.0-alpha.14", + "copyfiles": "2.4.1", + "jest": "27.5.1", + "jest-serializer-html": "7.1.0", + "jest-transform-yaml": "1.0.0" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/server/lib/components/Page.js b/packages/client/src/Client.js similarity index 57% rename from packages/server/lib/components/Page.js rename to packages/client/src/Client.js index 06b2a120f..0783ce362 100644 --- a/packages/server/lib/components/Page.js +++ b/packages/client/src/Client.js @@ -16,48 +16,36 @@ import React from 'react'; -import { urlQuery } from '@lowdefy/helpers'; -import { useRouter } from 'next/router'; - +import Block from './block/Block.js'; import Context from './Context.js'; import Head from './Head.js'; import ProgressBarController from './ProgressBarController.js'; -import Block from './block/Block.js'; -import setupLink from '../utils/setupLink.js'; -import createComponents from './createComponents.js'; -const Page = ({ lowdefy, pageConfig, rootConfig }) => { - const router = useRouter(); - lowdefy._internal.window = window; - lowdefy._internal.document = document; - lowdefy._internal.router = router; - lowdefy._internal.link = setupLink(lowdefy); - lowdefy._internal.components = createComponents(lowdefy); +import initLowdefyContext from './initLowdefyContext.js'; - lowdefy.basePath = lowdefy._internal.router.basePath; - lowdefy.home = rootConfig.home; - lowdefy.lowdefyGlobal = rootConfig.lowdefyGlobal; - lowdefy.menus = rootConfig.menus; - lowdefy.pageId = pageConfig.pageId; - lowdefy.urlQuery = urlQuery.parse(window.location.search.slice(1)); +const Client = ({ Components, config, router, stage, types, window }) => { + const lowdefy = initLowdefyContext({ Components, config, router, types, stage, window }); return ( ( - + {(context) => { return ( <> { ); }; -export default Page; +export default Client; diff --git a/packages/server/lib/components/Context.js b/packages/client/src/Context.js similarity index 100% rename from packages/server/lib/components/Context.js rename to packages/client/src/Context.js diff --git a/packages/utils/block-utils/src/ErrorBoundary.js b/packages/client/src/ErrorBoundary.js similarity index 100% rename from packages/utils/block-utils/src/ErrorBoundary.js rename to packages/client/src/ErrorBoundary.js diff --git a/packages/utils/block-utils/src/ErrorBoundary.test.js b/packages/client/src/ErrorBoundary.test.js similarity index 100% rename from packages/utils/block-utils/src/ErrorBoundary.test.js rename to packages/client/src/ErrorBoundary.test.js diff --git a/packages/utils/block-utils/src/ErrorPage.js b/packages/client/src/ErrorPage.js similarity index 100% rename from packages/utils/block-utils/src/ErrorPage.js rename to packages/client/src/ErrorPage.js diff --git a/packages/utils/block-utils/src/ErrorPage.test.js b/packages/client/src/ErrorPage.test.js similarity index 100% rename from packages/utils/block-utils/src/ErrorPage.test.js rename to packages/client/src/ErrorPage.test.js diff --git a/packages/server/lib/components/Head.js b/packages/client/src/Head.js similarity index 88% rename from packages/server/lib/components/Head.js rename to packages/client/src/Head.js index 10cb9cbfb..07644dbc5 100644 --- a/packages/server/lib/components/Head.js +++ b/packages/client/src/Head.js @@ -15,13 +15,12 @@ */ import React from 'react'; -import Head from 'next/head'; -const BindHead = ({ properties }) => { +const BindHead = ({ Component, properties }) => { return ( - + {properties.title} - + ); }; diff --git a/packages/server/lib/components/MountEvents.js b/packages/client/src/MountEvents.js similarity index 100% rename from packages/server/lib/components/MountEvents.js rename to packages/client/src/MountEvents.js diff --git a/packages/server/lib/components/ProgressBarController.js b/packages/client/src/ProgressBarController.js similarity index 100% rename from packages/server/lib/components/ProgressBarController.js rename to packages/client/src/ProgressBarController.js diff --git a/packages/utils/block-utils/src/__snapshots__/ErrorBoundary.test.js.snap b/packages/client/src/__snapshots__/ErrorBoundary.test.js.snap similarity index 100% rename from packages/utils/block-utils/src/__snapshots__/ErrorBoundary.test.js.snap rename to packages/client/src/__snapshots__/ErrorBoundary.test.js.snap diff --git a/packages/utils/block-utils/src/__snapshots__/ErrorPage.test.js.snap b/packages/client/src/__snapshots__/ErrorPage.test.js.snap similarity index 100% rename from packages/utils/block-utils/src/__snapshots__/ErrorPage.test.js.snap rename to packages/client/src/__snapshots__/ErrorPage.test.js.snap diff --git a/packages/utils/block-utils/src/__snapshots__/createIcon.test.js.snap b/packages/client/src/__snapshots__/createIcon.test.js.snap similarity index 100% rename from packages/utils/block-utils/src/__snapshots__/createIcon.test.js.snap rename to packages/client/src/__snapshots__/createIcon.test.js.snap diff --git a/packages/server/lib/components/block/Block.js b/packages/client/src/block/Block.js similarity index 97% rename from packages/server/lib/components/block/Block.js rename to packages/client/src/block/Block.js index 59c5db82a..fe60af0e4 100644 --- a/packages/server/lib/components/block/Block.js +++ b/packages/client/src/block/Block.js @@ -16,9 +16,8 @@ import React, { useState } from 'react'; -import { ErrorBoundary } from '@lowdefy/block-utils'; - import CategorySwitch from './CategorySwitch.js'; +import ErrorBoundary from '../ErrorBoundary.js'; import MountEvents from '../MountEvents.js'; const Block = ({ diff --git a/packages/server/lib/components/block/CategorySwitch.js b/packages/client/src/block/CategorySwitch.js similarity index 100% rename from packages/server/lib/components/block/CategorySwitch.js rename to packages/client/src/block/CategorySwitch.js diff --git a/packages/server/lib/components/block/Container.js b/packages/client/src/block/Container.js similarity index 100% rename from packages/server/lib/components/block/Container.js rename to packages/client/src/block/Container.js diff --git a/packages/server/lib/components/block/List.js b/packages/client/src/block/List.js similarity index 100% rename from packages/server/lib/components/block/List.js rename to packages/client/src/block/List.js diff --git a/packages/server/lib/components/block/LoadingBlock.js b/packages/client/src/block/LoadingBlock.js similarity index 100% rename from packages/server/lib/components/block/LoadingBlock.js rename to packages/client/src/block/LoadingBlock.js diff --git a/packages/server/lib/components/block/LoadingContainer.js b/packages/client/src/block/LoadingContainer.js similarity index 100% rename from packages/server/lib/components/block/LoadingContainer.js rename to packages/client/src/block/LoadingContainer.js diff --git a/packages/server/lib/components/block/LoadingList.js b/packages/client/src/block/LoadingList.js similarity index 100% rename from packages/server/lib/components/block/LoadingList.js rename to packages/client/src/block/LoadingList.js diff --git a/packages/server/lib/utils/callRequest.js b/packages/client/src/callRequest.js similarity index 100% rename from packages/server/lib/utils/callRequest.js rename to packages/client/src/callRequest.js diff --git a/packages/utils/block-utils/src/createIcon.js b/packages/client/src/createIcon.js similarity index 96% rename from packages/utils/block-utils/src/createIcon.js rename to packages/client/src/createIcon.js index 8e2104057..c7cfbea74 100644 --- a/packages/utils/block-utils/src/createIcon.js +++ b/packages/client/src/createIcon.js @@ -18,10 +18,9 @@ import React from 'react'; import classNames from 'classnames'; import { omit, type } from '@lowdefy/helpers'; import Icon from '@ant-design/icons'; +import { blockDefaultProps, makeCssClass } from '@lowdefy/block-utils'; -import blockDefaultProps from './blockDefaultProps.js'; import ErrorBoundary from './ErrorBoundary.js'; -import makeCssClass from './makeCssClass.js'; const lowdefyProps = [ 'actionLog', diff --git a/packages/utils/block-utils/src/createIcon.test.js b/packages/client/src/createIcon.test.js similarity index 98% rename from packages/utils/block-utils/src/createIcon.test.js rename to packages/client/src/createIcon.test.js index 6308c3c87..5c3484940 100644 --- a/packages/utils/block-utils/src/createIcon.test.js +++ b/packages/client/src/createIcon.test.js @@ -17,9 +17,9 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import { makeCssClass } from '@lowdefy/block-utils'; import createIcon from './createIcon.js'; -import makeCssClass from './makeCssClass.js'; const methods = { makeCssClass, diff --git a/packages/server/lib/components/createLinkComponent.js b/packages/client/src/createLinkComponent.js similarity index 89% rename from packages/server/lib/components/createLinkComponent.js rename to packages/client/src/createLinkComponent.js index 424f4124d..e60627daa 100644 --- a/packages/server/lib/components/createLinkComponent.js +++ b/packages/client/src/createLinkComponent.js @@ -1,9 +1,8 @@ import React from 'react'; -import NextLink from 'next/link'; import { createLink } from '@lowdefy/engine'; import { type } from '@lowdefy/helpers'; -const createLinkComponent = (lowdefy) => { +const createLinkComponent = (lowdefy, Link) => { const backLink = ({ ariaLabel, children, className, id, rel }) => ( { id={id} aria-label={ariaLabel} className={className} - href={`${window.location.origin}${lowdefy.basePath}${pathname}${ + href={`${window.location.origin}${lowdefy._internal.router.basePath}${pathname}${ query ? `?${query}` : '' }`} rel={rel || 'noopener noreferrer'} @@ -72,11 +71,11 @@ const createLinkComponent = (lowdefy) => { ); } return ( - + {type.isFunction(children) ? children(pageId || url || id) : children} - + ); }; const noLink = ({ className, children, id }) => ( diff --git a/packages/server-dev/lib/components/Head.js b/packages/client/src/index.js similarity index 74% rename from packages/server-dev/lib/components/Head.js rename to packages/client/src/index.js index 10cb9cbfb..55032cc19 100644 --- a/packages/server-dev/lib/components/Head.js +++ b/packages/client/src/index.js @@ -14,15 +14,6 @@ limitations under the License. */ -import React from 'react'; -import Head from 'next/head'; +import Client from './Client.js'; -const BindHead = ({ properties }) => { - return ( - - {properties.title} - - ); -}; - -export default BindHead; +export default Client; diff --git a/packages/client/src/initLowdefyContext.js b/packages/client/src/initLowdefyContext.js new file mode 100644 index 000000000..231791d11 --- /dev/null +++ b/packages/client/src/initLowdefyContext.js @@ -0,0 +1,66 @@ +/* + Copyright 2020-2022 Lowdefy, Inc + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +import { urlQuery } from '@lowdefy/helpers'; + +import callRequest from './callRequest.js'; +import setupLink from './setupLink.js'; +import createLinkComponent from './createLinkComponent.js'; +import createIcon from './createIcon.js'; + +const lowdefy = { + _internal: { + callRequest, + components: {}, + updaters: {}, + displayMessage: ({ content }) => { + console.log(content); + return () => undefined; + }, + link: () => undefined, + }, + contexts: {}, + inputs: {}, + lowdefyGlobal: {}, +}; + +function initLowdefyContext({ Components, config, router, stage, types, window }) { + if (stage === 'dev') { + window.lowdefy = lowdefy; + } + lowdefy.basePath = router.basePath; + lowdefy.home = config.rootConfig.home || {}; + lowdefy.lowdefyGlobal = config.rootConfig.lowdefyGlobal; + lowdefy.menus = config.rootConfig.menus; + lowdefy.pageId = config.pageConfig.pageId; + lowdefy.urlQuery = urlQuery.parse(window.location.search.slice(1)); + + lowdefy._internal.window = window; + lowdefy._internal.document = window.document; + lowdefy._internal.router = router; + lowdefy._internal.link = setupLink(router, window); + lowdefy._internal.updateBlock = (blockId) => + lowdefy._internal.updaters[blockId] && lowdefy._internal.updaters[blockId](); + lowdefy._internal.components.Link = createLinkComponent(lowdefy, Components.Link); + lowdefy._internal.components.Icon = createIcon(types.icons); + lowdefy._internal.actions = types.actions; + lowdefy._internal.blockComponents = types.blocks; + lowdefy._internal.operators = types.operators; + + return lowdefy; +} + +export default initLowdefyContext; diff --git a/packages/server/lib/utils/request.js b/packages/client/src/request.js similarity index 100% rename from packages/server/lib/utils/request.js rename to packages/client/src/request.js diff --git a/packages/server/lib/utils/setupLink.js b/packages/client/src/setupLink.js similarity index 83% rename from packages/server/lib/utils/setupLink.js rename to packages/client/src/setupLink.js index cec5e21de..ac22caf71 100644 --- a/packages/server/lib/utils/setupLink.js +++ b/packages/client/src/setupLink.js @@ -16,8 +16,7 @@ import { createLink } from '@lowdefy/engine'; -function setupLink(lowdefy) { - const { router, window } = lowdefy._internal; +function setupLink(router, window) { const backLink = () => router.back(); const disabledLink = () => {}; const newOriginLink = ({ url, query, newTab }) => { @@ -31,7 +30,7 @@ function setupLink(lowdefy) { if (newTab) { return window .open( - `${window.location.origin}${lowdefy.basePath}${pathname}${query ? `?${query}` : ''}`, + `${window.location.origin}${router.basePath}${pathname}${query ? `?${query}` : ''}`, '_blank' ) .focus(); @@ -46,7 +45,7 @@ function setupLink(lowdefy) { const noLink = () => { throw new Error(`Invalid Link.`); }; - return createLink({ backLink, disabledLink, lowdefy, newOriginLink, noLink, sameOriginLink }); + return createLink({ backLink, disabledLink, router, newOriginLink, noLink, sameOriginLink }); } export default setupLink; diff --git a/packages/utils/block-utils/src/style.less b/packages/client/src/style.less similarity index 100% rename from packages/utils/block-utils/src/style.less rename to packages/client/src/style.less diff --git a/packages/docs/blocks/display/Statistic.yaml b/packages/docs/blocks/display/Statistic.yaml index 869925fa0..f9d047583 100644 --- a/packages/docs/blocks/display/Statistic.yaml +++ b/packages/docs/blocks/display/Statistic.yaml @@ -32,4 +32,4 @@ _ref: type: Statistic properties: value: 99.5 - prefixIcon: AiTwoToneAlert + prefixIcon: AiOutlineAlert diff --git a/packages/docs/tutorial/tutorial-start.yaml b/packages/docs/tutorial/tutorial-start.yaml index 75750e4f3..681acfad6 100644 --- a/packages/docs/tutorial/tutorial-start.yaml +++ b/packages/docs/tutorial/tutorial-start.yaml @@ -137,7 +137,7 @@ _ref: subTitle: We are excited to see what you are going to build status: success icon: - name: AiTwoToneHeart + name: AiOutlineHeart color: '#f00' areas: extra: @@ -203,7 +203,7 @@ _ref: title: Welcome to your Lowdefy app subTitle: We are excited to see what you are going to build icon: - name: AiTwoToneHeart + name: AiOutlineHeart color: '#f00' areas: extra: diff --git a/packages/layout/src/tests/blocks/AutoBlockSim.js b/packages/layout/src/tests/blocks/AutoBlockSim.js index b5138402e..2ed63d9f9 100644 --- a/packages/layout/src/tests/blocks/AutoBlockSim.js +++ b/packages/layout/src/tests/blocks/AutoBlockSim.js @@ -16,7 +16,6 @@ import React from 'react'; import { type } from '@lowdefy/helpers'; -import { ErrorBoundary } from '@lowdefy/block-utils'; import { Area, BlockLayout, layoutParamsToArea } from '../../../src/index.js'; import Block from './Block.js'; @@ -112,24 +111,22 @@ const AutoBlock = ({ block, makeCssClass, highlightBorders }) => { const BindAutoBlock = ({ block, state, makeCssClass, highlightBorders }) => { return ( - - - + + - - - - + highlightBorders={highlightBorders} + /> + + ); }; diff --git a/packages/plugins/blocks/blocks-basic/src/blocks/Icon/schema.json b/packages/plugins/blocks/blocks-basic/src/blocks/Icon/schema.json index a897d94bd..d89907ddb 100644 --- a/packages/plugins/blocks/blocks-basic/src/blocks/Icon/schema.json +++ b/packages/plugins/blocks/blocks-basic/src/blocks/Icon/schema.json @@ -13,7 +13,7 @@ }, "name": { "type": "string", - "default": "AiCloseCircleOutlined", + "default": "AiOutlineCloseCircle", "description": "Name of icon to be displayed." }, "rotate": { diff --git a/packages/server-dev/lib/components/App.js b/packages/server-dev/lib/App.js similarity index 50% rename from packages/server-dev/lib/components/App.js rename to packages/server-dev/lib/App.js index dca2d9ba2..b5fe22901 100644 --- a/packages/server-dev/lib/components/App.js +++ b/packages/server-dev/lib/App.js @@ -16,40 +16,47 @@ import React from 'react'; -import { urlQuery } from '@lowdefy/helpers'; import { useRouter } from 'next/router'; -import Page from './Page.js'; -import Reload from './Reload.js'; -import setPageId from '../utils/setPageId.js'; -import setupLink from '../utils/setupLink.js'; -import useRootConfig from '../utils/useRootConfig.js'; -import createComponents from './createComponents.js'; +import Head from 'next/head'; +import Link from 'next/link'; -const App = ({ lowdefy }) => { +import Reload from './Reload.js'; +import Page from './Page.js'; +import setPageId from './utils/setPageId.js'; +import useRootConfig from './utils/useRootConfig.js'; + +import actions from '../build/plugins/actions.js'; +import blocks from '../build/plugins/blocks.js'; +import icons from '../build/plugins/icons.js'; +import operators from '../build/plugins/operatorsClient.js'; + +import '../build/plugins/styles.less'; + +const App = () => { const router = useRouter(); const { data: rootConfig } = useRootConfig(router.basePath); - window.lowdefy = lowdefy; - - lowdefy._internal.router = router; - lowdefy._internal.link = setupLink(lowdefy); - lowdefy._internal.components = createComponents(lowdefy); - - lowdefy.basePath = lowdefy._internal.router.basePath; - lowdefy.home = rootConfig.home; - lowdefy.lowdefyGlobal = rootConfig.lowdefyGlobal; - lowdefy.menus = rootConfig.menus; - lowdefy.urlQuery = urlQuery.parse(window.location.search.slice(1)); - - const redirect = setPageId(lowdefy); + const { redirect, pageId } = setPageId(router); if (redirect) { - lowdefy._internal.router.push(`/${lowdefy.pageId}`); + router.push(`/${pageId}`); } - return ( - - + + ); }; diff --git a/packages/server/lib/components/createComponents.js b/packages/server-dev/lib/Page.js similarity index 51% rename from packages/server/lib/components/createComponents.js rename to packages/server-dev/lib/Page.js index 596e97795..8904abfa7 100644 --- a/packages/server/lib/components/createComponents.js +++ b/packages/server-dev/lib/Page.js @@ -14,16 +14,30 @@ limitations under the License. */ -import { createIcon } from '@lowdefy/block-utils'; +import React from 'react'; -import createLinkComponent from './createLinkComponent.js'; -import icons from '../../build/plugins/icons.js'; +import Client from '@lowdefy/client'; +import usePageConfig from './utils/usePageConfig.js'; -const createComponents = (lowdefy) => { - return { - Link: createLinkComponent(lowdefy), - Icon: createIcon(icons), - }; +const Page = ({ Components, config, pageId, router, types }) => { + const { data: pageConfig } = usePageConfig(pageId, router.basePath); + if (!pageConfig) { + router.replace(`/404`); + return ''; + } + return ( + + ); }; -export default createComponents; +export default Page; diff --git a/packages/server-dev/lib/components/Reload.js b/packages/server-dev/lib/Reload.js similarity index 73% rename from packages/server-dev/lib/components/Reload.js rename to packages/server-dev/lib/Reload.js index 2c9d67772..bf701ffef 100644 --- a/packages/server-dev/lib/components/Reload.js +++ b/packages/server-dev/lib/Reload.js @@ -16,13 +16,13 @@ import React, { useEffect } from 'react'; -import useMutateCache from '../utils/useMutateCache.js'; -import waitForRestartedServer from '../utils/waitForRestartedServer.js'; +import useMutateCache from './utils/useMutateCache.js'; +import waitForRestartedServer from './utils/waitForRestartedServer.js'; -const Reload = ({ children, lowdefy }) => { - const mutateCache = useMutateCache(lowdefy.basePath); +const Reload = ({ children, basePath }) => { + const mutateCache = useMutateCache(basePath); useEffect(() => { - const sse = new EventSource(`${lowdefy.basePath}/api/reload`); + const sse = new EventSource(`${basePath}/api/reload`); sse.addEventListener('reload', () => { mutateCache(); @@ -31,7 +31,7 @@ const Reload = ({ children, lowdefy }) => { sse.onerror = () => { sse.close(); - waitForRestartedServer(lowdefy); + waitForRestartedServer(basePath); }; return () => { sse.close(); diff --git a/packages/server-dev/lib/components/Context.js b/packages/server-dev/lib/components/Context.js deleted file mode 100644 index 19899a4e1..000000000 --- a/packages/server-dev/lib/components/Context.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2020-2022 Lowdefy, Inc - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -import React from 'react'; -import getContext from '@lowdefy/engine'; - -import MountEvents from './block/MountEvents.js'; - -const Context = ({ children, lowdefy, config }) => { - const context = getContext({ config, lowdefy }); - - return ( - { - if (!async) { - context._internal.update(); // TODO: do we need this? - context._internal.State.freezeState(); - } - context._internal.RootBlocks.areas.root.blocks[0].triggerEvent({ name }); - }} - > - {(loadingOnInit) => { - if (loadingOnInit) return ''; // TODO: handle onInit Loader - return ( - - context._internal.RootBlocks.areas.root.blocks[0].triggerEvent({ name }) - } - > - {(loadingOnEnter) => children(context, loadingOnEnter)} - - ); - }} - - ); -}; - -export default Context; diff --git a/packages/server-dev/lib/components/LowdefyContext.js b/packages/server-dev/lib/components/LowdefyContext.js deleted file mode 100644 index 536f889e6..000000000 --- a/packages/server-dev/lib/components/LowdefyContext.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright 2020-2022 Lowdefy, Inc - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -import React from 'react'; - -import actions from '../../build/plugins/actions.js'; -import callRequest from '../utils/callRequest.js'; -import blockComponents from '../../build/plugins/blocks.js'; -import operators from '../../build/plugins/operatorsClient.js'; - -const LowdefyContext = ({ children, lowdefy }) => { - if (!lowdefy._internal) { - lowdefy._internal = { - actions, - blockComponents, - callRequest, - components: {}, - document, - operators, - updaters: {}, - window, - displayMessage: ({ content }) => { - console.log(content); - return () => undefined; - }, - link: () => undefined, - }; - lowdefy.contexts = {}; - lowdefy.inputs = {}; - lowdefy.lowdefyGlobal = {}; - } - lowdefy._internal.updateBlock = (blockId) => - lowdefy._internal.updaters[blockId] && lowdefy._internal.updaters[blockId](); - return <>{children}; -}; - -export default LowdefyContext; diff --git a/packages/server-dev/lib/components/Page.js b/packages/server-dev/lib/components/Page.js deleted file mode 100644 index bc2a63616..000000000 --- a/packages/server-dev/lib/components/Page.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2020-2022 Lowdefy, Inc - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -import React from 'react'; - -import Block from './block/Block.js'; -import Context from './Context.js'; -import Head from './Head.js'; -import usePageConfig from '../utils/usePageConfig.js'; - -const LoadingBlock = () =>
Loading...
; - -const Page = ({ lowdefy }) => { - const { data: pageConfig } = usePageConfig(lowdefy.pageId, lowdefy.basePath); - if (!pageConfig) { - lowdefy._internal.router.replace(`/404`); - return ; - } - return ( - - {(context, loading) => { - if (loading) { - return ; - } - return ( - <> - - - - ); - }} - - ); -}; - -export default Page; diff --git a/packages/server-dev/lib/components/block/Block.js b/packages/server-dev/lib/components/block/Block.js deleted file mode 100644 index d17706c0c..000000000 --- a/packages/server-dev/lib/components/block/Block.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2020-2022 Lowdefy, Inc - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -import React, { Suspense, useState } from 'react'; - -import { ErrorBoundary } from '@lowdefy/block-utils'; - -import CategorySwitch from './CategorySwitch.js'; -import LoadingBlock from './LoadingBlock.js'; -import MountEvents from './MountEvents.js'; - -const Block = ({ block, Blocks, context, isRoot, lowdefy }) => { - const [updates, setUpdate] = useState(0); - lowdefy._internal.updaters[block.id] = () => setUpdate(updates + 1); - return ( - - }> - - {(loading) => - loading ? ( - - ) : ( - - ) - } - - - - ); -}; - -export default Block; diff --git a/packages/server-dev/lib/components/block/CategorySwitch.js b/packages/server-dev/lib/components/block/CategorySwitch.js deleted file mode 100644 index f1b052ec7..000000000 --- a/packages/server-dev/lib/components/block/CategorySwitch.js +++ /dev/null @@ -1,115 +0,0 @@ -/* - Copyright 2020-2022 Lowdefy, Inc - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -import React from 'react'; -import { BlockLayout } from '@lowdefy/layout'; -import { makeCssClass } from '@lowdefy/block-utils'; - -import Container from './Container.js'; -import List from './List.js'; - -const CategorySwitch = ({ block, Blocks, context, lowdefy }) => { - if (!block.eval) return null; // Renderer updates before eval is executed for the first time on lists. See #520 - if (block.eval.visible === false) - return
; - const Component = lowdefy._internal.blockComponents[block.type]; - switch (Component.meta.category) { - case 'list': - return ( - - ); - case 'container': - return ( - - ); - case 'input': - return ( - - - - ); - default: - return ( - - - - ); - } -}; - -export default CategorySwitch; diff --git a/packages/server-dev/lib/components/block/Container.js b/packages/server-dev/lib/components/block/Container.js deleted file mode 100644 index 0738f4427..000000000 --- a/packages/server-dev/lib/components/block/Container.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright 2020-2022 Lowdefy, Inc - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -import React from 'react'; -import { Area, BlockLayout, layoutParamsToArea } from '@lowdefy/layout'; -import { makeCssClass } from '@lowdefy/block-utils'; - -import Block from './Block.js'; - -const Container = ({ block, Blocks, Component, context, lowdefy }) => { - const content = {}; - // eslint-disable-next-line prefer-destructuring - const areas = Blocks.subBlocks[block.id][0].areas; - Object.keys(areas).forEach((areaKey, i) => { - content[areaKey] = (areaStyle) => ( - - {areas[areaKey].blocks.map((bl, k) => ( - - ))} - - ); - }); - return ( - - - - ); -}; - -export default Container; diff --git a/packages/server-dev/lib/components/block/List.js b/packages/server-dev/lib/components/block/List.js deleted file mode 100644 index ab24fbb34..000000000 --- a/packages/server-dev/lib/components/block/List.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - Copyright 2020-2022 Lowdefy, Inc - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -import React from 'react'; -import { Area, BlockLayout, layoutParamsToArea } from '@lowdefy/layout'; -import { makeCssClass } from '@lowdefy/block-utils'; - -import Block from './Block.js'; - -const List = ({ block, Blocks, Component, context, lowdefy }) => { - const content = {}; - const contentList = []; - Blocks.subBlocks[block.id].forEach((SBlock) => { - Object.keys(SBlock.areas).forEach((areaKey) => { - content[areaKey] = (areaStyle) => ( - - {SBlock.areas[areaKey].blocks.map((bl) => ( - - ))} - - ); - }); - contentList.push({ ...content }); - }); - return ( - - - - ); -}; - -export default List; diff --git a/packages/server-dev/lib/components/block/LoadingBlock.js b/packages/server-dev/lib/components/block/LoadingBlock.js deleted file mode 100644 index 73480d185..000000000 --- a/packages/server-dev/lib/components/block/LoadingBlock.js +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; -// import { Loading, makeCssClass } from '@lowdefy/block-utils'; -// import { get } from '@lowdefy/helpers'; -// import { BlockLayout } from '@lowdefy/layout'; - -const LoadingBlock = ({ block, lowdefy }) => ( -
LoadingBlock
- // - // - // -); - -export default LoadingBlock; diff --git a/packages/server-dev/lib/components/block/MountEvents.js b/packages/server-dev/lib/components/block/MountEvents.js deleted file mode 100644 index e8bf988f2..000000000 --- a/packages/server-dev/lib/components/block/MountEvents.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright 2020-2022 Lowdefy, Inc - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -import React, { useEffect, useState } from 'react'; - -const MountEvents = ({ asyncEventName, context, eventName, triggerEvent, children }) => { - const [loading, setLoading] = useState(true); - const [error, setError] = useState(null); - useEffect(() => { - let mounted = true; - const mount = async () => { - try { - await triggerEvent({ name: eventName, context }); - if (mounted) { - triggerEvent({ name: asyncEventName, context, async: true }); - setLoading(false); - } - } catch (err) { - setError(err); - } - }; - mount(); - return () => { - mounted = false; - }; - }, [context]); - - if (error) throw error; - - return <>{children(loading)}; -}; - -export default MountEvents; diff --git a/packages/server-dev/lib/components/createComponents.js b/packages/server-dev/lib/components/createComponents.js deleted file mode 100644 index 596e97795..000000000 --- a/packages/server-dev/lib/components/createComponents.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright 2020-2022 Lowdefy, Inc - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -import { createIcon } from '@lowdefy/block-utils'; - -import createLinkComponent from './createLinkComponent.js'; -import icons from '../../build/plugins/icons.js'; - -const createComponents = (lowdefy) => { - return { - Link: createLinkComponent(lowdefy), - Icon: createIcon(icons), - }; -}; - -export default createComponents; diff --git a/packages/server-dev/lib/components/createLinkComponent.js b/packages/server-dev/lib/components/createLinkComponent.js deleted file mode 100644 index 424f4124d..000000000 --- a/packages/server-dev/lib/components/createLinkComponent.js +++ /dev/null @@ -1,97 +0,0 @@ -import React from 'react'; -import NextLink from 'next/link'; -import { createLink } from '@lowdefy/engine'; -import { type } from '@lowdefy/helpers'; - -const createLinkComponent = (lowdefy) => { - const backLink = ({ ariaLabel, children, className, id, rel }) => ( - lowdefy._internal.router.back()} - className={className} - rel={rel} - aria-label={ariaLabel || 'back'} - > - {type.isFunction(children) ? children(id) : children} - - ); - const newOriginLink = ({ - ariaLabel, - children, - className, - id, - newTab, - pageId, - query, - rel, - url, - }) => { - return ( - - {type.isFunction(children) ? children(pageId || url || id) : children} - - ); - }; - const sameOriginLink = ({ - ariaLabel, - children, - className, - id, - newTab, - pageId, - pathname, - query, - rel, - replace, - scroll, - setInput, - url, - }) => { - if (newTab) { - return ( - // eslint-disable-next-line react/jsx-no-target-blank - - {type.isFunction(children) ? children(pageId || url || id) : children} - - ); - } - return ( - - - {type.isFunction(children) ? children(pageId || url || id) : children} - - - ); - }; - const noLink = ({ className, children, id }) => ( - - {type.isFunction(children) ? children(id) : children} - - ); - return createLink({ - backLink, - lowdefy, - newOriginLink, - sameOriginLink, - noLink, - disabledLink: noLink, - }); -}; - -export default createLinkComponent; diff --git a/packages/server-dev/lib/utils/setPageId.js b/packages/server-dev/lib/setPageId.js similarity index 61% rename from packages/server-dev/lib/utils/setPageId.js rename to packages/server-dev/lib/setPageId.js index 6a724ede1..dfcd3317f 100644 --- a/packages/server-dev/lib/utils/setPageId.js +++ b/packages/server-dev/lib/setPageId.js @@ -14,20 +14,17 @@ limitations under the License. */ -function setPageId(lowdefy) { - if (lowdefy._internal.router.pathname === `/404`) { - lowdefy.pageId = '404'; - return false; +function setPageId(router, rootConfig) { + if (router.pathname === `/404`) { + return { redirect: false, pageId: '404' }; } - if (!lowdefy._internal.router.query.pageId) { - lowdefy.pageId = lowdefy.home.pageId; - if (lowdefy.home.configured === false) { - return true; + if (!router.query.pageId) { + if (rootConfig.home.configured === false) { + return { redirect: true, pageId: rootConfig.home.pageId }; } - return false; + return { redirect: false, pageId: rootConfig.home.pageId }; } - lowdefy.pageId = lowdefy._internal.router.query.pageId; - return false; + return { redirect: false, pageId: router.query.pageId }; } export default setPageId; diff --git a/packages/server-dev/lib/utils/callRequest.js b/packages/server-dev/lib/utils/callRequest.js deleted file mode 100644 index e80c9d243..000000000 --- a/packages/server-dev/lib/utils/callRequest.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - Copyright 2020-2022 Lowdefy, Inc - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -import request from './request.js'; - -function callRequest(apiContext, { pageId, payload, requestId }) { - return request({ - url: `${apiContext.config.basePath}/api/request/${pageId}/${requestId}`, - method: 'POST', - body: { payload }, - }); -} - -export default callRequest; diff --git a/packages/server-dev/lib/utils/request.js b/packages/server-dev/lib/utils/request.js index e79ec0f62..d6d2b484d 100644 --- a/packages/server-dev/lib/utils/request.js +++ b/packages/server-dev/lib/utils/request.js @@ -28,6 +28,8 @@ async function request({ url, method = 'GET', body }) { if (!res.ok) { // TODO: check const body = await res.json(); + console.log(res); + console.log(body); throw new Error(body.message || 'Request error'); } return res.json(); diff --git a/packages/server-dev/lib/utils/setupLink.js b/packages/server-dev/lib/utils/setupLink.js deleted file mode 100644 index cec5e21de..000000000 --- a/packages/server-dev/lib/utils/setupLink.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2020-2022 Lowdefy, Inc - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -import { createLink } from '@lowdefy/engine'; - -function setupLink(lowdefy) { - const { router, window } = lowdefy._internal; - const backLink = () => router.back(); - const disabledLink = () => {}; - const newOriginLink = ({ url, query, newTab }) => { - if (newTab) { - return window.open(`${url}${query ? `?${query}` : ''}`, '_blank').focus(); - } else { - return window.location.assign(`${url}${query ? `?${query}` : ''}`); - } - }; - const sameOriginLink = ({ newTab, pathname, query, setInput }) => { - if (newTab) { - return window - .open( - `${window.location.origin}${lowdefy.basePath}${pathname}${query ? `?${query}` : ''}`, - '_blank' - ) - .focus(); - } else { - setInput(); - return router.push({ - pathname, - query, - }); - } - }; - const noLink = () => { - throw new Error(`Invalid Link.`); - }; - return createLink({ backLink, disabledLink, lowdefy, newOriginLink, noLink, sameOriginLink }); -} - -export default setupLink; diff --git a/packages/server-dev/lib/utils/waitForRestartedServer.js b/packages/server-dev/lib/utils/waitForRestartedServer.js index 3c37bbcf8..98bbcd250 100644 --- a/packages/server-dev/lib/utils/waitForRestartedServer.js +++ b/packages/server-dev/lib/utils/waitForRestartedServer.js @@ -16,15 +16,15 @@ import request from './request.js'; -function waitForRestartedServer(lowdefy) { +function waitForRestartedServer(basePath) { setTimeout(async () => { try { await request({ - url: `${lowdefy.basePath}/api/ping`, + url: `${basePath}/api/ping`, }); - lowdefy._internal.window.location.reload(); + window.location.reload(); } catch (error) { - waitForRestartedServer(lowdefy); + waitForRestartedServer(basePath); } }, 1500); } diff --git a/packages/server-dev/package.json b/packages/server-dev/package.json index a5881a663..51e413474 100644 --- a/packages/server-dev/package.json +++ b/packages/server-dev/package.json @@ -37,8 +37,8 @@ "next": "next" }, "dependencies": { + "@lowdefy/actions-core": "4.0.0-alpha.8", "@lowdefy/api": "4.0.0-alpha.8", - "@lowdefy/block-utils": "4.0.0-alpha.8", "@lowdefy/blocks-antd": "4.0.0-alpha.8", "@lowdefy/blocks-basic": "4.0.0-alpha.8", "@lowdefy/blocks-color-selectors": "4.0.0-alpha.8", @@ -46,6 +46,7 @@ "@lowdefy/blocks-loaders": "4.0.0-alpha.8", "@lowdefy/blocks-markdown": "4.0.0-alpha.8", "@lowdefy/build": "4.0.0-alpha.8", + "@lowdefy/client": "4.0.0-alpha.8", "@lowdefy/connection-axios-http": "4.0.0-alpha.8", "@lowdefy/engine": "4.0.0-alpha.8", "@lowdefy/helpers": "4.0.0-alpha.8", diff --git a/packages/server-dev/pages/_app.js b/packages/server-dev/pages/_app.js index 2b58b4e90..adff5f43d 100644 --- a/packages/server-dev/pages/_app.js +++ b/packages/server-dev/pages/_app.js @@ -14,27 +14,14 @@ limitations under the License. */ -import React, { Suspense } from 'react'; +import React from 'react'; import dynamic from 'next/dynamic'; -import { ErrorBoundary } from '@lowdefy/block-utils'; - -import LowdefyContext from '../lib/components/LowdefyContext.js'; - +// Must be in _app due to next specifications. import '../build/plugins/styles.less'; -const lowdefy = {}; - function App({ Component, pageProps }) { - return ( - - - - - - - - ); + return ; } const DynamicApp = dynamic(() => Promise.resolve(App), { diff --git a/packages/server/lib/Page.js b/packages/server/lib/Page.js new file mode 100644 index 000000000..81b3ab4d1 --- /dev/null +++ b/packages/server/lib/Page.js @@ -0,0 +1,50 @@ +/* + Copyright 2020-2022 Lowdefy, Inc + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +import React from 'react'; + +import { useRouter } from 'next/router'; +import Client from '@lowdefy/client'; +import Head from 'next/head'; +import Link from 'next/link'; + +import actions from '../build/plugins/actions.js'; +import blocks from '../build/plugins/blocks.js'; +import icons from '../build/plugins/icons.js'; +import operators from '../build/plugins/operatorsClient.js'; + +const Page = ({ pageConfig, rootConfig }) => { + const router = useRouter(); + return ( + + ); +}; + +export default Page; diff --git a/packages/server/lib/utils/initLowdefyContext.js b/packages/server/lib/utils/initLowdefyContext.js deleted file mode 100644 index cae97342b..000000000 --- a/packages/server/lib/utils/initLowdefyContext.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright 2020-2022 Lowdefy, Inc - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -import actions from '../../build/plugins/actions.js'; -import callRequest from '../utils/callRequest.js'; -import blockComponents from '../../build/plugins/blocks.js'; -import operators from '../../build/plugins/operatorsClient.js'; - -function initLowdefyContext() { - const lowdefy = { - _internal: { - actions, - blockComponents, - callRequest, - components: {}, - operators, - updaters: {}, - displayMessage: ({ content }) => { - console.log(content); - return () => undefined; - }, - link: () => undefined, - }, - contexts: {}, - inputs: {}, - lowdefyGlobal: {}, - }; - lowdefy._internal.updateBlock = (blockId) => - lowdefy._internal.updaters[blockId] && lowdefy._internal.updaters[blockId](); - return lowdefy; -} - -export default initLowdefyContext; diff --git a/packages/server/package.json b/packages/server/package.json index d3c42c9a9..76c307099 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -40,13 +40,11 @@ "next": "next" }, "dependencies": { - "@lowdefy/actions-core": "4.0.0-alpha.8", "@lowdefy/api": "4.0.0-alpha.8", - "@lowdefy/block-utils": "4.0.0-alpha.8", "@lowdefy/blocks-antd": "4.0.0-alpha.8", "@lowdefy/blocks-basic": "4.0.0-alpha.8", "@lowdefy/blocks-loaders": "4.0.0-alpha.8", - "@lowdefy/engine": "4.0.0-alpha.8", + "@lowdefy/client": "4.0.0-alpha.8", "@lowdefy/helpers": "4.0.0-alpha.8", "@lowdefy/layout": "4.0.0-alpha.8", "@lowdefy/node-utils": "4.0.0-alpha.8", diff --git a/packages/server/pages/404.js b/packages/server/pages/404.js index c526d53a3..b0ea4c6dc 100644 --- a/packages/server/pages/404.js +++ b/packages/server/pages/404.js @@ -16,7 +16,7 @@ import { createApiContext, getPageConfig, getRootConfig } from '@lowdefy/api'; -import Page from '../lib/components/Page.js'; +import Page from '../lib/Page.js'; export async function getStaticProps() { // TODO: get the right api context options diff --git a/packages/server/pages/[pageId].js b/packages/server/pages/[pageId].js index 7594efb4f..59d1d63e7 100644 --- a/packages/server/pages/[pageId].js +++ b/packages/server/pages/[pageId].js @@ -16,7 +16,7 @@ import { createApiContext, getPageConfig, getRootConfig } from '@lowdefy/api'; -import Page from '../lib/components/Page.js'; +import Page from '../lib/Page.js'; export async function getServerSideProps(context) { const { pageId } = context.params; diff --git a/packages/server/pages/_app.js b/packages/server/pages/_app.js index f630095c6..adff5f43d 100644 --- a/packages/server/pages/_app.js +++ b/packages/server/pages/_app.js @@ -16,20 +16,12 @@ import React from 'react'; import dynamic from 'next/dynamic'; -import { ErrorBoundary } from '@lowdefy/block-utils'; - -import initLowdefyContext from '../lib/utils/initLowdefyContext.js'; +// Must be in _app due to next specifications. import '../build/plugins/styles.less'; -const lowdefy = initLowdefyContext(); - function App({ Component, pageProps }) { - return ( - - - - ); + return ; } const DynamicApp = dynamic(() => Promise.resolve(App), { diff --git a/packages/server/pages/index.js b/packages/server/pages/index.js index 617d60d1d..0330f093f 100644 --- a/packages/server/pages/index.js +++ b/packages/server/pages/index.js @@ -16,7 +16,7 @@ import { createApiContext, getPageConfig, getRootConfig } from '@lowdefy/api'; -import Page from '../lib/components/Page.js'; +import Page from '../lib/Page.js'; export async function getServerSideProps() { // TODO: is this build directory configurable from the cli? diff --git a/packages/utils/block-utils/package.json b/packages/utils/block-utils/package.json index df450bdb7..71db8ccd5 100644 --- a/packages/utils/block-utils/package.json +++ b/packages/utils/block-utils/package.json @@ -43,10 +43,8 @@ "test": "jest --coverage" }, "dependencies": { - "@ant-design/icons": "4.7.0", "@emotion/css": "11.7.1", "@lowdefy/helpers": "4.0.0-alpha.8", - "classnames": "2.3.1", "dompurify": "2.3.5", "react": "17.0.2", "react-dom": "17.0.2" diff --git a/packages/utils/block-utils/src/index.js b/packages/utils/block-utils/src/index.js index 80b48f2d5..c42b37187 100644 --- a/packages/utils/block-utils/src/index.js +++ b/packages/utils/block-utils/src/index.js @@ -16,8 +16,6 @@ import blockDefaultProps from './blockDefaultProps.js'; import blockSchema from './blockSchema.js'; -import createIcon from './createIcon.js'; -import ErrorBoundary from './ErrorBoundary.js'; import HtmlComponent from './HtmlComponent.js'; import makeCssClass from './makeCssClass.js'; import mediaToCssObject from './mediaToCssObject.js'; @@ -26,8 +24,6 @@ import renderHtml from './renderHtml.js'; export { blockDefaultProps, blockSchema, - createIcon, - ErrorBoundary, HtmlComponent, makeCssClass, mediaToCssObject, diff --git a/yarn.lock b/yarn.lock index da3af0ff8..930ad42db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2005,7 +2005,6 @@ __metadata: version: 0.0.0-use.local resolution: "@lowdefy/block-utils@workspace:packages/utils/block-utils" dependencies: - "@ant-design/icons": 4.7.0 "@emotion/css": 11.7.1 "@emotion/jest": 11.7.1 "@lowdefy/helpers": 4.0.0-alpha.8 @@ -2015,7 +2014,6 @@ __metadata: "@testing-library/dom": 8.11.3 "@testing-library/react": 13.0.0-alpha.4 "@testing-library/user-event": 14.0.0-alpha.14 - classnames: 2.3.1 copyfiles: 2.4.1 dompurify: 2.3.5 jest: 27.5.1 @@ -2225,6 +2223,32 @@ __metadata: languageName: unknown linkType: soft +"@lowdefy/client@4.0.0-alpha.8, @lowdefy/client@workspace:packages/client": + version: 0.0.0-use.local + resolution: "@lowdefy/client@workspace:packages/client" + dependencies: + "@ant-design/icons": 4.7.0 + "@emotion/jest": 11.7.1 + "@lowdefy/block-utils": 4.0.0-alpha.8 + "@lowdefy/engine": 4.0.0-alpha.8 + "@lowdefy/helpers": 4.0.0-alpha.8 + "@lowdefy/layout": 4.0.0-alpha.8 + "@swc/cli": 0.1.55 + "@swc/core": 1.2.135 + "@swc/jest": 0.2.17 + "@testing-library/dom": 8.11.3 + "@testing-library/react": 13.0.0-alpha.4 + "@testing-library/user-event": 14.0.0-alpha.14 + classnames: 2.3.1 + copyfiles: 2.4.1 + jest: 27.5.1 + jest-serializer-html: 7.1.0 + jest-transform-yaml: 1.0.0 + react: 17.0.2 + react-dom: 17.0.2 + languageName: unknown + linkType: soft + "@lowdefy/connection-axios-http@4.0.0-alpha.8, @lowdefy/connection-axios-http@workspace:packages/plugins/connections/connection-axios-http": version: 0.0.0-use.local resolution: "@lowdefy/connection-axios-http@workspace:packages/plugins/connections/connection-axios-http" @@ -2607,8 +2631,8 @@ __metadata: version: 0.0.0-use.local resolution: "@lowdefy/server-dev@workspace:packages/server-dev" dependencies: + "@lowdefy/actions-core": 4.0.0-alpha.8 "@lowdefy/api": 4.0.0-alpha.8 - "@lowdefy/block-utils": 4.0.0-alpha.8 "@lowdefy/blocks-antd": 4.0.0-alpha.8 "@lowdefy/blocks-basic": 4.0.0-alpha.8 "@lowdefy/blocks-color-selectors": 4.0.0-alpha.8 @@ -2616,6 +2640,7 @@ __metadata: "@lowdefy/blocks-loaders": 4.0.0-alpha.8 "@lowdefy/blocks-markdown": 4.0.0-alpha.8 "@lowdefy/build": 4.0.0-alpha.8 + "@lowdefy/client": 4.0.0-alpha.8 "@lowdefy/connection-axios-http": 4.0.0-alpha.8 "@lowdefy/engine": 4.0.0-alpha.8 "@lowdefy/helpers": 4.0.0-alpha.8 @@ -2650,14 +2675,12 @@ __metadata: version: 0.0.0-use.local resolution: "@lowdefy/server@workspace:packages/server" dependencies: - "@lowdefy/actions-core": 4.0.0-alpha.8 "@lowdefy/api": 4.0.0-alpha.8 - "@lowdefy/block-utils": 4.0.0-alpha.8 "@lowdefy/blocks-antd": 4.0.0-alpha.8 "@lowdefy/blocks-basic": 4.0.0-alpha.8 "@lowdefy/blocks-loaders": 4.0.0-alpha.8 "@lowdefy/build": 4.0.0-alpha.8 - "@lowdefy/engine": 4.0.0-alpha.8 + "@lowdefy/client": 4.0.0-alpha.8 "@lowdefy/helpers": 4.0.0-alpha.8 "@lowdefy/layout": 4.0.0-alpha.8 "@lowdefy/node-utils": 4.0.0-alpha.8