@measured/puck 0.13.0-canary.fad52d7 → 0.13.0-canary.fc2cc06
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/README.md +2 -2
- package/dist/{Config-4367c689.d.ts → Config-5804f327.d.ts} +1 -1
- package/dist/index.css +27 -30
- package/dist/index.d.ts +10 -12
- package/dist/index.js +517 -2727
- package/dist/rsc.d.ts +3 -3
- package/dist/rsc.js +1 -4
- package/package.json +2 -2
package/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Puck
|
2
2
|
|
3
|
-
The
|
3
|
+
The visual editor for React.
|
4
4
|
|
5
5
|
<p align="left">
|
6
6
|
<a aria-label="Measured logo" href="https://measured.co">
|
@@ -104,4 +104,4 @@ If you need support integrating Puck or creating a beautiful component library,
|
|
104
104
|
|
105
105
|
## License
|
106
106
|
|
107
|
-
MIT © [Measured
|
107
|
+
MIT © [Measured Corporation Ltd](https://measured.co)
|
@@ -155,7 +155,7 @@ type Config<Props extends {
|
|
155
155
|
[key: string]: any;
|
156
156
|
} = {
|
157
157
|
[key: string]: any;
|
158
|
-
}, RootProps extends DefaultRootProps = DefaultRootProps, CategoryName extends string =
|
158
|
+
}, RootProps extends DefaultRootProps = DefaultRootProps, CategoryName extends string = any> = {
|
159
159
|
categories?: Record<CategoryName, Category<keyof Props>> & {
|
160
160
|
other?: Category<Props>;
|
161
161
|
};
|
package/dist/index.css
CHANGED
@@ -606,7 +606,7 @@
|
|
606
606
|
}
|
607
607
|
|
608
608
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/styles.module.css/#css-module-data */
|
609
|
-
.
|
609
|
+
._Puck_17hk3_19 {
|
610
610
|
--puck-frame-width: auto;
|
611
611
|
--puck-side-bar-width: 186px;
|
612
612
|
--puck-space-px: 16px;
|
@@ -621,51 +621,51 @@
|
|
621
621
|
right: 0;
|
622
622
|
top: 0;
|
623
623
|
}
|
624
|
-
._Puck--
|
624
|
+
._Puck--leftSideBarVisible_17hk3_35 {
|
625
625
|
grid-template-columns: var(--puck-side-bar-width) var(--puck-frame-width) 0;
|
626
626
|
}
|
627
|
-
._Puck--
|
627
|
+
._Puck--rightSideBarVisible_17hk3_41 {
|
628
628
|
grid-template-columns: 0 var(--puck-frame-width) var(--puck-side-bar-width);
|
629
629
|
}
|
630
|
-
._Puck--
|
630
|
+
._Puck--leftSideBarVisible_17hk3_35._Puck--rightSideBarVisible_17hk3_41 {
|
631
631
|
grid-template-columns: var(--puck-side-bar-width) var(--puck-frame-width) var(--puck-side-bar-width);
|
632
632
|
}
|
633
633
|
@media (min-width: 458px) {
|
634
|
-
.
|
634
|
+
._Puck_17hk3_19 {
|
635
635
|
--puck-frame-width: minmax(266px, auto);
|
636
636
|
}
|
637
637
|
}
|
638
638
|
@media (min-width: 638px) {
|
639
|
-
.
|
639
|
+
._Puck_17hk3_19 {
|
640
640
|
--puck-side-bar-width: minmax(186px, 250px);
|
641
641
|
}
|
642
642
|
}
|
643
643
|
@media (min-width: 766px) {
|
644
|
-
.
|
644
|
+
._Puck_17hk3_19 {
|
645
645
|
--puck-frame-width: auto;
|
646
646
|
}
|
647
647
|
}
|
648
648
|
@media (min-width: 990px) {
|
649
|
-
.
|
649
|
+
._Puck_17hk3_19 {
|
650
650
|
--puck-side-bar-width: 256px;
|
651
651
|
}
|
652
652
|
}
|
653
653
|
@media (min-width: 1198px) {
|
654
|
-
.
|
654
|
+
._Puck_17hk3_19 {
|
655
655
|
--puck-side-bar-width: 274px;
|
656
656
|
}
|
657
657
|
}
|
658
658
|
@media (min-width: 1398px) {
|
659
|
-
.
|
659
|
+
._Puck_17hk3_19 {
|
660
660
|
--puck-side-bar-width: 290px;
|
661
661
|
}
|
662
662
|
}
|
663
663
|
@media (min-width: 1598px) {
|
664
|
-
.
|
664
|
+
._Puck_17hk3_19 {
|
665
665
|
--puck-side-bar-width: 320px;
|
666
666
|
}
|
667
667
|
}
|
668
|
-
._Puck-
|
668
|
+
._Puck-header_17hk3_95 {
|
669
669
|
background: var(--puck-color-white);
|
670
670
|
border-bottom: 1px solid var(--puck-color-grey-8);
|
671
671
|
color: var(--puck-color-black);
|
@@ -673,7 +673,7 @@
|
|
673
673
|
position: relative;
|
674
674
|
max-width: 100vw;
|
675
675
|
}
|
676
|
-
._Puck-
|
676
|
+
._Puck-headerInner_17hk3_104 {
|
677
677
|
align-items: end;
|
678
678
|
display: grid;
|
679
679
|
gap: var(--puck-space-px);
|
@@ -682,46 +682,43 @@
|
|
682
682
|
grid-template-rows: auto;
|
683
683
|
padding: var(--puck-space-px);
|
684
684
|
}
|
685
|
-
._Puck-
|
685
|
+
._Puck-headerToggle_17hk3_114 {
|
686
686
|
color: var(--puck-color-grey-4);
|
687
687
|
display: flex;
|
688
688
|
margin-left: -4px;
|
689
689
|
padding-top: 2px;
|
690
690
|
}
|
691
|
-
._Puck-
|
692
|
-
|
693
|
-
}
|
694
|
-
._Puck--rightSideBarVisible_pp63_41 ._Puck-rightSideBarToggle_pp63_121,
|
695
|
-
._Puck--leftSideBarVisible_pp63_35 ._Puck-leftSideBarToggle_pp63_126 {
|
691
|
+
._Puck--rightSideBarVisible_17hk3_41 ._Puck-rightSideBarToggle_17hk3_121,
|
692
|
+
._Puck--leftSideBarVisible_17hk3_35 ._Puck-leftSideBarToggle_17hk3_122 {
|
696
693
|
color: var(--puck-color-black);
|
697
694
|
}
|
698
|
-
._Puck-
|
695
|
+
._Puck-headerTitle_17hk3_126 {
|
699
696
|
align-self: center;
|
700
697
|
}
|
701
|
-
._Puck-
|
698
|
+
._Puck-headerPath_17hk3_130 {
|
702
699
|
font-family: var(--puck-font-family-monospaced);
|
703
700
|
font-size: var(--puck-font-size-xxs);
|
704
701
|
font-weight: normal;
|
705
702
|
word-break: break-all;
|
706
703
|
}
|
707
|
-
._Puck-
|
704
|
+
._Puck-headerTools_17hk3_137 {
|
708
705
|
display: flex;
|
709
706
|
gap: 16px;
|
710
707
|
justify-content: flex-end;
|
711
708
|
}
|
712
|
-
._Puck-
|
709
|
+
._Puck-menuButton_17hk3_143 {
|
713
710
|
color: var(--puck-color-grey-4);
|
714
711
|
margin-left: -4px;
|
715
712
|
}
|
716
|
-
._Puck--
|
713
|
+
._Puck--menuOpen_17hk3_148 ._Puck-menuButton_17hk3_143 {
|
717
714
|
color: var(--puck-color-black);
|
718
715
|
}
|
719
716
|
@media (min-width: 638px) {
|
720
|
-
._Puck-
|
717
|
+
._Puck-menuButton_17hk3_143 {
|
721
718
|
display: none;
|
722
719
|
}
|
723
720
|
}
|
724
|
-
._Puck-
|
721
|
+
._Puck-leftSideBar_17hk3_122 {
|
725
722
|
background: var(--puck-color-grey-11);
|
726
723
|
border-right: 1px solid var(--puck-color-grey-8);
|
727
724
|
display: flex;
|
@@ -729,25 +726,25 @@
|
|
729
726
|
grid-area: left;
|
730
727
|
overflow-y: auto;
|
731
728
|
}
|
732
|
-
._Puck-
|
729
|
+
._Puck-frame_17hk3_167 {
|
733
730
|
display: flex;
|
734
731
|
flex-direction: column;
|
735
732
|
grid-area: editor;
|
736
733
|
overflow: auto;
|
737
734
|
position: relative;
|
738
735
|
}
|
739
|
-
._Puck-
|
736
|
+
._Puck-root_17hk3_175 {
|
740
737
|
border: 1px solid var(--puck-color-grey-8);
|
741
738
|
box-shadow: 0 0 0 calc(var(--puck-space-px) * 1.5) var(--puck-color-grey-10);
|
742
739
|
margin: var(--puck-space-px);
|
743
740
|
min-width: 321px;
|
744
741
|
}
|
745
742
|
@media (min-width: 1198px) {
|
746
|
-
._Puck-
|
743
|
+
._Puck-root_17hk3_175 {
|
747
744
|
margin: calc(var(--puck-space-px) * 1.5);
|
748
745
|
}
|
749
746
|
}
|
750
|
-
._Puck-
|
747
|
+
._Puck-rightSideBar_17hk3_121 {
|
751
748
|
background: var(--puck-color-white);
|
752
749
|
border-left: 1px solid var(--puck-color-grey-8);
|
753
750
|
display: flex;
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
export { g as Adaptor, f as ArrayField, r as ArrayState, n as BaseData, B as BaseField, m as ComponentConfig, o as ComponentData, k as Content, i as CustomField, s as DropZone, h as ExternalField, E as ExternalFieldWithAdaptor, j as Fields, q as ItemWithId, N as NumberField, O as ObjectField, P as PuckComponent, l as PuckContext, e as RadioField, p as RootDataWithoutProps, S as SelectField, T as TextField, d as TextareaField } from './Config-
|
1
|
+
import { C as Config, D as Data, I as ItemSelector, U as UiState, A as AppState, F as Field, a as DefaultComponentProps, b as DefaultRootProps, M as MappedItem, R as RootDataWithProps, c as RootData } from './Config-5804f327.js';
|
2
|
+
export { g as Adaptor, f as ArrayField, r as ArrayState, n as BaseData, B as BaseField, m as ComponentConfig, o as ComponentData, k as Content, i as CustomField, s as DropZone, h as ExternalField, E as ExternalFieldWithAdaptor, j as Fields, q as ItemWithId, N as NumberField, O as ObjectField, P as PuckComponent, l as PuckContext, e as RadioField, p as RootDataWithoutProps, S as SelectField, T as TextField, d as TextareaField } from './Config-5804f327.js';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
import * as react from 'react';
|
5
5
|
import { ReactNode, CSSProperties, ReactElement, SyntheticEvent } from 'react';
|
@@ -9,9 +9,9 @@ type PathData = Record<string, {
|
|
9
9
|
path: string[];
|
10
10
|
label: string;
|
11
11
|
}>;
|
12
|
-
type DropZoneContext = {
|
12
|
+
type DropZoneContext<UserConfig extends Config<any, any, any> = Config<any, any, any>> = {
|
13
13
|
data: Data;
|
14
|
-
config:
|
14
|
+
config: UserConfig;
|
15
15
|
componentState?: Record<string, any>;
|
16
16
|
itemSelector?: ItemSelector | null;
|
17
17
|
setItemSelector?: (newIndex: ItemSelector | null) => void;
|
@@ -35,7 +35,7 @@ type DropZoneContext = {
|
|
35
35
|
mode?: "edit" | "render";
|
36
36
|
disableZoom?: boolean;
|
37
37
|
} | null;
|
38
|
-
declare const dropZoneContext: react.Context<DropZoneContext
|
38
|
+
declare const dropZoneContext: react.Context<DropZoneContext<Config<any, any, any>>>;
|
39
39
|
declare const DropZoneProvider: ({ children, value, }: {
|
40
40
|
children: ReactNode;
|
41
41
|
value: DropZoneContext;
|
@@ -217,9 +217,9 @@ type Plugin = {
|
|
217
217
|
overrides: Partial<Overrides>;
|
218
218
|
};
|
219
219
|
|
220
|
-
declare function Puck({ children, config, data: initialData, ui: initialUi, onChange, onPublish, plugins, overrides, renderHeader, renderHeaderActions, headerTitle, headerPath, }: {
|
220
|
+
declare function Puck<UserConfig extends Config<any, any, any> = Config<any, any, any>>({ children, config, data: initialData, ui: initialUi, onChange, onPublish, plugins, overrides, renderHeader, renderHeaderActions, headerTitle, headerPath, }: {
|
221
221
|
children?: ReactNode;
|
222
|
-
config:
|
222
|
+
config: UserConfig;
|
223
223
|
data: Data;
|
224
224
|
ui?: Partial<UiState>;
|
225
225
|
onChange?: (data: Data) => void;
|
@@ -247,8 +247,8 @@ declare namespace Puck {
|
|
247
247
|
}) => react_jsx_runtime.JSX.Element;
|
248
248
|
}
|
249
249
|
|
250
|
-
declare function Render({ config, data
|
251
|
-
config:
|
250
|
+
declare function Render<UserConfig extends Config<any, any, any> = Config<any, any, any>>({ config, data }: {
|
251
|
+
config: UserConfig;
|
252
252
|
data: Data;
|
253
253
|
}): react_jsx_runtime.JSX.Element;
|
254
254
|
|
@@ -273,9 +273,7 @@ declare const resolveAllData: (data: Data, config: Config<any, any, any>, onReso
|
|
273
273
|
|
274
274
|
declare const usePuck: () => {
|
275
275
|
appState: AppState;
|
276
|
-
config: Config<
|
277
|
-
[key: string]: any;
|
278
|
-
}, DefaultRootProps, string>;
|
276
|
+
config: Config<any, any, any>;
|
279
277
|
dispatch: (action: PuckAction) => void;
|
280
278
|
};
|
281
279
|
|