@jbpark/live-editor 4.6.0 → 4.6.1
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/dnd/index.d.ts +1 -1
- package/dist/dnd/index.js +1 -1
- package/dist/{dnd-UoJILA75.js → dnd-V8NAxd_R.js} +8 -9
- package/dist/dnd-V8NAxd_R.js.map +1 -0
- package/dist/document-CHO215iP.js +33992 -0
- package/dist/document-CHO215iP.js.map +1 -0
- package/dist/{document-Ct4jW78J.d.ts → document-DqRSCtsx.d.ts} +496 -435
- package/dist/index-C_PfR4X9.d.ts +734 -0
- package/dist/{index-C69Lv-jR.d.ts → index-CiWB0zFb.d.ts} +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{items-B6OXxcLG.js → items-BXXtMUNI.js} +148 -150
- package/dist/items-BXXtMUNI.js.map +1 -0
- package/dist/{sections-BYWOBISr.js → sections-jYuqS4KB.js} +2 -2
- package/dist/{sections-BYWOBISr.js.map → sections-jYuqS4KB.js.map} +1 -1
- package/dist/utils/ast/index.d.ts +2 -2
- package/dist/utils/ast/index.js +13 -15
- package/dist/utils/ast/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +5 -7
- package/dist/dnd-UoJILA75.js.map +0 -1
- package/dist/document-CGbe6bSV.js +0 -38667
- package/dist/document-CGbe6bSV.js.map +0 -1
- package/dist/index-DKYUxi-E.d.ts +0 -227
- package/dist/items-B6OXxcLG.js.map +0 -1
package/dist/dnd/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as PanelBindingSource, A as DndLayout, B as DndPalette, C as useDndItems, D as DraggableItem, E as useDndChildren, F as DndLayoutProps, G as useDndInspector, H as Props, I as DndRegionProps, J as Field, K as DndEditError, L as Layout, M as useDndPalette, N as useDndPanel, O as DraggableItemDragState, P as Canvas, Q as PanelBindingElement, R as Palette, S as DndItemsOptions, T as DndChildrenOptions, U as DndInspector, V as DndPanel, W as DndNodePick, X as PanelBinding, Y as FieldProps, Z as PanelBindingData, _ as DndItemsActions, a as ItemsEditorActions, at as DndSectionFallbackArgs, b as DndItemsNestedElement, c as ItemsEditorNestedGroup, d as useItemsEditor, et as PanelNodeChange, f as FieldKind, g as DndItems, h as isStructuralFieldKind, i as ItemsEditor, it as DndRenderSectionFallback, j as useDndLayout, k as DraggableItemProps, l as ItemsEditorOptions, m as getFieldKind, n as ChildrenEditorOptions, nt as resolvePanelBindings, o as ItemsEditorItem, p as FieldKindBinding, q as DndRenderField, r as Dnd, rt as withPanelCommit, s as ItemsEditorNestedElement, t as ChildrenEditor, tt as PanelNodesChange, u as useChildrenEditor, v as DndItemsExpansion, w as DndChildren, x as DndItemsNestedGroup, y as DndItemsItem, z as Panel } from "../index-
|
|
1
|
+
import { $ as PanelBindingSource, A as DndLayout, B as DndPalette, C as useDndItems, D as DraggableItem, E as useDndChildren, F as DndLayoutProps, G as useDndInspector, H as Props, I as DndRegionProps, J as Field, K as DndEditError, L as Layout, M as useDndPalette, N as useDndPanel, O as DraggableItemDragState, P as Canvas, Q as PanelBindingElement, R as Palette, S as DndItemsOptions, T as DndChildrenOptions, U as DndInspector, V as DndPanel, W as DndNodePick, X as PanelBinding, Y as FieldProps, Z as PanelBindingData, _ as DndItemsActions, a as ItemsEditorActions, at as DndSectionFallbackArgs, b as DndItemsNestedElement, c as ItemsEditorNestedGroup, d as useItemsEditor, et as PanelNodeChange, f as FieldKind, g as DndItems, h as isStructuralFieldKind, i as ItemsEditor, it as DndRenderSectionFallback, j as useDndLayout, k as DraggableItemProps, l as ItemsEditorOptions, m as getFieldKind, n as ChildrenEditorOptions, nt as resolvePanelBindings, o as ItemsEditorItem, p as FieldKindBinding, q as DndRenderField, r as Dnd, rt as withPanelCommit, s as ItemsEditorNestedElement, t as ChildrenEditor, tt as PanelNodesChange, u as useChildrenEditor, v as DndItemsExpansion, w as DndChildren, x as DndItemsNestedGroup, y as DndItemsItem, z as Panel } from "../index-CiWB0zFb.js";
|
|
2
2
|
export { Canvas, ChildrenEditor, ChildrenEditorOptions, type DndChildren, type DndChildrenOptions, type DndEditError, type DndInspector, type DndItems, type DndItemsActions, type DndItemsExpansion, type DndItemsItem, type DndItemsNestedElement, type DndItemsNestedGroup, type DndItemsOptions, type DndLayout, type DndLayoutProps, type DndNodePick, type DndPalette, type DndPanel, type DndRegionProps, type DndRenderField, type DndRenderSectionFallback, type DndSectionFallbackArgs, DraggableItem, type DraggableItemDragState, type DraggableItemProps, Field, type FieldKind, type FieldKindBinding, type FieldProps, ItemsEditor, ItemsEditorActions, ItemsEditorItem, ItemsEditorNestedElement, ItemsEditorNestedGroup, ItemsEditorOptions, Layout, Palette, Panel, type PanelBinding, type PanelBindingData, type PanelBindingElement, type PanelBindingSource, type PanelNodeChange, type PanelNodesChange, type Props, Dnd as default, getFieldKind, isStructuralFieldKind, resolvePanelBindings, useChildrenEditor, useDndChildren, useDndInspector, useDndItems, useDndLayout, useDndPalette, useDndPanel, useItemsEditor, withPanelCommit };
|
package/dist/dnd/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as useDndPanel, a as Layout, c as Field, d as isStructuralFieldKind, f as useDndChildren, g as useDndPalette, h as useDndLayout, i as Canvas, l as useDndItems, m as withPanelCommit, n as useChildrenEditor, o as Palette, p as resolvePanelBindings, r as useItemsEditor, s as Panel, t as Dnd, u as getFieldKind, v as useDndInspector, y as DraggableItem } from "../dnd-
|
|
1
|
+
import { _ as useDndPanel, a as Layout, c as Field, d as isStructuralFieldKind, f as useDndChildren, g as useDndPalette, h as useDndLayout, i as Canvas, l as useDndItems, m as withPanelCommit, n as useChildrenEditor, o as Palette, p as resolvePanelBindings, r as useItemsEditor, s as Panel, t as Dnd, u as getFieldKind, v as useDndInspector, y as DraggableItem } from "../dnd-V8NAxd_R.js";
|
|
2
2
|
export { Canvas, DraggableItem, Field, Layout, Palette, Panel, Dnd as default, getFieldKind, isStructuralFieldKind, resolvePanelBindings, useChildrenEditor, useDndChildren, useDndInspector, useDndItems, useDndLayout, useDndPalette, useDndPanel, useItemsEditor, withPanelCommit };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as isJSXElement, B as isObjectExpression, D as isExpression, N as isJSXFragment, O as isIdentifier, V as isObjectProperty, c as inspectDocument, h as replaceIds, m as fillIdsFrom, n as createSectionPreviewCache, r as fillSectionIds, x as nanoid } from "./document-CHO215iP.js";
|
|
2
2
|
import { c as RESERVED_BINDING_PROPERTIES, o as PALETTE_SECTIONS, r as DATA_ATTR, t as BINDING_PROP } from "./constants-DU17Tdwo.js";
|
|
3
3
|
import { n as validateBindingValue } from "./validate-iLo8IONY.js";
|
|
4
4
|
import { i as useLiveMessages } from "./messages-CSrMI4Rm.js";
|
|
5
5
|
import { i as usePreview } from "./states-Ci1AvoQ9.js";
|
|
6
|
-
import { A as extractNodeValue, C as getStructuredValue, D as readNodeBindings, M as parseArrayExpression, N as parseValue, b as getCurrentValue, c as updateArrayItemValue, f as updateAll, g as moveSelectedIndices, h as getChildrenSignatures, i as moveArrayItems, j as extractObjectProperties, k as canLosslesslyEvaluateSource, l as canStructurallyEditArray, n as duplicateArrayItems, o as removeArrayItems, r as moveArrayItem, s as updateArrayItemProperty, t as appendArrayItem, v as extract, y as findEditableChildren } from "./items-
|
|
6
|
+
import { A as extractNodeValue, C as getStructuredValue, D as readNodeBindings, M as parseArrayExpression, N as parseValue, b as getCurrentValue, c as updateArrayItemValue, f as updateAll, g as moveSelectedIndices, h as getChildrenSignatures, i as moveArrayItems, j as extractObjectProperties, k as canLosslesslyEvaluateSource, l as canStructurallyEditArray, n as duplicateArrayItems, o as removeArrayItems, r as moveArrayItem, s as updateArrayItemProperty, t as appendArrayItem, v as extract, y as findEditableChildren } from "./items-BXXtMUNI.js";
|
|
7
7
|
import { t as cn } from "./cn-CAnad2vL.js";
|
|
8
8
|
import { o as preloadScripts } from "./compile-Dxas-D05.js";
|
|
9
9
|
import { a as useStableModules, i as Frame, n as useCompiledModule, t as useDynamicTailwind } from "./use-dynamic-tailwind-BP1toJkW.js";
|
|
10
|
-
import { i as generateSection, o as replaceSections, r as extractSections } from "./sections-
|
|
10
|
+
import { i as generateSection, o as replaceSections, r as extractSections } from "./sections-jYuqS4KB.js";
|
|
11
11
|
import { n as Error$1, t as ErrorBoundary } from "./boundary-BLB80tyw.js";
|
|
12
12
|
import { t as Core } from "./core-Bgfek364.js";
|
|
13
13
|
import { Children, createContext, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
@@ -20,7 +20,6 @@ import { useDebounce, useMultiSelect, useResponsiveSize } from "@jbpark/use-hook
|
|
|
20
20
|
import { CSS as CSS$1 } from "@dnd-kit/utilities";
|
|
21
21
|
import { ArrowDown, ArrowUp, ChevronDown, ChevronRight, ChevronUp, Copy, Crosshair, GripVertical, LayoutGrid, Plus, Trash, X } from "lucide-react";
|
|
22
22
|
//#region src/components/dnd/palette/palette-drag.ts
|
|
23
|
-
var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
|
|
24
23
|
const PALETTE_SECTION = "palette-section";
|
|
25
24
|
const paletteDragData = (section) => ({
|
|
26
25
|
type: PALETTE_SECTION,
|
|
@@ -935,8 +934,8 @@ const parseSource = (value, bindingOptions) => {
|
|
|
935
934
|
const objectItems = [];
|
|
936
935
|
const primitiveItems = [];
|
|
937
936
|
ast.elements.forEach((element, elementIndex) => {
|
|
938
|
-
if (!
|
|
939
|
-
if (!
|
|
937
|
+
if (!isExpression(element)) return;
|
|
938
|
+
if (!isObjectExpression(element)) {
|
|
940
939
|
const extracted = extractNodeValue(element);
|
|
941
940
|
primitiveItems.push({
|
|
942
941
|
id: nanoid(6),
|
|
@@ -951,7 +950,7 @@ const parseSource = (value, bindingOptions) => {
|
|
|
951
950
|
const jsxBindings = {};
|
|
952
951
|
const jsxFallbacks = {};
|
|
953
952
|
element.properties.forEach((prop) => {
|
|
954
|
-
if (!
|
|
953
|
+
if (!isObjectProperty(prop) || !isIdentifier(prop.key) || !(isJSXElement(prop.value) || isJSXFragment(prop.value))) return;
|
|
955
954
|
const propertyName = prop.key.name;
|
|
956
955
|
try {
|
|
957
956
|
const found = bindingsInJSX(value.slice(prop.value.start, prop.value.end), bindingOptions);
|
|
@@ -1141,7 +1140,7 @@ const useDndItems = (value, { render, onChange, onNodeChange } = {}) => {
|
|
|
1141
1140
|
commit(snapshot, null, void 0, snapshot.selected);
|
|
1142
1141
|
return;
|
|
1143
1142
|
}
|
|
1144
|
-
const visible = parseArrayExpression(result.code)?.elements.flatMap((node, index) =>
|
|
1143
|
+
const visible = parseArrayExpression(result.code)?.elements.flatMap((node, index) => isExpression(node) && isObjectExpression(node) === !isPrimitive ? [index] : []) ?? [];
|
|
1145
1144
|
commit(snapshot, result.code, nextIdentity.items, new Set(visible.flatMap((position, index) => result.indices.has(position) ? [index] : [])));
|
|
1146
1145
|
},
|
|
1147
1146
|
removeSelected: () => {
|
|
@@ -2753,4 +2752,4 @@ const useChildrenEditor = useDndChildren;
|
|
|
2753
2752
|
//#endregion
|
|
2754
2753
|
export { useDndPanel as _, Layout as a, Field as c, isStructuralFieldKind as d, useDndChildren as f, useDndPalette as g, useDndLayout as h, Canvas as i, useDndItems as l, withPanelCommit as m, useChildrenEditor as n, Palette as o, resolvePanelBindings as p, useItemsEditor as r, Panel as s, Dnd as t, getFieldKind as u, useDndInspector as v, DraggableItem as y };
|
|
2755
2754
|
|
|
2756
|
-
//# sourceMappingURL=dnd-
|
|
2755
|
+
//# sourceMappingURL=dnd-V8NAxd_R.js.map
|