@btst/stack 1.10.0 → 1.11.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.
- package/dist/packages/ui/src/components/minimal-tiptap/utils.cjs +15 -11
- package/dist/packages/ui/src/components/minimal-tiptap/utils.mjs +15 -11
- package/dist/packages/ui/src/components/ui-builder/index.cjs +9 -7
- package/dist/packages/ui/src/components/ui-builder/index.mjs +9 -7
- package/dist/packages/ui/src/components/ui-builder/internal/canvas/auto-frame.cjs +6 -3
- package/dist/packages/ui/src/components/ui-builder/internal/canvas/auto-frame.mjs +6 -3
- package/dist/packages/ui/src/components/ui-builder/internal/components/add-component-popover.cjs +228 -48
- package/dist/packages/ui/src/components/ui-builder/internal/components/add-component-popover.mjs +228 -48
- package/dist/packages/ui/src/components/ui-builder/internal/components/element-selector.cjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/components/element-selector.mjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/components/error-fallback.cjs +4 -2
- package/dist/packages/ui/src/components/ui-builder/internal/components/error-fallback.mjs +4 -2
- package/dist/packages/ui/src/components/ui-builder/internal/components/multi-select.cjs +6 -3
- package/dist/packages/ui/src/components/ui-builder/internal/components/multi-select.mjs +6 -3
- package/dist/packages/ui/src/components/ui-builder/internal/dnd/draggable-new-component.cjs +67 -0
- package/dist/packages/ui/src/components/ui-builder/internal/dnd/draggable-new-component.mjs +62 -0
- package/dist/packages/ui/src/components/ui-builder/internal/dnd/drop-zone.cjs +181 -37
- package/dist/packages/ui/src/components/ui-builder/internal/dnd/drop-zone.mjs +181 -38
- package/dist/packages/ui/src/components/ui-builder/internal/editor-panel.cjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/editor-panel.mjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/form-fields/classname-control/classname-group-control.cjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/form-fields/classname-control/classname-group-control.mjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/form-fields/classname-control/classname-item-control.cjs +9 -2
- package/dist/packages/ui/src/components/ui-builder/internal/form-fields/classname-control/classname-item-control.mjs +9 -2
- package/dist/packages/ui/src/components/ui-builder/internal/form-fields/iconname-field.cjs +3 -2
- package/dist/packages/ui/src/components/ui-builder/internal/form-fields/iconname-field.mjs +3 -2
- package/dist/packages/ui/src/components/ui-builder/internal/layers-panel.cjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/layers-panel.mjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/props-panel.cjs +17 -5
- package/dist/packages/ui/src/components/ui-builder/internal/props-panel.mjs +17 -5
- package/dist/packages/ui/src/components/ui-builder/internal/utils/render-utils.cjs +70 -16
- package/dist/packages/ui/src/components/ui-builder/internal/utils/render-utils.mjs +73 -20
- package/dist/packages/ui/src/lib/ui-builder/context/dnd-context-colission-utils.cjs +14 -9
- package/dist/packages/ui/src/lib/ui-builder/context/dnd-context-colission-utils.mjs +14 -9
- package/dist/packages/ui/src/lib/ui-builder/context/dnd-context.cjs +38 -10
- package/dist/packages/ui/src/lib/ui-builder/context/dnd-context.mjs +35 -11
- package/dist/packages/ui/src/lib/ui-builder/context/dnd-contexts.cjs +1 -0
- package/dist/packages/ui/src/lib/ui-builder/context/dnd-contexts.mjs +1 -0
- package/dist/packages/ui/src/lib/ui-builder/context/drag-overlay.cjs +7 -4
- package/dist/packages/ui/src/lib/ui-builder/context/drag-overlay.mjs +7 -4
- package/dist/packages/ui/src/lib/ui-builder/hooks/use-auto-scroll.cjs +4 -4
- package/dist/packages/ui/src/lib/ui-builder/hooks/use-auto-scroll.mjs +4 -4
- package/dist/packages/ui/src/lib/ui-builder/hooks/use-dnd-event-handlers.cjs +53 -16
- package/dist/packages/ui/src/lib/ui-builder/hooks/use-dnd-event-handlers.mjs +53 -16
- package/dist/packages/ui/src/lib/ui-builder/hooks/use-drop-validation.cjs +23 -7
- package/dist/packages/ui/src/lib/ui-builder/hooks/use-drop-validation.mjs +23 -7
- package/dist/packages/ui/src/lib/ui-builder/registry/form-field-overrides.cjs +110 -11
- package/dist/packages/ui/src/lib/ui-builder/registry/form-field-overrides.mjs +111 -13
- package/dist/packages/ui/src/lib/ui-builder/store/editor-store.cjs +3 -2
- package/dist/packages/ui/src/lib/ui-builder/store/editor-store.mjs +3 -2
- package/dist/packages/ui/src/lib/ui-builder/store/layer-store.cjs +53 -7
- package/dist/packages/ui/src/lib/ui-builder/store/layer-store.mjs +54 -8
- package/dist/packages/ui/src/lib/ui-builder/store/layer-utils.cjs +4 -3
- package/dist/packages/ui/src/lib/ui-builder/store/layer-utils.mjs +4 -3
- package/dist/packages/ui/src/lib/ui-builder/utils/variable-resolver.cjs +12 -0
- package/dist/packages/ui/src/lib/ui-builder/utils/variable-resolver.mjs +12 -1
- package/dist/plugins/ui-builder/client/components/index.d.cts +1 -1
- package/dist/plugins/ui-builder/client/components/index.d.mts +1 -1
- package/dist/plugins/ui-builder/client/components/index.d.ts +1 -1
- package/dist/plugins/ui-builder/client/hooks/index.d.cts +2 -2
- package/dist/plugins/ui-builder/client/hooks/index.d.mts +2 -2
- package/dist/plugins/ui-builder/client/hooks/index.d.ts +2 -2
- package/dist/plugins/ui-builder/client/index.d.cts +17 -7
- package/dist/plugins/ui-builder/client/index.d.mts +17 -7
- package/dist/plugins/ui-builder/client/index.d.ts +17 -7
- package/dist/plugins/ui-builder/index.d.cts +2 -2
- package/dist/plugins/ui-builder/index.d.mts +2 -2
- package/dist/plugins/ui-builder/index.d.ts +2 -2
- package/dist/shared/{stack.BSM2cgoq.d.cts → stack.BYysGdHl.d.cts} +1 -1
- package/dist/shared/{stack.CqfZWfjJ.d.cts → stack.BdJFrdyt.d.cts} +8 -2
- package/dist/shared/{stack.e1FN86dE.d.mts → stack.ChVuHi5e.d.mts} +8 -2
- package/dist/shared/{stack.CLtOoAqF.d.mts → stack.DYCFcnkL.d.mts} +1 -1
- package/dist/shared/{stack.MMntCVZZ.d.ts → stack.EhM4pmtN.d.ts} +8 -2
- package/dist/shared/{stack.BD1m-4yB.d.ts → stack.kFbDspnF.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ const visitLayer = (layer, parentLayer, visitor) => {
|
|
|
14
14
|
return updatedLayer;
|
|
15
15
|
};
|
|
16
16
|
const countLayers = (layers) => {
|
|
17
|
-
if (typeof layers === "string") {
|
|
17
|
+
if (typeof layers === "string" || !Array.isArray(layers)) {
|
|
18
18
|
return 0;
|
|
19
19
|
}
|
|
20
20
|
return layers.reduce((count, layer) => {
|
|
@@ -244,7 +244,7 @@ const createComponentLayer = (layerType, componentRegistry, options = {}) => {
|
|
|
244
244
|
const schema = componentDef.schema;
|
|
245
245
|
const defaultProps = "shape" in schema && schema.shape ? schemaUtils.getDefaultProps(schema) : {};
|
|
246
246
|
const defaultChildrenRaw = componentDef.defaultChildren;
|
|
247
|
-
const defaultChildren = typeof defaultChildrenRaw === "string" ? defaultChildrenRaw : defaultChildrenRaw
|
|
247
|
+
const defaultChildren = typeof defaultChildrenRaw === "string" ? defaultChildrenRaw : Array.isArray(defaultChildrenRaw) ? defaultChildrenRaw.map((child) => duplicateWithNewIdsAndName(child, false)) : defaultChildrenRaw ?? [];
|
|
248
248
|
const initialProps = Object.entries(defaultProps).reduce((acc, [key, propDef]) => {
|
|
249
249
|
if (key !== "children") {
|
|
250
250
|
acc[key] = propDef;
|
|
@@ -274,11 +274,12 @@ const moveLayer = (layers, sourceLayerId, targetParentId, targetPosition) => {
|
|
|
274
274
|
const findLayerAndParent = (layers2, parentId = null) => {
|
|
275
275
|
for (let i = 0; i < layers2.length; i++) {
|
|
276
276
|
const layer = layers2[i];
|
|
277
|
+
if (!layer) continue;
|
|
277
278
|
if (layer.id === sourceLayerId) {
|
|
278
279
|
layerToMove = layer;
|
|
279
280
|
return true;
|
|
280
281
|
}
|
|
281
|
-
if (hasLayerChildren(layer)) {
|
|
282
|
+
if (hasLayerChildren(layer) && layer.children) {
|
|
282
283
|
if (findLayerAndParent(layer.children, layer.id)) {
|
|
283
284
|
return true;
|
|
284
285
|
}
|
|
@@ -12,7 +12,7 @@ const visitLayer = (layer, parentLayer, visitor) => {
|
|
|
12
12
|
return updatedLayer;
|
|
13
13
|
};
|
|
14
14
|
const countLayers = (layers) => {
|
|
15
|
-
if (typeof layers === "string") {
|
|
15
|
+
if (typeof layers === "string" || !Array.isArray(layers)) {
|
|
16
16
|
return 0;
|
|
17
17
|
}
|
|
18
18
|
return layers.reduce((count, layer) => {
|
|
@@ -242,7 +242,7 @@ const createComponentLayer = (layerType, componentRegistry, options = {}) => {
|
|
|
242
242
|
const schema = componentDef.schema;
|
|
243
243
|
const defaultProps = "shape" in schema && schema.shape ? getDefaultProps(schema) : {};
|
|
244
244
|
const defaultChildrenRaw = componentDef.defaultChildren;
|
|
245
|
-
const defaultChildren = typeof defaultChildrenRaw === "string" ? defaultChildrenRaw : defaultChildrenRaw
|
|
245
|
+
const defaultChildren = typeof defaultChildrenRaw === "string" ? defaultChildrenRaw : Array.isArray(defaultChildrenRaw) ? defaultChildrenRaw.map((child) => duplicateWithNewIdsAndName(child, false)) : defaultChildrenRaw ?? [];
|
|
246
246
|
const initialProps = Object.entries(defaultProps).reduce((acc, [key, propDef]) => {
|
|
247
247
|
if (key !== "children") {
|
|
248
248
|
acc[key] = propDef;
|
|
@@ -272,11 +272,12 @@ const moveLayer = (layers, sourceLayerId, targetParentId, targetPosition) => {
|
|
|
272
272
|
const findLayerAndParent = (layers2, parentId = null) => {
|
|
273
273
|
for (let i = 0; i < layers2.length; i++) {
|
|
274
274
|
const layer = layers2[i];
|
|
275
|
+
if (!layer) continue;
|
|
275
276
|
if (layer.id === sourceLayerId) {
|
|
276
277
|
layerToMove = layer;
|
|
277
278
|
return true;
|
|
278
279
|
}
|
|
279
|
-
if (hasLayerChildren(layer)) {
|
|
280
|
+
if (hasLayerChildren(layer) && layer.children) {
|
|
280
281
|
if (findLayerAndParent(layer.children, layer.id)) {
|
|
281
282
|
return true;
|
|
282
283
|
}
|
|
@@ -7,6 +7,17 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
7
7
|
|
|
8
8
|
const React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
9
9
|
|
|
10
|
+
function resolveChildrenVariableReference(children, variables, variableValues) {
|
|
11
|
+
if (types.isVariableReference(children)) {
|
|
12
|
+
const variable = variables.find((v) => v.id === children.__variableRef);
|
|
13
|
+
if (variable) {
|
|
14
|
+
const resolvedValue = variableValues?.[variable.id] ?? variable.defaultValue;
|
|
15
|
+
return String(resolvedValue);
|
|
16
|
+
}
|
|
17
|
+
return "";
|
|
18
|
+
}
|
|
19
|
+
return children;
|
|
20
|
+
}
|
|
10
21
|
function resolveVariableReferences(props, variables, variableValues) {
|
|
11
22
|
const resolved = {};
|
|
12
23
|
for (const [key, value] of Object.entries(props)) {
|
|
@@ -27,4 +38,5 @@ function resolveVariableReferences(props, variables, variableValues) {
|
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
exports.isVariableReference = types.isVariableReference;
|
|
41
|
+
exports.resolveChildrenVariableReference = resolveChildrenVariableReference;
|
|
30
42
|
exports.resolveVariableReferences = resolveVariableReferences;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { isVariableReference } from '../../../components/ui-builder/types.mjs';
|
|
3
3
|
|
|
4
|
+
function resolveChildrenVariableReference(children, variables, variableValues) {
|
|
5
|
+
if (isVariableReference(children)) {
|
|
6
|
+
const variable = variables.find((v) => v.id === children.__variableRef);
|
|
7
|
+
if (variable) {
|
|
8
|
+
const resolvedValue = variableValues?.[variable.id] ?? variable.defaultValue;
|
|
9
|
+
return String(resolvedValue);
|
|
10
|
+
}
|
|
11
|
+
return "";
|
|
12
|
+
}
|
|
13
|
+
return children;
|
|
14
|
+
}
|
|
4
15
|
function resolveVariableReferences(props, variables, variableValues) {
|
|
5
16
|
const resolved = {};
|
|
6
17
|
for (const [key, value] of Object.entries(props)) {
|
|
@@ -20,4 +31,4 @@ function resolveVariableReferences(props, variables, variableValues) {
|
|
|
20
31
|
return resolved;
|
|
21
32
|
}
|
|
22
33
|
|
|
23
|
-
export { isVariableReference, resolveVariableReferences };
|
|
34
|
+
export { isVariableReference, resolveChildrenVariableReference, resolveVariableReferences };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import { a as ComponentRegistry, P as PropValue } from '../../../../shared/stack.
|
|
2
|
+
import { a as ComponentRegistry, P as PropValue } from '../../../../shared/stack.BdJFrdyt.cjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '../../../../shared/stack.8nldKomx.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import { a as ComponentRegistry, P as PropValue } from '../../../../shared/stack.
|
|
2
|
+
import { a as ComponentRegistry, P as PropValue } from '../../../../shared/stack.ChVuHi5e.mjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '../../../../shared/stack.8nldKomx.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import { a as ComponentRegistry, P as PropValue } from '../../../../shared/stack.
|
|
2
|
+
import { a as ComponentRegistry, P as PropValue } from '../../../../shared/stack.EhM4pmtN.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '../../../../shared/stack.8nldKomx.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedUIBuilderPage } from '../../../../shared/stack.
|
|
3
|
-
import { C as ComponentLayer, V as Variable } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedUIBuilderPage } from '../../../../shared/stack.BYysGdHl.cjs';
|
|
3
|
+
import { C as ComponentLayer, V as Variable } from '../../../../shared/stack.BdJFrdyt.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '../../../../shared/stack.8nldKomx.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedUIBuilderPage } from '../../../../shared/stack.
|
|
3
|
-
import { C as ComponentLayer, V as Variable } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedUIBuilderPage } from '../../../../shared/stack.DYCFcnkL.mjs';
|
|
3
|
+
import { C as ComponentLayer, V as Variable } from '../../../../shared/stack.ChVuHi5e.mjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '../../../../shared/stack.8nldKomx.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedUIBuilderPage } from '../../../../shared/stack.
|
|
3
|
-
import { C as ComponentLayer, V as Variable } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedUIBuilderPage } from '../../../../shared/stack.kFbDspnF.js';
|
|
3
|
+
import { C as ComponentLayer, V as Variable } from '../../../../shared/stack.EhM4pmtN.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '../../../../shared/stack.8nldKomx.js';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import { ComponentType } from 'react';
|
|
3
|
+
import react__default, { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { c as UIBuilderClientHooks } from '../../../shared/stack.
|
|
7
|
-
import { a as ComponentRegistry, F as FieldConfigFunction, C as ComponentLayer } from '../../../shared/stack.
|
|
8
|
-
import
|
|
6
|
+
import { c as UIBuilderClientHooks } from '../../../shared/stack.BYysGdHl.cjs';
|
|
7
|
+
import { a as ComponentRegistry, F as FieldConfigFunction, C as ComponentLayer } from '../../../shared/stack.BdJFrdyt.cjs';
|
|
8
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
|
+
import { F as FieldConfigItem, A as AutoFormInputComponentProps } from '../../../shared/stack.8nldKomx.cjs';
|
|
9
10
|
export { PageBuilderPage, PageListPage, PageRenderer, PageRendererProps, SuspensePageRenderer } from './components/index.cjs';
|
|
10
11
|
export { CreateUIBuilderPageInput, UpdateUIBuilderPageInput, UseUIBuilderPagesOptions, UseUIBuilderPagesResult, useCreateUIBuilderPage, useDeleteUIBuilderPage, useSuspenseUIBuilderPage, useSuspenseUIBuilderPageBySlug, useSuspenseUIBuilderPages, useUIBuilderPage, useUIBuilderPageBySlug, useUIBuilderPages, useUpdateUIBuilderPage } from './hooks/index.cjs';
|
|
11
12
|
import 'zod';
|
|
12
13
|
import 'react-hook-form';
|
|
13
|
-
import 'react/jsx-runtime';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Configuration for UI Builder client plugin
|
|
@@ -202,8 +202,18 @@ declare function createComponentRegistry(components: ComponentRegistry): Compone
|
|
|
202
202
|
declare const classNameFieldOverrides: FieldConfigFunction;
|
|
203
203
|
declare const childrenFieldOverrides: FieldConfigFunction;
|
|
204
204
|
declare const iconNameFieldOverrides: FieldConfigFunction;
|
|
205
|
-
declare const childrenAsTextareaFieldOverrides:
|
|
206
|
-
|
|
205
|
+
declare const childrenAsTextareaFieldOverrides: (layer: ComponentLayer, allowVariableBinding?: boolean) => {
|
|
206
|
+
renderParent: (({ children }: {
|
|
207
|
+
children: react__default.ReactNode;
|
|
208
|
+
}) => react_jsx_runtime.JSX.Element) | undefined;
|
|
209
|
+
fieldType: ({ label, isRequired, fieldConfigItem, field, fieldProps, }: AutoFormInputComponentProps) => react_jsx_runtime.JSX.Element;
|
|
210
|
+
};
|
|
211
|
+
declare const childrenAsTipTapFieldOverrides: (layer: ComponentLayer, allowVariableBinding?: boolean) => {
|
|
212
|
+
renderParent: (({ children }: {
|
|
213
|
+
children: react__default.ReactNode;
|
|
214
|
+
}) => react_jsx_runtime.JSX.Element) | undefined;
|
|
215
|
+
fieldType: ({ label, isRequired, fieldConfigItem, field, fieldProps, }: AutoFormInputComponentProps) => react_jsx_runtime.JSX.Element;
|
|
216
|
+
};
|
|
207
217
|
declare const commonFieldOverrides: (allowBinding?: boolean) => Record<string, FieldConfigFunction> | {
|
|
208
218
|
className: (layer: ComponentLayer) => FieldConfigItem;
|
|
209
219
|
children: (layer: ComponentLayer) => FieldConfigItem;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import { ComponentType } from 'react';
|
|
3
|
+
import react__default, { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { c as UIBuilderClientHooks } from '../../../shared/stack.
|
|
7
|
-
import { a as ComponentRegistry, F as FieldConfigFunction, C as ComponentLayer } from '../../../shared/stack.
|
|
8
|
-
import
|
|
6
|
+
import { c as UIBuilderClientHooks } from '../../../shared/stack.DYCFcnkL.mjs';
|
|
7
|
+
import { a as ComponentRegistry, F as FieldConfigFunction, C as ComponentLayer } from '../../../shared/stack.ChVuHi5e.mjs';
|
|
8
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
|
+
import { F as FieldConfigItem, A as AutoFormInputComponentProps } from '../../../shared/stack.8nldKomx.mjs';
|
|
9
10
|
export { PageBuilderPage, PageListPage, PageRenderer, PageRendererProps, SuspensePageRenderer } from './components/index.mjs';
|
|
10
11
|
export { CreateUIBuilderPageInput, UpdateUIBuilderPageInput, UseUIBuilderPagesOptions, UseUIBuilderPagesResult, useCreateUIBuilderPage, useDeleteUIBuilderPage, useSuspenseUIBuilderPage, useSuspenseUIBuilderPageBySlug, useSuspenseUIBuilderPages, useUIBuilderPage, useUIBuilderPageBySlug, useUIBuilderPages, useUpdateUIBuilderPage } from './hooks/index.mjs';
|
|
11
12
|
import 'zod';
|
|
12
13
|
import 'react-hook-form';
|
|
13
|
-
import 'react/jsx-runtime';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Configuration for UI Builder client plugin
|
|
@@ -202,8 +202,18 @@ declare function createComponentRegistry(components: ComponentRegistry): Compone
|
|
|
202
202
|
declare const classNameFieldOverrides: FieldConfigFunction;
|
|
203
203
|
declare const childrenFieldOverrides: FieldConfigFunction;
|
|
204
204
|
declare const iconNameFieldOverrides: FieldConfigFunction;
|
|
205
|
-
declare const childrenAsTextareaFieldOverrides:
|
|
206
|
-
|
|
205
|
+
declare const childrenAsTextareaFieldOverrides: (layer: ComponentLayer, allowVariableBinding?: boolean) => {
|
|
206
|
+
renderParent: (({ children }: {
|
|
207
|
+
children: react__default.ReactNode;
|
|
208
|
+
}) => react_jsx_runtime.JSX.Element) | undefined;
|
|
209
|
+
fieldType: ({ label, isRequired, fieldConfigItem, field, fieldProps, }: AutoFormInputComponentProps) => react_jsx_runtime.JSX.Element;
|
|
210
|
+
};
|
|
211
|
+
declare const childrenAsTipTapFieldOverrides: (layer: ComponentLayer, allowVariableBinding?: boolean) => {
|
|
212
|
+
renderParent: (({ children }: {
|
|
213
|
+
children: react__default.ReactNode;
|
|
214
|
+
}) => react_jsx_runtime.JSX.Element) | undefined;
|
|
215
|
+
fieldType: ({ label, isRequired, fieldConfigItem, field, fieldProps, }: AutoFormInputComponentProps) => react_jsx_runtime.JSX.Element;
|
|
216
|
+
};
|
|
207
217
|
declare const commonFieldOverrides: (allowBinding?: boolean) => Record<string, FieldConfigFunction> | {
|
|
208
218
|
className: (layer: ComponentLayer) => FieldConfigItem;
|
|
209
219
|
children: (layer: ComponentLayer) => FieldConfigItem;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import { ComponentType } from 'react';
|
|
3
|
+
import react__default, { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { c as UIBuilderClientHooks } from '../../../shared/stack.
|
|
7
|
-
import { a as ComponentRegistry, F as FieldConfigFunction, C as ComponentLayer } from '../../../shared/stack.
|
|
8
|
-
import
|
|
6
|
+
import { c as UIBuilderClientHooks } from '../../../shared/stack.kFbDspnF.js';
|
|
7
|
+
import { a as ComponentRegistry, F as FieldConfigFunction, C as ComponentLayer } from '../../../shared/stack.EhM4pmtN.js';
|
|
8
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
|
+
import { F as FieldConfigItem, A as AutoFormInputComponentProps } from '../../../shared/stack.8nldKomx.js';
|
|
9
10
|
export { PageBuilderPage, PageListPage, PageRenderer, PageRendererProps, SuspensePageRenderer } from './components/index.js';
|
|
10
11
|
export { CreateUIBuilderPageInput, UpdateUIBuilderPageInput, UseUIBuilderPagesOptions, UseUIBuilderPagesResult, useCreateUIBuilderPage, useDeleteUIBuilderPage, useSuspenseUIBuilderPage, useSuspenseUIBuilderPageBySlug, useSuspenseUIBuilderPages, useUIBuilderPage, useUIBuilderPageBySlug, useUIBuilderPages, useUpdateUIBuilderPage } from './hooks/index.js';
|
|
11
12
|
import 'zod';
|
|
12
13
|
import 'react-hook-form';
|
|
13
|
-
import 'react/jsx-runtime';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Configuration for UI Builder client plugin
|
|
@@ -202,8 +202,18 @@ declare function createComponentRegistry(components: ComponentRegistry): Compone
|
|
|
202
202
|
declare const classNameFieldOverrides: FieldConfigFunction;
|
|
203
203
|
declare const childrenFieldOverrides: FieldConfigFunction;
|
|
204
204
|
declare const iconNameFieldOverrides: FieldConfigFunction;
|
|
205
|
-
declare const childrenAsTextareaFieldOverrides:
|
|
206
|
-
|
|
205
|
+
declare const childrenAsTextareaFieldOverrides: (layer: ComponentLayer, allowVariableBinding?: boolean) => {
|
|
206
|
+
renderParent: (({ children }: {
|
|
207
|
+
children: react__default.ReactNode;
|
|
208
|
+
}) => react_jsx_runtime.JSX.Element) | undefined;
|
|
209
|
+
fieldType: ({ label, isRequired, fieldConfigItem, field, fieldProps, }: AutoFormInputComponentProps) => react_jsx_runtime.JSX.Element;
|
|
210
|
+
};
|
|
211
|
+
declare const childrenAsTipTapFieldOverrides: (layer: ComponentLayer, allowVariableBinding?: boolean) => {
|
|
212
|
+
renderParent: (({ children }: {
|
|
213
|
+
children: react__default.ReactNode;
|
|
214
|
+
}) => react_jsx_runtime.JSX.Element) | undefined;
|
|
215
|
+
fieldType: ({ label, isRequired, fieldConfigItem, field, fieldProps, }: AutoFormInputComponentProps) => react_jsx_runtime.JSX.Element;
|
|
216
|
+
};
|
|
207
217
|
declare const commonFieldOverrides: (allowBinding?: boolean) => Record<string, FieldConfigFunction> | {
|
|
208
218
|
className: (layer: ComponentLayer) => FieldConfigItem;
|
|
209
219
|
children: (layer: ComponentLayer) => FieldConfigItem;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { C as ContentTypeConfig } from '../../shared/stack.BsXokfNh.cjs';
|
|
3
|
-
export { L as LoaderContext, b as PaginatedUIBuilderPages, P as ParsedUIBuilderPage, S as SerializedUIBuilderPage, c as UIBuilderClientHooks, a as UIBuilderPage, U as UIBuilderPageData } from '../../shared/stack.
|
|
4
|
-
export { C as ComponentLayer, a as ComponentRegistry, R as RegistryEntry, V as Variable } from '../../shared/stack.
|
|
3
|
+
export { L as LoaderContext, b as PaginatedUIBuilderPages, P as ParsedUIBuilderPage, S as SerializedUIBuilderPage, c as UIBuilderClientHooks, a as UIBuilderPage, U as UIBuilderPageData } from '../../shared/stack.BYysGdHl.cjs';
|
|
4
|
+
export { C as ComponentLayer, a as ComponentRegistry, R as RegistryEntry, V as Variable } from '../../shared/stack.BdJFrdyt.cjs';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '../../shared/stack.8nldKomx.cjs';
|
|
7
7
|
import 'react-hook-form';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { C as ContentTypeConfig } from '../../shared/stack.BsXokfNh.mjs';
|
|
3
|
-
export { L as LoaderContext, b as PaginatedUIBuilderPages, P as ParsedUIBuilderPage, S as SerializedUIBuilderPage, c as UIBuilderClientHooks, a as UIBuilderPage, U as UIBuilderPageData } from '../../shared/stack.
|
|
4
|
-
export { C as ComponentLayer, a as ComponentRegistry, R as RegistryEntry, V as Variable } from '../../shared/stack.
|
|
3
|
+
export { L as LoaderContext, b as PaginatedUIBuilderPages, P as ParsedUIBuilderPage, S as SerializedUIBuilderPage, c as UIBuilderClientHooks, a as UIBuilderPage, U as UIBuilderPageData } from '../../shared/stack.DYCFcnkL.mjs';
|
|
4
|
+
export { C as ComponentLayer, a as ComponentRegistry, R as RegistryEntry, V as Variable } from '../../shared/stack.ChVuHi5e.mjs';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '../../shared/stack.8nldKomx.mjs';
|
|
7
7
|
import 'react-hook-form';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { C as ContentTypeConfig } from '../../shared/stack.BsXokfNh.js';
|
|
3
|
-
export { L as LoaderContext, b as PaginatedUIBuilderPages, P as ParsedUIBuilderPage, S as SerializedUIBuilderPage, c as UIBuilderClientHooks, a as UIBuilderPage, U as UIBuilderPageData } from '../../shared/stack.
|
|
4
|
-
export { C as ComponentLayer, a as ComponentRegistry, R as RegistryEntry, V as Variable } from '../../shared/stack.
|
|
3
|
+
export { L as LoaderContext, b as PaginatedUIBuilderPages, P as ParsedUIBuilderPage, S as SerializedUIBuilderPage, c as UIBuilderClientHooks, a as UIBuilderPage, U as UIBuilderPageData } from '../../shared/stack.kFbDspnF.js';
|
|
4
|
+
export { C as ComponentLayer, a as ComponentRegistry, R as RegistryEntry, V as Variable } from '../../shared/stack.EhM4pmtN.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '../../shared/stack.8nldKomx.js';
|
|
7
7
|
import 'react-hook-form';
|
|
@@ -9,7 +9,7 @@ interface ComponentLayer<TProps extends Record<string, PropValue> = Record<strin
|
|
|
9
9
|
name?: string;
|
|
10
10
|
type: string;
|
|
11
11
|
props: ComponentProps<TProps>;
|
|
12
|
-
children: ComponentLayer[] | string;
|
|
12
|
+
children: ComponentLayer[] | string | VariableReference;
|
|
13
13
|
}
|
|
14
14
|
type VariableValueType = 'string' | 'number' | 'boolean';
|
|
15
15
|
type VariableValue<T extends VariableValueType> = T extends 'string' ? string : T extends 'number' ? number : T extends 'boolean' ? boolean : never;
|
|
@@ -32,9 +32,15 @@ interface RegistryEntry<T extends ComponentType<any>> {
|
|
|
32
32
|
schema: ZodObject<any> | ZodSchema<any>;
|
|
33
33
|
from?: string;
|
|
34
34
|
isFromDefaultExport?: boolean;
|
|
35
|
-
defaultChildren?: ComponentLayer[] | string;
|
|
35
|
+
defaultChildren?: ComponentLayer[] | string | VariableReference;
|
|
36
36
|
defaultVariableBindings?: DefaultVariableBinding[];
|
|
37
37
|
fieldOverrides?: Record<string, FieldConfigFunction>;
|
|
38
|
+
/**
|
|
39
|
+
* If defined, this component can only be added as a child of the specified parent types.
|
|
40
|
+
* Used to filter component options in the add popover and validate drag-and-drop.
|
|
41
|
+
* Example: TabsTrigger has childOf: ["TabsList"]
|
|
42
|
+
*/
|
|
43
|
+
childOf?: string[];
|
|
38
44
|
}
|
|
39
45
|
type FieldConfigFunction = (layer: ComponentLayer, allowVariableBinding?: boolean) => FieldConfigItem;
|
|
40
46
|
type ComponentRegistry = Record<string, RegistryEntry<ComponentType<any>>>;
|
|
@@ -9,7 +9,7 @@ interface ComponentLayer<TProps extends Record<string, PropValue> = Record<strin
|
|
|
9
9
|
name?: string;
|
|
10
10
|
type: string;
|
|
11
11
|
props: ComponentProps<TProps>;
|
|
12
|
-
children: ComponentLayer[] | string;
|
|
12
|
+
children: ComponentLayer[] | string | VariableReference;
|
|
13
13
|
}
|
|
14
14
|
type VariableValueType = 'string' | 'number' | 'boolean';
|
|
15
15
|
type VariableValue<T extends VariableValueType> = T extends 'string' ? string : T extends 'number' ? number : T extends 'boolean' ? boolean : never;
|
|
@@ -32,9 +32,15 @@ interface RegistryEntry<T extends ComponentType<any>> {
|
|
|
32
32
|
schema: ZodObject<any> | ZodSchema<any>;
|
|
33
33
|
from?: string;
|
|
34
34
|
isFromDefaultExport?: boolean;
|
|
35
|
-
defaultChildren?: ComponentLayer[] | string;
|
|
35
|
+
defaultChildren?: ComponentLayer[] | string | VariableReference;
|
|
36
36
|
defaultVariableBindings?: DefaultVariableBinding[];
|
|
37
37
|
fieldOverrides?: Record<string, FieldConfigFunction>;
|
|
38
|
+
/**
|
|
39
|
+
* If defined, this component can only be added as a child of the specified parent types.
|
|
40
|
+
* Used to filter component options in the add popover and validate drag-and-drop.
|
|
41
|
+
* Example: TabsTrigger has childOf: ["TabsList"]
|
|
42
|
+
*/
|
|
43
|
+
childOf?: string[];
|
|
38
44
|
}
|
|
39
45
|
type FieldConfigFunction = (layer: ComponentLayer, allowVariableBinding?: boolean) => FieldConfigItem;
|
|
40
46
|
type ComponentRegistry = Record<string, RegistryEntry<ComponentType<any>>>;
|
|
@@ -9,7 +9,7 @@ interface ComponentLayer<TProps extends Record<string, PropValue> = Record<strin
|
|
|
9
9
|
name?: string;
|
|
10
10
|
type: string;
|
|
11
11
|
props: ComponentProps<TProps>;
|
|
12
|
-
children: ComponentLayer[] | string;
|
|
12
|
+
children: ComponentLayer[] | string | VariableReference;
|
|
13
13
|
}
|
|
14
14
|
type VariableValueType = 'string' | 'number' | 'boolean';
|
|
15
15
|
type VariableValue<T extends VariableValueType> = T extends 'string' ? string : T extends 'number' ? number : T extends 'boolean' ? boolean : never;
|
|
@@ -32,9 +32,15 @@ interface RegistryEntry<T extends ComponentType<any>> {
|
|
|
32
32
|
schema: ZodObject<any> | ZodSchema<any>;
|
|
33
33
|
from?: string;
|
|
34
34
|
isFromDefaultExport?: boolean;
|
|
35
|
-
defaultChildren?: ComponentLayer[] | string;
|
|
35
|
+
defaultChildren?: ComponentLayer[] | string | VariableReference;
|
|
36
36
|
defaultVariableBindings?: DefaultVariableBinding[];
|
|
37
37
|
fieldOverrides?: Record<string, FieldConfigFunction>;
|
|
38
|
+
/**
|
|
39
|
+
* If defined, this component can only be added as a child of the specified parent types.
|
|
40
|
+
* Used to filter component options in the add popover and validate drag-and-drop.
|
|
41
|
+
* Example: TabsTrigger has childOf: ["TabsList"]
|
|
42
|
+
*/
|
|
43
|
+
childOf?: string[];
|
|
38
44
|
}
|
|
39
45
|
type FieldConfigFunction = (layer: ComponentLayer, allowVariableBinding?: boolean) => FieldConfigItem;
|
|
40
46
|
type ComponentRegistry = Record<string, RegistryEntry<ComponentType<any>>>;
|