@measured/puck 0.12.0-canary.2e931bc → 0.12.0-canary.53e3fc5
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 +3 -3
- package/dist/index.js +10 -8
- package/package.json +22 -1
package/README.md
CHANGED
@@ -33,7 +33,7 @@ Render the editor:
|
|
33
33
|
```jsx
|
34
34
|
// Editor.jsx
|
35
35
|
import { Puck } from "@measured/puck";
|
36
|
-
import "@measured/puck/
|
36
|
+
import "@measured/puck/puck.css";
|
37
37
|
|
38
38
|
// Create puck component config
|
39
39
|
const config = {
|
@@ -71,7 +71,7 @@ Render the page:
|
|
71
71
|
```jsx
|
72
72
|
// Page.jsx
|
73
73
|
import { Render } from "@measured/puck";
|
74
|
-
import "@measured/puck/
|
74
|
+
import "@measured/puck/puck.css";
|
75
75
|
|
76
76
|
export function Page() {
|
77
77
|
return <Render config={config} data={data} />;
|
@@ -380,7 +380,7 @@ If you want to use React server components, use ` <Render>` from the `@measured/
|
|
380
380
|
|
381
381
|
```tsx
|
382
382
|
import { Render } from "@measured/puck/rsc";
|
383
|
-
import "@measured/puck/
|
383
|
+
import "@measured/puck/puck.css";
|
384
384
|
|
385
385
|
export function Page() {
|
386
386
|
return <Render config={config} data={data} />;
|
package/dist/index.js
CHANGED
@@ -33102,14 +33102,16 @@ var InputOrGroup = (_a) => {
|
|
33102
33102
|
var _b = _a, { onChange } = _b, props = __objRest(_b, ["onChange"]);
|
33103
33103
|
const { name, field, value, readOnly } = props;
|
33104
33104
|
const [localValue, setLocalValue] = (0, import_react30.useState)(value);
|
33105
|
-
const
|
33106
|
-
|
33107
|
-
|
33108
|
-
|
33109
|
-
|
33110
|
-
|
33105
|
+
const onChangeDb = (0, import_use_debounce2.useDebouncedCallback)(
|
33106
|
+
(val) => {
|
33107
|
+
onChange(val);
|
33108
|
+
},
|
33109
|
+
50,
|
33110
|
+
{ leading: true }
|
33111
|
+
);
|
33111
33112
|
const onChangeLocal = (0, import_react30.useCallback)((val) => {
|
33112
33113
|
setLocalValue(val);
|
33114
|
+
onChangeDb(val);
|
33113
33115
|
}, []);
|
33114
33116
|
(0, import_react30.useEffect)(() => {
|
33115
33117
|
setLocalValue(value);
|
@@ -34300,7 +34302,7 @@ function Puck({
|
|
34300
34302
|
}) {
|
34301
34303
|
var _a, _b;
|
34302
34304
|
const [reducer] = (0, import_react38.useState)(() => createReducer({ config }));
|
34303
|
-
const initialAppState = __spreadProps(__spreadValues({}, defaultAppState), {
|
34305
|
+
const [initialAppState] = (0, import_react38.useState)(__spreadProps(__spreadValues({}, defaultAppState), {
|
34304
34306
|
data: initialData,
|
34305
34307
|
ui: __spreadProps(__spreadValues({}, defaultAppState.ui), {
|
34306
34308
|
// Store categories under componentList on state to allow render functions and plugins to modify
|
@@ -34318,7 +34320,7 @@ function Puck({
|
|
34318
34320
|
{}
|
34319
34321
|
) : {}
|
34320
34322
|
})
|
34321
|
-
});
|
34323
|
+
}));
|
34322
34324
|
const [appState, dispatch] = (0, import_react38.useReducer)(
|
34323
34325
|
reducer,
|
34324
34326
|
flushZones(initialAppState)
|
package/package.json
CHANGED
@@ -1,9 +1,30 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck",
|
3
|
-
"version": "0.12.0-canary.
|
3
|
+
"version": "0.12.0-canary.53e3fc5",
|
4
4
|
"private": false,
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.ts",
|
7
|
+
"exports": {
|
8
|
+
".": {
|
9
|
+
"import": "./dist/index.js",
|
10
|
+
"require": "./dist/index.js",
|
11
|
+
"types": "./dist/index.d.ts"
|
12
|
+
},
|
13
|
+
"./rsc": {
|
14
|
+
"import": "./dist/rsc.js",
|
15
|
+
"require": "./dist/rsc.js",
|
16
|
+
"types": "./dist/rsc.d.ts"
|
17
|
+
},
|
18
|
+
"./puck.css": "./dist/index.css",
|
19
|
+
"./dist/index.css": "./dist/index.css"
|
20
|
+
},
|
21
|
+
"typesVersions": {
|
22
|
+
"*": {
|
23
|
+
"rsc": [
|
24
|
+
"./dist/rsc.js"
|
25
|
+
]
|
26
|
+
}
|
27
|
+
},
|
7
28
|
"license": "MIT",
|
8
29
|
"scripts": {
|
9
30
|
"lint": "eslint \"**/*.ts*\"",
|