react-bricks 4.7.0-beta.1 → 4.7.0-beta.2

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.
@@ -1,13 +1,8 @@
1
1
  ---
2
2
  import type { types } from 'react-bricks/astro'
3
3
  import { reactBricksAstroStore, AstroBrick } from 'react-bricks/astro'
4
- import PageViewer from 'react-bricks/astro/PageViewer.astro'
5
-
6
- // import type { types } from '@/shared/types'
7
- // import reactBricksAstroStore from '../../ReactBricks/reactBricksAstroStore'
8
- // import AstroBrick from '../AstroBrick'
9
- // import PageViewer from './PageViewer.astro'
10
-
4
+ import PageViewer from './PageViewer.astro'
5
+
11
6
  interface Props {
12
7
  block: types.IContentBlock
13
8
  index?: number
@@ -16,9 +11,11 @@ interface Props {
16
11
  [x: string]: unknown
17
12
  }
18
13
 
14
+
19
15
  let error = false
20
16
  const { block, index, itemsCount, page, ...props } = Astro.props as Props
21
17
  const config = reactBricksAstroStore.getConfig()
18
+
22
19
  if (!config) {
23
20
  console.warn('React Bricks Store is not initialized')
24
21
  error = true
@@ -26,7 +23,6 @@ if (!config) {
26
23
 
27
24
  reactBricksAstroStore.setBlock(block)
28
25
 
29
- // console.log('DynamicComponent', import.meta.env.SSR, !!config)
30
26
  const Brick = reactBricksAstroStore.getBrick(block)
31
27
 
32
28
  let blockProps = { ...block.props, ...props }
@@ -37,8 +33,6 @@ if (!Brick) {
37
33
  }
38
34
  error = true
39
35
  } else {
40
- // Apply mapExternalDataToProps if it is defined
41
- // and externalData is supplied
42
36
  if (
43
37
  Brick.schema.mapExternalDataToProps &&
44
38
  typeof Brick.schema.mapExternalDataToProps === 'function' &&
@@ -60,6 +54,8 @@ const pathname =
60
54
  Astro.url.pathname === '/'
61
55
  ? Astro.url.pathname
62
56
  : trimEndChar(Astro.url.pathname || '', '/')
57
+
58
+ const isDev = import.meta.env.DEV
63
59
  ---
64
60
 
65
61
  {
@@ -79,8 +75,18 @@ const pathname =
79
75
  block={block}
80
76
  pathname={pathname}
81
77
  />
78
+ ) : Brick.schema.astroInteractivity && isDev ? (
79
+ <AstroBrick
80
+ client:only
81
+ blockProps={blockProps}
82
+ index={index}
83
+ itemsCount={itemsCount}
84
+ page={page}
85
+ block={block}
86
+ pathname={pathname}
87
+ />
82
88
  ) : Brick.schema.astroInteractivity === 'load' ||
83
- (Brick.schema.astroInteractivity as any).load === true ? (
89
+ Brick.schema.astroInteractivity.load === true ? (
84
90
  <AstroBrick
85
91
  client:load
86
92
  blockProps={blockProps}
@@ -91,7 +97,7 @@ const pathname =
91
97
  pathname={pathname}
92
98
  />
93
99
  ) : Brick.schema.astroInteractivity === 'idle' ||
94
- (Brick.schema.astroInteractivity as any).idle === true ? (
100
+ Brick.schema.astroInteractivity.idle === true ? (
95
101
  <AstroBrick
96
102
  client:idle
97
103
  blockProps={blockProps}
@@ -101,10 +107,10 @@ const pathname =
101
107
  block={block}
102
108
  pathname={pathname}
103
109
  />
104
- ) : !!(Brick.schema.astroInteractivity as any).idle?.timeout ? (
110
+ ) : !!Brick.schema.astroInteractivity.idle?.timeout ? (
105
111
  <AstroBrick
106
112
  client:idle={{
107
- timeout: (Brick.schema.astroInteractivity as any).idle?.timeout,
113
+ timeout: Brick.schema.astroInteractivity.idle?.timeout,
108
114
  }}
109
115
  blockProps={blockProps}
110
116
  index={index}
@@ -114,7 +120,7 @@ const pathname =
114
120
  pathname={pathname}
115
121
  />
116
122
  ) : Brick.schema.astroInteractivity === 'visible' ||
117
- (Brick.schema.astroInteractivity as any).visible === true ? (
123
+ Brick.schema.astroInteractivity.visible === true ? (
118
124
  <AstroBrick
119
125
  client:visible
120
126
  blockProps={blockProps}
@@ -124,11 +130,10 @@ const pathname =
124
130
  block={block}
125
131
  pathname={pathname}
126
132
  />
127
- ) : !!(Brick.schema.astroInteractivity as any).visible?.rootMargin ? (
133
+ ) : !!Brick.schema.astroInteractivity.visible?.rootMargin ? (
128
134
  <AstroBrick
129
135
  client:visible={{
130
- rootMargin: (Brick.schema.astroInteractivity as any).visible
131
- ?.rootMargin,
136
+ rootMargin: Brick.schema.astroInteractivity.visible?.rootMargin,
132
137
  }}
133
138
  blockProps={blockProps}
134
139
  index={index}
@@ -137,9 +142,9 @@ const pathname =
137
142
  block={block}
138
143
  pathname={pathname}
139
144
  />
140
- ) : !!(Brick.schema.astroInteractivity as any).media ? (
145
+ ) : !!Brick.schema.astroInteractivity.media ? (
141
146
  <AstroBrick
142
- client:media={(Brick.schema.astroInteractivity as any).media}
147
+ client:media={Brick.schema.astroInteractivity.media}
143
148
  blockProps={blockProps}
144
149
  index={index}
145
150
  itemsCount={itemsCount}
@@ -147,9 +152,9 @@ const pathname =
147
152
  block={block}
148
153
  pathname={pathname}
149
154
  />
150
- ) : !!(Brick.schema.astroInteractivity as any).only ? (
155
+ ) : !!Brick.schema.astroInteractivity.only ? (
151
156
  <AstroBrick
152
- client:only={(Brick.schema.astroInteractivity as any).only}
157
+ client:only={Brick.schema.astroInteractivity.only}
153
158
  blockProps={blockProps}
154
159
  index={index}
155
160
  itemsCount={itemsCount}
@@ -1,18 +1,14 @@
1
1
  ---
2
2
  import type { types } from 'react-bricks/astro'
3
- import { reactBricksAstroStore, ClickToEdit } from 'react-bricks/astro'
4
- import DynamicComponent from 'react-bricks/astro/DynamicComponent.astro'
5
-
6
- // import type { types } from '@/shared/types'
7
- // import reactBricksAstroStore from '../../ReactBricks/reactBricksAstroStore'
8
- // import ClickToEdit from '../ClickToEdit'
9
- // import DynamicComponent from './DynamicComponent.astro'
3
+ import { ClickToEdit, reactBricksAstroStore } from 'react-bricks/astro'
4
+ import DynamicComponent from './DynamicComponent.astro'
10
5
 
11
6
  interface Props {
12
7
  page: types.Page
13
8
  main?: boolean
14
9
  }
15
10
 
11
+
16
12
  let error = false
17
13
  const { page, main } = Astro.props as Props
18
14
 
@@ -30,13 +26,11 @@ if (!pageType) {
30
26
  error = true
31
27
  }
32
28
 
33
- // console.log('is main?', !!main, page.name)
34
29
  ---
35
-
36
30
  {
37
31
  error
38
32
  ? ''
39
- : (page?.content?.map((block, index) => (
33
+ : (page?.content?.map((block: any, index: any) => (
40
34
  <DynamicComponent
41
35
  page={page}
42
36
  key={`${block.id}-${index}`}
package/astro/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("intersection-observer");var e=require("../react-bricks-DBsyFafC.js"),t=require("../react-bricks-1Be065Jm.js"),r=require("react"),n=require("react-icons/fi"),o=require("../react-bricks-BFoJ4_oR.js");require("../react-bricks-Btf-citH.js"),require("classnames"),require("../react-bricks-BNm3bMhQ.js"),require("ts-md5");var i,s="c"+(i=5,e.__spreadArray([],e.__read(Array(i)),!1).map((function(){return(~~(36*Math.random())).toString(36)})).join("")),a=function(){return r.createElement(r.Fragment,null,r.createElement("style",null,"\n.".concat(s," {\n display:block;\n position: fixed;\n box-sizing: border-box;\n z-index: 999;\n bottom: 20px;\n left: 20px;\n padding: 5px 12px;\n background-color: #ffffffdd;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #1e293b;\n font-size: 11px;\n font-weight: 600;\n border: 1px solid #e2e8f0cc;\n border-radius: 20px;\n text-transform: uppercase;\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);\n filter: none;\n transition: all 300ms ease;\n}\n.").concat(s,":hover {\n background-color: #ffffff;\n filter: drop-shadow(0 20px 13px rgb(0 0 0 / 0.03)) drop-shadow(0 8px 5px rgb(0 0 0 / 0.08));\n}\n.").concat(s," .l {\n transition: color 300ms ease;\n}\n.").concat(s,":hover .l {\n color: #f65a8e;\n}\n ")),r.createElement("a",{href:"https://reactbricks.com?utm_campaign=site-badge",target:"_blank",className:s},r.createElement("img",{src:"https://reactbricks.com/_next/static/media/reactbricks_icon.c57a7be4.svg",style:{width:18,height:18,marginRight:6}}),r.createElement("span",null,"Made in ",r.createElement("span",{className:"l"},"React Bricks"))))},c=t.reactBricksAstroStore.getBricks,l=t.reactBricksAstroStore.getPageValues,p=t.reactBricksAstroStore.getBlockValue,d=t.reactBricksAstroStore.isAdmin;t.reactBricksAstroStore.register,Object.defineProperty(exports,"types",{enumerable:!0,get:function(){return e.types}}),exports.File=t.File,exports.Image=t.Image,exports.Link=t.Link,exports.Repeater=t.Repeater,exports.RichText=t.CompatibleRichText,exports.RichTextExt=t.RichText,exports.Text=t.Text,exports.reactBricksAstroStore=t.reactBricksAstroStore,exports.useAdminContext=t.useAdminContext,exports.usePageValues=t.usePageValues,exports.useReactBricksContext=t.useReactBricksContext,exports.useVisualEdit=t.useVisualEdit,exports.Plain=o.Plain,exports.AstroBrick=function(n){var o=n.index,i=n.itemsCount,s=n.blockProps,a=n.page,c=n.block,l=n.pathname,p=void 0===l?"":l,d=t.reactBricksAstroStore.getBrick(c);return d?(t.reactBricksAstroStore.setPathname(p),r.createElement(d,e.__assign({},s,{key:s.key,index:o,itemsCount:i,__page:a,__block:c}))):("development"===process.env.NODE_ENV&&console.warn('Missing component for block type "'.concat(c.type,'"')),null)},exports.ClickToEdit=function(i){var s,c,l=i.page,p=e.__read(r.useState(!1),2),d=p[0],u=p[1],x=t.useReactBricksContext();if(r.useEffect((function(){u(!0)}),[]),!d)return null;if(!x)return null;var m,f=(null===(s=null==l?void 0:l.customValues)||void 0===s?void 0:s.___t)&&!o.isPaidPlan(null===(c=l.customValues)||void 0===c?void 0:c.___t),g=localStorage.getItem(e.AUTH_TOKEN_LS_KEY);if(g&&g.length>10&&g.startsWith("ey")){if((null==x?void 0:x.clickToEditSide)===e.types.ClickToEditSide.None)return null;var k=x||{navigate:function(){}},b=k.navigate,h=k.editorPath,E=k.clickToEditSide,y={};return E===e.types.ClickToEditSide.BottomRight&&(y.bottom=50,y.right=0,y.borderTopLeftRadius=999,y.borderBottomLeftRadius=999,y.transform="translate(8px,0)"),E===e.types.ClickToEditSide.BottomLeft&&(y.bottom=50,y.left=0,y.borderTopRightRadius=999,y.borderBottomRightRadius=999,y.transform="translate(-8px,0)"),E===e.types.ClickToEditSide.TopRight&&(y.top=50,y.right=0,y.borderTopLeftRadius=999,y.borderBottomLeftRadius=999,y.transform="translate(8px,0)"),E===e.types.ClickToEditSide.TopLeft&&(y.top=50,y.left=0,y.borderTopRightRadius=999,y.borderBottomRightRadius=999,y.transform="translate(-8px,0)"),r.createElement(r.Fragment,null,r.createElement("style",null,"\n.rb-click-to-edit {\n position: fixed;\n z-index: 10;\n width: 61px;\n height: 38px;\n background-color: #f65a8e;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n font-size: 20px;\n cursor: pointer;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n transition: all 150ms ease;\n border: 2px solid #fff;\n}\n.rb-click-to-edit-left:hover {\n transform: translate(-2px,0)!important;\n}\n.rb-click-to-edit-right:hover {\n transform: translate(2px,0)!important;\n}\n "),r.createElement("div",{className:"rb-click-to-edit ".concat((m=E,m===e.types.ClickToEditSide.TopLeft||m===e.types.ClickToEditSide.BottomLeft?"rb-click-to-edit-left":"rb-click-to-edit-right")),style:y,onClick:function(){return b("".concat(h,"?p=").concat(encodeURIComponent(l.id),"&l=").concat(l.language))}},r.createElement(n.FiEdit,null)),f&&r.createElement(a,null))}return f&&r.createElement(a,null)},exports.getBlockValue=p,exports.getBricks=c,exports.getPageValues=l,exports.isAdmin=d;
1
+ "use strict";require("intersection-observer");var e=require("../react-bricks-DBsyFafC.js"),t=require("react"),r=require("../react-bricks-1Be065Jm.js"),n=require("react-icons/fi"),o=require("../react-bricks-BFoJ4_oR.js");require("../react-bricks-Btf-citH.js"),require("classnames"),require("../react-bricks-BNm3bMhQ.js"),require("ts-md5");var i,s="c"+(i=5,e.__spreadArray([],e.__read(Array(i)),!1).map((function(){return(~~(36*Math.random())).toString(36)})).join("")),a=function(){return t.createElement(t.Fragment,null,t.createElement("style",null,"\n.".concat(s," {\n display:block;\n position: fixed;\n box-sizing: border-box;\n z-index: 999;\n bottom: 20px;\n left: 20px;\n padding: 5px 12px;\n background-color: #ffffffdd;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #1e293b;\n font-size: 11px;\n font-weight: 600;\n border: 1px solid #e2e8f0cc;\n border-radius: 20px;\n text-transform: uppercase;\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);\n filter: none;\n transition: all 300ms ease;\n}\n.").concat(s,":hover {\n background-color: #ffffff;\n filter: drop-shadow(0 20px 13px rgb(0 0 0 / 0.03)) drop-shadow(0 8px 5px rgb(0 0 0 / 0.08));\n}\n.").concat(s," .l {\n transition: color 300ms ease;\n}\n.").concat(s,":hover .l {\n color: #f65a8e;\n}\n ")),t.createElement("a",{href:"https://reactbricks.com?utm_campaign=site-badge",target:"_blank",className:s},t.createElement("img",{src:"https://reactbricks.com/_next/static/media/reactbricks_icon.c57a7be4.svg",style:{width:18,height:18,marginRight:6}}),t.createElement("span",null,"Made in ",t.createElement("span",{className:"l"},"React Bricks"))))},c=r.reactBricksAstroStore.getBricks,l=r.reactBricksAstroStore.getPageValues,d=r.reactBricksAstroStore.getBlockValue,p=r.reactBricksAstroStore.isAdmin;r.reactBricksAstroStore.register,Object.defineProperty(exports,"types",{enumerable:!0,get:function(){return e.types}}),exports.File=r.File,exports.Image=r.Image,exports.Link=r.Link,exports.Repeater=r.Repeater,exports.RichText=r.CompatibleRichText,exports.RichTextExt=r.RichText,exports.Text=r.Text,exports.reactBricksAstroStore=r.reactBricksAstroStore,exports.useAdminContext=r.useAdminContext,exports.usePageValues=r.usePageValues,exports.useReactBricksContext=r.useReactBricksContext,exports.useVisualEdit=r.useVisualEdit,exports.Plain=o.Plain,exports.AstroBrick=function(n){var o=n.index,i=n.itemsCount,s=n.blockProps,a=n.page,c=n.block,l=n.pathname,d=void 0===l?"":l,p=e.__read(t.useState(r.reactBricksAstroStore.isRegistered()),2),u=p[0],f=p[1];if(t.useEffect((function(){return r.reactBricksAstroStore.__subscribeConfig((function(){f(!0)}))}),[]),"undefined"!=typeof window&&!u)return null;var x=r.reactBricksAstroStore.getBrick(c);return x?(r.reactBricksAstroStore.setPathname(d),t.createElement(x,e.__assign({},s,{key:s.key,index:o,itemsCount:i,__page:a,__block:c}))):("development"===process.env.NODE_ENV&&console.warn('Missing component for block type "'.concat(c.type,'"')),null)},exports.ClickToEdit=function(i){var s,c,l=i.page,d=e.__read(t.useState(!1),2),p=d[0],u=d[1],f=r.useReactBricksContext();if(t.useEffect((function(){u(!0)}),[]),!p)return null;if(!f)return null;var x,m=(null===(s=null==l?void 0:l.customValues)||void 0===s?void 0:s.___t)&&!o.isPaidPlan(null===(c=l.customValues)||void 0===c?void 0:c.___t),g=localStorage.getItem(e.AUTH_TOKEN_LS_KEY);if(g&&g.length>10&&g.startsWith("ey")){if((null==f?void 0:f.clickToEditSide)===e.types.ClickToEditSide.None)return null;var k=f||{navigate:function(){}},b=k.navigate,h=k.editorPath,E=k.clickToEditSide,_={};return E===e.types.ClickToEditSide.BottomRight&&(_.bottom=50,_.right=0,_.borderTopLeftRadius=999,_.borderBottomLeftRadius=999,_.transform="translate(8px,0)"),E===e.types.ClickToEditSide.BottomLeft&&(_.bottom=50,_.left=0,_.borderTopRightRadius=999,_.borderBottomRightRadius=999,_.transform="translate(-8px,0)"),E===e.types.ClickToEditSide.TopRight&&(_.top=50,_.right=0,_.borderTopLeftRadius=999,_.borderBottomLeftRadius=999,_.transform="translate(8px,0)"),E===e.types.ClickToEditSide.TopLeft&&(_.top=50,_.left=0,_.borderTopRightRadius=999,_.borderBottomRightRadius=999,_.transform="translate(-8px,0)"),t.createElement(t.Fragment,null,t.createElement("style",null,"\n.rb-click-to-edit {\n position: fixed;\n z-index: 10;\n width: 61px;\n height: 38px;\n background-color: #f65a8e;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n font-size: 20px;\n cursor: pointer;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n transition: all 150ms ease;\n border: 2px solid #fff;\n}\n.rb-click-to-edit-left:hover {\n transform: translate(-2px,0)!important;\n}\n.rb-click-to-edit-right:hover {\n transform: translate(2px,0)!important;\n}\n "),t.createElement("div",{className:"rb-click-to-edit ".concat((x=E,x===e.types.ClickToEditSide.TopLeft||x===e.types.ClickToEditSide.BottomLeft?"rb-click-to-edit-left":"rb-click-to-edit-right")),style:_,onClick:function(){return b("".concat(h,"?p=").concat(encodeURIComponent(l.id),"&l=").concat(l.language))}},t.createElement(n.FiEdit,null)),m&&t.createElement(a,null))}return m&&t.createElement(a,null)},exports.getBlockValue=d,exports.getBricks=c,exports.getPageValues=l,exports.isAdmin=p;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bricks-astro",
3
- "version": "4.7.0-beta.1",
3
+ "version": "4.7.0-beta.2",
4
4
  "main": "index.js",
5
5
  "module": "react-bricks-astro.esm.js",
6
6
  "types": "./react-bricks-astro.d.ts",
@@ -1 +1 @@
1
- import"intersection-observer";import{e as t,b as e,c as n,A as r,t as o}from"../react-bricks-BO8V0Yxk.esm.js";import{r as i,u as s}from"../react-bricks-vrNJ5_JL.esm.js";export{F as File,I as Image,L as Link,R as Repeater,C as RichText,a as RichTextExt,T as Text,b as useAdminContext,c as usePageValues,d as useVisualEdit}from"../react-bricks-vrNJ5_JL.esm.js";import l,{useState as m,useEffect as p}from"react";import{FiEdit as f}from"react-icons/fi";import{i as u}from"../react-bricks-DVKooNi6.esm.js";export{P as Plain}from"../react-bricks-DVKooNi6.esm.js";import"../react-bricks-DPkjyT2r.esm.js";import"classnames";import"../react-bricks-HPMmwU16.esm.js";import"ts-md5";var g=function(e){var n=e.index,r=e.itemsCount,o=e.blockProps,a=e.page,s=e.block,c=e.pathname,d=void 0===c?"":c,m=i.getBrick(s);return m?(i.setPathname(d),l.createElement(m,t({},o,{key:o.key,index:n,itemsCount:r,__page:a,__block:s}))):("development"===process.env.NODE_ENV&&console.warn('Missing component for block type "'.concat(s.type,'"')),null)},x="c"+e([],n(Array(5)),!1).map((function(){return(~~(36*Math.random())).toString(36)})).join(""),k=function(){return l.createElement(l.Fragment,null,l.createElement("style",null,"\n.".concat(x," {\n display:block;\n position: fixed;\n box-sizing: border-box;\n z-index: 999;\n bottom: 20px;\n left: 20px;\n padding: 5px 12px;\n background-color: #ffffffdd;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #1e293b;\n font-size: 11px;\n font-weight: 600;\n border: 1px solid #e2e8f0cc;\n border-radius: 20px;\n text-transform: uppercase;\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);\n filter: none;\n transition: all 300ms ease;\n}\n.").concat(x,":hover {\n background-color: #ffffff;\n filter: drop-shadow(0 20px 13px rgb(0 0 0 / 0.03)) drop-shadow(0 8px 5px rgb(0 0 0 / 0.08));\n}\n.").concat(x," .l {\n transition: color 300ms ease;\n}\n.").concat(x,":hover .l {\n color: #f65a8e;\n}\n ")),l.createElement("a",{href:"https://reactbricks.com?utm_campaign=site-badge",target:"_blank",className:x},l.createElement("img",{src:"https://reactbricks.com/_next/static/media/reactbricks_icon.c57a7be4.svg",style:{width:18,height:18,marginRight:6}}),l.createElement("span",null,"Made in ",l.createElement("span",{className:"l"},"React Bricks"))))},h=function(t){var e,i,a=t.page,c=n(m(!1),2),d=c[0],b=c[1],g=s();if(p((function(){b(!0)}),[]),!d)return null;if(!g)return null;var x,h=(null===(e=null==a?void 0:a.customValues)||void 0===e?void 0:e.___t)&&!u(null===(i=a.customValues)||void 0===i?void 0:i.___t),E=localStorage.getItem(r);if(E&&E.length>10&&E.startsWith("ey")){if((null==g?void 0:g.clickToEditSide)===o.ClickToEditSide.None)return null;var v=g||{navigate:function(){}},R=v.navigate,T=v.editorPath,y=v.clickToEditSide,_={};return y===o.ClickToEditSide.BottomRight&&(_.bottom=50,_.right=0,_.borderTopLeftRadius=999,_.borderBottomLeftRadius=999,_.transform="translate(8px,0)"),y===o.ClickToEditSide.BottomLeft&&(_.bottom=50,_.left=0,_.borderTopRightRadius=999,_.borderBottomRightRadius=999,_.transform="translate(-8px,0)"),y===o.ClickToEditSide.TopRight&&(_.top=50,_.right=0,_.borderTopLeftRadius=999,_.borderBottomLeftRadius=999,_.transform="translate(8px,0)"),y===o.ClickToEditSide.TopLeft&&(_.top=50,_.left=0,_.borderTopRightRadius=999,_.borderBottomRightRadius=999,_.transform="translate(-8px,0)"),l.createElement(l.Fragment,null,l.createElement("style",null,"\n.rb-click-to-edit {\n position: fixed;\n z-index: 10;\n width: 61px;\n height: 38px;\n background-color: #f65a8e;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n font-size: 20px;\n cursor: pointer;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n transition: all 150ms ease;\n border: 2px solid #fff;\n}\n.rb-click-to-edit-left:hover {\n transform: translate(-2px,0)!important;\n}\n.rb-click-to-edit-right:hover {\n transform: translate(2px,0)!important;\n}\n "),l.createElement("div",{className:"rb-click-to-edit ".concat((x=y,x===o.ClickToEditSide.TopLeft||x===o.ClickToEditSide.BottomLeft?"rb-click-to-edit-left":"rb-click-to-edit-right")),style:_,onClick:function(){return R("".concat(T,"?p=").concat(encodeURIComponent(a.id),"&l=").concat(a.language))}},l.createElement(f,null)),h&&l.createElement(k,null))}return h&&l.createElement(k,null)},E=i.getBricks,v=i.getPageValues,y=i.getBlockValue,_=i.isAdmin;i.register;export{g as AstroBrick,h as ClickToEdit,y as getBlockValue,E as getBricks,v as getPageValues,_ as isAdmin,i as reactBricksAstroStore,o as types,s as useReactBricksContext};
1
+ import"intersection-observer";import{c as t,e,b as n,A as r,t as o}from"../react-bricks-BO8V0Yxk.esm.js";import i,{useState as s,useEffect as l}from"react";import{r as m,u as p}from"../react-bricks-vrNJ5_JL.esm.js";export{F as File,I as Image,L as Link,R as Repeater,C as RichText,a as RichTextExt,T as Text,b as useAdminContext,c as usePageValues,d as useVisualEdit}from"../react-bricks-vrNJ5_JL.esm.js";import{FiEdit as f}from"react-icons/fi";import{i as u}from"../react-bricks-DVKooNi6.esm.js";export{P as Plain}from"../react-bricks-DVKooNi6.esm.js";import"../react-bricks-DPkjyT2r.esm.js";import"classnames";import"../react-bricks-HPMmwU16.esm.js";import"ts-md5";var g=function(n){var r=n.index,o=n.itemsCount,a=n.blockProps,c=n.page,d=n.block,p=n.pathname,f=void 0===p?"":p,u=t(s(m.isRegistered()),2),b=u[0],g=u[1];if(l((function(){return m.__subscribeConfig((function(){g(!0)}))}),[]),"undefined"!=typeof window&&!b)return null;var x=m.getBrick(d);return x?(m.setPathname(f),i.createElement(x,e({},a,{key:a.key,index:r,itemsCount:o,__page:c,__block:d}))):("development"===process.env.NODE_ENV&&console.warn('Missing component for block type "'.concat(d.type,'"')),null)},x="c"+n([],t(Array(5)),!1).map((function(){return(~~(36*Math.random())).toString(36)})).join(""),k=function(){return i.createElement(i.Fragment,null,i.createElement("style",null,"\n.".concat(x," {\n display:block;\n position: fixed;\n box-sizing: border-box;\n z-index: 999;\n bottom: 20px;\n left: 20px;\n padding: 5px 12px;\n background-color: #ffffffdd;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #1e293b;\n font-size: 11px;\n font-weight: 600;\n border: 1px solid #e2e8f0cc;\n border-radius: 20px;\n text-transform: uppercase;\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);\n filter: none;\n transition: all 300ms ease;\n}\n.").concat(x,":hover {\n background-color: #ffffff;\n filter: drop-shadow(0 20px 13px rgb(0 0 0 / 0.03)) drop-shadow(0 8px 5px rgb(0 0 0 / 0.08));\n}\n.").concat(x," .l {\n transition: color 300ms ease;\n}\n.").concat(x,":hover .l {\n color: #f65a8e;\n}\n ")),i.createElement("a",{href:"https://reactbricks.com?utm_campaign=site-badge",target:"_blank",className:x},i.createElement("img",{src:"https://reactbricks.com/_next/static/media/reactbricks_icon.c57a7be4.svg",style:{width:18,height:18,marginRight:6}}),i.createElement("span",null,"Made in ",i.createElement("span",{className:"l"},"React Bricks"))))},h=function(e){var n,a,c=e.page,d=t(s(!1),2),m=d[0],b=d[1],g=p();if(l((function(){b(!0)}),[]),!m)return null;if(!g)return null;var x,h=(null===(n=null==c?void 0:c.customValues)||void 0===n?void 0:n.___t)&&!u(null===(a=c.customValues)||void 0===a?void 0:a.___t),E=localStorage.getItem(r);if(E&&E.length>10&&E.startsWith("ey")){if((null==g?void 0:g.clickToEditSide)===o.ClickToEditSide.None)return null;var v=g||{navigate:function(){}},R=v.navigate,T=v.editorPath,_=v.clickToEditSide,y={};return _===o.ClickToEditSide.BottomRight&&(y.bottom=50,y.right=0,y.borderTopLeftRadius=999,y.borderBottomLeftRadius=999,y.transform="translate(8px,0)"),_===o.ClickToEditSide.BottomLeft&&(y.bottom=50,y.left=0,y.borderTopRightRadius=999,y.borderBottomRightRadius=999,y.transform="translate(-8px,0)"),_===o.ClickToEditSide.TopRight&&(y.top=50,y.right=0,y.borderTopLeftRadius=999,y.borderBottomLeftRadius=999,y.transform="translate(8px,0)"),_===o.ClickToEditSide.TopLeft&&(y.top=50,y.left=0,y.borderTopRightRadius=999,y.borderBottomRightRadius=999,y.transform="translate(-8px,0)"),i.createElement(i.Fragment,null,i.createElement("style",null,"\n.rb-click-to-edit {\n position: fixed;\n z-index: 10;\n width: 61px;\n height: 38px;\n background-color: #f65a8e;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n font-size: 20px;\n cursor: pointer;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n transition: all 150ms ease;\n border: 2px solid #fff;\n}\n.rb-click-to-edit-left:hover {\n transform: translate(-2px,0)!important;\n}\n.rb-click-to-edit-right:hover {\n transform: translate(2px,0)!important;\n}\n "),i.createElement("div",{className:"rb-click-to-edit ".concat((x=_,x===o.ClickToEditSide.TopLeft||x===o.ClickToEditSide.BottomLeft?"rb-click-to-edit-left":"rb-click-to-edit-right")),style:y,onClick:function(){return R("".concat(T,"?p=").concat(encodeURIComponent(c.id),"&l=").concat(c.language))}},i.createElement(f,null)),h&&i.createElement(k,null))}return h&&i.createElement(k,null)},E=m.getBricks,v=m.getPageValues,_=m.getBlockValue,y=m.isAdmin;m.register;export{g as AstroBrick,h as ClickToEdit,_ as getBlockValue,E as getBricks,v as getPageValues,y as isAdmin,m as reactBricksAstroStore,o as types,p as useReactBricksContext};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bricks-astro-server",
3
- "version": "4.7.0-beta.1",
3
+ "version": "4.7.0-beta.2",
4
4
  "main": "index.js",
5
5
  "module": "react-bricks-astro-server.esm.js",
6
6
  "types": "./react-bricks-astro-server.d.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bricks-frontend",
3
- "version": "4.7.0-beta.1",
3
+ "version": "4.7.0-beta.2",
4
4
  "main": "index.js",
5
5
  "module": "react-bricks-frontend.esm.js",
6
6
  "types": "../react-bricks.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bricks",
3
- "version": "4.7.0-beta.1",
3
+ "version": "4.7.0-beta.2",
4
4
  "description": "React Bricks is a CMS with visual editing based on React components for Next.js, Gatsby and Remix.",
5
5
  "keywords": [
6
6
  "react bricks",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bricks-rsc-client",
3
- "version": "4.7.0-beta.1",
3
+ "version": "4.7.0-beta.2",
4
4
  "main": "index.js",
5
5
  "module": "react-bricks-rsc-client.esm.js",
6
6
  "types": "./react-bricks-rsc-client.d.ts",
package/rsc/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bricks-rsc",
3
- "version": "4.7.0-beta.1",
3
+ "version": "4.7.0-beta.2",
4
4
  "main": "index.js",
5
5
  "module": "react-bricks-rsc.esm.js",
6
6
  "types": "./react-bricks-rsc.d.ts",