@puckeditor/core 0.23.0-canary.9bf3e00a → 0.23.0-canary.e7fef140

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 (43) hide show
  1. package/dist/{Editor-ZZW3KF2T.css → Editor-T7TKW6NT.css} +7 -7
  2. package/dist/{Editor-BJP5AFD5.mjs → Editor-Z6P5UAVB.mjs} +8 -8
  3. package/dist/{actions-Csn3gOP8.d.mts → actions-3w-1VzY_.d.mts} +7 -1
  4. package/dist/{actions-Csn3gOP8.d.ts → actions-3w-1VzY_.d.ts} +7 -1
  5. package/dist/{chunk-WQV7W7OC.mjs → chunk-3OLRWMRO.mjs} +7 -7
  6. package/dist/{chunk-JNJJ2M57.mjs → chunk-3TERNOIP.mjs} +1 -1
  7. package/dist/{chunk-JHNG6XYK.mjs → chunk-DIYX54ZO.mjs} +19 -5
  8. package/dist/{chunk-HB4CVO3I.mjs → chunk-L73ATZ55.mjs} +1 -1
  9. package/dist/{chunk-WUO7D6OQ.mjs → chunk-NPAYGEG5.mjs} +1 -0
  10. package/dist/{chunk-MU6IPW26.mjs → chunk-OCFR2FFG.mjs} +1 -1
  11. package/dist/{chunk-EYJW64M2.mjs → chunk-OSPG5CWL.mjs} +1 -1
  12. package/dist/{chunk-BMRBP3ET.mjs → chunk-PJYHZPJK.mjs} +3 -3
  13. package/dist/{chunk-Q6WCB6GM.mjs → chunk-S3CSGIQ3.mjs} +1844 -714
  14. package/dist/{chunk-25QAPMLH.mjs → chunk-UAWUZ45G.mjs} +41 -18
  15. package/dist/{full-7ONH7UPJ.mjs → full-67VCA5MX.mjs} +7 -7
  16. package/dist/{full-S3QQ2IBQ.css → full-AAZK6KLI.css} +7 -7
  17. package/dist/{index-De5Tn61v.d.mts → index-KWLAZybR.d.ts} +8 -3
  18. package/dist/{index-t7c1w81O.d.ts → index-l1l-a8tj.d.mts} +8 -3
  19. package/dist/index.css +308 -111
  20. package/dist/index.d.mts +6 -8
  21. package/dist/index.d.ts +6 -8
  22. package/dist/index.js +1948 -732
  23. package/dist/index.mjs +10 -10
  24. package/dist/internal.d.mts +2 -2
  25. package/dist/internal.d.ts +2 -2
  26. package/dist/internal.js +40 -18
  27. package/dist/internal.mjs +1 -1
  28. package/dist/{loaded-PF5Y4VWH.mjs → loaded-4XVG2RKQ.mjs} +4 -4
  29. package/dist/{loaded-FVWRAJR3.css → loaded-CA3Q7UHH.css} +7 -7
  30. package/dist/{loaded-35D7XAOE.mjs → loaded-LM723CWI.mjs} +4 -4
  31. package/dist/{loaded-6YDNF4HS.mjs → loaded-VBJBTUSI.mjs} +4 -4
  32. package/dist/no-external.css +308 -111
  33. package/dist/no-external.d.mts +3 -3
  34. package/dist/no-external.d.ts +3 -3
  35. package/dist/no-external.js +1948 -732
  36. package/dist/no-external.mjs +10 -10
  37. package/dist/rsc.d.mts +2 -2
  38. package/dist/rsc.d.ts +2 -2
  39. package/dist/rsc.js +1 -0
  40. package/dist/rsc.mjs +2 -2
  41. package/dist/{walk-tree-CWrsBHHe.d.ts → walk-tree-ConR82Y6.d.ts} +1 -1
  42. package/dist/{walk-tree-BrW9VQ_t.d.mts → walk-tree-DJMo6GTF.d.mts} +1 -1
  43. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import {
2
+ rootAreaId,
2
3
  rootDroppableId,
3
4
  setupZone,
4
5
  walkAppState,
@@ -378,16 +379,13 @@ var reorderAction = (state, action, appStore) => {
378
379
  init_react_import();
379
380
  var removeAction = (state, action, appStore) => {
380
381
  const item = getItem({ index: action.index, zone: action.zone }, state);
381
- const nodesToDelete = Object.entries(state.indexes.nodes).reduce(
382
- (acc, [nodeId, nodeData]) => {
383
- const pathIds = nodeData.path.map((p) => p.split(":")[0]);
384
- if (pathIds.includes(item.props.id)) {
385
- return [...acc, nodeId];
386
- }
387
- return acc;
388
- },
389
- [item.props.id]
390
- );
382
+ const nodesToDelete = /* @__PURE__ */ new Set([item.props.id]);
383
+ Object.entries(state.indexes.nodes).forEach(([nodeId, nodeData]) => {
384
+ const pathIds = nodeData.path.map((p) => p.split(":")[0]);
385
+ if (pathIds.includes(item.props.id)) {
386
+ nodesToDelete.add(nodeId);
387
+ }
388
+ });
391
389
  const newState = walkAppState(
392
390
  state,
393
391
  appStore.config,
@@ -400,19 +398,22 @@ var removeAction = (state, action, appStore) => {
400
398
  );
401
399
  Object.keys(newState.data.zones || {}).forEach((zoneCompound) => {
402
400
  const parentId = zoneCompound.split(":")[0];
403
- if (nodesToDelete.includes(parentId) && newState.data.zones) {
401
+ if (nodesToDelete.has(parentId) && newState.data.zones) {
404
402
  delete newState.data.zones[zoneCompound];
405
403
  }
406
404
  });
407
405
  Object.keys(newState.indexes.zones).forEach((zoneCompound) => {
408
406
  const parentId = zoneCompound.split(":")[0];
409
- if (nodesToDelete.includes(parentId)) {
407
+ if (nodesToDelete.has(parentId)) {
410
408
  delete newState.indexes.zones[zoneCompound];
411
409
  }
412
410
  });
411
+ const newItemExpanded = __spreadValues({}, newState.ui.itemExpanded);
413
412
  nodesToDelete.forEach((id) => {
414
413
  delete newState.indexes.nodes[id];
414
+ delete newItemExpanded[id];
415
415
  });
416
+ newState.ui = __spreadProps(__spreadValues({}, newState.ui), { itemExpanded: newItemExpanded });
416
417
  return newState;
417
418
  };
418
419
 
@@ -481,14 +482,36 @@ var setDataAction = (state, action, appStore) => {
481
482
 
482
483
  // reducer/actions/set-ui.ts
483
484
  init_react_import();
484
- var setUiAction = (state, action) => {
485
- if (typeof action.ui === "object") {
486
- return __spreadProps(__spreadValues({}, state), {
487
- ui: __spreadValues(__spreadValues({}, state.ui), action.ui)
488
- });
485
+ var revealSelectedItem = (state, partialUi) => {
486
+ var _a, _b;
487
+ const itemSelector = partialUi.itemSelector;
488
+ if (!itemSelector) {
489
+ return partialUi;
490
+ }
491
+ const item = getItem(itemSelector, state);
492
+ if (!item) {
493
+ return partialUi;
494
+ }
495
+ const path = (_b = (_a = state.indexes.nodes[item.props.id]) == null ? void 0 : _a.path) != null ? _b : [];
496
+ const collapsedAncestorIds = path.map((zoneCompound) => zoneCompound.split(":")[0]).filter(
497
+ (ancestorId) => {
498
+ var _a2, _b2;
499
+ return ancestorId && ancestorId !== rootAreaId && !((_a2 = state.ui.itemExpanded) == null ? void 0 : _a2[ancestorId]) && !((_b2 = partialUi.itemExpanded) == null ? void 0 : _b2[ancestorId]);
500
+ }
501
+ );
502
+ if (collapsedAncestorIds.length === 0) {
503
+ return partialUi;
489
504
  }
505
+ const itemExpanded = __spreadValues(__spreadValues({}, state.ui.itemExpanded), partialUi.itemExpanded);
506
+ collapsedAncestorIds.forEach((ancestorId) => {
507
+ itemExpanded[ancestorId] = true;
508
+ });
509
+ return __spreadProps(__spreadValues({}, partialUi), { itemExpanded });
510
+ };
511
+ var setUiAction = (state, action) => {
512
+ const partialUi = typeof action.ui === "object" ? action.ui : action.ui(state.ui);
490
513
  return __spreadProps(__spreadValues({}, state), {
491
- ui: __spreadValues(__spreadValues({}, state.ui), action.ui(state.ui))
514
+ ui: __spreadValues(__spreadValues({}, state.ui), revealSelectedItem(state, partialUi))
492
515
  });
493
516
  };
494
517
 
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LoadedRichTextMenuInner
3
- } from "./chunk-WQV7W7OC.mjs";
4
- import "./chunk-EYJW64M2.mjs";
5
- import "./chunk-MU6IPW26.mjs";
6
- import "./chunk-HB4CVO3I.mjs";
7
- import "./chunk-JHNG6XYK.mjs";
8
- import "./chunk-25QAPMLH.mjs";
9
- import "./chunk-WUO7D6OQ.mjs";
3
+ } from "./chunk-3OLRWMRO.mjs";
4
+ import "./chunk-OSPG5CWL.mjs";
5
+ import "./chunk-OCFR2FFG.mjs";
6
+ import "./chunk-L73ATZ55.mjs";
7
+ import "./chunk-DIYX54ZO.mjs";
8
+ import "./chunk-UAWUZ45G.mjs";
9
+ import "./chunk-NPAYGEG5.mjs";
10
10
  import "./chunk-Y2EFNT5P.mjs";
11
11
  import "./chunk-QHQD3BMI.mjs";
12
12
  import {
@@ -41,7 +41,7 @@
41
41
  }
42
42
 
43
43
  /* css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css/#css-module-data */
44
- ._IconButton_yuha3_1 {
44
+ ._IconButton_1pxxt_1 {
45
45
  align-items: center;
46
46
  background: var(--puck-iconbutton-color-bg, transparent);
47
47
  border: none;
@@ -53,26 +53,26 @@
53
53
  padding: var(--puck-iconbutton-space, var(--puck-space-1));
54
54
  transition: background-color var(--puck-duration-fast) var(--puck-ease-exit), color var(--puck-duration-fast) var(--puck-ease-exit);
55
55
  }
56
- ._IconButton--active_yuha3_15 {
56
+ ._IconButton--active_1pxxt_15 {
57
57
  color: var( --puck-iconbutton-color-icon-active, var(--puck-color-interactive) );
58
58
  }
59
- ._IconButton_yuha3_1:focus-visible {
59
+ ._IconButton_1pxxt_1:focus-visible {
60
60
  outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);
61
61
  outline-offset: calc(var(--puck-border-width-focus) * -1);
62
62
  }
63
63
  @media (hover: hover) and (pointer: fine) {
64
- ._IconButton_yuha3_1:hover:not(._IconButton--disabled_yuha3_28) {
65
- background: var( --puck-iconbutton-color-bg-hover, var(--puck-color-interactive-neutral-hover) );
64
+ ._IconButton_1pxxt_1:hover:not(._IconButton--disabled_1pxxt_28) {
65
+ background: var( --_puck-iconbutton-color-bg-hover, var( --puck-iconbutton-color-bg-hover, var(--puck-color-interactive-neutral-hover) ) );
66
66
  color: var( --puck-iconbutton-color-icon-hover, var(--puck-color-interactive) );
67
67
  cursor: pointer;
68
68
  transition: none;
69
69
  }
70
70
  }
71
- ._IconButton_yuha3_1:active {
71
+ ._IconButton_1pxxt_1:active {
72
72
  background: var( --puck-iconbutton-color-bg-active, var(--puck-color-interactive-soft) );
73
73
  transition: none;
74
74
  }
75
- ._IconButton--disabled_yuha3_28 {
75
+ ._IconButton--disabled_1pxxt_28 {
76
76
  color: var( --puck-iconbutton-color-icon-disabled, var(--puck-color-text-subtle) );
77
77
  }
78
78
 
@@ -1,4 +1,4 @@
1
- import { P as History, $ as Permissions, i as ComponentData, m as Config, am as UserGenerics, O as Fields, a3 as PuckAction, ad as RootDataWithProps, a8 as ResolveDataTrigger, a0 as Plugin, _ as Overrides, ao as Viewports, Q as IframeConfig, al as UiState, f as ComponentConfig, a as AppState, V as Metadata, N as FieldTransforms, aa as RichtextField } from './actions-Csn3gOP8.mjs';
1
+ import { Q as History, a0 as Permissions, i as ComponentData, m as Config, an as UserGenerics, P as Fields, a4 as PuckAction, ae as RootDataWithProps, a9 as ResolveDataTrigger, a1 as Plugin, $ as Overrides, ap as Viewports, R as IframeConfig, am as UiState, f as ComponentConfig, a as AppState, W as Metadata, x as DndConfig, O as FieldTransforms, ab as RichtextField } from './actions-3w-1VzY_.js';
2
2
  import { Editor } from '@tiptap/react';
3
3
 
4
4
  type HistorySlice<D = any> = {
@@ -80,8 +80,12 @@ declare const defaultDictionary: {
80
80
  readonly "label-page": "Page";
81
81
  readonly "label-component": "Component";
82
82
  readonly "outline-empty": "No items";
83
- readonly "outline-collapse": "Collapse";
84
- readonly "outline-expand": "Expand";
83
+ readonly "outline-item-collapse": "Collapse";
84
+ readonly "outline-item-expand": "Expand";
85
+ readonly "outline-header-title": "Outline";
86
+ readonly "outline-header-collapseall": "Collapse all";
87
+ readonly "outline-item-duplicate": "Duplicate";
88
+ readonly "outline-item-delete": "Delete";
85
89
  readonly "drawer-category-collapse": "Collapse {title}";
86
90
  readonly "drawer-category-expand": "Expand {title}";
87
91
  readonly "drawer-category-other": "Other";
@@ -184,6 +188,7 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
184
188
  onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
185
189
  metadata: Metadata;
186
190
  dictionary: Dictionary;
191
+ dnd?: DndConfig;
187
192
  fields: FieldsSlice;
188
193
  history: HistorySlice;
189
194
  nodes: NodesSlice;
@@ -1,4 +1,4 @@
1
- import { P as History, $ as Permissions, i as ComponentData, m as Config, am as UserGenerics, O as Fields, a3 as PuckAction, ad as RootDataWithProps, a8 as ResolveDataTrigger, a0 as Plugin, _ as Overrides, ao as Viewports, Q as IframeConfig, al as UiState, f as ComponentConfig, a as AppState, V as Metadata, N as FieldTransforms, aa as RichtextField } from './actions-Csn3gOP8.js';
1
+ import { Q as History, a0 as Permissions, i as ComponentData, m as Config, an as UserGenerics, P as Fields, a4 as PuckAction, ae as RootDataWithProps, a9 as ResolveDataTrigger, a1 as Plugin, $ as Overrides, ap as Viewports, R as IframeConfig, am as UiState, f as ComponentConfig, a as AppState, W as Metadata, x as DndConfig, O as FieldTransforms, ab as RichtextField } from './actions-3w-1VzY_.mjs';
2
2
  import { Editor } from '@tiptap/react';
3
3
 
4
4
  type HistorySlice<D = any> = {
@@ -80,8 +80,12 @@ declare const defaultDictionary: {
80
80
  readonly "label-page": "Page";
81
81
  readonly "label-component": "Component";
82
82
  readonly "outline-empty": "No items";
83
- readonly "outline-collapse": "Collapse";
84
- readonly "outline-expand": "Expand";
83
+ readonly "outline-item-collapse": "Collapse";
84
+ readonly "outline-item-expand": "Expand";
85
+ readonly "outline-header-title": "Outline";
86
+ readonly "outline-header-collapseall": "Collapse all";
87
+ readonly "outline-item-duplicate": "Duplicate";
88
+ readonly "outline-item-delete": "Delete";
85
89
  readonly "drawer-category-collapse": "Collapse {title}";
86
90
  readonly "drawer-category-expand": "Expand {title}";
87
91
  readonly "drawer-category-other": "Other";
@@ -184,6 +188,7 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
184
188
  onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
185
189
  metadata: Metadata;
186
190
  dictionary: Dictionary;
191
+ dnd?: DndConfig;
187
192
  fields: FieldsSlice;
188
193
  history: HistorySlice;
189
194
  nodes: NodesSlice;