@lowdefy/client 0.0.0-experimental-20231123101256 → 0.0.0-experimental-20240111121545
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BrandTag.js +76 -0
- package/dist/Client.js +2 -1
- package/dist/setupLink.js +11 -3
- package/package.json +6 -6
package/dist/BrandTag.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React, { useState, useEffect } from 'react';
|
|
16
|
+
const containerStyle = {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
position: 'fixed',
|
|
19
|
+
bottom: 0,
|
|
20
|
+
right: 0
|
|
21
|
+
};
|
|
22
|
+
const brandStyle = {
|
|
23
|
+
flex: '0 1 auto',
|
|
24
|
+
contentAlign: 'middle',
|
|
25
|
+
padding: '8px 4px',
|
|
26
|
+
background: '#1990FF',
|
|
27
|
+
borderRadius: 6,
|
|
28
|
+
margin: 4
|
|
29
|
+
};
|
|
30
|
+
const imageStyle = {
|
|
31
|
+
flex: '1 0 auto',
|
|
32
|
+
padding: 2,
|
|
33
|
+
marginRight: 4
|
|
34
|
+
};
|
|
35
|
+
const textStyle = {
|
|
36
|
+
flex: '1 0 auto',
|
|
37
|
+
fontSize: 12,
|
|
38
|
+
color: 'white',
|
|
39
|
+
lineHeight: '1.2rem'
|
|
40
|
+
};
|
|
41
|
+
const checkEntitlement = async ({ setShowBranding })=>{
|
|
42
|
+
const license = await (await fetch('/api/license')).json();
|
|
43
|
+
setShowBranding(!license.entitlements.includes['NO_BRANDING']);
|
|
44
|
+
};
|
|
45
|
+
const BrandTag = ()=>{
|
|
46
|
+
const [showBranding, setShowBranding] = useState(false);
|
|
47
|
+
useEffect(()=>{
|
|
48
|
+
checkEntitlement({
|
|
49
|
+
setShowBranding
|
|
50
|
+
});
|
|
51
|
+
}, []);
|
|
52
|
+
if (!showBranding) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
56
|
+
style: containerStyle
|
|
57
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
58
|
+
style: brandStyle
|
|
59
|
+
}, /*#__PURE__*/ React.createElement("img", {
|
|
60
|
+
style: imageStyle,
|
|
61
|
+
src: "https://lowdefy.com/images/logo_white_40.png",
|
|
62
|
+
alt: "",
|
|
63
|
+
height: 20
|
|
64
|
+
}), /*#__PURE__*/ React.createElement("span", {
|
|
65
|
+
style: textStyle
|
|
66
|
+
}, /*#__PURE__*/ React.createElement("a", {
|
|
67
|
+
href: "https://lowdefy.com",
|
|
68
|
+
target: "_blank",
|
|
69
|
+
rel: "noreferrer",
|
|
70
|
+
style: {
|
|
71
|
+
textDecoration: 'none',
|
|
72
|
+
color: 'inherit'
|
|
73
|
+
}
|
|
74
|
+
}, "Built with Lowdefy"))));
|
|
75
|
+
};
|
|
76
|
+
export default BrandTag;
|
package/dist/Client.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { serializer } from '@lowdefy/helpers';
|
|
17
17
|
import Block from './block/Block.js';
|
|
18
|
+
import BrandTag from './BrandTag.js';
|
|
18
19
|
import Context from './Context.js';
|
|
19
20
|
import DisplayMessage from './DisplayMessage.js';
|
|
20
21
|
import Head from './Head.js';
|
|
@@ -66,6 +67,6 @@ const Client = ({ auth, Components, config: rawConfig, lowdefy, resetContext = {
|
|
|
66
67
|
lowdefy: lowdefy,
|
|
67
68
|
parentLoading: false
|
|
68
69
|
}));
|
|
69
|
-
}));
|
|
70
|
+
}), /*#__PURE__*/ React.createElement(BrandTag, null));
|
|
70
71
|
};
|
|
71
72
|
export default Client;
|
package/dist/setupLink.js
CHANGED
|
@@ -20,10 +20,18 @@ function setupLink(lowdefy) {
|
|
|
20
20
|
const disabledLink = ()=>{};
|
|
21
21
|
const newOriginLink = ({ url, query, newTab })=>{
|
|
22
22
|
if (newTab) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const handle = window.open(`${url}${query ? `?${query}` : ''}`, '_blank');
|
|
24
|
+
if (!handle) {
|
|
25
|
+
lowdefy._internal.displayMessage({
|
|
26
|
+
content: 'A popup blocker may be preventing the application from opening the page. Approve the popup to continue.',
|
|
27
|
+
status: 'info',
|
|
28
|
+
duration: 10
|
|
29
|
+
});
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
return handle.focus();
|
|
26
33
|
}
|
|
34
|
+
return window.location.assign(`${url}${query ? `?${query}` : ''}`);
|
|
27
35
|
};
|
|
28
36
|
const sameOriginLink = ({ newTab, pathname, query, setInput })=>{
|
|
29
37
|
if (newTab) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/client",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20240111121545",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Lowdefy Client",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@ant-design/icons": "4.8.0",
|
|
37
|
-
"@lowdefy/block-utils": "0.0.0-experimental-
|
|
38
|
-
"@lowdefy/engine": "0.0.0-experimental-
|
|
39
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
40
|
-
"@lowdefy/layout": "0.0.0-experimental-
|
|
37
|
+
"@lowdefy/block-utils": "0.0.0-experimental-20240111121545",
|
|
38
|
+
"@lowdefy/engine": "0.0.0-experimental-20240111121545",
|
|
39
|
+
"@lowdefy/helpers": "0.0.0-experimental-20240111121545",
|
|
40
|
+
"@lowdefy/layout": "0.0.0-experimental-20240111121545",
|
|
41
41
|
"classnames": "2.3.2",
|
|
42
42
|
"react": "18.2.0",
|
|
43
43
|
"react-dom": "18.2.0"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@emotion/jest": "11.10.5",
|
|
47
47
|
"@jest/globals": "28.1.3",
|
|
48
|
-
"@lowdefy/jest-yaml-transform": "0.0.0-experimental-
|
|
48
|
+
"@lowdefy/jest-yaml-transform": "0.0.0-experimental-20240111121545",
|
|
49
49
|
"@swc/cli": "0.1.63",
|
|
50
50
|
"@swc/core": "1.3.99",
|
|
51
51
|
"@swc/jest": "0.2.29",
|