@lowdefy/client 5.1.0 → 5.2.0

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.
@@ -23,6 +23,7 @@ const Container = ({ block, Blocks, Component, context, loading, lowdefy })=>{
23
23
  // eslint-disable-next-line prefer-destructuring
24
24
  const slots = Blocks.subSlots[block.id][0].slots;
25
25
  Object.keys(slots).forEach((slotKey, i)=>{
26
+ if (slots[slotKey].blocks.length === 0) return;
26
27
  content[slotKey] = (contentStyle)=>/*#__PURE__*/ React.createElement(Area, {
27
28
  area: block.eval.slots[slotKey],
28
29
  areaKey: slotKey,
@@ -23,6 +23,7 @@ const InputContainer = ({ block, Blocks, Component, context, loading, lowdefy })
23
23
  // eslint-disable-next-line prefer-destructuring
24
24
  const slots = Blocks.subSlots[block.id][0].slots;
25
25
  Object.keys(slots).forEach((slotKey, i)=>{
26
+ if (slots[slotKey].blocks.length === 0) return;
26
27
  content[slotKey] = (contentStyle)=>/*#__PURE__*/ React.createElement(Area, {
27
28
  area: block.eval.slots[slotKey],
28
29
  areaKey: slotKey,
@@ -15,6 +15,7 @@
15
15
  */ import React from 'react';
16
16
  import { Area, BlockLayout } from '@lowdefy/layout';
17
17
  import { cn } from '@lowdefy/block-utils';
18
+ import { get } from '@lowdefy/helpers';
18
19
  import Block from './Block.js';
19
20
  import resolveClassNames from './resolveClassNames.js';
20
21
  const List = ({ block, Blocks, Component, context, loading, lowdefy })=>{
@@ -23,6 +24,7 @@ const List = ({ block, Blocks, Component, context, loading, lowdefy })=>{
23
24
  const contentList = [];
24
25
  Blocks.subSlots[block.id].forEach((SBlock)=>{
25
26
  Object.keys(SBlock.slots).forEach((slotKey)=>{
27
+ if (SBlock.slots[slotKey].blocks.length === 0) return;
26
28
  content[slotKey] = (contentStyle)=>/*#__PURE__*/ React.createElement(Area, {
27
29
  area: block.eval.slots[slotKey],
28
30
  areaKey: slotKey,
@@ -70,6 +72,7 @@ const List = ({ block, Blocks, Component, context, loading, lowdefy })=>{
70
72
  events: block.eval.events ?? {},
71
73
  key: block.blockId,
72
74
  list: contentList,
75
+ value: get(context.state, block.blockId) ?? [],
73
76
  loading: loading,
74
77
  menus: lowdefy.menus,
75
78
  pageId: lowdefy.pageId,
@@ -3,9 +3,10 @@ import { createLink } from '@lowdefy/engine';
3
3
  import { type } from '@lowdefy/helpers';
4
4
  const createLinkComponent = (lowdefy, Link)=>{
5
5
  const { window } = lowdefy._internal.globals;
6
- const backLink = ({ ariaLabel, children, className, id, onClick = ()=>{}, rel })=>/*#__PURE__*/ React.createElement("a", {
6
+ const backLink = ({ ariaLabel, children, className, id, onClick = ()=>{}, rel, style })=>/*#__PURE__*/ React.createElement("a", {
7
7
  id: id,
8
8
  className: className,
9
+ style: style,
9
10
  rel: rel,
10
11
  "aria-label": ariaLabel ?? 'back',
11
12
  onClick: (...params)=>{
@@ -13,11 +14,12 @@ const createLinkComponent = (lowdefy, Link)=>{
13
14
  onClick(...params);
14
15
  }
15
16
  }, type.isFunction(children) ? children(id) : children);
16
- const newOriginLink = ({ ariaLabel, children, className, href, id, onClick = ()=>{}, newTab, pageId, query, rel, url })=>{
17
+ const newOriginLink = ({ ariaLabel, children, className, href, id, onClick = ()=>{}, newTab, pageId, query, rel, style, url })=>{
17
18
  return /*#__PURE__*/ React.createElement("a", {
18
19
  id: id,
19
20
  "aria-label": ariaLabel,
20
21
  className: className,
22
+ style: style,
21
23
  href: href ?? `${url}${query ? `?${query}` : ''}`,
22
24
  rel: rel ?? (newTab && 'noopener noreferrer'),
23
25
  target: newTab && '_blank',
@@ -27,13 +29,14 @@ const createLinkComponent = (lowdefy, Link)=>{
27
29
  }
28
30
  }, type.isFunction(children) ? children(pageId ?? url ?? id) : children);
29
31
  };
30
- const sameOriginLink = ({ ariaLabel, children, className, id, newTab, onClick = ()=>{}, pageId, pathname, query, rel, replace, scroll, setInput, url })=>{
32
+ const sameOriginLink = ({ ariaLabel, children, className, id, newTab, onClick = ()=>{}, pageId, pathname, query, rel, replace, scroll, setInput, style, url })=>{
31
33
  if (newTab) {
32
34
  return(// eslint-disable-next-line react/jsx-no-target-blank
33
35
  /*#__PURE__*/ React.createElement("a", {
34
36
  id: id,
35
37
  "aria-label": ariaLabel,
36
38
  className: className,
39
+ style: style,
37
40
  href: `${window.location.origin}${lowdefy.basePath}${pathname}${query ? `?${query}` : ''}`,
38
41
  rel: rel ?? 'noopener noreferrer',
39
42
  target: "_blank",
@@ -54,6 +57,7 @@ const createLinkComponent = (lowdefy, Link)=>{
54
57
  id: id,
55
58
  "aria-label": ariaLabel,
56
59
  className: className,
60
+ style: style,
57
61
  rel: rel,
58
62
  onClick: (...params)=>{
59
63
  setInput();
@@ -61,9 +65,10 @@ const createLinkComponent = (lowdefy, Link)=>{
61
65
  }
62
66
  }, type.isFunction(children) ? children(pageId ?? url ?? id) : children));
63
67
  };
64
- const noLink = ({ className, children, id, onClick = ()=>{} })=>/*#__PURE__*/ React.createElement("span", {
68
+ const noLink = ({ className, children, id, onClick = ()=>{}, style })=>/*#__PURE__*/ React.createElement("span", {
65
69
  id: id,
66
70
  className: className,
71
+ style: style,
67
72
  onClick: onClick
68
73
  }, type.isFunction(children) ? children(id) : children);
69
74
  return createLink({
@@ -0,0 +1,31 @@
1
+ /*
2
+ Copyright 2020-2026 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
+ */ // Create a container element for antd's CSS-in-JS injection that is positioned
16
+ // AFTER the @layer order declaration in <head>. Without this, antd's StyleProvider
17
+ // prepends <style> tags to the top of <head>, placing them before the @layer
18
+ // declaration and breaking the cascade layer priority (antd becomes lowest instead
19
+ // of overriding Tailwind's preflight).
20
+ function getOrCreateAntdCssContainer() {
21
+ if (typeof document === 'undefined') return undefined;
22
+ const existing = document.getElementById('__antd-css-container');
23
+ if (existing) return existing;
24
+ const anchor = document.getElementById('__lf-layer-order');
25
+ if (!anchor) return undefined;
26
+ const container = document.createElement('div');
27
+ container.id = '__antd-css-container';
28
+ anchor.after(container);
29
+ return container;
30
+ }
31
+ export default getOrCreateAntdCssContainer;
package/dist/index.js CHANGED
@@ -14,4 +14,5 @@
14
14
  limitations under the License.
15
15
  */ import Client from './Client.js';
16
16
  export default Client;
17
+ export { default as getOrCreateAntdCssContainer } from './getOrCreateAntdCssContainer.js';
17
18
  export { default as useDarkMode } from './useDarkMode.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/client",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Lowdefy Client",
6
6
  "homepage": "https://lowdefy.com",
@@ -35,19 +35,19 @@
35
35
  "dependencies": {
36
36
  "@ant-design/icons": "6.1.0",
37
37
  "antd": "6.3.1",
38
- "@lowdefy/block-utils": "5.1.0",
39
- "@lowdefy/engine": "5.1.0",
40
- "@lowdefy/errors": "5.1.0",
41
- "@lowdefy/helpers": "5.1.0",
42
- "@lowdefy/layout": "5.1.0",
43
- "@lowdefy/logger": "5.1.0",
38
+ "@lowdefy/block-utils": "5.2.0",
39
+ "@lowdefy/engine": "5.2.0",
40
+ "@lowdefy/errors": "5.2.0",
41
+ "@lowdefy/helpers": "5.2.0",
42
+ "@lowdefy/layout": "5.2.0",
43
+ "@lowdefy/logger": "5.2.0",
44
44
  "react": "18.2.0",
45
45
  "react-dom": "18.2.0",
46
46
  "tinykeys": "^3.0.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@jest/globals": "28.1.3",
50
- "@lowdefy/jest-yaml-transform": "5.1.0",
50
+ "@lowdefy/jest-yaml-transform": "5.2.0",
51
51
  "@swc/cli": "0.8.0",
52
52
  "@swc/core": "1.15.18",
53
53
  "@swc/jest": "0.2.39",