@measured/puck 0.17.0-canary.229cbdd → 0.17.0-canary.8ea38c3

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.css CHANGED
@@ -607,10 +607,10 @@ textarea._Input-input_3pq3z_47 {
607
607
  }
608
608
 
609
609
  /* css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css/#css-module-data */
610
- ._ExternalInput-actions_8wgzm_1 {
610
+ ._ExternalInput-actions_wprq3_1 {
611
611
  display: flex;
612
612
  }
613
- ._ExternalInput-button_8wgzm_5 {
613
+ ._ExternalInput-button_wprq3_5 {
614
614
  display: flex;
615
615
  gap: 8px;
616
616
  align-items: center;
@@ -628,16 +628,16 @@ textarea._Input-input_3pq3z_47 {
628
628
  overflow: hidden;
629
629
  flex-grow: 1;
630
630
  }
631
- ._ExternalInput--dataSelected_8wgzm_24 ._ExternalInput-button_8wgzm_5 {
631
+ ._ExternalInput--dataSelected_wprq3_24 ._ExternalInput-button_wprq3_5 {
632
632
  color: var(--puck-color-grey-03);
633
633
  display: block;
634
634
  border-top-right-radius: 0px;
635
635
  border-bottom-right-radius: 0px;
636
636
  }
637
- ._ExternalInput--readOnly_8wgzm_31 ._ExternalInput-button_8wgzm_5 {
637
+ ._ExternalInput--readOnly_wprq3_31 ._ExternalInput-button_wprq3_5 {
638
638
  background-color: var(--puck-color-grey-11);
639
639
  }
640
- ._ExternalInput-detachButton_8wgzm_35 {
640
+ ._ExternalInput-detachButton_wprq3_35 {
641
641
  border: 1px solid var(--puck-color-grey-09);
642
642
  border-top-right-radius: 4px;
643
643
  border-bottom-right-radius: 4px;
@@ -652,28 +652,28 @@ textarea._Input-input_3pq3z_47 {
652
652
  transition: background-color 50ms ease-in, color 50ms ease-in;
653
653
  margin-left: -1px;
654
654
  }
655
- ._ExternalInput-button_8wgzm_5:focus-visible,
656
- ._ExternalInput-detachButton_8wgzm_35:focus-visible {
655
+ ._ExternalInput-button_wprq3_5:focus-visible,
656
+ ._ExternalInput-detachButton_wprq3_35:focus-visible {
657
657
  outline: 2px solid var(--puck-color-azure-05);
658
658
  outline-offset: 2px;
659
659
  z-index: 1;
660
660
  }
661
661
  @media (hover: hover) and (pointer: fine) {
662
- ._ExternalInput_8wgzm_1:not(._ExternalInput--readOnly_8wgzm_31) ._ExternalInput-button_8wgzm_5:hover,
663
- ._ExternalInput_8wgzm_1:not(._ExternalInput--readOnly_8wgzm_31) ._ExternalInput-detachButton_8wgzm_35:hover {
662
+ ._ExternalInput_wprq3_1:not(._ExternalInput--readOnly_wprq3_31) ._ExternalInput-button_wprq3_5:hover,
663
+ ._ExternalInput_wprq3_1:not(._ExternalInput--readOnly_wprq3_31) ._ExternalInput-detachButton_wprq3_35:hover {
664
664
  background: var(--puck-color-azure-12);
665
665
  transition: none;
666
666
  }
667
- ._ExternalInput_8wgzm_1:not(._ExternalInput--readOnly_8wgzm_31) ._ExternalInput-detachButton_8wgzm_35:hover {
667
+ ._ExternalInput_wprq3_1:not(._ExternalInput--readOnly_wprq3_31) ._ExternalInput-detachButton_wprq3_35:hover {
668
668
  color: var(--puck-color-azure-04);
669
669
  }
670
670
  }
671
- ._ExternalInput_8wgzm_1:not(._ExternalInput--readOnly_8wgzm_31) ._ExternalInput-button_8wgzm_5:active,
672
- ._ExternalInput_8wgzm_1:not(._ExternalInput--readOnly_8wgzm_31) ._ExternalInput-detachButton_8wgzm_35:active {
671
+ ._ExternalInput_wprq3_1:not(._ExternalInput--readOnly_wprq3_31) ._ExternalInput-button_wprq3_5:active,
672
+ ._ExternalInput_wprq3_1:not(._ExternalInput--readOnly_wprq3_31) ._ExternalInput-detachButton_wprq3_35:active {
673
673
  background: var(--puck-color-azure-11);
674
674
  transition: none;
675
675
  }
676
- ._ExternalInputModal_8wgzm_79 {
676
+ ._ExternalInputModal_wprq3_79 {
677
677
  color: var(--puck-color-black);
678
678
  display: grid;
679
679
  grid-template-rows: min-content minmax(128px, 100%) min-content;
@@ -682,35 +682,35 @@ textarea._Input-input_3pq3z_47 {
682
682
  min-height: 50dvh;
683
683
  max-height: 90dvh;
684
684
  }
685
- ._ExternalInputModal-grid_8wgzm_89 {
685
+ ._ExternalInputModal-grid_wprq3_89 {
686
686
  display: flex;
687
687
  flex-direction: column;
688
688
  }
689
689
  @media (min-width: 458px) {
690
- ._ExternalInputModal-grid_8wgzm_89 {
690
+ ._ExternalInputModal-grid_wprq3_89 {
691
691
  display: grid;
692
692
  grid-template-columns: 100%;
693
693
  }
694
- ._ExternalInputModal--filtersToggled_8wgzm_100 ._ExternalInputModal-grid_8wgzm_89 {
694
+ ._ExternalInputModal--filtersToggled_wprq3_100 ._ExternalInputModal-grid_wprq3_89 {
695
695
  grid-template-columns: 25% 75%;
696
696
  }
697
697
  }
698
- ._ExternalInputModal-filters_8wgzm_105 {
698
+ ._ExternalInputModal-filters_wprq3_105 {
699
699
  border-bottom: 1px solid var(--puck-color-grey-09);
700
700
  }
701
- ._ExternalInputModal--filtersToggled_8wgzm_100 ._ExternalInputModal-filters_8wgzm_105 {
701
+ ._ExternalInputModal--filtersToggled_wprq3_100 ._ExternalInputModal-filters_wprq3_105 {
702
702
  display: none;
703
703
  }
704
704
  @media (min-width: 458px) {
705
- ._ExternalInputModal-filters_8wgzm_105 {
705
+ ._ExternalInputModal-filters_wprq3_105 {
706
706
  border-right: 1px solid var(--puck-color-grey-09);
707
707
  display: none;
708
708
  }
709
- ._ExternalInputModal--filtersToggled_8wgzm_100 ._ExternalInputModal-filters_8wgzm_105 {
709
+ ._ExternalInputModal--filtersToggled_wprq3_100 ._ExternalInputModal-filters_wprq3_105 {
710
710
  display: block;
711
711
  }
712
712
  }
713
- ._ExternalInputModal-masthead_8wgzm_124 {
713
+ ._ExternalInputModal-masthead_wprq3_124 {
714
714
  background-color: var(--puck-color-grey-12);
715
715
  border-bottom: 1px solid var(--puck-color-grey-09);
716
716
  display: flex;
@@ -718,13 +718,13 @@ textarea._Input-input_3pq3z_47 {
718
718
  gap: 24px;
719
719
  padding: 24px;
720
720
  }
721
- ._ExternalInputModal-tableWrapper_8wgzm_133 {
721
+ ._ExternalInputModal-tableWrapper_wprq3_133 {
722
722
  position: relative;
723
723
  overflow-x: auto;
724
724
  overflow-y: auto;
725
725
  flex-grow: 1;
726
726
  }
727
- ._ExternalInputModal-table_8wgzm_133 {
727
+ ._ExternalInputModal-table_wprq3_133 {
728
728
  border-collapse: unset;
729
729
  border-spacing: 0px;
730
730
  color: var(--puck-color-grey-02);
@@ -732,51 +732,51 @@ textarea._Input-input_3pq3z_47 {
732
732
  z-index: 0;
733
733
  min-width: 100%;
734
734
  }
735
- ._ExternalInputModal-thead_8wgzm_149 {
735
+ ._ExternalInputModal-thead_wprq3_149 {
736
736
  background-color: var(--puck-color-white);
737
737
  position: sticky;
738
738
  top: 0;
739
739
  z-index: 1;
740
740
  }
741
- ._ExternalInputModal-th_8wgzm_149 {
741
+ ._ExternalInputModal-th_wprq3_149 {
742
742
  border-bottom: 1px solid var(--puck-color-grey-09);
743
743
  color: var(--puck-color-grey-04);
744
744
  font-weight: 500;
745
745
  font-size: 14px;
746
746
  padding: 16px 24px;
747
747
  }
748
- ._ExternalInputModal-td_8wgzm_164 {
748
+ ._ExternalInputModal-td_wprq3_164 {
749
749
  border-bottom: 1px solid var(--puck-color-grey-10);
750
750
  padding: 16px 24px;
751
751
  }
752
- ._ExternalInputModal-tr_8wgzm_169 ._ExternalInputModal-td_8wgzm_164:first-of-type {
752
+ ._ExternalInputModal-tr_wprq3_169 ._ExternalInputModal-td_wprq3_164:first-of-type {
753
753
  font-weight: 500;
754
754
  width: 1%;
755
755
  white-space: nowrap;
756
756
  }
757
757
  @media (hover: hover) and (pointer: fine) {
758
- ._ExternalInputModal-tbody_8wgzm_176 ._ExternalInputModal-tr_8wgzm_169:hover {
758
+ ._ExternalInputModal-tbody_wprq3_176 ._ExternalInputModal-tr_wprq3_169:hover {
759
759
  background: var(--puck-color-azure-12);
760
760
  color: var(--puck-color-azure-04);
761
761
  cursor: pointer;
762
762
  position: relative;
763
763
  margin-left: -5px;
764
764
  }
765
- ._ExternalInputModal-tbody_8wgzm_176 ._ExternalInputModal-tr_8wgzm_169:hover ._ExternalInputModal-td_8wgzm_164:first-of-type {
765
+ ._ExternalInputModal-tbody_wprq3_176 ._ExternalInputModal-tr_wprq3_169:hover ._ExternalInputModal-td_wprq3_164:first-of-type {
766
766
  border-left: 4px solid var(--puck-color-azure-04);
767
767
  padding-left: 20px;
768
768
  }
769
769
  }
770
- ._ExternalInputModal-tbody_8wgzm_176 ._ExternalInputModal-tr_8wgzm_169:last-of-type ._ExternalInputModal-td_8wgzm_164 {
770
+ ._ExternalInputModal-tbody_wprq3_176 ._ExternalInputModal-tr_wprq3_169:last-of-type ._ExternalInputModal-td_wprq3_164 {
771
771
  border-bottom: none;
772
772
  }
773
- ._ExternalInputModal-tableWrapper_8wgzm_133 {
773
+ ._ExternalInputModal-tableWrapper_wprq3_133 {
774
774
  display: none;
775
775
  }
776
- ._ExternalInputModal--hasData_8wgzm_202 ._ExternalInputModal-tableWrapper_8wgzm_133 {
776
+ ._ExternalInputModal--hasData_wprq3_202 ._ExternalInputModal-tableWrapper_wprq3_133 {
777
777
  display: block;
778
778
  }
779
- ._ExternalInputModal-loadingBanner_8wgzm_206 {
779
+ ._ExternalInputModal-loadingBanner_wprq3_206 {
780
780
  display: none;
781
781
  background-color: color-mix(in srgb, var(--puck-color-white) 90%, transparent);
782
782
  padding: 64px;
@@ -788,21 +788,21 @@ textarea._Input-input_3pq3z_47 {
788
788
  right: 0;
789
789
  bottom: 0;
790
790
  }
791
- ._ExternalInputModal--isLoading_8wgzm_223 ._ExternalInputModal-loadingBanner_8wgzm_206 {
791
+ ._ExternalInputModal--isLoading_wprq3_223 ._ExternalInputModal-loadingBanner_wprq3_206 {
792
792
  display: flex;
793
793
  }
794
- ._ExternalInputModal-searchForm_8wgzm_227 {
794
+ ._ExternalInputModal-searchForm_wprq3_227 {
795
795
  display: flex;
796
796
  flex-wrap: wrap;
797
797
  gap: 12px;
798
798
  flex-grow: 1;
799
799
  }
800
800
  @media (min-width: 458px) {
801
- ._ExternalInputModal-searchForm_8wgzm_227 {
801
+ ._ExternalInputModal-searchForm_wprq3_227 {
802
802
  flex-wrap: nowrap;
803
803
  }
804
804
  }
805
- ._ExternalInputModal-search_8wgzm_227 {
805
+ ._ExternalInputModal-search_wprq3_227 {
806
806
  display: flex;
807
807
  background: var(--puck-color-white);
808
808
  border-width: 1px;
@@ -812,18 +812,18 @@ textarea._Input-input_3pq3z_47 {
812
812
  flex-grow: 1;
813
813
  transition: border-color 50ms ease-in;
814
814
  }
815
- ._ExternalInputModal-search_8wgzm_227:focus-within {
815
+ ._ExternalInputModal-search_wprq3_227:focus-within {
816
816
  border-color: var(--puck-color-grey-05);
817
817
  outline: 2px solid var(--puck-color-azure-05);
818
818
  transition: none;
819
819
  }
820
820
  @media (hover: hover) and (pointer: fine) {
821
- ._ExternalInputModal-search_8wgzm_227:hover {
821
+ ._ExternalInputModal-search_wprq3_227:hover {
822
822
  border-color: var(--puck-color-grey-05);
823
823
  transition: none;
824
824
  }
825
825
  }
826
- ._ExternalInputModal-searchIcon_8wgzm_264 {
826
+ ._ExternalInputModal-searchIcon_wprq3_264 {
827
827
  align-items: center;
828
828
  background: var(--puck-color-grey-12);
829
829
  border-bottom-left-radius: 4px;
@@ -835,17 +835,17 @@ textarea._Input-input_3pq3z_47 {
835
835
  padding: 12px 15px;
836
836
  transition: color 50ms ease-in;
837
837
  }
838
- ._ExternalInputModal-search_8wgzm_227:focus-within ._ExternalInputModal-searchIcon_8wgzm_264 {
838
+ ._ExternalInputModal-search_wprq3_227:focus-within ._ExternalInputModal-searchIcon_wprq3_264 {
839
839
  color: var(--puck-color-grey-04);
840
840
  transition: none;
841
841
  }
842
842
  @media (hover: hover) and (pointer: fine) {
843
- ._ExternalInputModal-search_8wgzm_227:hover ._ExternalInputModal-searchIcon_8wgzm_264 {
843
+ ._ExternalInputModal-search_wprq3_227:hover ._ExternalInputModal-searchIcon_wprq3_264 {
844
844
  color: var(--puck-color-grey-04);
845
845
  transition: none;
846
846
  }
847
847
  }
848
- ._ExternalInputModal-searchIconText_8wgzm_289 {
848
+ ._ExternalInputModal-searchIconText_wprq3_289 {
849
849
  clip: rect(0 0 0 0);
850
850
  clip-path: inset(100%);
851
851
  height: 1px;
@@ -854,7 +854,7 @@ textarea._Input-input_3pq3z_47 {
854
854
  white-space: nowrap;
855
855
  width: 1px;
856
856
  }
857
- ._ExternalInputModal-searchInput_8wgzm_299 {
857
+ ._ExternalInputModal-searchInput_wprq3_299 {
858
858
  border: none;
859
859
  border-radius: 4px;
860
860
  background: var(--puck-color-white);
@@ -863,32 +863,30 @@ textarea._Input-input_3pq3z_47 {
863
863
  padding: 12px 15px;
864
864
  width: 100%;
865
865
  }
866
- ._ExternalInputModal-searchInput_8wgzm_299:focus {
866
+ ._ExternalInputModal-searchInput_wprq3_299:focus {
867
867
  outline: 0;
868
868
  }
869
- ._ExternalInputModal-searchActions_8wgzm_313 {
869
+ ._ExternalInputModal-searchActions_wprq3_313 {
870
870
  display: flex;
871
871
  gap: 8px;
872
872
  height: 44px;
873
873
  width: 100%;
874
874
  }
875
875
  @media (min-width: 458px) {
876
- ._ExternalInputModal-searchActions_8wgzm_313 {
876
+ ._ExternalInputModal-searchActions_wprq3_313 {
877
877
  width: auto;
878
878
  }
879
879
  }
880
- ._ExternalInputModal-searchActionIcon_8wgzm_326 {
880
+ ._ExternalInputModal-searchActionIcon_wprq3_326 {
881
881
  align-self: center;
882
882
  }
883
- ._ExternalInputModal-footerContainer_8wgzm_330 {
883
+ ._ExternalInputModal-footer_wprq3_330 {
884
884
  background-color: var(--puck-color-grey-12);
885
885
  border-top: 1px solid var(--puck-color-grey-09);
886
886
  color: var(--puck-color-grey-04);
887
- padding: 16px;
888
- }
889
- ._ExternalInputModal-footer_8wgzm_330 {
890
887
  font-weight: 500;
891
888
  font-size: 14px;
889
+ padding: 16px;
892
890
  text-align: right;
893
891
  }
894
892
 
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-Bd3DnhYE.mjs';
2
- export { L as Adaptor, J as ArrayField, r as ArrayState, a2 as AsFieldProps, B as BaseData, y as BaseField, t as ComponentConfig, w as ComponentData, x as Content, X as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, W as ExternalField, Q as ExternalFieldWithAdaptor, p as FieldRenderFunctions, Y as Fields, q as ItemWithId, M as MappedItem, N as NumberField, K as ObjectField, n as OverrideKey, s as PuckComponent, Z as PuckContext, G as RadioField, v as RootData, R as RootDataWithProps, u as RootDataWithoutProps, S as SelectField, T as TextField, z as TextareaField, m as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, o as overrideKeys, a4 as resolveAllData } from './resolve-all-data-Bd3DnhYE.mjs';
1
+ import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-CaVk1fIL.mjs';
2
+ export { L as Adaptor, J as ArrayField, r as ArrayState, a2 as AsFieldProps, B as BaseData, y as BaseField, t as ComponentConfig, w as ComponentData, x as Content, X as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, W as ExternalField, Q as ExternalFieldWithAdaptor, p as FieldRenderFunctions, Y as Fields, q as ItemWithId, M as MappedItem, N as NumberField, K as ObjectField, n as OverrideKey, s as PuckComponent, Z as PuckContext, G as RadioField, v as RootData, R as RootDataWithProps, u as RootDataWithoutProps, S as SelectField, T as TextField, z as TextareaField, m as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, o as overrideKeys, a4 as resolveAllData } from './resolve-all-data-CaVk1fIL.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-Bd3DnhYE.js';
2
- export { L as Adaptor, J as ArrayField, r as ArrayState, a2 as AsFieldProps, B as BaseData, y as BaseField, t as ComponentConfig, w as ComponentData, x as Content, X as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, W as ExternalField, Q as ExternalFieldWithAdaptor, p as FieldRenderFunctions, Y as Fields, q as ItemWithId, M as MappedItem, N as NumberField, K as ObjectField, n as OverrideKey, s as PuckComponent, Z as PuckContext, G as RadioField, v as RootData, R as RootDataWithProps, u as RootDataWithoutProps, S as SelectField, T as TextField, z as TextareaField, m as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, o as overrideKeys, a4 as resolveAllData } from './resolve-all-data-Bd3DnhYE.js';
1
+ import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-CaVk1fIL.js';
2
+ export { L as Adaptor, J as ArrayField, r as ArrayState, a2 as AsFieldProps, B as BaseData, y as BaseField, t as ComponentConfig, w as ComponentData, x as Content, X as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, W as ExternalField, Q as ExternalFieldWithAdaptor, p as FieldRenderFunctions, Y as Fields, q as ItemWithId, M as MappedItem, N as NumberField, K as ObjectField, n as OverrideKey, s as PuckComponent, Z as PuckContext, G as RadioField, v as RootData, R as RootDataWithProps, u as RootDataWithoutProps, S as SelectField, T as TextField, z as TextareaField, m as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, o as overrideKeys, a4 as resolveAllData } from './resolve-all-data-CaVk1fIL.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
package/dist/index.js CHANGED
@@ -1485,60 +1485,32 @@ var ArrayField = ({
1485
1485
  children: [
1486
1486
  field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
1487
1487
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: getClassNameItem("rhs"), children: [
1488
- !readOnly && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: getClassNameItem("actions"), children: [
1489
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1490
- IconButton,
1491
- {
1492
- type: "button",
1493
- disabled: !!addDisabled,
1494
- onClick: (e) => {
1495
- e.stopPropagation();
1496
- const existingValue = [
1497
- ...value || []
1498
- ];
1499
- existingValue.splice(
1500
- i,
1501
- 0,
1502
- existingValue[i]
1503
- );
1504
- onChange(
1505
- existingValue,
1506
- mapArrayStateToUi(
1507
- regenerateArrayState(existingValue)
1508
- )
1509
- );
1510
- },
1511
- title: "Duplicate",
1512
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Copy, { size: 16 })
1513
- }
1514
- ) }),
1515
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1516
- IconButton,
1517
- {
1518
- type: "button",
1519
- disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
1520
- onClick: (e) => {
1521
- e.stopPropagation();
1522
- const existingValue = [
1523
- ...value || []
1524
- ];
1525
- const existingItems = [
1526
- ...arrayState.items || []
1527
- ];
1528
- existingValue.splice(i, 1);
1529
- existingItems.splice(i, 1);
1530
- onChange(
1531
- existingValue,
1532
- mapArrayStateToUi({
1533
- items: existingItems
1534
- })
1535
- );
1536
- },
1537
- title: "Delete",
1538
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Trash, { size: 16 })
1539
- }
1540
- ) })
1541
- ] }),
1488
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("actions"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1489
+ IconButton,
1490
+ {
1491
+ type: "button",
1492
+ disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
1493
+ onClick: (e) => {
1494
+ e.stopPropagation();
1495
+ const existingValue = [
1496
+ ...value || []
1497
+ ];
1498
+ const existingItems = [
1499
+ ...arrayState.items || []
1500
+ ];
1501
+ existingValue.splice(i, 1);
1502
+ existingItems.splice(i, 1);
1503
+ onChange(
1504
+ existingValue,
1505
+ mapArrayStateToUi({
1506
+ items: existingItems
1507
+ })
1508
+ );
1509
+ },
1510
+ title: "Delete",
1511
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Trash, { size: 16 })
1512
+ }
1513
+ ) }) }),
1542
1514
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DragIcon, {}) })
1543
1515
  ] })
1544
1516
  ]
@@ -1664,7 +1636,7 @@ var import_react10 = require("react");
1664
1636
 
1665
1637
  // css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css#css-module
1666
1638
  init_react_import();
1667
- var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-actions_8wgzm_1", "ExternalInput-button": "_ExternalInput-button_8wgzm_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_8wgzm_24", "ExternalInput--readOnly": "_ExternalInput--readOnly_8wgzm_31", "ExternalInput-detachButton": "_ExternalInput-detachButton_8wgzm_35", "ExternalInput": "_ExternalInput_8wgzm_1", "ExternalInputModal": "_ExternalInputModal_8wgzm_79", "ExternalInputModal-grid": "_ExternalInputModal-grid_8wgzm_89", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_8wgzm_100", "ExternalInputModal-filters": "_ExternalInputModal-filters_8wgzm_105", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_8wgzm_124", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_8wgzm_133", "ExternalInputModal-table": "_ExternalInputModal-table_8wgzm_133", "ExternalInputModal-thead": "_ExternalInputModal-thead_8wgzm_149", "ExternalInputModal-th": "_ExternalInputModal-th_8wgzm_149", "ExternalInputModal-td": "_ExternalInputModal-td_8wgzm_164", "ExternalInputModal-tr": "_ExternalInputModal-tr_8wgzm_169", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_8wgzm_176", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_8wgzm_202", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_8wgzm_206", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_8wgzm_223", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_8wgzm_227", "ExternalInputModal-search": "_ExternalInputModal-search_8wgzm_227", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_8wgzm_264", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_8wgzm_289", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_8wgzm_299", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_8wgzm_313", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_8wgzm_326", "ExternalInputModal-footerContainer": "_ExternalInputModal-footerContainer_8wgzm_330", "ExternalInputModal-footer": "_ExternalInputModal-footer_8wgzm_330" };
1639
+ var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-actions_wprq3_1", "ExternalInput-button": "_ExternalInput-button_wprq3_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_wprq3_24", "ExternalInput--readOnly": "_ExternalInput--readOnly_wprq3_31", "ExternalInput-detachButton": "_ExternalInput-detachButton_wprq3_35", "ExternalInput": "_ExternalInput_wprq3_1", "ExternalInputModal": "_ExternalInputModal_wprq3_79", "ExternalInputModal-grid": "_ExternalInputModal-grid_wprq3_89", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_wprq3_100", "ExternalInputModal-filters": "_ExternalInputModal-filters_wprq3_105", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_wprq3_124", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_wprq3_133", "ExternalInputModal-table": "_ExternalInputModal-table_wprq3_133", "ExternalInputModal-thead": "_ExternalInputModal-thead_wprq3_149", "ExternalInputModal-th": "_ExternalInputModal-th_wprq3_149", "ExternalInputModal-td": "_ExternalInputModal-td_wprq3_164", "ExternalInputModal-tr": "_ExternalInputModal-tr_wprq3_169", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_wprq3_176", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_wprq3_202", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_wprq3_206", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_wprq3_223", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_wprq3_227", "ExternalInputModal-search": "_ExternalInputModal-search_wprq3_227", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_wprq3_264", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_wprq3_289", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_wprq3_299", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_wprq3_313", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_wprq3_326", "ExternalInputModal-footer": "_ExternalInputModal-footer_wprq3_330" };
1668
1640
 
1669
1641
  // components/Modal/index.tsx
1670
1642
  init_react_import();
@@ -1842,14 +1814,6 @@ var ExternalInput = ({
1842
1814
  }),
1843
1815
  [id, field]
1844
1816
  );
1845
- const Footer = (0, import_react10.useCallback)(
1846
- (props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: getClassNameModal("footer"), children: [
1847
- props.items.length,
1848
- " result",
1849
- props.items.length === 1 ? "" : "s"
1850
- ] }),
1851
- [field.renderFooter]
1852
- );
1853
1817
  (0, import_react10.useEffect)(() => {
1854
1818
  search(searchQuery, filters);
1855
1819
  }, []);
@@ -1989,7 +1953,11 @@ var ExternalInput = ({
1989
1953
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loader, { size: 24 }) })
1990
1954
  ] })
1991
1955
  ] }),
1992
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("footerContainer"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Footer, { items: mappedData }) })
1956
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("footer"), children: [
1957
+ mappedData.length,
1958
+ " result",
1959
+ mappedData.length === 1 ? "" : "s"
1960
+ ] })
1993
1961
  ]
1994
1962
  }
1995
1963
  ) })
package/dist/index.mjs CHANGED
@@ -1298,60 +1298,32 @@ var ArrayField = ({
1298
1298
  children: [
1299
1299
  field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
1300
1300
  /* @__PURE__ */ jsxs4("div", { className: getClassNameItem("rhs"), children: [
1301
- !readOnly && /* @__PURE__ */ jsxs4("div", { className: getClassNameItem("actions"), children: [
1302
- /* @__PURE__ */ jsx9("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ jsx9(
1303
- IconButton,
1304
- {
1305
- type: "button",
1306
- disabled: !!addDisabled,
1307
- onClick: (e) => {
1308
- e.stopPropagation();
1309
- const existingValue = [
1310
- ...value || []
1311
- ];
1312
- existingValue.splice(
1313
- i,
1314
- 0,
1315
- existingValue[i]
1316
- );
1317
- onChange(
1318
- existingValue,
1319
- mapArrayStateToUi(
1320
- regenerateArrayState(existingValue)
1321
- )
1322
- );
1323
- },
1324
- title: "Duplicate",
1325
- children: /* @__PURE__ */ jsx9(Copy, { size: 16 })
1326
- }
1327
- ) }),
1328
- /* @__PURE__ */ jsx9("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ jsx9(
1329
- IconButton,
1330
- {
1331
- type: "button",
1332
- disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
1333
- onClick: (e) => {
1334
- e.stopPropagation();
1335
- const existingValue = [
1336
- ...value || []
1337
- ];
1338
- const existingItems = [
1339
- ...arrayState.items || []
1340
- ];
1341
- existingValue.splice(i, 1);
1342
- existingItems.splice(i, 1);
1343
- onChange(
1344
- existingValue,
1345
- mapArrayStateToUi({
1346
- items: existingItems
1347
- })
1348
- );
1349
- },
1350
- title: "Delete",
1351
- children: /* @__PURE__ */ jsx9(Trash, { size: 16 })
1352
- }
1353
- ) })
1354
- ] }),
1301
+ !readOnly && /* @__PURE__ */ jsx9("div", { className: getClassNameItem("actions"), children: /* @__PURE__ */ jsx9("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ jsx9(
1302
+ IconButton,
1303
+ {
1304
+ type: "button",
1305
+ disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
1306
+ onClick: (e) => {
1307
+ e.stopPropagation();
1308
+ const existingValue = [
1309
+ ...value || []
1310
+ ];
1311
+ const existingItems = [
1312
+ ...arrayState.items || []
1313
+ ];
1314
+ existingValue.splice(i, 1);
1315
+ existingItems.splice(i, 1);
1316
+ onChange(
1317
+ existingValue,
1318
+ mapArrayStateToUi({
1319
+ items: existingItems
1320
+ })
1321
+ );
1322
+ },
1323
+ title: "Delete",
1324
+ children: /* @__PURE__ */ jsx9(Trash, { size: 16 })
1325
+ }
1326
+ ) }) }),
1355
1327
  /* @__PURE__ */ jsx9("div", { children: /* @__PURE__ */ jsx9(DragIcon, {}) })
1356
1328
  ] })
1357
1329
  ]
@@ -1483,7 +1455,7 @@ import {
1483
1455
 
1484
1456
  // css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css#css-module
1485
1457
  init_react_import();
1486
- var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-actions_8wgzm_1", "ExternalInput-button": "_ExternalInput-button_8wgzm_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_8wgzm_24", "ExternalInput--readOnly": "_ExternalInput--readOnly_8wgzm_31", "ExternalInput-detachButton": "_ExternalInput-detachButton_8wgzm_35", "ExternalInput": "_ExternalInput_8wgzm_1", "ExternalInputModal": "_ExternalInputModal_8wgzm_79", "ExternalInputModal-grid": "_ExternalInputModal-grid_8wgzm_89", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_8wgzm_100", "ExternalInputModal-filters": "_ExternalInputModal-filters_8wgzm_105", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_8wgzm_124", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_8wgzm_133", "ExternalInputModal-table": "_ExternalInputModal-table_8wgzm_133", "ExternalInputModal-thead": "_ExternalInputModal-thead_8wgzm_149", "ExternalInputModal-th": "_ExternalInputModal-th_8wgzm_149", "ExternalInputModal-td": "_ExternalInputModal-td_8wgzm_164", "ExternalInputModal-tr": "_ExternalInputModal-tr_8wgzm_169", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_8wgzm_176", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_8wgzm_202", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_8wgzm_206", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_8wgzm_223", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_8wgzm_227", "ExternalInputModal-search": "_ExternalInputModal-search_8wgzm_227", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_8wgzm_264", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_8wgzm_289", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_8wgzm_299", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_8wgzm_313", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_8wgzm_326", "ExternalInputModal-footerContainer": "_ExternalInputModal-footerContainer_8wgzm_330", "ExternalInputModal-footer": "_ExternalInputModal-footer_8wgzm_330" };
1458
+ var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-actions_wprq3_1", "ExternalInput-button": "_ExternalInput-button_wprq3_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_wprq3_24", "ExternalInput--readOnly": "_ExternalInput--readOnly_wprq3_31", "ExternalInput-detachButton": "_ExternalInput-detachButton_wprq3_35", "ExternalInput": "_ExternalInput_wprq3_1", "ExternalInputModal": "_ExternalInputModal_wprq3_79", "ExternalInputModal-grid": "_ExternalInputModal-grid_wprq3_89", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_wprq3_100", "ExternalInputModal-filters": "_ExternalInputModal-filters_wprq3_105", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_wprq3_124", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_wprq3_133", "ExternalInputModal-table": "_ExternalInputModal-table_wprq3_133", "ExternalInputModal-thead": "_ExternalInputModal-thead_wprq3_149", "ExternalInputModal-th": "_ExternalInputModal-th_wprq3_149", "ExternalInputModal-td": "_ExternalInputModal-td_wprq3_164", "ExternalInputModal-tr": "_ExternalInputModal-tr_wprq3_169", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_wprq3_176", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_wprq3_202", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_wprq3_206", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_wprq3_223", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_wprq3_227", "ExternalInputModal-search": "_ExternalInputModal-search_wprq3_227", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_wprq3_264", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_wprq3_289", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_wprq3_299", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_wprq3_313", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_wprq3_326", "ExternalInputModal-footer": "_ExternalInputModal-footer_wprq3_330" };
1487
1459
 
1488
1460
  // components/Modal/index.tsx
1489
1461
  init_react_import();
@@ -1661,14 +1633,6 @@ var ExternalInput = ({
1661
1633
  }),
1662
1634
  [id, field]
1663
1635
  );
1664
- const Footer = useCallback4(
1665
- (props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ jsxs7("span", { className: getClassNameModal("footer"), children: [
1666
- props.items.length,
1667
- " result",
1668
- props.items.length === 1 ? "" : "s"
1669
- ] }),
1670
- [field.renderFooter]
1671
- );
1672
1636
  useEffect7(() => {
1673
1637
  search(searchQuery, filters);
1674
1638
  }, []);
@@ -1808,7 +1772,11 @@ var ExternalInput = ({
1808
1772
  /* @__PURE__ */ jsx14("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ jsx14(Loader, { size: 24 }) })
1809
1773
  ] })
1810
1774
  ] }),
1811
- /* @__PURE__ */ jsx14("div", { className: getClassNameModal("footerContainer"), children: /* @__PURE__ */ jsx14(Footer, { items: mappedData }) })
1775
+ /* @__PURE__ */ jsxs7("div", { className: getClassNameModal("footer"), children: [
1776
+ mappedData.length,
1777
+ " result",
1778
+ mappedData.length === 1 ? "" : "s"
1779
+ ] })
1812
1780
  ]
1813
1781
  }
1814
1782
  ) })
@@ -94,9 +94,6 @@ type ExternalField<Props extends {
94
94
  mapRow?: (value: any) => Record<string, string | number | ReactElement>;
95
95
  getItemSummary?: (item: Props, index?: number) => string;
96
96
  showSearch?: boolean;
97
- renderFooter?: (props: {
98
- items: any[];
99
- }) => ReactElement;
100
97
  initialQuery?: string;
101
98
  filterFields?: Record<string, Field>;
102
99
  initialFilters?: Record<string, any>;
@@ -94,9 +94,6 @@ type ExternalField<Props extends {
94
94
  mapRow?: (value: any) => Record<string, string | number | ReactElement>;
95
95
  getItemSummary?: (item: Props, index?: number) => string;
96
96
  showSearch?: boolean;
97
- renderFooter?: (props: {
98
- items: any[];
99
- }) => ReactElement;
100
97
  initialQuery?: string;
101
98
  filterFields?: Record<string, Field>;
102
99
  initialFilters?: Record<string, any>;
package/dist/rsc.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, D as Data } from './resolve-all-data-Bd3DnhYE.mjs';
3
- export { a4 as resolveAllData } from './resolve-all-data-Bd3DnhYE.mjs';
2
+ import { C as Config, D as Data } from './resolve-all-data-CaVk1fIL.mjs';
3
+ export { a4 as resolveAllData } from './resolve-all-data-CaVk1fIL.mjs';
4
4
  import 'react';
5
5
 
6
6
  declare function Render<UserConfig extends Config = Config>({ config, data, }: {
package/dist/rsc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, D as Data } from './resolve-all-data-Bd3DnhYE.js';
3
- export { a4 as resolveAllData } from './resolve-all-data-Bd3DnhYE.js';
2
+ import { C as Config, D as Data } from './resolve-all-data-CaVk1fIL.js';
3
+ export { a4 as resolveAllData } from './resolve-all-data-CaVk1fIL.js';
4
4
  import 'react';
5
5
 
6
6
  declare function Render<UserConfig extends Config = Config>({ config, data, }: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.17.0-canary.229cbdd",
3
+ "version": "0.17.0-canary.8ea38c3",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",