@andmarruda/lpb-react 0.0.0-stage → 0.0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Anderson Arruda
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,30 @@
1
- # Temporary Holding Version
1
+ # @andmarruda/lpb-react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ React renderer of Laravel Page Builder pages — part of
4
+ [Laravel Page Builder](https://github.com/andmarruda/lpb). Renders the 48
5
+ built-in widgets through [`@andmarruda/lpb-core`](https://www.npmjs.com/package/@andmarruda/lpb-core)
6
+ and your own components for any widget name, with the page's scoped styles
7
+ and interactive behaviours.
8
+
9
+ ```bash
10
+ npm install @andmarruda/lpb-core @andmarruda/lpb-react react react-dom
11
+ ```
12
+
13
+ ```tsx
14
+ import "@andmarruda/lpb-core/styles.css";
15
+ import { readEmbeddedPayload } from "@andmarruda/lpb-core";
16
+ import { LpbPage } from "@andmarruda/lpb-react";
17
+
18
+ createRoot(document.getElementById("lpb-app")!).render(
19
+ <LpbPage payload={readEmbeddedPayload()} components={{ hero: MyHero }} />,
20
+ );
21
+ ```
22
+
23
+ With Inertia, render `InertiaPage` from the page component configured in
24
+ `laravel-page-builder.inertia.component` (default `Lpb/Page`). For external
25
+ frontends use `usePagePayload({ slug })`.
26
+
27
+ Components receive the widget's `config` and `instance`; a component with
28
+ the name of a built-in widget replaces it.
29
+
30
+ MIT © Anderson Arruda
@@ -0,0 +1,13 @@
1
+ import type { PagePayload } from '@andmarruda/lpb-core';
2
+ import { type LpbPageProps } from './LpbPage.js';
3
+ /**
4
+ * Page component for the Inertia flow: Lpb::inertia() renders the
5
+ * configured component (default "Lpb/Page") with the payload as `page`.
6
+ *
7
+ * // resources/js/Pages/Lpb/Page.tsx
8
+ * import { InertiaPage } from '@andmarruda/lpb-react';
9
+ * export default (props) => <InertiaPage {...props} components={{ hero: Hero }} />;
10
+ */
11
+ export declare function InertiaPage({ page, ...props }: {
12
+ page: PagePayload;
13
+ } & Omit<LpbPageProps, 'payload'>): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { LpbPage } from './LpbPage.js';
3
+ /**
4
+ * Page component for the Inertia flow: Lpb::inertia() renders the
5
+ * configured component (default "Lpb/Page") with the payload as `page`.
6
+ *
7
+ * // resources/js/Pages/Lpb/Page.tsx
8
+ * import { InertiaPage } from '@andmarruda/lpb-react';
9
+ * export default (props) => <InertiaPage {...props} components={{ hero: Hero }} />;
10
+ */
11
+ export function InertiaPage({ page, ...props }) {
12
+ return _jsx(LpbPage, { payload: page, ...props });
13
+ }
14
+ //# sourceMappingURL=InertiaPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InertiaPage.js","sourceRoot":"","sources":["../src/InertiaPage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAqB,MAAM,cAAc,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAyD;IACnG,OAAO,KAAC,OAAO,IAAC,OAAO,EAAE,IAAI,KAAM,KAAK,GAAI,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { type ComponentType, type ReactNode } from 'react';
2
+ import { type Breakpoints, type Media, type PagePayload, type WidgetInstance, type WidgetRenderer } from '@andmarruda/lpb-core';
3
+ export interface WidgetComponentProps<C = Record<string, any>> {
4
+ config: C;
5
+ instance: WidgetInstance<C>;
6
+ }
7
+ export interface LpbPageProps {
8
+ payload: Pick<PagePayload, 'blocks'> | null | undefined;
9
+ /** React components by widget name: custom widgets or overrides of built-in ones. */
10
+ components?: Record<string, ComponentType<WidgetComponentProps<any>>>;
11
+ /** Extra core renderers by widget name. */
12
+ renderers?: Record<string, WidgetRenderer>;
13
+ /** Resolves media references (editor previews of working trees). */
14
+ resolveMedia?: (id: string | number) => Media | null;
15
+ /** Base URL of the delivery API, for nav-menu (default /lpb/api). */
16
+ apiBase?: string;
17
+ breakpoints?: Breakpoints;
18
+ /** Skip the interactive behaviours (e.g. inside an editor canvas). */
19
+ static?: boolean;
20
+ className?: string;
21
+ /** Rendered when there is no payload. */
22
+ fallback?: ReactNode;
23
+ }
24
+ /**
25
+ * Renders a page payload: blocks, built-in widgets (from @andmarruda/lpb-core) and the
26
+ * application's widget components, with the page's scoped CSS.
27
+ */
28
+ export declare function LpbPage({ payload, components, renderers, resolveMedia, apiBase, breakpoints, static: isStatic, className, fallback }: LpbPageProps): import("react").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useRef } from 'react';
3
+ import { DEFAULT_BREAKPOINTS, enhance, renderBlocks, treeCss } from '@andmarruda/lpb-core';
4
+ import { renderVNode } from './vnode.js';
5
+ /**
6
+ * Renders a page payload: blocks, built-in widgets (from @andmarruda/lpb-core) and the
7
+ * application's widget components, with the page's scoped CSS.
8
+ */
9
+ export function LpbPage({ payload, components = {}, renderers, resolveMedia, apiBase, breakpoints = DEFAULT_BREAKPOINTS, static: isStatic = false, className, fallback = null }) {
10
+ const root = useRef(null);
11
+ const names = Object.keys(components);
12
+ const blocks = payload?.blocks;
13
+ // Renderers and resolveMedia are often passed inline: keep the latest in refs
14
+ // so a parent re-render does not rebuild the page and restart its behaviours
15
+ const latest = useRef({ renderers, resolveMedia });
16
+ latest.current = { renderers, resolveMedia };
17
+ const rendererNames = Object.keys(renderers ?? {}).join(',');
18
+ const nodes = useMemo(() => renderBlocks(blocks ?? [], { components: names, renderers: latest.current.renderers, resolveMedia: latest.current.resolveMedia, apiBase }), [blocks, names.join(','), rendererNames, apiBase]);
19
+ const css = useMemo(() => treeCss(blocks ?? [], breakpoints), [blocks, breakpoints]);
20
+ useEffect(() => (isStatic ? undefined : enhance(root.current)), [nodes, isStatic]);
21
+ if (!payload)
22
+ return _jsx(_Fragment, { children: fallback });
23
+ return (_jsxs(_Fragment, { children: [css ? _jsx("style", { "data-lpb-styles": "", children: css }) : null, _jsx("div", { ref: root, className: className ? `lpb-page ${className}` : 'lpb-page', children: renderVNode(nodes, (slot, key) => {
24
+ const Component = components[slot.instance.widget];
25
+ return Component ? (_jsx("div", { className: slot.className, "data-lpb-widget": slot.instance.widget, children: _jsx(Component, { config: slot.instance.config, instance: slot.instance }) }, key)) : null;
26
+ }) })] }));
27
+ }
28
+ //# sourceMappingURL=LpbPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LpbPage.js","sourceRoot":"","sources":["../src/LpbPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAsC,MAAM,OAAO,CAA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AM,IAAI,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAErF,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEnF,IAAI,CAAC,OAAO;QAAE,OAAO,4BAAG,QAAQ,GAAI,CAAC;IAErC,OAAO,CACL,8BACG,GAAG,CAAC,CAAC,CAAC,mCAAuB,EAAE,YAAE,GAAG,GAAS,CAAC,CAAC,CAAC,IAAI,EACrD,cAAK,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,YAAY,SAAS,EAAE,CAAC,CAAC,CAAC,UAAU,YACxE,WAAW,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;oBAChC,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;oBACnD,OAAO,SAAS,CAAC,CAAC,CAAC,CACjB,cAAe,SAAS,EAAE,IAAI,CAAC,SAAS,qBAAmB,IAAI,CAAC,QAAQ,CAAC,MAAM,YAC7E,KAAC,SAAS,IAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAI,IAD5D,GAAG,CAEP,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;gBACX,CAAC,CAAC,GACE,IACL,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { LpbClient, type PagePayload } from '@andmarruda/lpb-core';
2
+ export type PageState = {
3
+ status: 'loading' | 'ready' | 'not-found' | 'error';
4
+ payload: PagePayload | null;
5
+ error?: unknown;
6
+ };
7
+ /**
8
+ * The payload of a page for the view flow (embedded by @lpbPayload) or
9
+ * fetched from the delivery API for external frontends.
10
+ */
11
+ export declare function usePagePayload(source: {
12
+ slug: string;
13
+ client?: LpbClient;
14
+ } | {
15
+ embedded: true;
16
+ }): PageState;
package/dist/hooks.js ADDED
@@ -0,0 +1,27 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { LpbClient, readEmbeddedPayload } from '@andmarruda/lpb-core';
3
+ /**
4
+ * The payload of a page for the view flow (embedded by @lpbPayload) or
5
+ * fetched from the delivery API for external frontends.
6
+ */
7
+ export function usePagePayload(source) {
8
+ const embedded = 'embedded' in source ? readEmbeddedPayload() : null;
9
+ const [state, setState] = useState(() => (embedded ? { status: 'ready', payload: embedded } : { status: 'loading', payload: null }));
10
+ const slug = 'slug' in source ? source.slug : null;
11
+ const client = 'client' in source ? source.client : undefined;
12
+ useEffect(() => {
13
+ if (slug === null) {
14
+ if (!embedded)
15
+ setState({ status: 'not-found', payload: null });
16
+ return;
17
+ }
18
+ let active = true;
19
+ setState({ status: 'loading', payload: null });
20
+ (client ?? new LpbClient()).page(slug)
21
+ .then((payload) => active && setState(payload ? { status: 'ready', payload } : { status: 'not-found', payload: null }))
22
+ .catch((error) => active && setState({ status: 'error', payload: null, error }));
23
+ return () => { active = false; };
24
+ }, [slug, client]);
25
+ return state;
26
+ }
27
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAoB,MAAM,sBAAsB,CAAC;AAIxF;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAiE;IAC9F,MAAM,QAAQ,GAAG,UAAU,IAAI,MAAM,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACrE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC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O,GAAG,EAAE,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAEnB,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { LpbPage, type LpbPageProps, type WidgetComponentProps } from './LpbPage.js';
2
+ export { renderVNode, styleObject, type SlotRenderer } from './vnode.js';
3
+ export { usePagePayload, type PageState } from './hooks.js';
4
+ export { InertiaPage } from './InertiaPage.js';
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { LpbPage } from './LpbPage.js';
2
+ export { renderVNode, styleObject } from './vnode.js';
3
+ export { usePagePayload } from './hooks.js';
4
+ export { InertiaPage } from './InertiaPage.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAgD,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAqB,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,cAAc,EAAkB,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Fragment, type ReactNode } from 'react';
2
+ import type { SlotNode, VNode } from '@andmarruda/lpb-core';
3
+ export type SlotRenderer = (slot: SlotNode, key: string) => ReactNode;
4
+ export declare function styleObject(style: string): Record<string, string>;
5
+ /** Renders core virtual nodes as React elements. */
6
+ export declare function renderVNode(node: VNode | VNode[], slot?: SlotRenderer, key?: string): ReactNode;
7
+ export { Fragment };
package/dist/vnode.js ADDED
@@ -0,0 +1,53 @@
1
+ import { createElement, Fragment } from 'react';
2
+ /** HTML attribute names that React spells differently. */
3
+ const PROPS = {
4
+ class: 'className', for: 'htmlFor', tabindex: 'tabIndex', frameborder: 'frameBorder', allowfullscreen: 'allowFullScreen',
5
+ referrerpolicy: 'referrerPolicy', playsinline: 'playsInline', autoplay: 'autoPlay', novalidate: 'noValidate', readonly: 'readOnly',
6
+ colspan: 'colSpan', rowspan: 'rowSpan', maxlength: 'maxLength', crossorigin: 'crossOrigin', srcset: 'srcSet', datetime: 'dateTime',
7
+ autocomplete: 'autoComplete', 'stroke-dasharray': 'strokeDasharray', 'stroke-dashoffset': 'strokeDashoffset',
8
+ 'stroke-width': 'strokeWidth', 'stroke-linecap': 'strokeLinecap', 'stroke-linejoin': 'strokeLinejoin', 'fill-rule': 'fillRule', 'clip-rule': 'clipRule',
9
+ };
10
+ export function styleObject(style) {
11
+ const out = {};
12
+ for (const declaration of style.split(';')) {
13
+ const at = declaration.indexOf(':');
14
+ if (at === -1)
15
+ continue;
16
+ const name = declaration.slice(0, at).trim();
17
+ const value = declaration.slice(at + 1).trim();
18
+ if (!name)
19
+ continue;
20
+ out[name.startsWith('--') ? name : name.replace(/-([a-z])/g, (_, c) => c.toUpperCase())] = value;
21
+ }
22
+ return out;
23
+ }
24
+ function props(attrs, key) {
25
+ const out = { key };
26
+ for (const [name, value] of Object.entries(attrs)) {
27
+ if (value === null || value === undefined || value === false)
28
+ continue;
29
+ if (name === 'style')
30
+ out.style = styleObject(String(value));
31
+ else
32
+ out[PROPS[name] ?? name] = value === true ? true : value;
33
+ }
34
+ return out;
35
+ }
36
+ /** Renders core virtual nodes as React elements. */
37
+ export function renderVNode(node, slot, key = '0') {
38
+ if (Array.isArray(node))
39
+ return node.map((child, i) => renderVNode(child, slot, `${key}.${i}`));
40
+ if (node.kind === 'text')
41
+ return node.text;
42
+ if (node.kind === 'slot')
43
+ return slot ? slot(node, key) : null;
44
+ const elementProps = props(node.attrs, key);
45
+ if (node.html !== undefined) {
46
+ return createElement(node.tag, { ...elementProps, dangerouslySetInnerHTML: { __html: node.html } });
47
+ }
48
+ return node.children.length === 0
49
+ ? createElement(node.tag, elementProps)
50
+ : createElement(node.tag, elementProps, ...node.children.map((child, i) => renderVNode(child, slot, `${key}.${i}`)));
51
+ }
52
+ export { Fragment };
53
+ //# sourceMappingURL=vnode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vnode.js","sourceRoot":"","sources":["../src/vnode.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAGhE,0DAA0D;AAC1D,MAAM,KAAK,GAA2B;IACpC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB;IACxH,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU;IAClI,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU;IAClI,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,kBAAkB;IAC5G,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU;CACxJ,CAAC;AAIF,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,WAAW,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3C,MAAM,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,EAAE,KAAK,CAAC,CAAC;YAAE,SAAS;QACxB,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,C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C,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAChG,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IAC3C,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE/D,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC5C,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,GAAG,YAAY,EAAE,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACtG,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QAC/B,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC;QACvC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACzH,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,61 @@
1
1
  {
2
2
  "name": "@andmarruda/lpb-react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.2",
4
+ "description": "React renderer of Laravel Page Builder pages",
5
+ "keywords": [
6
+ "laravel",
7
+ "page-builder",
8
+ "lpb",
9
+ "cms",
10
+ "react",
11
+ "inertia"
12
+ ],
13
+ "license": "MIT",
14
+ "author": "Anderson Arruda",
15
+ "homepage": "https://github.com/andmarruda/lpb-frontend/tree/main/packages/react#readme",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/andmarruda/lpb-frontend.git",
19
+ "directory": "packages/react"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/andmarruda/lpb-frontend/issues"
23
+ },
24
+ "type": "module",
25
+ "main": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "default": "./dist/index.js"
31
+ }
32
+ },
33
+ "files": [
34
+ "dist"
35
+ ],
36
+ "scripts": {
37
+ "build": "tsc -p tsconfig.build.json",
38
+ "typecheck": "tsc -p tsconfig.json --noEmit",
39
+ "test": "vitest run"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "engines": {
45
+ "node": ">=18"
46
+ },
47
+ "dependencies": {
48
+ "@andmarruda/lpb-core": "0.0.2"
49
+ },
50
+ "peerDependencies": {
51
+ "react": ">=18",
52
+ "react-dom": ">=18"
53
+ },
54
+ "devDependencies": {
55
+ "@andmarruda/lpb-conformance": "0.0.2",
56
+ "@types/react": "^19.3.0",
57
+ "@types/react-dom": "^19.3.0",
58
+ "react": "^19.3.1",
59
+ "react-dom": "^19.3.1"
60
+ }
61
+ }