@measured/puck 0.21.0-canary.cf074bc6 → 0.21.0-canary.e4131567
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/dist/{chunk-MYJB3LKU.mjs → chunk-KNAV6QTS.mjs} +45 -4
- package/dist/{chunk-OOLYDXKW.mjs → chunk-X7YZ3YE7.mjs} +5 -5
- package/dist/index.css +4 -3
- package/dist/index.js +49 -8
- package/dist/index.mjs +2 -2
- package/dist/no-external.css +4 -3
- package/dist/no-external.js +49 -8
- package/dist/no-external.mjs +2 -2
- package/dist/rsc.js +5 -5
- package/dist/rsc.mjs +1 -1
- package/package.json +2 -2
@@ -24,7 +24,7 @@ import {
|
|
24
24
|
walkAppState,
|
25
25
|
walkField,
|
26
26
|
walkTree
|
27
|
-
} from "./chunk-
|
27
|
+
} from "./chunk-X7YZ3YE7.mjs";
|
28
28
|
|
29
29
|
// ../../node_modules/classnames/index.js
|
30
30
|
var require_classnames = __commonJS({
|
@@ -88,6 +88,42 @@ var require_classnames = __commonJS({
|
|
88
88
|
}
|
89
89
|
});
|
90
90
|
|
91
|
+
// ../../node_modules/fast-deep-equal/index.js
|
92
|
+
var require_fast_deep_equal = __commonJS({
|
93
|
+
"../../node_modules/fast-deep-equal/index.js"(exports, module) {
|
94
|
+
"use strict";
|
95
|
+
init_react_import();
|
96
|
+
module.exports = function equal(a, b) {
|
97
|
+
if (a === b) return true;
|
98
|
+
if (a && b && typeof a == "object" && typeof b == "object") {
|
99
|
+
if (a.constructor !== b.constructor) return false;
|
100
|
+
var length, i, keys;
|
101
|
+
if (Array.isArray(a)) {
|
102
|
+
length = a.length;
|
103
|
+
if (length != b.length) return false;
|
104
|
+
for (i = length; i-- !== 0; )
|
105
|
+
if (!equal(a[i], b[i])) return false;
|
106
|
+
return true;
|
107
|
+
}
|
108
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
109
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
110
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
111
|
+
keys = Object.keys(a);
|
112
|
+
length = keys.length;
|
113
|
+
if (length !== Object.keys(b).length) return false;
|
114
|
+
for (i = length; i-- !== 0; )
|
115
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
116
|
+
for (i = length; i-- !== 0; ) {
|
117
|
+
var key = keys[i];
|
118
|
+
if (!equal(a[key], b[key])) return false;
|
119
|
+
}
|
120
|
+
return true;
|
121
|
+
}
|
122
|
+
return a !== a && b !== b;
|
123
|
+
};
|
124
|
+
}
|
125
|
+
});
|
126
|
+
|
91
127
|
// types/API/Overrides.ts
|
92
128
|
init_react_import();
|
93
129
|
var overrideKeys = [
|
@@ -820,6 +856,10 @@ var monitorHotkeys = (doc) => {
|
|
820
856
|
useHotkeyStore.getState().reset();
|
821
857
|
}
|
822
858
|
};
|
859
|
+
const onBlur = () => {
|
860
|
+
useHotkeyStore.getState().reset();
|
861
|
+
};
|
862
|
+
window.addEventListener("blur", onBlur);
|
823
863
|
doc.addEventListener("keydown", onKeyDown);
|
824
864
|
doc.addEventListener("keyup", onKeyUp);
|
825
865
|
doc.addEventListener("visibilitychange", onVisibilityChanged);
|
@@ -827,6 +867,7 @@ var monitorHotkeys = (doc) => {
|
|
827
867
|
doc.removeEventListener("keydown", onKeyDown);
|
828
868
|
doc.removeEventListener("keyup", onKeyUp);
|
829
869
|
doc.removeEventListener("visibilitychange", onVisibilityChanged);
|
870
|
+
window.removeEventListener("blur", onBlur);
|
830
871
|
};
|
831
872
|
};
|
832
873
|
var useMonitorHotkeys = () => {
|
@@ -5665,7 +5706,7 @@ var registerOverlayPortal = (el, opts = {}) => {
|
|
5665
5706
|
|
5666
5707
|
// css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css#css-module
|
5667
5708
|
init_react_import();
|
5668
|
-
var styles_module_default13 = { "InlineTextField": "
|
5709
|
+
var styles_module_default13 = { "InlineTextField": "_InlineTextField_104qp_1" };
|
5669
5710
|
|
5670
5711
|
// lib/data/set-deep.ts
|
5671
5712
|
init_react_import();
|
@@ -8047,7 +8088,7 @@ var useDeleteHotkeys = () => {
|
|
8047
8088
|
};
|
8048
8089
|
|
8049
8090
|
// components/Puck/index.tsx
|
8050
|
-
|
8091
|
+
var import_fast_deep_equal = __toESM(require_fast_deep_equal());
|
8051
8092
|
|
8052
8093
|
// components/Puck/components/Header/index.tsx
|
8053
8094
|
init_react_import();
|
@@ -8653,7 +8694,7 @@ function PuckProvider({ children }) {
|
|
8653
8694
|
(s) => s.state.data,
|
8654
8695
|
(data) => {
|
8655
8696
|
if (onChange) {
|
8656
|
-
if (
|
8697
|
+
if ((0, import_fast_deep_equal.default)(data, previousData.current)) return;
|
8657
8698
|
onChange(data);
|
8658
8699
|
previousData.current = data;
|
8659
8700
|
}
|
@@ -681,19 +681,19 @@ init_react_import();
|
|
681
681
|
|
682
682
|
// lib/get-changed.ts
|
683
683
|
init_react_import();
|
684
|
-
import
|
684
|
+
import { deepEqual } from "fast-equals";
|
685
685
|
var getChanged = (newItem, oldItem) => {
|
686
686
|
return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
|
687
687
|
const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
|
688
688
|
const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
|
689
689
|
return __spreadProps(__spreadValues({}, acc), {
|
690
|
-
[item]: !
|
690
|
+
[item]: !deepEqual(oldItemProps[item], newItemProps[item])
|
691
691
|
});
|
692
692
|
}, {}) : {};
|
693
693
|
};
|
694
694
|
|
695
695
|
// lib/resolve-component-data.ts
|
696
|
-
import
|
696
|
+
import { deepEqual as deepEqual2 } from "fast-equals";
|
697
697
|
var cache = { lastChange: {} };
|
698
698
|
var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
699
699
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
@@ -702,7 +702,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
702
702
|
const id = "id" in item.props ? item.props.id : "root";
|
703
703
|
if (shouldRunResolver) {
|
704
704
|
const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
|
705
|
-
if (trigger !== "force" && item &&
|
705
|
+
if (trigger !== "force" && item && deepEqual2(item, oldItem)) {
|
706
706
|
return { node: resolved, didChange: false };
|
707
707
|
}
|
708
708
|
const changed = getChanged(item, oldItem);
|
@@ -752,7 +752,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
752
752
|
};
|
753
753
|
return {
|
754
754
|
node: itemWithResolvedChildren,
|
755
|
-
didChange: !
|
755
|
+
didChange: !deepEqual2(item, itemWithResolvedChildren)
|
756
756
|
};
|
757
757
|
});
|
758
758
|
|
package/dist/index.css
CHANGED
@@ -1331,16 +1331,17 @@ body:has(._DropZone--isAnimating_1i2sv_68:empty) [data-puck-overlay] {
|
|
1331
1331
|
}
|
1332
1332
|
|
1333
1333
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css/#css-module-data */
|
1334
|
-
.
|
1334
|
+
._InlineTextField_104qp_1 {
|
1335
1335
|
cursor: text;
|
1336
1336
|
display: inline-block;
|
1337
1337
|
white-space: pre-wrap;
|
1338
|
+
text-decoration: inherit;
|
1338
1339
|
}
|
1339
|
-
[data-dnd-dragging] .
|
1340
|
+
[data-dnd-dragging] ._InlineTextField_104qp_1 {
|
1340
1341
|
cursor: none;
|
1341
1342
|
caret-color: transparent;
|
1342
1343
|
}
|
1343
|
-
[data-dnd-dragging] .
|
1344
|
+
[data-dnd-dragging] ._InlineTextField_104qp_1::selection {
|
1344
1345
|
display: none;
|
1345
1346
|
}
|
1346
1347
|
|
package/dist/index.js
CHANGED
@@ -153,6 +153,42 @@ var require_classnames = __commonJS({
|
|
153
153
|
}
|
154
154
|
});
|
155
155
|
|
156
|
+
// ../../node_modules/fast-deep-equal/index.js
|
157
|
+
var require_fast_deep_equal = __commonJS({
|
158
|
+
"../../node_modules/fast-deep-equal/index.js"(exports2, module2) {
|
159
|
+
"use strict";
|
160
|
+
init_react_import();
|
161
|
+
module2.exports = function equal(a, b) {
|
162
|
+
if (a === b) return true;
|
163
|
+
if (a && b && typeof a == "object" && typeof b == "object") {
|
164
|
+
if (a.constructor !== b.constructor) return false;
|
165
|
+
var length, i, keys;
|
166
|
+
if (Array.isArray(a)) {
|
167
|
+
length = a.length;
|
168
|
+
if (length != b.length) return false;
|
169
|
+
for (i = length; i-- !== 0; )
|
170
|
+
if (!equal(a[i], b[i])) return false;
|
171
|
+
return true;
|
172
|
+
}
|
173
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
174
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
175
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
176
|
+
keys = Object.keys(a);
|
177
|
+
length = keys.length;
|
178
|
+
if (length !== Object.keys(b).length) return false;
|
179
|
+
for (i = length; i-- !== 0; )
|
180
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
181
|
+
for (i = length; i-- !== 0; ) {
|
182
|
+
var key = keys[i];
|
183
|
+
if (!equal(a[key], b[key])) return false;
|
184
|
+
}
|
185
|
+
return true;
|
186
|
+
}
|
187
|
+
return a !== a && b !== b;
|
188
|
+
};
|
189
|
+
}
|
190
|
+
});
|
191
|
+
|
156
192
|
// bundle/index.ts
|
157
193
|
var bundle_exports = {};
|
158
194
|
__export(bundle_exports, {
|
@@ -1713,6 +1749,10 @@ var monitorHotkeys = (doc) => {
|
|
1713
1749
|
useHotkeyStore.getState().reset();
|
1714
1750
|
}
|
1715
1751
|
};
|
1752
|
+
const onBlur = () => {
|
1753
|
+
useHotkeyStore.getState().reset();
|
1754
|
+
};
|
1755
|
+
window.addEventListener("blur", onBlur);
|
1716
1756
|
doc.addEventListener("keydown", onKeyDown);
|
1717
1757
|
doc.addEventListener("keyup", onKeyUp);
|
1718
1758
|
doc.addEventListener("visibilitychange", onVisibilityChanged);
|
@@ -1720,6 +1760,7 @@ var monitorHotkeys = (doc) => {
|
|
1720
1760
|
doc.removeEventListener("keydown", onKeyDown);
|
1721
1761
|
doc.removeEventListener("keyup", onKeyUp);
|
1722
1762
|
doc.removeEventListener("visibilitychange", onVisibilityChanged);
|
1763
|
+
window.removeEventListener("blur", onBlur);
|
1723
1764
|
};
|
1724
1765
|
};
|
1725
1766
|
var useMonitorHotkeys = () => {
|
@@ -1922,13 +1963,13 @@ var flattenData = (state, config) => {
|
|
1922
1963
|
|
1923
1964
|
// lib/get-changed.ts
|
1924
1965
|
init_react_import();
|
1925
|
-
var
|
1966
|
+
var import_fast_equals = require("fast-equals");
|
1926
1967
|
var getChanged = (newItem, oldItem) => {
|
1927
1968
|
return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
|
1928
1969
|
const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
|
1929
1970
|
const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
|
1930
1971
|
return __spreadProps(__spreadValues({}, acc), {
|
1931
|
-
[item]: !(0,
|
1972
|
+
[item]: !(0, import_fast_equals.deepEqual)(oldItemProps[item], newItemProps[item])
|
1932
1973
|
});
|
1933
1974
|
}, {}) : {};
|
1934
1975
|
};
|
@@ -2149,7 +2190,7 @@ var useRegisterFieldsSlice = (appStore, id) => {
|
|
2149
2190
|
|
2150
2191
|
// lib/resolve-component-data.ts
|
2151
2192
|
init_react_import();
|
2152
|
-
var
|
2193
|
+
var import_fast_equals2 = require("fast-equals");
|
2153
2194
|
var cache = { lastChange: {} };
|
2154
2195
|
var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
2155
2196
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
@@ -2158,7 +2199,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
2158
2199
|
const id = "id" in item.props ? item.props.id : "root";
|
2159
2200
|
if (shouldRunResolver) {
|
2160
2201
|
const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
|
2161
|
-
if (trigger !== "force" && item && (0,
|
2202
|
+
if (trigger !== "force" && item && (0, import_fast_equals2.deepEqual)(item, oldItem)) {
|
2162
2203
|
return { node: resolved, didChange: false };
|
2163
2204
|
}
|
2164
2205
|
const changed = getChanged(item, oldItem);
|
@@ -2208,7 +2249,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
2208
2249
|
};
|
2209
2250
|
return {
|
2210
2251
|
node: itemWithResolvedChildren,
|
2211
|
-
didChange: !(0,
|
2252
|
+
didChange: !(0, import_fast_equals2.deepEqual)(item, itemWithResolvedChildren)
|
2212
2253
|
};
|
2213
2254
|
});
|
2214
2255
|
|
@@ -5562,7 +5603,7 @@ var registerOverlayPortal = (el, opts = {}) => {
|
|
5562
5603
|
|
5563
5604
|
// css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css#css-module
|
5564
5605
|
init_react_import();
|
5565
|
-
var styles_module_default13 = { "InlineTextField": "
|
5606
|
+
var styles_module_default13 = { "InlineTextField": "_InlineTextField_104qp_1" };
|
5566
5607
|
|
5567
5608
|
// lib/data/set-deep.ts
|
5568
5609
|
init_react_import();
|
@@ -8739,7 +8780,7 @@ function useGetPuck() {
|
|
8739
8780
|
}
|
8740
8781
|
|
8741
8782
|
// components/Puck/index.tsx
|
8742
|
-
var
|
8783
|
+
var import_fast_deep_equal = __toESM(require_fast_deep_equal());
|
8743
8784
|
|
8744
8785
|
// components/Puck/components/Header/index.tsx
|
8745
8786
|
init_react_import();
|
@@ -9345,7 +9386,7 @@ function PuckProvider({ children }) {
|
|
9345
9386
|
(s) => s.state.data,
|
9346
9387
|
(data) => {
|
9347
9388
|
if (onChange) {
|
9348
|
-
if ((0,
|
9389
|
+
if ((0, import_fast_deep_equal.default)(data, previousData.current)) return;
|
9349
9390
|
onChange(data);
|
9350
9391
|
previousData.current = data;
|
9351
9392
|
}
|
package/dist/index.mjs
CHANGED
@@ -18,14 +18,14 @@ import {
|
|
18
18
|
setDeep,
|
19
19
|
useGetPuck,
|
20
20
|
usePuck
|
21
|
-
} from "./chunk-
|
21
|
+
} from "./chunk-KNAV6QTS.mjs";
|
22
22
|
import {
|
23
23
|
init_react_import,
|
24
24
|
migrate,
|
25
25
|
resolveAllData,
|
26
26
|
transformProps,
|
27
27
|
walkTree
|
28
|
-
} from "./chunk-
|
28
|
+
} from "./chunk-X7YZ3YE7.mjs";
|
29
29
|
|
30
30
|
// bundle/index.ts
|
31
31
|
init_react_import();
|
package/dist/no-external.css
CHANGED
@@ -1329,16 +1329,17 @@ body:has(._DropZone--isAnimating_1i2sv_68:empty) [data-puck-overlay] {
|
|
1329
1329
|
}
|
1330
1330
|
|
1331
1331
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css/#css-module-data */
|
1332
|
-
.
|
1332
|
+
._InlineTextField_104qp_1 {
|
1333
1333
|
cursor: text;
|
1334
1334
|
display: inline-block;
|
1335
1335
|
white-space: pre-wrap;
|
1336
|
+
text-decoration: inherit;
|
1336
1337
|
}
|
1337
|
-
[data-dnd-dragging] .
|
1338
|
+
[data-dnd-dragging] ._InlineTextField_104qp_1 {
|
1338
1339
|
cursor: none;
|
1339
1340
|
caret-color: transparent;
|
1340
1341
|
}
|
1341
|
-
[data-dnd-dragging] .
|
1342
|
+
[data-dnd-dragging] ._InlineTextField_104qp_1::selection {
|
1342
1343
|
display: none;
|
1343
1344
|
}
|
1344
1345
|
|
package/dist/no-external.js
CHANGED
@@ -153,6 +153,42 @@ var require_classnames = __commonJS({
|
|
153
153
|
}
|
154
154
|
});
|
155
155
|
|
156
|
+
// ../../node_modules/fast-deep-equal/index.js
|
157
|
+
var require_fast_deep_equal = __commonJS({
|
158
|
+
"../../node_modules/fast-deep-equal/index.js"(exports2, module2) {
|
159
|
+
"use strict";
|
160
|
+
init_react_import();
|
161
|
+
module2.exports = function equal(a, b) {
|
162
|
+
if (a === b) return true;
|
163
|
+
if (a && b && typeof a == "object" && typeof b == "object") {
|
164
|
+
if (a.constructor !== b.constructor) return false;
|
165
|
+
var length, i, keys;
|
166
|
+
if (Array.isArray(a)) {
|
167
|
+
length = a.length;
|
168
|
+
if (length != b.length) return false;
|
169
|
+
for (i = length; i-- !== 0; )
|
170
|
+
if (!equal(a[i], b[i])) return false;
|
171
|
+
return true;
|
172
|
+
}
|
173
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
174
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
175
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
176
|
+
keys = Object.keys(a);
|
177
|
+
length = keys.length;
|
178
|
+
if (length !== Object.keys(b).length) return false;
|
179
|
+
for (i = length; i-- !== 0; )
|
180
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
181
|
+
for (i = length; i-- !== 0; ) {
|
182
|
+
var key = keys[i];
|
183
|
+
if (!equal(a[key], b[key])) return false;
|
184
|
+
}
|
185
|
+
return true;
|
186
|
+
}
|
187
|
+
return a !== a && b !== b;
|
188
|
+
};
|
189
|
+
}
|
190
|
+
});
|
191
|
+
|
156
192
|
// bundle/no-external.ts
|
157
193
|
var no_external_exports = {};
|
158
194
|
__export(no_external_exports, {
|
@@ -1713,6 +1749,10 @@ var monitorHotkeys = (doc) => {
|
|
1713
1749
|
useHotkeyStore.getState().reset();
|
1714
1750
|
}
|
1715
1751
|
};
|
1752
|
+
const onBlur = () => {
|
1753
|
+
useHotkeyStore.getState().reset();
|
1754
|
+
};
|
1755
|
+
window.addEventListener("blur", onBlur);
|
1716
1756
|
doc.addEventListener("keydown", onKeyDown);
|
1717
1757
|
doc.addEventListener("keyup", onKeyUp);
|
1718
1758
|
doc.addEventListener("visibilitychange", onVisibilityChanged);
|
@@ -1720,6 +1760,7 @@ var monitorHotkeys = (doc) => {
|
|
1720
1760
|
doc.removeEventListener("keydown", onKeyDown);
|
1721
1761
|
doc.removeEventListener("keyup", onKeyUp);
|
1722
1762
|
doc.removeEventListener("visibilitychange", onVisibilityChanged);
|
1763
|
+
window.removeEventListener("blur", onBlur);
|
1723
1764
|
};
|
1724
1765
|
};
|
1725
1766
|
var useMonitorHotkeys = () => {
|
@@ -1922,13 +1963,13 @@ var flattenData = (state, config) => {
|
|
1922
1963
|
|
1923
1964
|
// lib/get-changed.ts
|
1924
1965
|
init_react_import();
|
1925
|
-
var
|
1966
|
+
var import_fast_equals = require("fast-equals");
|
1926
1967
|
var getChanged = (newItem, oldItem) => {
|
1927
1968
|
return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
|
1928
1969
|
const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
|
1929
1970
|
const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
|
1930
1971
|
return __spreadProps(__spreadValues({}, acc), {
|
1931
|
-
[item]: !(0,
|
1972
|
+
[item]: !(0, import_fast_equals.deepEqual)(oldItemProps[item], newItemProps[item])
|
1932
1973
|
});
|
1933
1974
|
}, {}) : {};
|
1934
1975
|
};
|
@@ -2149,7 +2190,7 @@ var useRegisterFieldsSlice = (appStore, id) => {
|
|
2149
2190
|
|
2150
2191
|
// lib/resolve-component-data.ts
|
2151
2192
|
init_react_import();
|
2152
|
-
var
|
2193
|
+
var import_fast_equals2 = require("fast-equals");
|
2153
2194
|
var cache = { lastChange: {} };
|
2154
2195
|
var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
2155
2196
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
@@ -2158,7 +2199,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
2158
2199
|
const id = "id" in item.props ? item.props.id : "root";
|
2159
2200
|
if (shouldRunResolver) {
|
2160
2201
|
const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
|
2161
|
-
if (trigger !== "force" && item && (0,
|
2202
|
+
if (trigger !== "force" && item && (0, import_fast_equals2.deepEqual)(item, oldItem)) {
|
2162
2203
|
return { node: resolved, didChange: false };
|
2163
2204
|
}
|
2164
2205
|
const changed = getChanged(item, oldItem);
|
@@ -2208,7 +2249,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
2208
2249
|
};
|
2209
2250
|
return {
|
2210
2251
|
node: itemWithResolvedChildren,
|
2211
|
-
didChange: !(0,
|
2252
|
+
didChange: !(0, import_fast_equals2.deepEqual)(item, itemWithResolvedChildren)
|
2212
2253
|
};
|
2213
2254
|
});
|
2214
2255
|
|
@@ -5562,7 +5603,7 @@ var registerOverlayPortal = (el, opts = {}) => {
|
|
5562
5603
|
|
5563
5604
|
// css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css#css-module
|
5564
5605
|
init_react_import();
|
5565
|
-
var styles_module_default13 = { "InlineTextField": "
|
5606
|
+
var styles_module_default13 = { "InlineTextField": "_InlineTextField_104qp_1" };
|
5566
5607
|
|
5567
5608
|
// lib/data/set-deep.ts
|
5568
5609
|
init_react_import();
|
@@ -8739,7 +8780,7 @@ function useGetPuck() {
|
|
8739
8780
|
}
|
8740
8781
|
|
8741
8782
|
// components/Puck/index.tsx
|
8742
|
-
var
|
8783
|
+
var import_fast_deep_equal = __toESM(require_fast_deep_equal());
|
8743
8784
|
|
8744
8785
|
// components/Puck/components/Header/index.tsx
|
8745
8786
|
init_react_import();
|
@@ -9345,7 +9386,7 @@ function PuckProvider({ children }) {
|
|
9345
9386
|
(s) => s.state.data,
|
9346
9387
|
(data) => {
|
9347
9388
|
if (onChange) {
|
9348
|
-
if ((0,
|
9389
|
+
if ((0, import_fast_deep_equal.default)(data, previousData.current)) return;
|
9349
9390
|
onChange(data);
|
9350
9391
|
previousData.current = data;
|
9351
9392
|
}
|
package/dist/no-external.mjs
CHANGED
@@ -18,14 +18,14 @@ import {
|
|
18
18
|
setDeep,
|
19
19
|
useGetPuck,
|
20
20
|
usePuck
|
21
|
-
} from "./chunk-
|
21
|
+
} from "./chunk-KNAV6QTS.mjs";
|
22
22
|
import {
|
23
23
|
init_react_import,
|
24
24
|
migrate,
|
25
25
|
resolveAllData,
|
26
26
|
transformProps,
|
27
27
|
walkTree
|
28
|
-
} from "./chunk-
|
28
|
+
} from "./chunk-X7YZ3YE7.mjs";
|
29
29
|
|
30
30
|
// bundle/no-external.ts
|
31
31
|
init_react_import();
|
package/dist/rsc.js
CHANGED
@@ -460,19 +460,19 @@ function Render({
|
|
460
460
|
}
|
461
461
|
|
462
462
|
// lib/get-changed.ts
|
463
|
-
var
|
463
|
+
var import_fast_equals = require("fast-equals");
|
464
464
|
var getChanged = (newItem, oldItem) => {
|
465
465
|
return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
|
466
466
|
const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
|
467
467
|
const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
|
468
468
|
return __spreadProps(__spreadValues({}, acc), {
|
469
|
-
[item]: !(0,
|
469
|
+
[item]: !(0, import_fast_equals.deepEqual)(oldItemProps[item], newItemProps[item])
|
470
470
|
});
|
471
471
|
}, {}) : {};
|
472
472
|
};
|
473
473
|
|
474
474
|
// lib/resolve-component-data.ts
|
475
|
-
var
|
475
|
+
var import_fast_equals2 = require("fast-equals");
|
476
476
|
var cache = { lastChange: {} };
|
477
477
|
var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
478
478
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
@@ -481,7 +481,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
481
481
|
const id = "id" in item.props ? item.props.id : "root";
|
482
482
|
if (shouldRunResolver) {
|
483
483
|
const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
|
484
|
-
if (trigger !== "force" && item && (0,
|
484
|
+
if (trigger !== "force" && item && (0, import_fast_equals2.deepEqual)(item, oldItem)) {
|
485
485
|
return { node: resolved, didChange: false };
|
486
486
|
}
|
487
487
|
const changed = getChanged(item, oldItem);
|
@@ -531,7 +531,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
531
531
|
};
|
532
532
|
return {
|
533
533
|
node: itemWithResolvedChildren,
|
534
|
-
didChange: !(0,
|
534
|
+
didChange: !(0, import_fast_equals2.deepEqual)(item, itemWithResolvedChildren)
|
535
535
|
};
|
536
536
|
});
|
537
537
|
|
package/dist/rsc.mjs
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck",
|
3
|
-
"version": "0.21.0-canary.
|
3
|
+
"version": "0.21.0-canary.e4131567",
|
4
4
|
"description": "The open-source visual editor for React",
|
5
5
|
"author": "Chris Villa <chris@puckeditor.com>",
|
6
6
|
"repository": "measuredco/puck",
|
@@ -96,7 +96,7 @@
|
|
96
96
|
"@dnd-kit/helpers": "0.1.18",
|
97
97
|
"@dnd-kit/react": "0.1.18",
|
98
98
|
"deep-diff": "^1.0.2",
|
99
|
-
"fast-
|
99
|
+
"fast-equals": "5.2.2",
|
100
100
|
"flat": "^5.0.2",
|
101
101
|
"object-hash": "^3.0.0",
|
102
102
|
"react-hotkeys-hook": "^4.6.1",
|