@questpie/admin 3.2.0 → 3.2.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.
Files changed (85) hide show
  1. package/dist/client/blocks/block-renderer.d.mts +12 -2
  2. package/dist/client/blocks/block-renderer.mjs +357 -49
  3. package/dist/client/components/blocks/block-editor-context.mjs +11 -1
  4. package/dist/client/components/blocks/block-editor-provider.mjs +68 -26
  5. package/dist/client/components/blocks/block-item.mjs +181 -170
  6. package/dist/client/components/blocks/utils/tree-utils.mjs +13 -1
  7. package/dist/client/components/fields/array-field.mjs +177 -118
  8. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +305 -310
  9. package/dist/client/components/filter-builder/filters-tab.mjs +1 -1
  10. package/dist/client/components/history-sidebar.mjs +121 -114
  11. package/dist/client/components/preview/live-preview-mode.mjs +140 -114
  12. package/dist/client/components/preview/preview-pane.mjs +288 -333
  13. package/dist/client/components/primitives/option-label.mjs +44 -0
  14. package/dist/client/components/primitives/select-multi.mjs +408 -383
  15. package/dist/client/components/primitives/select-single.mjs +387 -357
  16. package/dist/client/components/widgets/chart-widget.mjs +168 -143
  17. package/dist/client/contexts/focus-context.d.mts +11 -0
  18. package/dist/client/contexts/focus-context.mjs +51 -34
  19. package/dist/client/hooks/use-brand.mjs +2 -1
  20. package/dist/client/preview/block-scope-context.d.mts +2 -2
  21. package/dist/client/preview/block-scope-context.mjs +10 -20
  22. package/dist/client/preview/index.d.mts +1 -1
  23. package/dist/client/preview/patch.mjs +100 -0
  24. package/dist/client/preview/preview-banner.d.mts +2 -2
  25. package/dist/client/preview/preview-field.d.mts +34 -5
  26. package/dist/client/preview/preview-field.mjs +385 -118
  27. package/dist/client/preview/types.d.mts +82 -3
  28. package/dist/client/preview/types.mjs +85 -6
  29. package/dist/client/preview/use-collection-preview.d.mts +19 -1
  30. package/dist/client/preview/use-collection-preview.mjs +182 -58
  31. package/dist/client/runtime/index.d.mts +2 -2
  32. package/dist/client/runtime/index.mjs +2 -2
  33. package/dist/client/runtime/provider.d.mts +5 -5
  34. package/dist/client/utils/build-field-definitions-from-schema.mjs +8 -3
  35. package/dist/client/views/auth/reset-password-form.d.mts +2 -2
  36. package/dist/client/views/auth/setup-form.d.mts +2 -2
  37. package/dist/client/views/collection/bulk-action-toolbar.mjs +23 -25
  38. package/dist/client/views/collection/cells/primitive-cells.mjs +63 -13
  39. package/dist/client/views/collection/columns/build-columns.mjs +1 -0
  40. package/dist/client/views/collection/form-view.mjs +262 -33
  41. package/dist/client/views/collection/table-view.mjs +16 -11
  42. package/dist/client/views/layout/admin-layout-provider.d.mts +5 -5
  43. package/dist/client/views/layout/admin-layout-provider.mjs +107 -16
  44. package/dist/client.d.mts +2 -2
  45. package/dist/client.mjs +1 -1
  46. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  47. package/dist/index.d.mts +2 -2
  48. package/dist/index.mjs +1 -1
  49. package/dist/server/augmentation/common.d.mts +8 -4
  50. package/dist/server/augmentation/form-layout.d.mts +1 -1
  51. package/dist/server/i18n/messages/cs.mjs +11 -0
  52. package/dist/server/i18n/messages/de.mjs +11 -0
  53. package/dist/server/i18n/messages/en.mjs +11 -0
  54. package/dist/server/i18n/messages/es.mjs +11 -0
  55. package/dist/server/i18n/messages/fr.mjs +11 -0
  56. package/dist/server/i18n/messages/pl.mjs +11 -0
  57. package/dist/server/i18n/messages/pt.mjs +11 -0
  58. package/dist/server/i18n/messages/sk.mjs +11 -0
  59. package/dist/server/modules/admin/block/block-builder.d.mts +7 -10
  60. package/dist/server/modules/admin/block/block-builder.mjs +7 -10
  61. package/dist/server/modules/admin/collections/account.d.mts +50 -50
  62. package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
  63. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  64. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  65. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  66. package/dist/server/modules/admin/collections/assets.d.mts +57 -20
  67. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  68. package/dist/server/modules/admin/collections/user.d.mts +100 -34
  69. package/dist/server/modules/admin/collections/user.mjs +4 -4
  70. package/dist/server/modules/admin/collections/verification.d.mts +32 -32
  71. package/dist/server/modules/admin/index.d.mts +3 -3
  72. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  73. package/dist/server/modules/admin/routes/admin-config.mjs +9 -12
  74. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  75. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  76. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  77. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  78. package/dist/server/modules/admin/routes/setup.d.mts +7 -7
  79. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  80. package/dist/server/modules/admin/routes/translations.mjs +1 -1
  81. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  82. package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +4 -6
  83. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +31 -33
  84. package/dist/server/modules/admin-preferences/collections/saved-views.mjs +4 -6
  85. package/package.json +3 -3
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { useTranslation } from "../../i18n/hooks.mjs";
4
4
  import { cn } from "../../lib/utils.mjs";
5
- import { useBlockEditorActions, useBlockSchema, useBlockValues, useIsBlockExpanded } from "./block-editor-context.mjs";
5
+ import { useBlockEditorActions, useBlockSchema, useBlockValues, useIsBlockExpanded, useIsBlockSelected } from "./block-editor-context.mjs";
6
6
  import { BlockInsertButton } from "./block-insert-button.mjs";
7
7
  import { Card, CardContent, CardHeader } from "../ui/card.mjs";
8
8
  import { BlockFieldsRenderer } from "./block-fields-renderer.mjs";
@@ -27,13 +27,14 @@ function areBlockItemPropsEqual(prev, next) {
27
27
  return prev.block === next.block && prev.level === next.level && prev.index === next.index && prev.parentId === next.parentId;
28
28
  }
29
29
  const BlockItem = React.memo(function BlockItem$1(t0) {
30
- const $ = c(100);
30
+ const $ = c(105);
31
31
  const { block, level } = t0;
32
32
  const { t } = useTranslation();
33
33
  const actions = useBlockEditorActions();
34
34
  const blockSchema = useBlockSchema(block.type);
35
35
  const values = useBlockValues(block.id);
36
36
  const isExpanded = useIsBlockExpanded(block.id);
37
+ const isSelected = useIsBlockSelected(block.id);
37
38
  const isUnknownType = !blockSchema;
38
39
  const canHaveChildren = blockSchema?.allowChildren ?? false;
39
40
  let t1;
@@ -129,63 +130,68 @@ const BlockItem = React.memo(function BlockItem$1(t0) {
129
130
  $[25] = showDropIndicator;
130
131
  $[26] = t11;
131
132
  } else t11 = $[26];
132
- const t12 = isUnknownType && "border-destructive/50";
133
- let t13;
134
- if ($[27] !== t12) {
135
- t13 = cn("gap-0 overflow-hidden p-0 transition-shadow", t12);
136
- $[27] = t12;
137
- $[28] = t13;
138
- } else t13 = $[28];
139
- let t14;
140
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
141
- t14 = cn("group flex cursor-pointer flex-row items-center gap-2 px-3 py-2 select-none", "hover:bg-muted transition-colors", "focus-visible:ring-ring/25 focus-visible:ring-3 focus-visible:outline-none focus-visible:ring-inset");
142
- $[29] = t14;
143
- } else t14 = $[29];
133
+ const t12 = `content._values.${block.id}`;
134
+ const t13 = isUnknownType && "border-destructive/50";
135
+ const t14 = isSelected && "border-primary ring-primary/20 ring-2";
144
136
  let t15;
145
- if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
146
- t15 = /* @__PURE__ */ jsx(Icon, {
137
+ if ($[27] !== t13 || $[28] !== t14) {
138
+ t15 = cn("gap-0 overflow-hidden p-0 transition-[border-color,box-shadow]", t13, t14);
139
+ $[27] = t13;
140
+ $[28] = t14;
141
+ $[29] = t15;
142
+ } else t15 = $[29];
143
+ const t16 = isSelected && "bg-primary/5";
144
+ let t17;
145
+ if ($[30] !== t16) {
146
+ t17 = cn("group flex cursor-pointer flex-row items-center gap-2 px-3 py-2 select-none", "hover:bg-muted transition-colors", "focus-visible:ring-ring/25 focus-visible:ring-3 focus-visible:outline-none focus-visible:ring-inset", t16);
147
+ $[30] = t16;
148
+ $[31] = t17;
149
+ } else t17 = $[31];
150
+ let t18;
151
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
152
+ t18 = /* @__PURE__ */ jsx(Icon, {
147
153
  icon: "ph:dots-six-vertical",
148
154
  className: "text-muted-foreground h-4 w-4"
149
155
  });
150
- $[30] = t15;
151
- } else t15 = $[30];
152
- let t16;
153
- if ($[31] !== attributes || $[32] !== listeners) {
154
- t16 = /* @__PURE__ */ jsx("button", {
156
+ $[32] = t18;
157
+ } else t18 = $[32];
158
+ let t19;
159
+ if ($[33] !== attributes || $[34] !== listeners) {
160
+ t19 = /* @__PURE__ */ jsx("button", {
155
161
  type: "button",
156
162
  "data-drag-handle": true,
157
163
  className: "hover:bg-muted -ml-1 cursor-grab rounded p-1 active:cursor-grabbing",
158
164
  ...attributes,
159
165
  ...listeners,
160
166
  onClick: _temp,
161
- children: t15
167
+ children: t18
162
168
  });
163
- $[31] = attributes;
164
- $[32] = listeners;
165
- $[33] = t16;
166
- } else t16 = $[33];
167
- const t17 = isExpanded && "rotate-90";
168
- let t18;
169
- if ($[34] !== t17) {
170
- t18 = cn("h-4 w-4 transition-transform duration-150 ease-in-out", t17);
171
- $[34] = t17;
172
- $[35] = t18;
173
- } else t18 = $[35];
174
- let t19;
175
- if ($[36] !== t18) {
176
- t19 = /* @__PURE__ */ jsx("div", {
169
+ $[33] = attributes;
170
+ $[34] = listeners;
171
+ $[35] = t19;
172
+ } else t19 = $[35];
173
+ const t20 = isExpanded && "rotate-90";
174
+ let t21;
175
+ if ($[36] !== t20) {
176
+ t21 = cn("h-4 w-4 transition-transform duration-150 ease-in-out", t20);
177
+ $[36] = t20;
178
+ $[37] = t21;
179
+ } else t21 = $[37];
180
+ let t22;
181
+ if ($[38] !== t21) {
182
+ t22 = /* @__PURE__ */ jsx("div", {
177
183
  className: "text-muted-foreground",
178
184
  children: /* @__PURE__ */ jsx(Icon, {
179
185
  icon: "ph:caret-right",
180
- className: t18
186
+ className: t21
181
187
  })
182
188
  });
183
- $[36] = t18;
184
- $[37] = t19;
185
- } else t19 = $[37];
186
- let t20;
187
- if ($[38] !== blockSchema?.admin?.icon || $[39] !== isRoot || $[40] !== isUnknownType) {
188
- t20 = isUnknownType ? /* @__PURE__ */ jsx(Icon, {
189
+ $[38] = t21;
190
+ $[39] = t22;
191
+ } else t22 = $[39];
192
+ let t23;
193
+ if ($[40] !== blockSchema?.admin?.icon || $[41] !== isRoot || $[42] !== isUnknownType) {
194
+ t23 = isUnknownType ? /* @__PURE__ */ jsx(Icon, {
189
195
  icon: "ph:warning",
190
196
  className: "text-destructive h-3.5 w-3.5"
191
197
  }) : /* @__PURE__ */ jsx(BlockIcon, {
@@ -193,50 +199,50 @@ const BlockItem = React.memo(function BlockItem$1(t0) {
193
199
  size: 14,
194
200
  className: isRoot ? "text-foreground" : "text-muted-foreground"
195
201
  });
196
- $[38] = blockSchema?.admin?.icon;
197
- $[39] = isRoot;
198
- $[40] = isUnknownType;
199
- $[41] = t20;
200
- } else t20 = $[41];
201
- const t21 = isUnknownType ? "text-destructive" : isRoot ? "text-foreground" : "text-foreground/90";
202
- let t22;
203
- if ($[42] !== t21) {
204
- t22 = cn("truncate text-sm font-medium", t21);
205
- $[42] = t21;
206
- $[43] = t22;
207
- } else t22 = $[43];
208
- let t23;
209
- if ($[44] !== blockLabel || $[45] !== t22) {
210
- t23 = /* @__PURE__ */ jsx("span", {
211
- className: t22,
202
+ $[40] = blockSchema?.admin?.icon;
203
+ $[41] = isRoot;
204
+ $[42] = isUnknownType;
205
+ $[43] = t23;
206
+ } else t23 = $[43];
207
+ const t24 = isUnknownType ? "text-destructive" : isRoot ? "text-foreground" : "text-foreground/90";
208
+ let t25;
209
+ if ($[44] !== t24) {
210
+ t25 = cn("truncate text-sm font-medium", t24);
211
+ $[44] = t24;
212
+ $[45] = t25;
213
+ } else t25 = $[45];
214
+ let t26;
215
+ if ($[46] !== blockLabel || $[47] !== t25) {
216
+ t26 = /* @__PURE__ */ jsx("span", {
217
+ className: t25,
212
218
  children: blockLabel
213
219
  });
214
- $[44] = blockLabel;
215
- $[45] = t22;
216
- $[46] = t23;
217
- } else t23 = $[46];
218
- let t24;
219
- if ($[47] !== values) {
220
- t24 = values && /* @__PURE__ */ jsx("span", {
220
+ $[46] = blockLabel;
221
+ $[47] = t25;
222
+ $[48] = t26;
223
+ } else t26 = $[48];
224
+ let t27;
225
+ if ($[49] !== values) {
226
+ t27 = values && /* @__PURE__ */ jsx("span", {
221
227
  className: "text-muted-foreground hidden truncate text-xs sm:inline",
222
228
  children: getPreviewText(values)
223
229
  });
224
- $[47] = values;
225
- $[48] = t24;
226
- } else t24 = $[48];
227
- let t25;
228
- if ($[49] !== t23 || $[50] !== t24) {
229
- t25 = /* @__PURE__ */ jsxs("div", {
230
+ $[49] = values;
231
+ $[50] = t27;
232
+ } else t27 = $[50];
233
+ let t28;
234
+ if ($[51] !== t26 || $[52] !== t27) {
235
+ t28 = /* @__PURE__ */ jsxs("div", {
230
236
  className: "flex min-w-0 flex-1 items-baseline gap-2",
231
- children: [t23, t24]
237
+ children: [t26, t27]
232
238
  });
233
- $[49] = t23;
234
- $[50] = t24;
235
- $[51] = t25;
236
- } else t25 = $[51];
237
- let t26;
238
- if ($[52] !== block.id || $[53] !== canHaveChildren || $[54] !== handleDuplicate || $[55] !== handleRemove) {
239
- t26 = /* @__PURE__ */ jsx("div", {
239
+ $[51] = t26;
240
+ $[52] = t27;
241
+ $[53] = t28;
242
+ } else t28 = $[53];
243
+ let t29;
244
+ if ($[54] !== block.id || $[55] !== canHaveChildren || $[56] !== handleDuplicate || $[57] !== handleRemove) {
245
+ t29 = /* @__PURE__ */ jsx("div", {
240
246
  "data-actions-menu": true,
241
247
  children: /* @__PURE__ */ jsx(BlockItemDropdownMenu, {
242
248
  blockId: block.id,
@@ -246,55 +252,58 @@ const BlockItem = React.memo(function BlockItem$1(t0) {
246
252
  className: "h-7 w-7 opacity-0 transition-opacity group-hover:opacity-100"
247
253
  })
248
254
  });
249
- $[52] = block.id;
250
- $[53] = canHaveChildren;
251
- $[54] = handleDuplicate;
252
- $[55] = handleRemove;
253
- $[56] = t26;
254
- } else t26 = $[56];
255
- let t27;
256
- if ($[57] !== handleKeyDown || $[58] !== handleToggleExpand || $[59] !== t16 || $[60] !== t19 || $[61] !== t20 || $[62] !== t25 || $[63] !== t26) {
257
- t27 = /* @__PURE__ */ jsxs(CardHeader, {
255
+ $[54] = block.id;
256
+ $[55] = canHaveChildren;
257
+ $[56] = handleDuplicate;
258
+ $[57] = handleRemove;
259
+ $[58] = t29;
260
+ } else t29 = $[58];
261
+ let t30;
262
+ if ($[59] !== handleKeyDown || $[60] !== handleToggleExpand || $[61] !== isExpanded || $[62] !== t17 || $[63] !== t19 || $[64] !== t22 || $[65] !== t23 || $[66] !== t28 || $[67] !== t29) {
263
+ t30 = /* @__PURE__ */ jsxs(CardHeader, {
258
264
  role: "button",
259
265
  tabIndex: 0,
260
- className: t14,
266
+ "aria-expanded": isExpanded,
267
+ className: t17,
261
268
  onClick: handleToggleExpand,
262
269
  onKeyDown: handleKeyDown,
263
270
  children: [
264
- t16,
265
271
  t19,
266
- t20,
267
- t25,
268
- t26
272
+ t22,
273
+ t23,
274
+ t28,
275
+ t29
269
276
  ]
270
277
  });
271
- $[57] = handleKeyDown;
272
- $[58] = handleToggleExpand;
273
- $[59] = t16;
274
- $[60] = t19;
275
- $[61] = t20;
276
- $[62] = t25;
277
- $[63] = t26;
278
- $[64] = t27;
279
- } else t27 = $[64];
280
- let t28;
281
- if ($[65] !== block.id || $[66] !== blockSchema || $[67] !== isExpanded || $[68] !== isRoot) {
282
- t28 = isExpanded && blockSchema && /* @__PURE__ */ jsx(CardContent, {
278
+ $[59] = handleKeyDown;
279
+ $[60] = handleToggleExpand;
280
+ $[61] = isExpanded;
281
+ $[62] = t17;
282
+ $[63] = t19;
283
+ $[64] = t22;
284
+ $[65] = t23;
285
+ $[66] = t28;
286
+ $[67] = t29;
287
+ $[68] = t30;
288
+ } else t30 = $[68];
289
+ let t31;
290
+ if ($[69] !== block.id || $[70] !== blockSchema || $[71] !== isExpanded || $[72] !== isRoot) {
291
+ t31 = isExpanded && blockSchema && /* @__PURE__ */ jsx(CardContent, {
283
292
  className: cn("p-3", !isRoot && "py-2"),
284
293
  children: /* @__PURE__ */ jsx(BlockFieldsRenderer, {
285
294
  blockId: block.id,
286
295
  blockSchema
287
296
  })
288
297
  });
289
- $[65] = block.id;
290
- $[66] = blockSchema;
291
- $[67] = isExpanded;
292
- $[68] = isRoot;
293
- $[69] = t28;
294
- } else t28 = $[69];
295
- let t29;
296
- if ($[70] !== block.type || $[71] !== isExpanded || $[72] !== isUnknownType || $[73] !== t) {
297
- t29 = isExpanded && isUnknownType && /* @__PURE__ */ jsx(CardContent, {
298
+ $[69] = block.id;
299
+ $[70] = blockSchema;
300
+ $[71] = isExpanded;
301
+ $[72] = isRoot;
302
+ $[73] = t31;
303
+ } else t31 = $[73];
304
+ let t32;
305
+ if ($[74] !== block.type || $[75] !== isExpanded || $[76] !== isUnknownType || $[77] !== t) {
306
+ t32 = isExpanded && isUnknownType && /* @__PURE__ */ jsx(CardContent, {
298
307
  className: "p-3",
299
308
  children: /* @__PURE__ */ jsxs("div", {
300
309
  className: "text-destructive flex items-center gap-2 text-sm",
@@ -304,31 +313,33 @@ const BlockItem = React.memo(function BlockItem$1(t0) {
304
313
  }), /* @__PURE__ */ jsx("span", { children: t("blocks.unknownType", { type: block.type }) })]
305
314
  })
306
315
  });
307
- $[70] = block.type;
308
- $[71] = isExpanded;
309
- $[72] = isUnknownType;
310
- $[73] = t;
311
- $[74] = t29;
312
- } else t29 = $[74];
313
- let t30;
314
- if ($[75] !== t13 || $[76] !== t27 || $[77] !== t28 || $[78] !== t29) {
315
- t30 = /* @__PURE__ */ jsxs(Card, {
316
- className: t13,
316
+ $[74] = block.type;
317
+ $[75] = isExpanded;
318
+ $[76] = isUnknownType;
319
+ $[77] = t;
320
+ $[78] = t32;
321
+ } else t32 = $[78];
322
+ let t33;
323
+ if ($[79] !== t12 || $[80] !== t15 || $[81] !== t30 || $[82] !== t31 || $[83] !== t32) {
324
+ t33 = /* @__PURE__ */ jsxs(Card, {
325
+ "data-field-path": t12,
326
+ className: t15,
317
327
  children: [
318
- t27,
319
- t28,
320
- t29
328
+ t30,
329
+ t31,
330
+ t32
321
331
  ]
322
332
  });
323
- $[75] = t13;
324
- $[76] = t27;
325
- $[77] = t28;
326
- $[78] = t29;
327
- $[79] = t30;
328
- } else t30 = $[79];
329
- let t31;
330
- if ($[80] !== block.children || $[81] !== block.id || $[82] !== canHaveChildren || $[83] !== isExpanded || $[84] !== level) {
331
- t31 = canHaveChildren && isExpanded && block.children.length > 0 && /* @__PURE__ */ jsxs("div", {
333
+ $[79] = t12;
334
+ $[80] = t15;
335
+ $[81] = t30;
336
+ $[82] = t31;
337
+ $[83] = t32;
338
+ $[84] = t33;
339
+ } else t33 = $[84];
340
+ let t34;
341
+ if ($[85] !== block.children || $[86] !== block.id || $[87] !== canHaveChildren || $[88] !== isExpanded || $[89] !== level) {
342
+ t34 = canHaveChildren && isExpanded && block.children.length > 0 && /* @__PURE__ */ jsxs("div", {
332
343
  className: "relative",
333
344
  children: [/* @__PURE__ */ jsx("div", { className: "bg-border absolute top-0 bottom-0 left-3 w-px" }), /* @__PURE__ */ jsx("div", {
334
345
  className: "space-y-2 pt-2 pl-8",
@@ -339,16 +350,16 @@ const BlockItem = React.memo(function BlockItem$1(t0) {
339
350
  })
340
351
  })]
341
352
  });
342
- $[80] = block.children;
343
- $[81] = block.id;
344
- $[82] = canHaveChildren;
345
- $[83] = isExpanded;
346
- $[84] = level;
347
- $[85] = t31;
348
- } else t31 = $[85];
349
- let t32;
350
- if ($[86] !== block.children || $[87] !== block.id || $[88] !== blockLabel || $[89] !== canHaveChildren || $[90] !== isExpanded) {
351
- t32 = canHaveChildren && isExpanded && /* @__PURE__ */ jsxs("div", {
353
+ $[85] = block.children;
354
+ $[86] = block.id;
355
+ $[87] = canHaveChildren;
356
+ $[88] = isExpanded;
357
+ $[89] = level;
358
+ $[90] = t34;
359
+ } else t34 = $[90];
360
+ let t35;
361
+ if ($[91] !== block.children || $[92] !== block.id || $[93] !== blockLabel || $[94] !== canHaveChildren || $[95] !== isExpanded) {
362
+ t35 = canHaveChildren && isExpanded && /* @__PURE__ */ jsxs("div", {
352
363
  className: "relative mt-2 pl-8",
353
364
  children: [
354
365
  /* @__PURE__ */ jsx("div", { className: "bg-border absolute -top-2 left-3 h-[calc(50%+8px)] w-px" }),
@@ -363,36 +374,36 @@ const BlockItem = React.memo(function BlockItem$1(t0) {
363
374
  })
364
375
  ]
365
376
  });
366
- $[86] = block.children;
367
- $[87] = block.id;
368
- $[88] = blockLabel;
369
- $[89] = canHaveChildren;
370
- $[90] = isExpanded;
371
- $[91] = t32;
372
- } else t32 = $[91];
373
- let t33;
374
- if ($[92] !== setNodeRef || $[93] !== style || $[94] !== t10 || $[95] !== t11 || $[96] !== t30 || $[97] !== t31 || $[98] !== t32) {
375
- t33 = /* @__PURE__ */ jsxs("div", {
377
+ $[91] = block.children;
378
+ $[92] = block.id;
379
+ $[93] = blockLabel;
380
+ $[94] = canHaveChildren;
381
+ $[95] = isExpanded;
382
+ $[96] = t35;
383
+ } else t35 = $[96];
384
+ let t36;
385
+ if ($[97] !== setNodeRef || $[98] !== style || $[99] !== t10 || $[100] !== t11 || $[101] !== t33 || $[102] !== t34 || $[103] !== t35) {
386
+ t36 = /* @__PURE__ */ jsxs("div", {
376
387
  ref: setNodeRef,
377
388
  style,
378
389
  className: t10,
379
390
  children: [
380
391
  t11,
381
- t30,
382
- t31,
383
- t32
392
+ t33,
393
+ t34,
394
+ t35
384
395
  ]
385
396
  });
386
- $[92] = setNodeRef;
387
- $[93] = style;
388
- $[94] = t10;
389
- $[95] = t11;
390
- $[96] = t30;
391
- $[97] = t31;
392
- $[98] = t32;
393
- $[99] = t33;
394
- } else t33 = $[99];
395
- return t33;
397
+ $[97] = setNodeRef;
398
+ $[98] = style;
399
+ $[99] = t10;
400
+ $[100] = t11;
401
+ $[101] = t33;
402
+ $[102] = t34;
403
+ $[103] = t35;
404
+ $[104] = t36;
405
+ } else t36 = $[104];
406
+ return t36;
396
407
  }, areBlockItemPropsEqual);
397
408
  function getBlockLabel(block, blockSchema, values) {
398
409
  if (values) {
@@ -19,6 +19,18 @@ function findBlockById(tree, id) {
19
19
  return null;
20
20
  }
21
21
  /**
22
+ * Find the path of block IDs from root to the target block.
23
+ */
24
+ function getBlockPathIds(tree, id) {
25
+ for (const node of tree) {
26
+ const nextPath = [node.id];
27
+ if (node.id === id) return nextPath;
28
+ const childPath = getBlockPathIds(node.children, id);
29
+ if (childPath) return [...nextPath, ...childPath];
30
+ }
31
+ return null;
32
+ }
33
+ /**
22
34
  * Find a block's position (parent and index) in the tree.
23
35
  */
24
36
  function findBlockPosition(tree, id, parentId = null) {
@@ -182,4 +194,4 @@ function getDefaultValues(fields) {
182
194
  }
183
195
 
184
196
  //#endregion
185
- export { countBlocks, duplicateBlockInTree, findBlockById, findBlockPosition, getAllBlockIds, getDefaultValues, insertBlockInTree, removeBlockFromTree, reorderBlockInTree };
197
+ export { countBlocks, duplicateBlockInTree, findBlockById, findBlockPosition, getAllBlockIds, getBlockPathIds, getDefaultValues, insertBlockInTree, removeBlockFromTree, reorderBlockInTree };