@measured/puck 0.14.0-canary.92750a2 → 0.14.0-canary.95280e6
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/{Config-ab049d49.d.ts → Config-DXxsEDkF.d.ts} +23 -3
- package/dist/index.css +437 -346
- package/dist/index.d.ts +18 -7
- package/dist/index.js +1548 -685
- package/dist/rsc.d.ts +1 -1
- package/package.json +5 -3
package/dist/index.js
CHANGED
@@ -93,7 +93,8 @@ var init_react_import = __esm({
|
|
93
93
|
|
94
94
|
// ../../node_modules/classnames/index.js
|
95
95
|
var require_classnames = __commonJS({
|
96
|
-
"../../node_modules/classnames/index.js"(
|
96
|
+
"../../node_modules/classnames/index.js"(exports2, module2) {
|
97
|
+
"use strict";
|
97
98
|
init_react_import();
|
98
99
|
(function() {
|
99
100
|
"use strict";
|
@@ -145,7 +146,7 @@ var require_classnames = __commonJS({
|
|
145
146
|
|
146
147
|
// ../../node_modules/scheduler/cjs/scheduler.production.min.js
|
147
148
|
var require_scheduler_production_min = __commonJS({
|
148
|
-
"../../node_modules/scheduler/cjs/scheduler.production.min.js"(
|
149
|
+
"../../node_modules/scheduler/cjs/scheduler.production.min.js"(exports2) {
|
149
150
|
"use strict";
|
150
151
|
init_react_import();
|
151
152
|
function f(a, b) {
|
@@ -188,12 +189,12 @@ var require_scheduler_production_min = __commonJS({
|
|
188
189
|
}
|
189
190
|
if ("object" === typeof performance && "function" === typeof performance.now) {
|
190
191
|
l = performance;
|
191
|
-
|
192
|
+
exports2.unstable_now = function() {
|
192
193
|
return l.now();
|
193
194
|
};
|
194
195
|
} else {
|
195
196
|
p = Date, q = p.now();
|
196
|
-
|
197
|
+
exports2.unstable_now = function() {
|
197
198
|
return p.now() - q;
|
198
199
|
};
|
199
200
|
}
|
@@ -247,7 +248,7 @@ var require_scheduler_production_min = __commonJS({
|
|
247
248
|
v.callback = null;
|
248
249
|
y = v.priorityLevel;
|
249
250
|
var e = d(v.expirationTime <= b);
|
250
|
-
b =
|
251
|
+
b = exports2.unstable_now();
|
251
252
|
"function" === typeof e ? v.callback = e : v === h(r) && k(r);
|
252
253
|
G(b);
|
253
254
|
} else
|
@@ -272,11 +273,11 @@ var require_scheduler_production_min = __commonJS({
|
|
272
273
|
var P = 5;
|
273
274
|
var Q = -1;
|
274
275
|
function M() {
|
275
|
-
return
|
276
|
+
return exports2.unstable_now() - Q < P ? false : true;
|
276
277
|
}
|
277
278
|
function R() {
|
278
279
|
if (null !== O) {
|
279
|
-
var a =
|
280
|
+
var a = exports2.unstable_now();
|
280
281
|
Q = a;
|
281
282
|
var b = true;
|
282
283
|
try {
|
@@ -310,31 +311,31 @@ var require_scheduler_production_min = __commonJS({
|
|
310
311
|
}
|
311
312
|
function K(a, b) {
|
312
313
|
L = D(function() {
|
313
|
-
a(
|
314
|
+
a(exports2.unstable_now());
|
314
315
|
}, b);
|
315
316
|
}
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
317
|
+
exports2.unstable_IdlePriority = 5;
|
318
|
+
exports2.unstable_ImmediatePriority = 1;
|
319
|
+
exports2.unstable_LowPriority = 4;
|
320
|
+
exports2.unstable_NormalPriority = 3;
|
321
|
+
exports2.unstable_Profiling = null;
|
322
|
+
exports2.unstable_UserBlockingPriority = 2;
|
323
|
+
exports2.unstable_cancelCallback = function(a) {
|
323
324
|
a.callback = null;
|
324
325
|
};
|
325
|
-
|
326
|
+
exports2.unstable_continueExecution = function() {
|
326
327
|
A || z || (A = true, I(J));
|
327
328
|
};
|
328
|
-
|
329
|
+
exports2.unstable_forceFrameRate = function(a) {
|
329
330
|
0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P = 0 < a ? Math.floor(1e3 / a) : 5;
|
330
331
|
};
|
331
|
-
|
332
|
+
exports2.unstable_getCurrentPriorityLevel = function() {
|
332
333
|
return y;
|
333
334
|
};
|
334
|
-
|
335
|
+
exports2.unstable_getFirstCallbackNode = function() {
|
335
336
|
return h(r);
|
336
337
|
};
|
337
|
-
|
338
|
+
exports2.unstable_next = function(a) {
|
338
339
|
switch (y) {
|
339
340
|
case 1:
|
340
341
|
case 2:
|
@@ -352,11 +353,11 @@ var require_scheduler_production_min = __commonJS({
|
|
352
353
|
y = c;
|
353
354
|
}
|
354
355
|
};
|
355
|
-
|
356
|
+
exports2.unstable_pauseExecution = function() {
|
356
357
|
};
|
357
|
-
|
358
|
+
exports2.unstable_requestPaint = function() {
|
358
359
|
};
|
359
|
-
|
360
|
+
exports2.unstable_runWithPriority = function(a, b) {
|
360
361
|
switch (a) {
|
361
362
|
case 1:
|
362
363
|
case 2:
|
@@ -375,8 +376,8 @@ var require_scheduler_production_min = __commonJS({
|
|
375
376
|
y = c;
|
376
377
|
}
|
377
378
|
};
|
378
|
-
|
379
|
-
var d =
|
379
|
+
exports2.unstable_scheduleCallback = function(a, b, c) {
|
380
|
+
var d = exports2.unstable_now();
|
380
381
|
"object" === typeof c && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
|
381
382
|
switch (a) {
|
382
383
|
case 1:
|
@@ -399,8 +400,8 @@ var require_scheduler_production_min = __commonJS({
|
|
399
400
|
c > d ? (a.sortIndex = c, f(t, a), null === h(r) && a === h(t) && (B ? (E(L), L = -1) : B = true, K(H, c - d))) : (a.sortIndex = e, f(r, a), A || z || (A = true, I(J)));
|
400
401
|
return a;
|
401
402
|
};
|
402
|
-
|
403
|
-
|
403
|
+
exports2.unstable_shouldYield = M;
|
404
|
+
exports2.unstable_wrapCallback = function(a) {
|
404
405
|
var b = y;
|
405
406
|
return function() {
|
406
407
|
var c = y;
|
@@ -417,7 +418,7 @@ var require_scheduler_production_min = __commonJS({
|
|
417
418
|
|
418
419
|
// ../../node_modules/scheduler/cjs/scheduler.development.js
|
419
420
|
var require_scheduler_development = __commonJS({
|
420
|
-
"../../node_modules/scheduler/cjs/scheduler.development.js"(
|
421
|
+
"../../node_modules/scheduler/cjs/scheduler.development.js"(exports2) {
|
421
422
|
"use strict";
|
422
423
|
init_react_import();
|
423
424
|
if (process.env.NODE_ENV !== "production") {
|
@@ -505,13 +506,13 @@ var require_scheduler_development = __commonJS({
|
|
505
506
|
var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
|
506
507
|
if (hasPerformanceNow) {
|
507
508
|
var localPerformance = performance;
|
508
|
-
|
509
|
+
exports2.unstable_now = function() {
|
509
510
|
return localPerformance.now();
|
510
511
|
};
|
511
512
|
} else {
|
512
513
|
var localDate = Date;
|
513
514
|
var initialTime = localDate.now();
|
514
|
-
|
515
|
+
exports2.unstable_now = function() {
|
515
516
|
return localDate.now() - initialTime;
|
516
517
|
};
|
517
518
|
}
|
@@ -577,7 +578,7 @@ var require_scheduler_development = __commonJS({
|
|
577
578
|
return workLoop(hasTimeRemaining, initialTime2);
|
578
579
|
} catch (error) {
|
579
580
|
if (currentTask !== null) {
|
580
|
-
var currentTime =
|
581
|
+
var currentTime = exports2.unstable_now();
|
581
582
|
markTaskErrored(currentTask, currentTime);
|
582
583
|
currentTask.isQueued = false;
|
583
584
|
}
|
@@ -606,7 +607,7 @@ var require_scheduler_development = __commonJS({
|
|
606
607
|
currentPriorityLevel = currentTask.priorityLevel;
|
607
608
|
var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
|
608
609
|
var continuationCallback = callback(didUserCallbackTimeout);
|
609
|
-
currentTime =
|
610
|
+
currentTime = exports2.unstable_now();
|
610
611
|
if (typeof continuationCallback === "function") {
|
611
612
|
currentTask.callback = continuationCallback;
|
612
613
|
} else {
|
@@ -682,7 +683,7 @@ var require_scheduler_development = __commonJS({
|
|
682
683
|
};
|
683
684
|
}
|
684
685
|
function unstable_scheduleCallback(priorityLevel, callback, options) {
|
685
|
-
var currentTime =
|
686
|
+
var currentTime = exports2.unstable_now();
|
686
687
|
var startTime2;
|
687
688
|
if (typeof options === "object" && options !== null) {
|
688
689
|
var delay = options.delay;
|
@@ -766,7 +767,7 @@ var require_scheduler_development = __commonJS({
|
|
766
767
|
var frameInterval = frameYieldMs;
|
767
768
|
var startTime = -1;
|
768
769
|
function shouldYieldToHost() {
|
769
|
-
var timeElapsed =
|
770
|
+
var timeElapsed = exports2.unstable_now() - startTime;
|
770
771
|
if (timeElapsed < frameInterval) {
|
771
772
|
return false;
|
772
773
|
}
|
@@ -787,7 +788,7 @@ var require_scheduler_development = __commonJS({
|
|
787
788
|
}
|
788
789
|
var performWorkUntilDeadline = function() {
|
789
790
|
if (scheduledHostCallback !== null) {
|
790
|
-
var currentTime =
|
791
|
+
var currentTime = exports2.unstable_now();
|
791
792
|
startTime = currentTime;
|
792
793
|
var hasTimeRemaining = true;
|
793
794
|
var hasMoreWork = true;
|
@@ -831,7 +832,7 @@ var require_scheduler_development = __commonJS({
|
|
831
832
|
}
|
832
833
|
function requestHostTimeout(callback, ms) {
|
833
834
|
taskTimeoutID = localSetTimeout(function() {
|
834
|
-
callback(
|
835
|
+
callback(exports2.unstable_now());
|
835
836
|
}, ms);
|
836
837
|
}
|
837
838
|
function cancelHostTimeout() {
|
@@ -840,24 +841,24 @@ var require_scheduler_development = __commonJS({
|
|
840
841
|
}
|
841
842
|
var unstable_requestPaint = requestPaint;
|
842
843
|
var unstable_Profiling = null;
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
844
|
+
exports2.unstable_IdlePriority = IdlePriority;
|
845
|
+
exports2.unstable_ImmediatePriority = ImmediatePriority;
|
846
|
+
exports2.unstable_LowPriority = LowPriority;
|
847
|
+
exports2.unstable_NormalPriority = NormalPriority;
|
848
|
+
exports2.unstable_Profiling = unstable_Profiling;
|
849
|
+
exports2.unstable_UserBlockingPriority = UserBlockingPriority;
|
850
|
+
exports2.unstable_cancelCallback = unstable_cancelCallback;
|
851
|
+
exports2.unstable_continueExecution = unstable_continueExecution;
|
852
|
+
exports2.unstable_forceFrameRate = forceFrameRate;
|
853
|
+
exports2.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
|
854
|
+
exports2.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
|
855
|
+
exports2.unstable_next = unstable_next;
|
856
|
+
exports2.unstable_pauseExecution = unstable_pauseExecution;
|
857
|
+
exports2.unstable_requestPaint = unstable_requestPaint;
|
858
|
+
exports2.unstable_runWithPriority = unstable_runWithPriority;
|
859
|
+
exports2.unstable_scheduleCallback = unstable_scheduleCallback;
|
860
|
+
exports2.unstable_shouldYield = shouldYieldToHost;
|
861
|
+
exports2.unstable_wrapCallback = unstable_wrapCallback;
|
861
862
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
862
863
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
863
864
|
}
|
@@ -868,7 +869,7 @@ var require_scheduler_development = __commonJS({
|
|
868
869
|
|
869
870
|
// ../../node_modules/scheduler/index.js
|
870
871
|
var require_scheduler = __commonJS({
|
871
|
-
"../../node_modules/scheduler/index.js"(
|
872
|
+
"../../node_modules/scheduler/index.js"(exports2, module2) {
|
872
873
|
"use strict";
|
873
874
|
init_react_import();
|
874
875
|
if (process.env.NODE_ENV === "production") {
|
@@ -881,7 +882,7 @@ var require_scheduler = __commonJS({
|
|
881
882
|
|
882
883
|
// ../../node_modules/react-dom/cjs/react-dom.production.min.js
|
883
884
|
var require_react_dom_production_min = __commonJS({
|
884
|
-
"../../node_modules/react-dom/cjs/react-dom.production.min.js"(
|
885
|
+
"../../node_modules/react-dom/cjs/react-dom.production.min.js"(exports2) {
|
885
886
|
"use strict";
|
886
887
|
init_react_import();
|
887
888
|
var aa = require("react");
|
@@ -7938,14 +7939,14 @@ var require_react_dom_production_min = __commonJS({
|
|
7938
7939
|
}
|
7939
7940
|
}
|
7940
7941
|
var wl;
|
7941
|
-
|
7942
|
-
|
7942
|
+
exports2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = tl;
|
7943
|
+
exports2.createPortal = function(a, b) {
|
7943
7944
|
var c = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
7944
7945
|
if (!ol(b))
|
7945
7946
|
throw Error(p(200));
|
7946
7947
|
return dl(a, b, null, c);
|
7947
7948
|
};
|
7948
|
-
|
7949
|
+
exports2.createRoot = function(a, b) {
|
7949
7950
|
if (!ol(a))
|
7950
7951
|
throw Error(p(299));
|
7951
7952
|
var c = false, d = "", e = ll;
|
@@ -7955,7 +7956,7 @@ var require_react_dom_production_min = __commonJS({
|
|
7955
7956
|
sf(8 === a.nodeType ? a.parentNode : a);
|
7956
7957
|
return new ml(b);
|
7957
7958
|
};
|
7958
|
-
|
7959
|
+
exports2.findDOMNode = function(a) {
|
7959
7960
|
if (null == a)
|
7960
7961
|
return null;
|
7961
7962
|
if (1 === a.nodeType)
|
@@ -7971,15 +7972,15 @@ var require_react_dom_production_min = __commonJS({
|
|
7971
7972
|
a = null === a ? null : a.stateNode;
|
7972
7973
|
return a;
|
7973
7974
|
};
|
7974
|
-
|
7975
|
+
exports2.flushSync = function(a) {
|
7975
7976
|
return Sk(a);
|
7976
7977
|
};
|
7977
|
-
|
7978
|
+
exports2.hydrate = function(a, b, c) {
|
7978
7979
|
if (!pl(b))
|
7979
7980
|
throw Error(p(200));
|
7980
7981
|
return sl(null, a, b, true, c);
|
7981
7982
|
};
|
7982
|
-
|
7983
|
+
exports2.hydrateRoot = function(a, b, c) {
|
7983
7984
|
if (!ol(a))
|
7984
7985
|
throw Error(p(405));
|
7985
7986
|
var d = null != c && c.hydratedSources || null, e = false, f = "", g = ll;
|
@@ -7995,12 +7996,12 @@ var require_react_dom_production_min = __commonJS({
|
|
7995
7996
|
);
|
7996
7997
|
return new nl(b);
|
7997
7998
|
};
|
7998
|
-
|
7999
|
+
exports2.render = function(a, b, c) {
|
7999
8000
|
if (!pl(b))
|
8000
8001
|
throw Error(p(200));
|
8001
8002
|
return sl(null, a, b, false, c);
|
8002
8003
|
};
|
8003
|
-
|
8004
|
+
exports2.unmountComponentAtNode = function(a) {
|
8004
8005
|
if (!pl(a))
|
8005
8006
|
throw Error(p(40));
|
8006
8007
|
return a._reactRootContainer ? (Sk(function() {
|
@@ -8010,21 +8011,21 @@ var require_react_dom_production_min = __commonJS({
|
|
8010
8011
|
});
|
8011
8012
|
}), true) : false;
|
8012
8013
|
};
|
8013
|
-
|
8014
|
-
|
8014
|
+
exports2.unstable_batchedUpdates = Rk;
|
8015
|
+
exports2.unstable_renderSubtreeIntoContainer = function(a, b, c, d) {
|
8015
8016
|
if (!pl(c))
|
8016
8017
|
throw Error(p(200));
|
8017
8018
|
if (null == a || void 0 === a._reactInternals)
|
8018
8019
|
throw Error(p(38));
|
8019
8020
|
return sl(a, b, c, false, d);
|
8020
8021
|
};
|
8021
|
-
|
8022
|
+
exports2.version = "18.2.0-next-9e3b772b8-20220608";
|
8022
8023
|
}
|
8023
8024
|
});
|
8024
8025
|
|
8025
8026
|
// ../../node_modules/react-dom/cjs/react-dom.development.js
|
8026
8027
|
var require_react_dom_development = __commonJS({
|
8027
|
-
"../../node_modules/react-dom/cjs/react-dom.development.js"(
|
8028
|
+
"../../node_modules/react-dom/cjs/react-dom.development.js"(exports2) {
|
8028
8029
|
"use strict";
|
8029
8030
|
init_react_import();
|
8030
8031
|
if (process.env.NODE_ENV !== "production") {
|
@@ -8084,7 +8085,7 @@ var require_react_dom_development = __commonJS({
|
|
8084
8085
|
var HostPortal = 4;
|
8085
8086
|
var HostComponent = 5;
|
8086
8087
|
var HostText = 6;
|
8087
|
-
var
|
8088
|
+
var Fragment16 = 7;
|
8088
8089
|
var Mode = 8;
|
8089
8090
|
var ContextConsumer = 9;
|
8090
8091
|
var ContextProvider = 10;
|
@@ -8264,8 +8265,8 @@ var require_react_dom_development = __commonJS({
|
|
8264
8265
|
if (propertyInfo !== null) {
|
8265
8266
|
return !propertyInfo.acceptsBooleans;
|
8266
8267
|
} else {
|
8267
|
-
var
|
8268
|
-
return
|
8268
|
+
var prefix3 = name.toLowerCase().slice(0, 5);
|
8269
|
+
return prefix3 !== "data-" && prefix3 !== "aria-";
|
8269
8270
|
}
|
8270
8271
|
}
|
8271
8272
|
default:
|
@@ -8937,18 +8938,18 @@ var require_react_dom_development = __commonJS({
|
|
8937
8938
|
}
|
8938
8939
|
}
|
8939
8940
|
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
8940
|
-
var
|
8941
|
+
var prefix2;
|
8941
8942
|
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
8942
8943
|
{
|
8943
|
-
if (
|
8944
|
+
if (prefix2 === void 0) {
|
8944
8945
|
try {
|
8945
8946
|
throw Error();
|
8946
8947
|
} catch (x) {
|
8947
8948
|
var match = x.stack.trim().match(/\n( *(at )?)/);
|
8948
|
-
|
8949
|
+
prefix2 = match && match[1] || "";
|
8949
8950
|
}
|
8950
8951
|
}
|
8951
|
-
return "\n" +
|
8952
|
+
return "\n" + prefix2 + name;
|
8952
8953
|
}
|
8953
8954
|
}
|
8954
8955
|
var reentry = false;
|
@@ -9240,7 +9241,7 @@ var require_react_dom_development = __commonJS({
|
|
9240
9241
|
return "DehydratedFragment";
|
9241
9242
|
case ForwardRef:
|
9242
9243
|
return getWrappedName$1(type, type.render, "ForwardRef");
|
9243
|
-
case
|
9244
|
+
case Fragment16:
|
9244
9245
|
return "Fragment";
|
9245
9246
|
case HostComponent:
|
9246
9247
|
return type;
|
@@ -10033,13 +10034,13 @@ var require_react_dom_development = __commonJS({
|
|
10033
10034
|
strokeOpacity: true,
|
10034
10035
|
strokeWidth: true
|
10035
10036
|
};
|
10036
|
-
function prefixKey(
|
10037
|
-
return
|
10037
|
+
function prefixKey(prefix3, key) {
|
10038
|
+
return prefix3 + key.charAt(0).toUpperCase() + key.substring(1);
|
10038
10039
|
}
|
10039
10040
|
var prefixes = ["Webkit", "ms", "Moz", "O"];
|
10040
10041
|
Object.keys(isUnitlessNumber).forEach(function(prop) {
|
10041
|
-
prefixes.forEach(function(
|
10042
|
-
isUnitlessNumber[prefixKey(
|
10042
|
+
prefixes.forEach(function(prefix3) {
|
10043
|
+
isUnitlessNumber[prefixKey(prefix3, prop)] = isUnitlessNumber[prop];
|
10043
10044
|
});
|
10044
10045
|
});
|
10045
10046
|
function dangerousStyleValue(name, value, isCustomProperty) {
|
@@ -18911,7 +18912,7 @@ var require_react_dom_development = __commonJS({
|
|
18911
18912
|
}
|
18912
18913
|
}
|
18913
18914
|
function updateFragment2(returnFiber, current2, fragment, lanes, key) {
|
18914
|
-
if (current2 === null || current2.tag !==
|
18915
|
+
if (current2 === null || current2.tag !== Fragment16) {
|
18915
18916
|
var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
|
18916
18917
|
created.return = returnFiber;
|
18917
18918
|
return created;
|
@@ -19314,7 +19315,7 @@ var require_react_dom_development = __commonJS({
|
|
19314
19315
|
if (child.key === key) {
|
19315
19316
|
var elementType = element.type;
|
19316
19317
|
if (elementType === REACT_FRAGMENT_TYPE) {
|
19317
|
-
if (child.tag ===
|
19318
|
+
if (child.tag === Fragment16) {
|
19318
19319
|
deleteRemainingChildren(returnFiber, child.sibling);
|
19319
19320
|
var existing = useFiber(child, element.props.children);
|
19320
19321
|
existing.return = returnFiber;
|
@@ -23489,7 +23490,7 @@ var require_react_dom_development = __commonJS({
|
|
23489
23490
|
var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
|
23490
23491
|
return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
|
23491
23492
|
}
|
23492
|
-
case
|
23493
|
+
case Fragment16:
|
23493
23494
|
return updateFragment(current2, workInProgress2, renderLanes2);
|
23494
23495
|
case Mode:
|
23495
23496
|
return updateMode(current2, workInProgress2, renderLanes2);
|
@@ -23762,7 +23763,7 @@ var require_react_dom_development = __commonJS({
|
|
23762
23763
|
case SimpleMemoComponent:
|
23763
23764
|
case FunctionComponent:
|
23764
23765
|
case ForwardRef:
|
23765
|
-
case
|
23766
|
+
case Fragment16:
|
23766
23767
|
case Mode:
|
23767
23768
|
case Profiler:
|
23768
23769
|
case ContextConsumer:
|
@@ -28021,7 +28022,7 @@ var require_react_dom_development = __commonJS({
|
|
28021
28022
|
return fiber;
|
28022
28023
|
}
|
28023
28024
|
function createFiberFromFragment(elements, mode, lanes, key) {
|
28024
|
-
var fiber = createFiber(
|
28025
|
+
var fiber = createFiber(Fragment16, elements, key, mode);
|
28025
28026
|
fiber.lanes = lanes;
|
28026
28027
|
return fiber;
|
28027
28028
|
}
|
@@ -29094,18 +29095,18 @@ var require_react_dom_development = __commonJS({
|
|
29094
29095
|
}
|
29095
29096
|
}
|
29096
29097
|
}
|
29097
|
-
|
29098
|
-
|
29099
|
-
|
29100
|
-
|
29101
|
-
|
29102
|
-
|
29103
|
-
|
29104
|
-
|
29105
|
-
|
29106
|
-
|
29107
|
-
|
29108
|
-
|
29098
|
+
exports2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
|
29099
|
+
exports2.createPortal = createPortal$1;
|
29100
|
+
exports2.createRoot = createRoot$1;
|
29101
|
+
exports2.findDOMNode = findDOMNode;
|
29102
|
+
exports2.flushSync = flushSync$1;
|
29103
|
+
exports2.hydrate = hydrate;
|
29104
|
+
exports2.hydrateRoot = hydrateRoot$1;
|
29105
|
+
exports2.render = render;
|
29106
|
+
exports2.unmountComponentAtNode = unmountComponentAtNode;
|
29107
|
+
exports2.unstable_batchedUpdates = batchedUpdates$1;
|
29108
|
+
exports2.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
|
29109
|
+
exports2.version = ReactVersion;
|
29109
29110
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
29110
29111
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
29111
29112
|
}
|
@@ -29116,7 +29117,7 @@ var require_react_dom_development = __commonJS({
|
|
29116
29117
|
|
29117
29118
|
// ../../node_modules/react-dom/index.js
|
29118
29119
|
var require_react_dom = __commonJS({
|
29119
|
-
"../../node_modules/react-dom/index.js"(
|
29120
|
+
"../../node_modules/react-dom/index.js"(exports2, module2) {
|
29120
29121
|
"use strict";
|
29121
29122
|
init_react_import();
|
29122
29123
|
function checkDCE() {
|
@@ -29171,9 +29172,19 @@ init_react_import();
|
|
29171
29172
|
init_react_import();
|
29172
29173
|
var import_react2 = require("react");
|
29173
29174
|
|
29174
|
-
//
|
29175
|
-
|
29176
|
-
|
29175
|
+
// components/Button/Button.module.css
|
29176
|
+
var Button_default = {
|
29177
|
+
Button: "Button_Button",
|
29178
|
+
"Button--medium": "Button_Button--medium",
|
29179
|
+
"Button--large": "Button_Button--large",
|
29180
|
+
"Button-icon": "Button_Button-icon",
|
29181
|
+
"Button--primary": "Button_Button--primary",
|
29182
|
+
"Button--secondary": "Button_Button--secondary",
|
29183
|
+
"Button--flush": "Button_Button--flush",
|
29184
|
+
"Button--disabled": "Button_Button--disabled",
|
29185
|
+
"Button--fullWidth": "Button_Button--fullWidth",
|
29186
|
+
"Button-spinner": "Button_Button-spinner"
|
29187
|
+
};
|
29177
29188
|
|
29178
29189
|
// lib/get-class-name-factory.ts
|
29179
29190
|
init_react_import();
|
@@ -29210,7 +29221,7 @@ var get_class_name_factory_default = getClassNameFactory;
|
|
29210
29221
|
// components/Button/Button.tsx
|
29211
29222
|
var import_react_spinners = require("react-spinners");
|
29212
29223
|
var import_jsx_runtime = require("react/jsx-runtime");
|
29213
|
-
var getClassName = get_class_name_factory_default("Button",
|
29224
|
+
var getClassName = get_class_name_factory_default("Button", Button_default);
|
29214
29225
|
var Button = ({
|
29215
29226
|
children,
|
29216
29227
|
href,
|
@@ -29264,16 +29275,190 @@ var Button = ({
|
|
29264
29275
|
|
29265
29276
|
// components/Drawer/index.tsx
|
29266
29277
|
init_react_import();
|
29267
|
-
var import_dnd2 = require("@hello-pangea/dnd");
|
29268
29278
|
|
29269
|
-
//
|
29279
|
+
// components/Droppable/index.tsx
|
29270
29280
|
init_react_import();
|
29271
|
-
var
|
29281
|
+
var import_dnd = require("@measured/dnd");
|
29272
29282
|
|
29273
|
-
// components/
|
29283
|
+
// components/Puck/context.tsx
|
29274
29284
|
init_react_import();
|
29275
|
-
var
|
29285
|
+
var import_react3 = require("react");
|
29286
|
+
|
29287
|
+
// lib/get-item.ts
|
29288
|
+
init_react_import();
|
29289
|
+
|
29290
|
+
// lib/root-droppable-id.ts
|
29291
|
+
init_react_import();
|
29292
|
+
var rootDroppableId = "default-zone";
|
29293
|
+
|
29294
|
+
// lib/setup-zone.ts
|
29295
|
+
init_react_import();
|
29296
|
+
var setupZone = (data, zoneKey) => {
|
29297
|
+
if (zoneKey === rootDroppableId) {
|
29298
|
+
return data;
|
29299
|
+
}
|
29300
|
+
const newData = __spreadValues({}, data);
|
29301
|
+
newData.zones = data.zones || {};
|
29302
|
+
newData.zones[zoneKey] = newData.zones[zoneKey] || [];
|
29303
|
+
return newData;
|
29304
|
+
};
|
29305
|
+
|
29306
|
+
// lib/get-item.ts
|
29307
|
+
var getItem = (selector, data, dynamicProps = {}) => {
|
29308
|
+
if (!selector.zone || selector.zone === rootDroppableId) {
|
29309
|
+
const item2 = data.content[selector.index];
|
29310
|
+
return __spreadProps(__spreadValues({}, item2), { props: dynamicProps[item2.props.id] || item2.props });
|
29311
|
+
}
|
29312
|
+
const item = setupZone(data, selector.zone).zones[selector.zone][selector.index];
|
29313
|
+
return __spreadProps(__spreadValues({}, item), { props: dynamicProps[item.props.id] || item.props });
|
29314
|
+
};
|
29315
|
+
|
29316
|
+
// components/ViewportControls/default-viewports.ts
|
29317
|
+
init_react_import();
|
29318
|
+
var defaultViewports = [
|
29319
|
+
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
29320
|
+
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
29321
|
+
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
29322
|
+
];
|
29323
|
+
|
29324
|
+
// components/Puck/context.tsx
|
29276
29325
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
29326
|
+
var defaultAppState = {
|
29327
|
+
data: { content: [], root: { props: { title: "" } } },
|
29328
|
+
ui: {
|
29329
|
+
leftSideBarVisible: true,
|
29330
|
+
rightSideBarVisible: true,
|
29331
|
+
arrayState: {},
|
29332
|
+
itemSelector: null,
|
29333
|
+
componentList: {},
|
29334
|
+
isDragging: false,
|
29335
|
+
viewports: {
|
29336
|
+
current: {
|
29337
|
+
width: defaultViewports[0].width,
|
29338
|
+
height: defaultViewports[0].height || "auto"
|
29339
|
+
},
|
29340
|
+
options: [],
|
29341
|
+
controlsVisible: true
|
29342
|
+
}
|
29343
|
+
}
|
29344
|
+
};
|
29345
|
+
var defaultContext = {
|
29346
|
+
state: defaultAppState,
|
29347
|
+
dispatch: () => null,
|
29348
|
+
config: { components: {} },
|
29349
|
+
componentState: {},
|
29350
|
+
resolveData: () => {
|
29351
|
+
},
|
29352
|
+
plugins: [],
|
29353
|
+
overrides: {},
|
29354
|
+
history: {},
|
29355
|
+
viewports: defaultViewports,
|
29356
|
+
zoomConfig: {
|
29357
|
+
autoZoom: 1,
|
29358
|
+
rootHeight: 0,
|
29359
|
+
zoom: 1
|
29360
|
+
},
|
29361
|
+
setZoomConfig: () => null,
|
29362
|
+
status: "LOADING",
|
29363
|
+
setStatus: () => null,
|
29364
|
+
iframe: {}
|
29365
|
+
};
|
29366
|
+
var appContext = (0, import_react3.createContext)(defaultContext);
|
29367
|
+
var AppProvider = ({
|
29368
|
+
children,
|
29369
|
+
value
|
29370
|
+
}) => {
|
29371
|
+
const [zoomConfig, setZoomConfig] = (0, import_react3.useState)(defaultContext.zoomConfig);
|
29372
|
+
const [status, setStatus] = (0, import_react3.useState)("LOADING");
|
29373
|
+
(0, import_react3.useEffect)(() => {
|
29374
|
+
setStatus("MOUNTED");
|
29375
|
+
}, []);
|
29376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
29377
|
+
appContext.Provider,
|
29378
|
+
{
|
29379
|
+
value: __spreadProps(__spreadValues({}, value), { zoomConfig, setZoomConfig, status, setStatus }),
|
29380
|
+
children
|
29381
|
+
}
|
29382
|
+
);
|
29383
|
+
};
|
29384
|
+
function useAppContext() {
|
29385
|
+
const mainContext = (0, import_react3.useContext)(appContext);
|
29386
|
+
const selectedItem = mainContext.state.ui.itemSelector ? getItem(mainContext.state.ui.itemSelector, mainContext.state.data) : void 0;
|
29387
|
+
return __spreadProps(__spreadValues({}, mainContext), {
|
29388
|
+
// Helpers
|
29389
|
+
selectedItem,
|
29390
|
+
setUi: (ui, recordHistory) => {
|
29391
|
+
return mainContext.dispatch({
|
29392
|
+
type: "setUi",
|
29393
|
+
ui,
|
29394
|
+
recordHistory
|
29395
|
+
});
|
29396
|
+
}
|
29397
|
+
});
|
29398
|
+
}
|
29399
|
+
|
29400
|
+
// components/Droppable/index.tsx
|
29401
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
29402
|
+
var defaultProvided = {
|
29403
|
+
droppableProps: {
|
29404
|
+
"data-rfd-droppable-context-id": "",
|
29405
|
+
"data-rfd-droppable-id": ""
|
29406
|
+
},
|
29407
|
+
placeholder: null,
|
29408
|
+
innerRef: () => null
|
29409
|
+
};
|
29410
|
+
var defaultSnapshot = {
|
29411
|
+
isDraggingOver: false,
|
29412
|
+
draggingOverWith: null,
|
29413
|
+
draggingFromThisWith: null,
|
29414
|
+
isUsingPlaceholder: false
|
29415
|
+
};
|
29416
|
+
var DefaultDroppable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: children(defaultProvided, defaultSnapshot) });
|
29417
|
+
var Droppable = (props) => {
|
29418
|
+
const { status } = useAppContext();
|
29419
|
+
const El = status !== "LOADING" ? import_dnd.Droppable : DefaultDroppable;
|
29420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(El, __spreadValues({}, props));
|
29421
|
+
};
|
29422
|
+
|
29423
|
+
// components/Drawer/styles.module.css
|
29424
|
+
var styles_default = {
|
29425
|
+
Drawer: "styles_Drawer",
|
29426
|
+
"DrawerItem-default": "styles_DrawerItem-default",
|
29427
|
+
"DrawerItem-draggableWrapper": "styles_DrawerItem-draggableWrapper",
|
29428
|
+
DrawerItem: "styles_DrawerItem",
|
29429
|
+
"DrawerItem-draggable": "styles_DrawerItem-draggable",
|
29430
|
+
"Drawer--isDraggingFrom": "styles_Drawer--isDraggingFrom",
|
29431
|
+
"DrawerItem-name": "styles_DrawerItem-name"
|
29432
|
+
};
|
29433
|
+
|
29434
|
+
// components/Draggable/index.tsx
|
29435
|
+
init_react_import();
|
29436
|
+
var import_dnd2 = require("@measured/dnd");
|
29437
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
29438
|
+
var defaultProvided2 = {
|
29439
|
+
draggableProps: {
|
29440
|
+
"data-rfd-draggable-context-id": "",
|
29441
|
+
"data-rfd-draggable-id": ""
|
29442
|
+
},
|
29443
|
+
dragHandleProps: null,
|
29444
|
+
innerRef: () => null
|
29445
|
+
};
|
29446
|
+
var defaultSnapshot2 = {
|
29447
|
+
isDragging: false,
|
29448
|
+
isDropAnimating: false,
|
29449
|
+
isClone: false,
|
29450
|
+
dropAnimation: null,
|
29451
|
+
draggingOver: null,
|
29452
|
+
combineWith: null,
|
29453
|
+
combineTargetFor: null,
|
29454
|
+
mode: null
|
29455
|
+
};
|
29456
|
+
var defaultRubric = {
|
29457
|
+
draggableId: "",
|
29458
|
+
type: "",
|
29459
|
+
source: { droppableId: "", index: 0 }
|
29460
|
+
};
|
29461
|
+
var DefaultDraggable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: children(defaultProvided2, defaultSnapshot2, defaultRubric) });
|
29277
29462
|
var Draggable = ({
|
29278
29463
|
className,
|
29279
29464
|
children,
|
@@ -29283,39 +29468,33 @@ var Draggable = ({
|
|
29283
29468
|
disableAnimations = false,
|
29284
29469
|
isDragDisabled = false
|
29285
29470
|
}) => {
|
29286
|
-
|
29287
|
-
|
29288
|
-
|
29289
|
-
|
29290
|
-
|
29291
|
-
|
29292
|
-
|
29293
|
-
|
29294
|
-
|
29295
|
-
|
29296
|
-
|
29297
|
-
|
29298
|
-
|
29299
|
-
|
29300
|
-
|
29301
|
-
|
29302
|
-
|
29303
|
-
|
29304
|
-
|
29305
|
-
|
29306
|
-
),
|
29307
|
-
|
29308
|
-
|
29309
|
-
|
29310
|
-
|
29311
|
-
|
29312
|
-
|
29313
|
-
}
|
29314
|
-
)
|
29315
|
-
] });
|
29316
|
-
}
|
29317
|
-
}
|
29318
|
-
);
|
29471
|
+
const { status } = useAppContext();
|
29472
|
+
const El = status !== "LOADING" ? import_dnd2.Draggable : DefaultDraggable;
|
29473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(El, { draggableId: id, index, isDragDisabled, children: (provided, snapshot) => {
|
29474
|
+
var _a;
|
29475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
29476
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
29477
|
+
"div",
|
29478
|
+
__spreadProps(__spreadValues(__spreadValues({
|
29479
|
+
className: className && className(provided, snapshot),
|
29480
|
+
ref: provided.innerRef
|
29481
|
+
}, provided.draggableProps), provided.dragHandleProps), {
|
29482
|
+
style: __spreadProps(__spreadValues({}, provided.draggableProps.style), {
|
29483
|
+
transform: snapshot.isDragging || !disableAnimations ? (_a = provided.draggableProps.style) == null ? void 0 : _a.transform : "translate(0px, 0px)"
|
29484
|
+
}),
|
29485
|
+
children: children(provided, snapshot)
|
29486
|
+
})
|
29487
|
+
),
|
29488
|
+
showShadow && snapshot.isDragging && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
29489
|
+
"div",
|
29490
|
+
{
|
29491
|
+
className: className && className(provided, snapshot),
|
29492
|
+
style: { transform: "none !important" },
|
29493
|
+
children: children(provided, snapshot)
|
29494
|
+
}
|
29495
|
+
)
|
29496
|
+
] });
|
29497
|
+
} });
|
29319
29498
|
};
|
29320
29499
|
|
29321
29500
|
// components/DragIcon/index.tsx
|
@@ -29345,28 +29524,29 @@ var replace = (list, index, newItem) => {
|
|
29345
29524
|
return result;
|
29346
29525
|
};
|
29347
29526
|
|
29348
|
-
//
|
29349
|
-
|
29350
|
-
|
29527
|
+
// components/DragIcon/styles.module.css
|
29528
|
+
var styles_default2 = {
|
29529
|
+
DragIcon: "styles_DragIcon"
|
29530
|
+
};
|
29351
29531
|
|
29352
29532
|
// components/DragIcon/index.tsx
|
29353
|
-
var
|
29354
|
-
var getClassName2 = get_class_name_factory_default("DragIcon",
|
29355
|
-
var DragIcon = () => /* @__PURE__ */ (0,
|
29533
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
29534
|
+
var getClassName2 = get_class_name_factory_default("DragIcon", styles_default2);
|
29535
|
+
var DragIcon = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: getClassName2(), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { viewBox: "0 0 20 20", width: "12", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z" }) }) });
|
29356
29536
|
|
29357
29537
|
// components/Drawer/index.tsx
|
29358
|
-
var
|
29359
|
-
var
|
29360
|
-
var getClassName3 = get_class_name_factory_default("Drawer",
|
29361
|
-
var getClassNameItem = get_class_name_factory_default("DrawerItem",
|
29362
|
-
var drawerContext = (0,
|
29538
|
+
var import_react4 = require("react");
|
29539
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
29540
|
+
var getClassName3 = get_class_name_factory_default("Drawer", styles_default);
|
29541
|
+
var getClassNameItem = get_class_name_factory_default("DrawerItem", styles_default);
|
29542
|
+
var drawerContext = (0, import_react4.createContext)({
|
29363
29543
|
droppableId: ""
|
29364
29544
|
});
|
29365
29545
|
var DrawerDraggable = ({
|
29366
29546
|
children,
|
29367
29547
|
id,
|
29368
29548
|
index
|
29369
|
-
}) => /* @__PURE__ */ (0,
|
29549
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
29370
29550
|
Draggable,
|
29371
29551
|
{
|
29372
29552
|
id,
|
@@ -29382,17 +29562,18 @@ var DrawerItem = ({
|
|
29382
29562
|
name,
|
29383
29563
|
children,
|
29384
29564
|
id,
|
29565
|
+
label,
|
29385
29566
|
index
|
29386
29567
|
}) => {
|
29387
|
-
const ctx = (0,
|
29568
|
+
const ctx = (0, import_react4.useContext)(drawerContext);
|
29388
29569
|
const resolvedId = `${ctx.droppableId}::${id || name}`;
|
29389
|
-
const CustomInner = (0,
|
29390
|
-
() => children || (({ children: children2, name: name2 }) => /* @__PURE__ */ (0,
|
29570
|
+
const CustomInner = (0, import_react4.useMemo)(
|
29571
|
+
() => children || (({ children: children2, name: name2 }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: getClassNameItem("default"), children: children2 })),
|
29391
29572
|
[children]
|
29392
29573
|
);
|
29393
|
-
return /* @__PURE__ */ (0,
|
29394
|
-
/* @__PURE__ */ (0,
|
29395
|
-
/* @__PURE__ */ (0,
|
29574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DrawerDraggable, { id: resolvedId, index, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CustomInner, { name, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: getClassNameItem("draggableWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: getClassNameItem("draggable"), children: [
|
29575
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: getClassNameItem("name"), children: label != null ? label : name }),
|
29576
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: getClassNameItem("icon"), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DragIcon, {}) })
|
29396
29577
|
] }) }) }) });
|
29397
29578
|
};
|
29398
29579
|
var Drawer = ({
|
@@ -29400,7 +29581,7 @@ var Drawer = ({
|
|
29400
29581
|
droppableId = "component-list",
|
29401
29582
|
direction = "vertical"
|
29402
29583
|
}) => {
|
29403
|
-
return /* @__PURE__ */ (0,
|
29584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(drawerContext.Provider, { value: { droppableId }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Droppable, { droppableId, isDropDisabled: true, direction, children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
29404
29585
|
"div",
|
29405
29586
|
__spreadProps(__spreadValues({}, provided.droppableProps), {
|
29406
29587
|
ref: provided.innerRef,
|
@@ -29409,7 +29590,7 @@ var Drawer = ({
|
|
29409
29590
|
}),
|
29410
29591
|
children: [
|
29411
29592
|
children,
|
29412
|
-
/* @__PURE__ */ (0,
|
29593
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { display: "none" }, children: provided.placeholder })
|
29413
29594
|
]
|
29414
29595
|
})
|
29415
29596
|
) }) });
|
@@ -29422,19 +29603,32 @@ var import_react9 = require("react");
|
|
29422
29603
|
|
29423
29604
|
// components/DraggableComponent/index.tsx
|
29424
29605
|
init_react_import();
|
29425
|
-
var
|
29426
|
-
var import_dnd3 = require("@
|
29606
|
+
var import_react7 = require("react");
|
29607
|
+
var import_dnd3 = require("@measured/dnd");
|
29427
29608
|
|
29428
|
-
//
|
29429
|
-
|
29430
|
-
|
29609
|
+
// components/DraggableComponent/styles.module.css
|
29610
|
+
var styles_default3 = {
|
29611
|
+
DraggableComponent: "styles_DraggableComponent",
|
29612
|
+
"DraggableComponent--isDragging": "styles_DraggableComponent--isDragging",
|
29613
|
+
"DraggableComponent-contents": "styles_DraggableComponent-contents",
|
29614
|
+
"DraggableComponent-overlay": "styles_DraggableComponent-overlay",
|
29615
|
+
"DraggableComponent-loadingOverlay": "styles_DraggableComponent-loadingOverlay",
|
29616
|
+
"DraggableComponent--isLocked": "styles_DraggableComponent--isLocked",
|
29617
|
+
"DraggableComponent--forceHover": "styles_DraggableComponent--forceHover",
|
29618
|
+
"DraggableComponent--isSelected": "styles_DraggableComponent--isSelected",
|
29619
|
+
"DraggableComponent--indicativeHover": "styles_DraggableComponent--indicativeHover",
|
29620
|
+
"DraggableComponent-actionsOverlay": "styles_DraggableComponent-actionsOverlay",
|
29621
|
+
"DraggableComponent-actions": "styles_DraggableComponent-actions",
|
29622
|
+
"DraggableComponent-actionsLabel": "styles_DraggableComponent-actionsLabel",
|
29623
|
+
"DraggableComponent-action": "styles_DraggableComponent-action"
|
29624
|
+
};
|
29431
29625
|
|
29432
29626
|
// ../../node_modules/lucide-react/dist/esm/lucide-react.js
|
29433
29627
|
init_react_import();
|
29434
29628
|
|
29435
29629
|
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
29436
29630
|
init_react_import();
|
29437
|
-
var
|
29631
|
+
var import_react5 = require("react");
|
29438
29632
|
|
29439
29633
|
// ../../node_modules/lucide-react/dist/esm/defaultAttributes.js
|
29440
29634
|
init_react_import();
|
@@ -29453,10 +29647,10 @@ var defaultAttributes = {
|
|
29453
29647
|
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
29454
29648
|
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().trim();
|
29455
29649
|
var createLucideIcon = (iconName, iconNode) => {
|
29456
|
-
const Component = (0,
|
29650
|
+
const Component = (0, import_react5.forwardRef)(
|
29457
29651
|
(_a, ref) => {
|
29458
29652
|
var _b = _a, { color = "currentColor", size = 24, strokeWidth = 2, absoluteStrokeWidth, className = "", children } = _b, rest = __objRest(_b, ["color", "size", "strokeWidth", "absoluteStrokeWidth", "className", "children"]);
|
29459
|
-
return (0,
|
29653
|
+
return (0, import_react5.createElement)(
|
29460
29654
|
"svg",
|
29461
29655
|
__spreadValues(__spreadProps(__spreadValues({
|
29462
29656
|
ref
|
@@ -29468,7 +29662,7 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
29468
29662
|
className: ["lucide", `lucide-${toKebabCase(iconName)}`, className].join(" ")
|
29469
29663
|
}), rest),
|
29470
29664
|
[
|
29471
|
-
...iconNode.map(([tag, attrs]) => (0,
|
29665
|
+
...iconNode.map(([tag, attrs]) => (0, import_react5.createElement)(tag, attrs)),
|
29472
29666
|
...Array.isArray(children) ? children : [children]
|
29473
29667
|
]
|
29474
29668
|
);
|
@@ -29579,6 +29773,14 @@ var Lock = createLucideIcon("Lock", [
|
|
29579
29773
|
["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
|
29580
29774
|
]);
|
29581
29775
|
|
29776
|
+
// ../../node_modules/lucide-react/dist/esm/icons/monitor.js
|
29777
|
+
init_react_import();
|
29778
|
+
var Monitor = createLucideIcon("Monitor", [
|
29779
|
+
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
29780
|
+
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
29781
|
+
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
29782
|
+
]);
|
29783
|
+
|
29582
29784
|
// ../../node_modules/lucide-react/dist/esm/icons/more-vertical.js
|
29583
29785
|
init_react_import();
|
29584
29786
|
var MoreVertical = createLucideIcon("MoreVertical", [
|
@@ -29629,6 +29831,20 @@ var SlidersHorizontal = createLucideIcon("SlidersHorizontal", [
|
|
29629
29831
|
["line", { x1: "16", x2: "16", y1: "18", y2: "22", key: "1lctlv" }]
|
29630
29832
|
]);
|
29631
29833
|
|
29834
|
+
// ../../node_modules/lucide-react/dist/esm/icons/smartphone.js
|
29835
|
+
init_react_import();
|
29836
|
+
var Smartphone = createLucideIcon("Smartphone", [
|
29837
|
+
["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "1yt0o3" }],
|
29838
|
+
["path", { d: "M12 18h.01", key: "mhygvu" }]
|
29839
|
+
]);
|
29840
|
+
|
29841
|
+
// ../../node_modules/lucide-react/dist/esm/icons/tablet.js
|
29842
|
+
init_react_import();
|
29843
|
+
var Tablet = createLucideIcon("Tablet", [
|
29844
|
+
["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2", key: "76otgf" }],
|
29845
|
+
["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
|
29846
|
+
]);
|
29847
|
+
|
29632
29848
|
// ../../node_modules/lucide-react/dist/esm/icons/trash.js
|
29633
29849
|
init_react_import();
|
29634
29850
|
var Trash = createLucideIcon("Trash", [
|
@@ -29652,12 +29868,29 @@ var Unlock = createLucideIcon("Unlock", [
|
|
29652
29868
|
["path", { d: "M7 11V7a5 5 0 0 1 9.9-1", key: "1mm8w8" }]
|
29653
29869
|
]);
|
29654
29870
|
|
29871
|
+
// ../../node_modules/lucide-react/dist/esm/icons/zoom-in.js
|
29872
|
+
init_react_import();
|
29873
|
+
var ZoomIn = createLucideIcon("ZoomIn", [
|
29874
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
29875
|
+
["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
|
29876
|
+
["line", { x1: "11", x2: "11", y1: "8", y2: "14", key: "1vmskp" }],
|
29877
|
+
["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
|
29878
|
+
]);
|
29879
|
+
|
29880
|
+
// ../../node_modules/lucide-react/dist/esm/icons/zoom-out.js
|
29881
|
+
init_react_import();
|
29882
|
+
var ZoomOut = createLucideIcon("ZoomOut", [
|
29883
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
29884
|
+
["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
|
29885
|
+
["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
|
29886
|
+
]);
|
29887
|
+
|
29655
29888
|
// lib/use-modifier-held.ts
|
29656
29889
|
init_react_import();
|
29657
|
-
var
|
29890
|
+
var import_react6 = require("react");
|
29658
29891
|
var useModifierHeld = (modifier) => {
|
29659
|
-
const [modifierHeld, setModifierHeld] = (0,
|
29660
|
-
(0,
|
29892
|
+
const [modifierHeld, setModifierHeld] = (0, import_react6.useState)(false);
|
29893
|
+
(0, import_react6.useEffect)(() => {
|
29661
29894
|
function downHandler({ key }) {
|
29662
29895
|
if (key === modifier) {
|
29663
29896
|
setModifierHeld(true);
|
@@ -29680,8 +29913,12 @@ var useModifierHeld = (modifier) => {
|
|
29680
29913
|
|
29681
29914
|
// components/DraggableComponent/index.tsx
|
29682
29915
|
var import_react_spinners2 = require("react-spinners");
|
29683
|
-
var
|
29684
|
-
var getClassName4 = get_class_name_factory_default("DraggableComponent",
|
29916
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
29917
|
+
var getClassName4 = get_class_name_factory_default("DraggableComponent", styles_default3);
|
29918
|
+
var space = 8;
|
29919
|
+
var actionsOverlayTop = space * 6.5;
|
29920
|
+
var actionsTop = -(actionsOverlayTop - 8);
|
29921
|
+
var actionsRight = space;
|
29685
29922
|
var DraggableComponent = ({
|
29686
29923
|
children,
|
29687
29924
|
id,
|
@@ -29704,91 +29941,87 @@ var DraggableComponent = ({
|
|
29704
29941
|
indicativeHover = false,
|
29705
29942
|
style
|
29706
29943
|
}) => {
|
29944
|
+
const { zoomConfig } = useAppContext();
|
29707
29945
|
const isModifierHeld = useModifierHeld("Alt");
|
29708
|
-
|
29709
|
-
|
29710
|
-
|
29711
|
-
|
29712
|
-
|
29713
|
-
|
29714
|
-
|
29715
|
-
|
29716
|
-
|
29717
|
-
|
29718
|
-
|
29719
|
-
|
29720
|
-
|
29721
|
-
|
29722
|
-
|
29723
|
-
|
29724
|
-
|
29725
|
-
|
29726
|
-
|
29727
|
-
|
29728
|
-
|
29729
|
-
|
29730
|
-
|
29731
|
-
|
29732
|
-
|
29733
|
-
|
29734
|
-
|
29735
|
-
|
29736
|
-
|
29737
|
-
|
29738
|
-
|
29739
|
-
|
29740
|
-
|
29741
|
-
|
29742
|
-
|
29743
|
-
|
29744
|
-
|
29745
|
-
|
29746
|
-
|
29747
|
-
|
29748
|
-
|
29749
|
-
|
29750
|
-
|
29751
|
-
|
29752
|
-
|
29753
|
-
|
29754
|
-
|
29755
|
-
|
29756
|
-
|
29757
|
-
|
29758
|
-
|
29759
|
-
|
29760
|
-
|
29761
|
-
|
29762
|
-
|
29763
|
-
|
29764
|
-
|
29765
|
-
var setupZone = (data, zoneKey) => {
|
29766
|
-
if (zoneKey === rootDroppableId) {
|
29767
|
-
return data;
|
29768
|
-
}
|
29769
|
-
const newData = __spreadValues({}, data);
|
29770
|
-
newData.zones = data.zones || {};
|
29771
|
-
newData.zones[zoneKey] = newData.zones[zoneKey] || [];
|
29772
|
-
return newData;
|
29946
|
+
const { status } = useAppContext();
|
29947
|
+
const El = status !== "LOADING" ? import_dnd3.Draggable : DefaultDraggable;
|
29948
|
+
(0, import_react7.useEffect)(onMount, []);
|
29949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(El, { draggableId: id, index, isDragDisabled, children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
29950
|
+
"div",
|
29951
|
+
__spreadProps(__spreadValues(__spreadValues({
|
29952
|
+
ref: provided.innerRef
|
29953
|
+
}, provided.draggableProps), provided.dragHandleProps), {
|
29954
|
+
className: getClassName4({
|
29955
|
+
isSelected,
|
29956
|
+
isModifierHeld,
|
29957
|
+
isDragging: snapshot.isDragging,
|
29958
|
+
isLocked,
|
29959
|
+
forceHover,
|
29960
|
+
indicativeHover
|
29961
|
+
}),
|
29962
|
+
style: __spreadProps(__spreadValues(__spreadValues({}, style), provided.draggableProps.style), {
|
29963
|
+
cursor: isModifierHeld ? "initial" : "grab"
|
29964
|
+
}),
|
29965
|
+
onMouseOver,
|
29966
|
+
onMouseOut,
|
29967
|
+
onMouseDown,
|
29968
|
+
onMouseUp,
|
29969
|
+
onClick,
|
29970
|
+
children: [
|
29971
|
+
debug,
|
29972
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassName4("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_spinners2.ClipLoader, { "aria-label": "loading", size: 16, color: "inherit" }) }),
|
29973
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
29974
|
+
"div",
|
29975
|
+
{
|
29976
|
+
className: getClassName4("actionsOverlay"),
|
29977
|
+
style: {
|
29978
|
+
top: actionsOverlayTop / zoomConfig.zoom
|
29979
|
+
},
|
29980
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
29981
|
+
"div",
|
29982
|
+
{
|
29983
|
+
className: getClassName4("actions"),
|
29984
|
+
style: {
|
29985
|
+
transform: `scale(${1 / zoomConfig.zoom}`,
|
29986
|
+
top: actionsTop / zoomConfig.zoom,
|
29987
|
+
right: actionsRight / zoomConfig.zoom
|
29988
|
+
},
|
29989
|
+
children: [
|
29990
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassName4("actionsLabel"), children: label }),
|
29991
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { className: getClassName4("action"), onClick: onDuplicate, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Copy, { size: 16 }) }),
|
29992
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { className: getClassName4("action"), onClick: onDelete, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Trash, { size: 16 }) })
|
29993
|
+
]
|
29994
|
+
}
|
29995
|
+
)
|
29996
|
+
}
|
29997
|
+
),
|
29998
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassName4("overlay") }),
|
29999
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassName4("contents"), children })
|
30000
|
+
]
|
30001
|
+
})
|
30002
|
+
) }, id);
|
29773
30003
|
};
|
29774
30004
|
|
29775
|
-
//
|
29776
|
-
var
|
29777
|
-
|
29778
|
-
|
29779
|
-
|
29780
|
-
|
29781
|
-
|
29782
|
-
|
30005
|
+
// components/DropZone/styles.module.css
|
30006
|
+
var styles_default4 = {
|
30007
|
+
DropZone: "styles_DropZone",
|
30008
|
+
"DropZone-content": "styles_DropZone-content",
|
30009
|
+
"DropZone--userIsDragging": "styles_DropZone--userIsDragging",
|
30010
|
+
"DropZone--draggingOverArea": "styles_DropZone--draggingOverArea",
|
30011
|
+
"DropZone--draggingNewComponent": "styles_DropZone--draggingNewComponent",
|
30012
|
+
"DropZone--isAreaSelected": "styles_DropZone--isAreaSelected",
|
30013
|
+
"DropZone--hoveringOverArea": "styles_DropZone--hoveringOverArea",
|
30014
|
+
"DropZone--isDisabled": "styles_DropZone--isDisabled",
|
30015
|
+
"DropZone--isRootZone": "styles_DropZone--isRootZone",
|
30016
|
+
"DropZone--hasChildren": "styles_DropZone--hasChildren",
|
30017
|
+
"DropZone--isDestination": "styles_DropZone--isDestination",
|
30018
|
+
"DropZone-item": "styles_DropZone-item",
|
30019
|
+
"DropZone-hitbox": "styles_DropZone-hitbox"
|
29783
30020
|
};
|
29784
30021
|
|
29785
|
-
// css-module:/home/runner/work/puck/puck/packages/core/components/DropZone/styles.module.css#css-module
|
29786
|
-
init_react_import();
|
29787
|
-
var styles_module_default4 = { "DropZone": "_DropZone_utidm_1", "DropZone--zoomEnabled": "_DropZone--zoomEnabled_utidm_10", "DropZone-renderWrapper": "_DropZone-renderWrapper_utidm_14", "DropZone-content": "_DropZone-content_utidm_18", "DropZone--userIsDragging": "_DropZone--userIsDragging_utidm_23", "DropZone--draggingOverArea": "_DropZone--draggingOverArea_utidm_27", "DropZone--draggingNewComponent": "_DropZone--draggingNewComponent_utidm_28", "DropZone--isAreaSelected": "_DropZone--isAreaSelected_utidm_34", "DropZone--hoveringOverArea": "_DropZone--hoveringOverArea_utidm_35", "DropZone--isDisabled": "_DropZone--isDisabled_utidm_36", "DropZone--isRootZone": "_DropZone--isRootZone_utidm_37", "DropZone--hasChildren": "_DropZone--hasChildren_utidm_43", "DropZone--isDestination": "_DropZone--isDestination_utidm_48", "DropZone-item": "_DropZone-item_utidm_56", "DropZone-hitbox": "_DropZone-hitbox_utidm_60" };
|
29788
|
-
|
29789
30022
|
// components/DropZone/context.tsx
|
29790
30023
|
init_react_import();
|
29791
|
-
var
|
30024
|
+
var import_react8 = require("react");
|
29792
30025
|
var import_use_debounce = require("use-debounce");
|
29793
30026
|
|
29794
30027
|
// lib/get-zone-id.ts
|
@@ -29804,30 +30037,30 @@ var getZoneId = (zoneCompound) => {
|
|
29804
30037
|
};
|
29805
30038
|
|
29806
30039
|
// components/DropZone/context.tsx
|
29807
|
-
var
|
29808
|
-
var dropZoneContext = (0,
|
30040
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
30041
|
+
var dropZoneContext = (0, import_react8.createContext)(null);
|
29809
30042
|
var DropZoneProvider = ({
|
29810
30043
|
children,
|
29811
30044
|
value
|
29812
30045
|
}) => {
|
29813
|
-
const [hoveringArea, setHoveringArea] = (0,
|
29814
|
-
const [hoveringZone, setHoveringZone] = (0,
|
30046
|
+
const [hoveringArea, setHoveringArea] = (0, import_react8.useState)(null);
|
30047
|
+
const [hoveringZone, setHoveringZone] = (0, import_react8.useState)(
|
29815
30048
|
rootDroppableId
|
29816
30049
|
);
|
29817
|
-
const [hoveringComponent, setHoveringComponent] = (0,
|
30050
|
+
const [hoveringComponent, setHoveringComponent] = (0, import_react8.useState)();
|
29818
30051
|
const [hoveringAreaDb] = (0, import_use_debounce.useDebounce)(hoveringArea, 75, { leading: false });
|
29819
|
-
const [areasWithZones, setAreasWithZones] = (0,
|
30052
|
+
const [areasWithZones, setAreasWithZones] = (0, import_react8.useState)(
|
29820
30053
|
{}
|
29821
30054
|
);
|
29822
|
-
const [activeZones, setActiveZones] = (0,
|
30055
|
+
const [activeZones, setActiveZones] = (0, import_react8.useState)({});
|
29823
30056
|
const { dispatch = null } = value ? value : {};
|
29824
|
-
const registerZoneArea = (0,
|
30057
|
+
const registerZoneArea = (0, import_react8.useCallback)(
|
29825
30058
|
(area) => {
|
29826
30059
|
setAreasWithZones((latest) => __spreadProps(__spreadValues({}, latest), { [area]: true }));
|
29827
30060
|
},
|
29828
30061
|
[setAreasWithZones]
|
29829
30062
|
);
|
29830
|
-
const registerZone = (0,
|
30063
|
+
const registerZone = (0, import_react8.useCallback)(
|
29831
30064
|
(zoneCompound) => {
|
29832
30065
|
if (!dispatch) {
|
29833
30066
|
return;
|
@@ -29840,7 +30073,7 @@ var DropZoneProvider = ({
|
|
29840
30073
|
},
|
29841
30074
|
[setActiveZones, dispatch]
|
29842
30075
|
);
|
29843
|
-
const unregisterZone = (0,
|
30076
|
+
const unregisterZone = (0, import_react8.useCallback)(
|
29844
30077
|
(zoneCompound) => {
|
29845
30078
|
if (!dispatch) {
|
29846
30079
|
return;
|
@@ -29855,8 +30088,8 @@ var DropZoneProvider = ({
|
|
29855
30088
|
},
|
29856
30089
|
[setActiveZones, dispatch]
|
29857
30090
|
);
|
29858
|
-
const [pathData, setPathData] = (0,
|
29859
|
-
const registerPath = (0,
|
30091
|
+
const [pathData, setPathData] = (0, import_react8.useState)();
|
30092
|
+
const registerPath = (0, import_react8.useCallback)(
|
29860
30093
|
(selector) => {
|
29861
30094
|
if (!(value == null ? void 0 : value.data)) {
|
29862
30095
|
return;
|
@@ -29881,7 +30114,8 @@ var DropZoneProvider = ({
|
|
29881
30114
|
},
|
29882
30115
|
[value, setPathData]
|
29883
30116
|
);
|
29884
|
-
|
30117
|
+
const [zoneWillDrag, setZoneWillDrag] = (0, import_react8.useState)("");
|
30118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: value && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
29885
30119
|
dropZoneContext.Provider,
|
29886
30120
|
{
|
29887
30121
|
value: __spreadValues({
|
@@ -29897,58 +30131,18 @@ var DropZoneProvider = ({
|
|
29897
30131
|
unregisterZone,
|
29898
30132
|
activeZones,
|
29899
30133
|
registerPath,
|
29900
|
-
pathData
|
30134
|
+
pathData,
|
30135
|
+
zoneWillDrag,
|
30136
|
+
setZoneWillDrag
|
29901
30137
|
}, value),
|
29902
30138
|
children
|
29903
30139
|
}
|
29904
30140
|
) });
|
29905
30141
|
};
|
29906
30142
|
|
29907
|
-
// components/Puck/context.tsx
|
29908
|
-
init_react_import();
|
29909
|
-
var import_react8 = require("react");
|
29910
|
-
var defaultAppState = {
|
29911
|
-
data: { content: [], root: { props: { title: "" } } },
|
29912
|
-
ui: {
|
29913
|
-
leftSideBarVisible: true,
|
29914
|
-
rightSideBarVisible: true,
|
29915
|
-
arrayState: {},
|
29916
|
-
itemSelector: null,
|
29917
|
-
componentList: {},
|
29918
|
-
isDragging: false
|
29919
|
-
}
|
29920
|
-
};
|
29921
|
-
var appContext = (0, import_react8.createContext)({
|
29922
|
-
state: defaultAppState,
|
29923
|
-
dispatch: () => null,
|
29924
|
-
config: { components: {} },
|
29925
|
-
componentState: {},
|
29926
|
-
resolveData: () => {
|
29927
|
-
},
|
29928
|
-
plugins: [],
|
29929
|
-
overrides: {},
|
29930
|
-
history: {}
|
29931
|
-
});
|
29932
|
-
var AppProvider = appContext.Provider;
|
29933
|
-
function useAppContext() {
|
29934
|
-
const mainContext = (0, import_react8.useContext)(appContext);
|
29935
|
-
const selectedItem = mainContext.state.ui.itemSelector ? getItem(mainContext.state.ui.itemSelector, mainContext.state.data) : void 0;
|
29936
|
-
return __spreadProps(__spreadValues({}, mainContext), {
|
29937
|
-
// Helpers
|
29938
|
-
selectedItem,
|
29939
|
-
setUi: (ui, recordHistory) => {
|
29940
|
-
return mainContext.dispatch({
|
29941
|
-
type: "setUi",
|
29942
|
-
ui,
|
29943
|
-
recordHistory
|
29944
|
-
});
|
29945
|
-
}
|
29946
|
-
});
|
29947
|
-
}
|
29948
|
-
|
29949
30143
|
// components/DropZone/index.tsx
|
29950
|
-
var
|
29951
|
-
var getClassName5 = get_class_name_factory_default("DropZone",
|
30144
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
30145
|
+
var getClassName5 = get_class_name_factory_default("DropZone", styles_default4);
|
29952
30146
|
function DropZoneEdit({ zone, allow, disallow, style }) {
|
29953
30147
|
var _a;
|
29954
30148
|
const appContext2 = useAppContext();
|
@@ -29966,7 +30160,8 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
29966
30160
|
registerZoneArea,
|
29967
30161
|
areasWithZones,
|
29968
30162
|
hoveringComponent,
|
29969
|
-
|
30163
|
+
zoneWillDrag,
|
30164
|
+
setZoneWillDrag = () => null
|
29970
30165
|
} = ctx || {};
|
29971
30166
|
let content = data.content || [];
|
29972
30167
|
let zoneCompound = rootDroppableId;
|
@@ -29996,12 +30191,12 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
29996
30191
|
const draggedDestinationId = draggedItem && ((_a = draggedItem.destination) == null ? void 0 : _a.droppableId);
|
29997
30192
|
const [zoneArea] = getZoneId(zoneCompound);
|
29998
30193
|
const [draggedSourceArea] = getZoneId(draggedSourceId);
|
29999
|
-
const
|
30194
|
+
const userWillDrag = zoneWillDrag === zone;
|
30000
30195
|
const userIsDragging = !!draggedItem;
|
30001
30196
|
const draggingOverArea = userIsDragging && zoneArea === draggedSourceArea;
|
30002
30197
|
const draggingNewComponent = draggedSourceId == null ? void 0 : draggedSourceId.startsWith("component-list");
|
30003
30198
|
if (!(ctx == null ? void 0 : ctx.config) || !ctx.setHoveringArea || !ctx.setHoveringZone || !ctx.setHoveringComponent || !ctx.setItemSelector || !ctx.registerPath || !ctx.dispatch) {
|
30004
|
-
return /* @__PURE__ */ (0,
|
30199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: "DropZone requires context to work." });
|
30005
30200
|
}
|
30006
30201
|
const {
|
30007
30202
|
hoveringArea = "root",
|
@@ -30038,7 +30233,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30038
30233
|
}
|
30039
30234
|
const selectedItem = itemSelector ? getItem(itemSelector, data) : null;
|
30040
30235
|
const isAreaSelected = selectedItem && zoneArea === selectedItem.props.id;
|
30041
|
-
return /* @__PURE__ */ (0,
|
30236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
30042
30237
|
"div",
|
30043
30238
|
{
|
30044
30239
|
className: getClassName5({
|
@@ -30050,17 +30245,19 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30050
30245
|
isDestination: draggedDestinationId === zoneCompound,
|
30051
30246
|
isDisabled: !isEnabled,
|
30052
30247
|
isAreaSelected,
|
30053
|
-
hasChildren: content.length > 0
|
30054
|
-
zoomEnabled: !disableZoom
|
30248
|
+
hasChildren: content.length > 0
|
30055
30249
|
}),
|
30056
|
-
|
30057
|
-
|
30250
|
+
onMouseUp: () => {
|
30251
|
+
setZoneWillDrag("");
|
30252
|
+
},
|
30253
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
30254
|
+
Droppable,
|
30058
30255
|
{
|
30059
30256
|
droppableId: zoneCompound,
|
30060
30257
|
direction: "vertical",
|
30061
30258
|
isDropDisabled: !isEnabled,
|
30062
30259
|
children: (provided, snapshot) => {
|
30063
|
-
return /* @__PURE__ */ (0,
|
30260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
30064
30261
|
"div",
|
30065
30262
|
__spreadProps(__spreadValues({}, (provided || { droppableProps: {} }).droppableProps), {
|
30066
30263
|
className: getClassName5("content"),
|
@@ -30074,7 +30271,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30074
30271
|
},
|
30075
30272
|
children: [
|
30076
30273
|
content.map((item, i) => {
|
30077
|
-
var _a2, _b;
|
30274
|
+
var _a2, _b, _c;
|
30078
30275
|
const componentId = item.props.id;
|
30079
30276
|
const defaultedProps = __spreadProps(__spreadValues(__spreadValues({}, (_a2 = config.components[item.type]) == null ? void 0 : _a2.defaultProps), item.props), {
|
30080
30277
|
puck: { renderDropZone: DropZone },
|
@@ -30085,33 +30282,33 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30085
30282
|
"draggable-"
|
30086
30283
|
)[1] === componentId;
|
30087
30284
|
const containsZone = areasWithZones ? areasWithZones[componentId] : false;
|
30088
|
-
const Render2 = config.components[item.type] ? config.components[item.type].render : () => /* @__PURE__ */ (0,
|
30285
|
+
const Render2 = config.components[item.type] ? config.components[item.type].render : () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { padding: 48, textAlign: "center" }, children: [
|
30089
30286
|
"No configuration for ",
|
30090
30287
|
item.type
|
30091
30288
|
] });
|
30092
|
-
return /* @__PURE__ */ (0,
|
30289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
30093
30290
|
"div",
|
30094
30291
|
{
|
30095
30292
|
className: getClassName5("item"),
|
30096
30293
|
style: { zIndex: isDragging ? 1 : void 0 },
|
30097
30294
|
children: [
|
30098
|
-
/* @__PURE__ */ (0,
|
30295
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
30099
30296
|
DropZoneProvider,
|
30100
30297
|
{
|
30101
30298
|
value: __spreadProps(__spreadValues({}, ctx), {
|
30102
30299
|
areaId: componentId
|
30103
30300
|
}),
|
30104
|
-
children: /* @__PURE__ */ (0,
|
30301
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
30105
30302
|
DraggableComponent,
|
30106
30303
|
{
|
30107
|
-
label: item.type.toString(),
|
30304
|
+
label: (_b = config.components[item.type]["label"]) != null ? _b : item.type.toString(),
|
30108
30305
|
id: `draggable-${componentId}`,
|
30109
30306
|
index: i,
|
30110
30307
|
isSelected,
|
30111
30308
|
isLocked: userIsDragging,
|
30112
30309
|
forceHover: hoveringComponent === componentId && !userIsDragging,
|
30113
30310
|
indicativeHover: userIsDragging && containsZone && hoveringArea === componentId,
|
30114
|
-
isLoading: (
|
30311
|
+
isLoading: (_c = appContext2.componentState[componentId]) == null ? void 0 : _c.loading,
|
30115
30312
|
onMount: () => {
|
30116
30313
|
ctx.registerPath({
|
30117
30314
|
index: i,
|
@@ -30127,11 +30324,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30127
30324
|
},
|
30128
30325
|
onMouseDown: (e) => {
|
30129
30326
|
e.stopPropagation();
|
30130
|
-
|
30131
|
-
},
|
30132
|
-
onMouseUp: (e) => {
|
30133
|
-
e.stopPropagation();
|
30134
|
-
setUserWillDrag(false);
|
30327
|
+
setZoneWillDrag(zone);
|
30135
30328
|
},
|
30136
30329
|
onMouseOver: (e) => {
|
30137
30330
|
e.stopPropagation();
|
@@ -30172,12 +30365,12 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30172
30365
|
style: {
|
30173
30366
|
pointerEvents: userIsDragging && draggingNewComponent ? "all" : void 0
|
30174
30367
|
},
|
30175
|
-
children: /* @__PURE__ */ (0,
|
30368
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassName5("renderWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Render2, __spreadValues({}, defaultedProps)) })
|
30176
30369
|
}
|
30177
30370
|
)
|
30178
30371
|
}
|
30179
30372
|
),
|
30180
|
-
userIsDragging && /* @__PURE__ */ (0,
|
30373
|
+
userIsDragging && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
30181
30374
|
"div",
|
30182
30375
|
{
|
30183
30376
|
className: getClassName5("hitbox"),
|
@@ -30194,7 +30387,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30194
30387
|
);
|
30195
30388
|
}),
|
30196
30389
|
provided == null ? void 0 : provided.placeholder,
|
30197
|
-
(snapshot == null ? void 0 : snapshot.isDraggingOver) && /* @__PURE__ */ (0,
|
30390
|
+
(snapshot == null ? void 0 : snapshot.isDraggingOver) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
30198
30391
|
"div",
|
30199
30392
|
{
|
30200
30393
|
"data-puck-placeholder": true,
|
@@ -30226,14 +30419,14 @@ function DropZoneRender({ zone }) {
|
|
30226
30419
|
zoneCompound = `${areaId}:${zone}`;
|
30227
30420
|
content = setupZone(data, zoneCompound).zones[zoneCompound];
|
30228
30421
|
}
|
30229
|
-
return /* @__PURE__ */ (0,
|
30422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: content.map((item) => {
|
30230
30423
|
const Component = config.components[item.type];
|
30231
30424
|
if (Component) {
|
30232
|
-
return /* @__PURE__ */ (0,
|
30425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
30233
30426
|
DropZoneProvider,
|
30234
30427
|
{
|
30235
30428
|
value: { data, config, areaId: item.props.id },
|
30236
|
-
children: /* @__PURE__ */ (0,
|
30429
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
30237
30430
|
Component.render,
|
30238
30431
|
__spreadProps(__spreadValues({}, item.props), {
|
30239
30432
|
puck: { renderDropZone: DropZone }
|
@@ -30249,9 +30442,9 @@ function DropZoneRender({ zone }) {
|
|
30249
30442
|
function DropZone(props) {
|
30250
30443
|
const ctx = (0, import_react9.useContext)(dropZoneContext);
|
30251
30444
|
if ((ctx == null ? void 0 : ctx.mode) === "edit") {
|
30252
|
-
return /* @__PURE__ */ (0,
|
30445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DropZoneEdit, __spreadValues({}, props));
|
30253
30446
|
}
|
30254
|
-
return /* @__PURE__ */ (0,
|
30447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DropZoneRender, __spreadValues({}, props));
|
30255
30448
|
}
|
30256
30449
|
|
30257
30450
|
// components/IconButton/index.ts
|
@@ -30261,14 +30454,17 @@ init_react_import();
|
|
30261
30454
|
init_react_import();
|
30262
30455
|
var import_react10 = require("react");
|
30263
30456
|
|
30264
|
-
//
|
30265
|
-
|
30266
|
-
|
30457
|
+
// components/IconButton/IconButton.module.css
|
30458
|
+
var IconButton_default = {
|
30459
|
+
IconButton: "IconButton_IconButton",
|
30460
|
+
"IconButton--disabled": "IconButton_IconButton--disabled",
|
30461
|
+
"IconButton-title": "IconButton_IconButton-title"
|
30462
|
+
};
|
30267
30463
|
|
30268
30464
|
// components/IconButton/IconButton.tsx
|
30269
30465
|
var import_react_spinners3 = require("react-spinners");
|
30270
|
-
var
|
30271
|
-
var getClassName6 = get_class_name_factory_default("IconButton",
|
30466
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
30467
|
+
var getClassName6 = get_class_name_factory_default("IconButton", IconButton_default);
|
30272
30468
|
var IconButton = ({
|
30273
30469
|
children,
|
30274
30470
|
href,
|
@@ -30283,7 +30479,7 @@ var IconButton = ({
|
|
30283
30479
|
}) => {
|
30284
30480
|
const [loading, setLoading] = (0, import_react10.useState)(false);
|
30285
30481
|
const ElementType = href ? "a" : "button";
|
30286
|
-
const el = /* @__PURE__ */ (0,
|
30482
|
+
const el = /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
30287
30483
|
ElementType,
|
30288
30484
|
{
|
30289
30485
|
className: getClassName6({
|
@@ -30308,11 +30504,11 @@ var IconButton = ({
|
|
30308
30504
|
href,
|
30309
30505
|
title,
|
30310
30506
|
children: [
|
30311
|
-
/* @__PURE__ */ (0,
|
30507
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: getClassName6("title"), children: title }),
|
30312
30508
|
children,
|
30313
|
-
loading && /* @__PURE__ */ (0,
|
30509
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
30314
30510
|
"\xA0\xA0",
|
30315
|
-
/* @__PURE__ */ (0,
|
30511
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_spinners3.ClipLoader, { "aria-label": "Loading", color: "inherit", size: "14px" })
|
30316
30512
|
] })
|
30317
30513
|
]
|
30318
30514
|
}
|
@@ -30322,12 +30518,23 @@ var IconButton = ({
|
|
30322
30518
|
|
30323
30519
|
// components/Puck/index.tsx
|
30324
30520
|
init_react_import();
|
30325
|
-
var
|
30326
|
-
var import_dnd7 = require("@hello-pangea/dnd");
|
30521
|
+
var import_react28 = require("react");
|
30327
30522
|
|
30328
30523
|
// lib/use-placeholder-style.ts
|
30329
30524
|
init_react_import();
|
30330
30525
|
var import_react11 = require("react");
|
30526
|
+
|
30527
|
+
// lib/get-frame.ts
|
30528
|
+
init_react_import();
|
30529
|
+
var getFrame = () => {
|
30530
|
+
let frame = document.querySelector("#preview-frame");
|
30531
|
+
if ((frame == null ? void 0 : frame.tagName) === "IFRAME") {
|
30532
|
+
frame = frame.contentDocument;
|
30533
|
+
}
|
30534
|
+
return frame;
|
30535
|
+
};
|
30536
|
+
|
30537
|
+
// lib/use-placeholder-style.ts
|
30331
30538
|
var usePlaceholderStyle = () => {
|
30332
30539
|
const queryAttr = "data-rfd-drag-handle-draggable-id";
|
30333
30540
|
const [placeholderStyle, setPlaceholderStyle] = (0, import_react11.useState)();
|
@@ -30337,11 +30544,12 @@ var usePlaceholderStyle = () => {
|
|
30337
30544
|
const destinationIndex = (draggedItem.destination || draggedItem.source).index;
|
30338
30545
|
const droppableId = (draggedItem.destination || draggedItem.source).droppableId;
|
30339
30546
|
const domQuery = `[${queryAttr}='${draggableId}']`;
|
30340
|
-
const
|
30547
|
+
const frame = getFrame();
|
30548
|
+
const draggedDOM = document.querySelector(domQuery) || (frame == null ? void 0 : frame.querySelector(domQuery));
|
30341
30549
|
if (!draggedDOM) {
|
30342
30550
|
return;
|
30343
30551
|
}
|
30344
|
-
const targetListElement =
|
30552
|
+
const targetListElement = frame == null ? void 0 : frame.querySelector(
|
30345
30553
|
`[data-rfd-droppable-id='${droppableId}']`
|
30346
30554
|
);
|
30347
30555
|
const { clientHeight } = draggedDOM;
|
@@ -30376,23 +30584,42 @@ var usePlaceholderStyle = () => {
|
|
30376
30584
|
// components/SidebarSection/index.tsx
|
30377
30585
|
init_react_import();
|
30378
30586
|
|
30379
|
-
//
|
30380
|
-
|
30381
|
-
|
30587
|
+
// components/SidebarSection/styles.module.css
|
30588
|
+
var styles_default5 = {
|
30589
|
+
SidebarSection: "styles_SidebarSection",
|
30590
|
+
"SidebarSection-title": "styles_SidebarSection-title",
|
30591
|
+
"SidebarSection--noBorderTop": "styles_SidebarSection--noBorderTop",
|
30592
|
+
"SidebarSection-content": "styles_SidebarSection-content",
|
30593
|
+
"SidebarSection--noPadding": "styles_SidebarSection--noPadding",
|
30594
|
+
"SidebarSection-breadcrumbLabel": "styles_SidebarSection-breadcrumbLabel",
|
30595
|
+
"SidebarSection-breadcrumbs": "styles_SidebarSection-breadcrumbs",
|
30596
|
+
"SidebarSection-breadcrumb": "styles_SidebarSection-breadcrumb",
|
30597
|
+
"SidebarSection-heading": "styles_SidebarSection-heading",
|
30598
|
+
"SidebarSection-loadingOverlay": "styles_SidebarSection-loadingOverlay"
|
30599
|
+
};
|
30382
30600
|
|
30383
30601
|
// components/Heading/index.tsx
|
30384
30602
|
init_react_import();
|
30385
30603
|
|
30386
|
-
//
|
30387
|
-
|
30388
|
-
|
30604
|
+
// components/Heading/styles.module.css
|
30605
|
+
var styles_default6 = {
|
30606
|
+
Heading: "styles_Heading",
|
30607
|
+
"Heading--xxxxl": "styles_Heading--xxxxl",
|
30608
|
+
"Heading--xxxl": "styles_Heading--xxxl",
|
30609
|
+
"Heading--xxl": "styles_Heading--xxl",
|
30610
|
+
"Heading--xl": "styles_Heading--xl",
|
30611
|
+
"Heading--l": "styles_Heading--l",
|
30612
|
+
"Heading--m": "styles_Heading--m",
|
30613
|
+
"Heading--s": "styles_Heading--s",
|
30614
|
+
"Heading--xs": "styles_Heading--xs"
|
30615
|
+
};
|
30389
30616
|
|
30390
30617
|
// components/Heading/index.tsx
|
30391
|
-
var
|
30392
|
-
var getClassName7 = get_class_name_factory_default("Heading",
|
30618
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
30619
|
+
var getClassName7 = get_class_name_factory_default("Heading", styles_default6);
|
30393
30620
|
var Heading = ({ children, rank, size = "m" }) => {
|
30394
30621
|
const Tag = rank ? `h${rank}` : "span";
|
30395
|
-
return /* @__PURE__ */ (0,
|
30622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
30396
30623
|
Tag,
|
30397
30624
|
{
|
30398
30625
|
className: getClassName7({
|
@@ -30471,8 +30698,8 @@ var useBreadcrumbs = (renderCount) => {
|
|
30471
30698
|
|
30472
30699
|
// components/SidebarSection/index.tsx
|
30473
30700
|
var import_react_spinners4 = require("react-spinners");
|
30474
|
-
var
|
30475
|
-
var getClassName8 = get_class_name_factory_default("SidebarSection",
|
30701
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
30702
|
+
var getClassName8 = get_class_name_factory_default("SidebarSection", styles_default5);
|
30476
30703
|
var SidebarSection = ({
|
30477
30704
|
children,
|
30478
30705
|
title,
|
@@ -30484,15 +30711,15 @@ var SidebarSection = ({
|
|
30484
30711
|
}) => {
|
30485
30712
|
const { setUi } = useAppContext();
|
30486
30713
|
const breadcrumbs = useBreadcrumbs(1);
|
30487
|
-
return /* @__PURE__ */ (0,
|
30714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
30488
30715
|
"div",
|
30489
30716
|
{
|
30490
30717
|
className: getClassName8({ noBorderTop, noPadding }),
|
30491
30718
|
style: { background },
|
30492
30719
|
children: [
|
30493
|
-
/* @__PURE__ */ (0,
|
30494
|
-
showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0,
|
30495
|
-
/* @__PURE__ */ (0,
|
30720
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassName8("title"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: getClassName8("breadcrumbs"), children: [
|
30721
|
+
showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: getClassName8("breadcrumb"), children: [
|
30722
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
30496
30723
|
"button",
|
30497
30724
|
{
|
30498
30725
|
className: getClassName8("breadcrumbLabel"),
|
@@ -30500,12 +30727,12 @@ var SidebarSection = ({
|
|
30500
30727
|
children: breadcrumb.label
|
30501
30728
|
}
|
30502
30729
|
),
|
30503
|
-
/* @__PURE__ */ (0,
|
30730
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChevronRight, { size: 16 })
|
30504
30731
|
] }, i)) : null,
|
30505
|
-
/* @__PURE__ */ (0,
|
30732
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassName8("heading"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Heading, { rank: 2, size: "xs", children: title }) })
|
30506
30733
|
] }) }),
|
30507
|
-
/* @__PURE__ */ (0,
|
30508
|
-
isLoading && /* @__PURE__ */ (0,
|
30734
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassName8("content"), children }),
|
30735
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassName8("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_spinners4.ClipLoader, { "aria-label": "loading" }) })
|
30509
30736
|
]
|
30510
30737
|
}
|
30511
30738
|
);
|
@@ -31082,13 +31309,17 @@ var useResolvedData = (appState, config, dispatch) => {
|
|
31082
31309
|
// components/MenuBar/index.tsx
|
31083
31310
|
init_react_import();
|
31084
31311
|
|
31085
|
-
//
|
31086
|
-
|
31087
|
-
|
31312
|
+
// components/MenuBar/styles.module.css
|
31313
|
+
var styles_default7 = {
|
31314
|
+
MenuBar: "styles_MenuBar",
|
31315
|
+
"MenuBar--menuOpen": "styles_MenuBar--menuOpen",
|
31316
|
+
"MenuBar-inner": "styles_MenuBar-inner",
|
31317
|
+
"MenuBar-history": "styles_MenuBar-history"
|
31318
|
+
};
|
31088
31319
|
|
31089
31320
|
// components/MenuBar/index.tsx
|
31090
|
-
var
|
31091
|
-
var getClassName9 = get_class_name_factory_default("MenuBar",
|
31321
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
31322
|
+
var getClassName9 = get_class_name_factory_default("MenuBar", styles_default7);
|
31092
31323
|
var MenuBar = ({
|
31093
31324
|
appState,
|
31094
31325
|
data = { content: [], root: { props: { title: "" } } },
|
@@ -31102,7 +31333,7 @@ var MenuBar = ({
|
|
31102
31333
|
history: { back, forward, historyStore }
|
31103
31334
|
} = useAppContext();
|
31104
31335
|
const { hasFuture = false, hasPast = false } = historyStore || {};
|
31105
|
-
return /* @__PURE__ */ (0,
|
31336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
31106
31337
|
"div",
|
31107
31338
|
{
|
31108
31339
|
className: getClassName9({ menuOpen }),
|
@@ -31116,16 +31347,16 @@ var MenuBar = ({
|
|
31116
31347
|
setMenuOpen(false);
|
31117
31348
|
}
|
31118
31349
|
},
|
31119
|
-
children: /* @__PURE__ */ (0,
|
31120
|
-
/* @__PURE__ */ (0,
|
31121
|
-
/* @__PURE__ */ (0,
|
31350
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: getClassName9("inner"), children: [
|
31351
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: getClassName9("history"), children: [
|
31352
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconButton, { title: "undo", disabled: !hasPast, onClick: back, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
31122
31353
|
ChevronLeft,
|
31123
31354
|
{
|
31124
31355
|
size: 21,
|
31125
31356
|
stroke: hasPast ? "var(--puck-color-black)" : "var(--puck-color-grey-08)"
|
31126
31357
|
}
|
31127
31358
|
) }),
|
31128
|
-
/* @__PURE__ */ (0,
|
31359
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconButton, { title: "redo", disabled: !hasFuture, onClick: forward, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
31129
31360
|
ChevronRight,
|
31130
31361
|
{
|
31131
31362
|
size: 21,
|
@@ -31133,17 +31364,17 @@ var MenuBar = ({
|
|
31133
31364
|
}
|
31134
31365
|
) })
|
31135
31366
|
] }),
|
31136
|
-
/* @__PURE__ */ (0,
|
31367
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: renderHeaderActions && renderHeaderActions({
|
31137
31368
|
state: appState,
|
31138
31369
|
dispatch
|
31139
31370
|
}) }),
|
31140
|
-
/* @__PURE__ */ (0,
|
31371
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
31141
31372
|
Button,
|
31142
31373
|
{
|
31143
31374
|
onClick: () => {
|
31144
31375
|
onPublish && onPublish(data);
|
31145
31376
|
},
|
31146
|
-
icon: /* @__PURE__ */ (0,
|
31377
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Globe, { size: "14px" }),
|
31147
31378
|
children: "Publish"
|
31148
31379
|
}
|
31149
31380
|
) })
|
@@ -31152,9 +31383,24 @@ var MenuBar = ({
|
|
31152
31383
|
);
|
31153
31384
|
};
|
31154
31385
|
|
31155
|
-
//
|
31156
|
-
|
31157
|
-
|
31386
|
+
// components/Puck/styles.module.css
|
31387
|
+
var styles_default8 = {
|
31388
|
+
Puck: "styles_Puck",
|
31389
|
+
"Puck--leftSideBarVisible": "styles_Puck--leftSideBarVisible",
|
31390
|
+
"Puck--rightSideBarVisible": "styles_Puck--rightSideBarVisible",
|
31391
|
+
"Puck-header": "styles_Puck-header",
|
31392
|
+
"Puck-headerInner": "styles_Puck-headerInner",
|
31393
|
+
"Puck-headerToggle": "styles_Puck-headerToggle",
|
31394
|
+
"Puck-rightSideBarToggle": "styles_Puck-rightSideBarToggle",
|
31395
|
+
"Puck-leftSideBarToggle": "styles_Puck-leftSideBarToggle",
|
31396
|
+
"Puck-headerTitle": "styles_Puck-headerTitle",
|
31397
|
+
"Puck-headerPath": "styles_Puck-headerPath",
|
31398
|
+
"Puck-headerTools": "styles_Puck-headerTools",
|
31399
|
+
"Puck-menuButton": "styles_Puck-menuButton",
|
31400
|
+
"Puck--menuOpen": "styles_Puck--menuOpen",
|
31401
|
+
"Puck-leftSideBar": "styles_Puck-leftSideBar",
|
31402
|
+
"Puck-rightSideBar": "styles_Puck-rightSideBar"
|
31403
|
+
};
|
31158
31404
|
|
31159
31405
|
// components/Puck/components/Fields/index.tsx
|
31160
31406
|
init_react_import();
|
@@ -31163,9 +31409,19 @@ var import_react_spinners6 = require("react-spinners");
|
|
31163
31409
|
// components/InputOrGroup/index.tsx
|
31164
31410
|
init_react_import();
|
31165
31411
|
|
31166
|
-
//
|
31167
|
-
|
31168
|
-
|
31412
|
+
// components/InputOrGroup/styles.module.css
|
31413
|
+
var styles_default9 = {
|
31414
|
+
Input: "styles_Input",
|
31415
|
+
"Input-label": "styles_Input-label",
|
31416
|
+
"Input-labelIcon": "styles_Input-labelIcon",
|
31417
|
+
"Input-disabledIcon": "styles_Input-disabledIcon",
|
31418
|
+
"Input-input": "styles_Input-input",
|
31419
|
+
"Input--readOnly": "styles_Input--readOnly",
|
31420
|
+
"Input-radioGroupItems": "styles_Input-radioGroupItems",
|
31421
|
+
"Input-radio": "styles_Input-radio",
|
31422
|
+
"Input-radioInner": "styles_Input-radioInner",
|
31423
|
+
"Input-radioInput": "styles_Input-radioInput"
|
31424
|
+
};
|
31169
31425
|
|
31170
31426
|
// components/InputOrGroup/index.tsx
|
31171
31427
|
var import_react18 = require("react");
|
@@ -31176,17 +31432,41 @@ init_react_import();
|
|
31176
31432
|
// components/InputOrGroup/fields/ArrayField/index.tsx
|
31177
31433
|
init_react_import();
|
31178
31434
|
|
31179
|
-
//
|
31180
|
-
|
31181
|
-
|
31435
|
+
// components/InputOrGroup/fields/ArrayField/styles.module.css
|
31436
|
+
var styles_default10 = {
|
31437
|
+
ArrayField: "styles_ArrayField",
|
31438
|
+
"ArrayField--isDraggingFrom": "styles_ArrayField--isDraggingFrom",
|
31439
|
+
"ArrayField-addButton": "styles_ArrayField-addButton",
|
31440
|
+
"ArrayField--hasItems": "styles_ArrayField--hasItems",
|
31441
|
+
ArrayFieldItem: "styles_ArrayFieldItem",
|
31442
|
+
"ArrayFieldItem--isDragging": "styles_ArrayFieldItem--isDragging",
|
31443
|
+
"ArrayFieldItem--isExpanded": "styles_ArrayFieldItem--isExpanded",
|
31444
|
+
"ArrayFieldItem-summary": "styles_ArrayFieldItem-summary",
|
31445
|
+
"ArrayField--addDisabled": "styles_ArrayField--addDisabled",
|
31446
|
+
"ArrayFieldItem-body": "styles_ArrayFieldItem-body",
|
31447
|
+
"ArrayFieldItem-fieldset": "styles_ArrayFieldItem-fieldset",
|
31448
|
+
"ArrayFieldItem-rhs": "styles_ArrayFieldItem-rhs",
|
31449
|
+
"ArrayFieldItem-actions": "styles_ArrayFieldItem-actions"
|
31450
|
+
};
|
31182
31451
|
|
31183
31452
|
// components/InputOrGroup/fields/ArrayField/index.tsx
|
31184
|
-
var import_dnd5 = require("@hello-pangea/dnd");
|
31185
|
-
var import_dnd6 = require("@hello-pangea/dnd");
|
31186
31453
|
var import_react14 = require("react");
|
31187
|
-
|
31188
|
-
|
31189
|
-
|
31454
|
+
|
31455
|
+
// components/DragDropContext/index.tsx
|
31456
|
+
init_react_import();
|
31457
|
+
var import_dnd4 = require("@measured/dnd");
|
31458
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
31459
|
+
var DefaultDragDropContext = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children });
|
31460
|
+
var DragDropContext = (props) => {
|
31461
|
+
const { status } = useAppContext();
|
31462
|
+
const El = status !== "LOADING" ? import_dnd4.DragDropContext : DefaultDragDropContext;
|
31463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(El, __spreadValues({}, props));
|
31464
|
+
};
|
31465
|
+
|
31466
|
+
// components/InputOrGroup/fields/ArrayField/index.tsx
|
31467
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
31468
|
+
var getClassName10 = get_class_name_factory_default("ArrayField", styles_default10);
|
31469
|
+
var getClassNameItem2 = get_class_name_factory_default("ArrayFieldItem", styles_default10);
|
31190
31470
|
var ArrayField = ({
|
31191
31471
|
field,
|
31192
31472
|
onChange,
|
@@ -31248,21 +31528,24 @@ var ArrayField = ({
|
|
31248
31528
|
[arrayState]
|
31249
31529
|
);
|
31250
31530
|
(0, import_react14.useEffect)(() => {
|
31251
|
-
|
31531
|
+
if (arrayState.items.length > 0) {
|
31532
|
+
setUi(mapArrayStateToUi(arrayState));
|
31533
|
+
}
|
31252
31534
|
}, []);
|
31253
31535
|
const [hovering, setHovering] = (0, import_react14.useState)(false);
|
31254
31536
|
if (field.type !== "array" || !field.arrayFields) {
|
31255
31537
|
return null;
|
31256
31538
|
}
|
31257
|
-
|
31539
|
+
const addDisabled = field.max !== void 0 && localState.arrayState.items.length >= field.max || readOnly;
|
31540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31258
31541
|
FieldLabelInternal,
|
31259
31542
|
{
|
31260
31543
|
label: label || name,
|
31261
|
-
icon: /* @__PURE__ */ (0,
|
31544
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(List, { size: 16 }),
|
31262
31545
|
el: "div",
|
31263
31546
|
readOnly,
|
31264
|
-
children: /* @__PURE__ */ (0,
|
31265
|
-
|
31547
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31548
|
+
DragDropContext,
|
31266
31549
|
{
|
31267
31550
|
onDragEnd: (event) => {
|
31268
31551
|
var _a, _b;
|
@@ -31288,14 +31571,15 @@ var ArrayField = ({
|
|
31288
31571
|
});
|
31289
31572
|
}
|
31290
31573
|
},
|
31291
|
-
children: /* @__PURE__ */ (0,
|
31292
|
-
return /* @__PURE__ */ (0,
|
31574
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Droppable, { droppableId: "array", isDropDisabled: readOnly, children: (provided, snapshot) => {
|
31575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
31293
31576
|
"div",
|
31294
31577
|
__spreadProps(__spreadValues({}, provided.droppableProps), {
|
31295
31578
|
ref: provided.innerRef,
|
31296
31579
|
className: getClassName10({
|
31297
31580
|
isDraggingFrom: !!snapshot.draggingFromThisWith,
|
31298
|
-
hasItems: Array.isArray(value) && value.length > 0
|
31581
|
+
hasItems: Array.isArray(value) && value.length > 0,
|
31582
|
+
addDisabled
|
31299
31583
|
}),
|
31300
31584
|
onMouseOver: (e) => {
|
31301
31585
|
e.stopPropagation();
|
@@ -31309,7 +31593,7 @@ var ArrayField = ({
|
|
31309
31593
|
localState.arrayState.items.map((item, i) => {
|
31310
31594
|
const { _arrayId = `${id}-${i}`, _originalIndex = i } = item;
|
31311
31595
|
const data = Array.from(localState.value || [])[i] || {};
|
31312
|
-
return /* @__PURE__ */ (0,
|
31596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31313
31597
|
Draggable,
|
31314
31598
|
{
|
31315
31599
|
id: _arrayId,
|
@@ -31320,8 +31604,8 @@ var ArrayField = ({
|
|
31320
31604
|
readOnly
|
31321
31605
|
}),
|
31322
31606
|
isDragDisabled: readOnly || !hovering,
|
31323
|
-
children: () => /* @__PURE__ */ (0,
|
31324
|
-
/* @__PURE__ */ (0,
|
31607
|
+
children: () => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
31608
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
31325
31609
|
"div",
|
31326
31610
|
{
|
31327
31611
|
onClick: () => {
|
@@ -31342,10 +31626,12 @@ var ArrayField = ({
|
|
31342
31626
|
className: getClassNameItem2("summary"),
|
31343
31627
|
children: [
|
31344
31628
|
field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
|
31345
|
-
/* @__PURE__ */ (0,
|
31346
|
-
!readOnly && /* @__PURE__ */ (0,
|
31629
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameItem2("rhs"), children: [
|
31630
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameItem2("actions"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameItem2("action"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31347
31631
|
IconButton,
|
31348
31632
|
{
|
31633
|
+
type: "button",
|
31634
|
+
disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
|
31349
31635
|
onClick: (e) => {
|
31350
31636
|
e.stopPropagation();
|
31351
31637
|
const existingValue = [
|
@@ -31364,20 +31650,20 @@ var ArrayField = ({
|
|
31364
31650
|
);
|
31365
31651
|
},
|
31366
31652
|
title: "Delete",
|
31367
|
-
children: /* @__PURE__ */ (0,
|
31653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Trash, { size: 16 })
|
31368
31654
|
}
|
31369
31655
|
) }) }),
|
31370
|
-
/* @__PURE__ */ (0,
|
31656
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DragIcon, {}) })
|
31371
31657
|
] })
|
31372
31658
|
]
|
31373
31659
|
}
|
31374
31660
|
),
|
31375
|
-
/* @__PURE__ */ (0,
|
31661
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameItem2("body"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("fieldset", { className: getClassNameItem2("fieldset"), children: Object.keys(field.arrayFields).map(
|
31376
31662
|
(fieldName) => {
|
31377
31663
|
const subField = field.arrayFields[fieldName];
|
31378
31664
|
const subFieldName = `${name}[${i}].${fieldName}`;
|
31379
31665
|
const wildcardFieldName = `${name}[*].${fieldName}`;
|
31380
|
-
return /* @__PURE__ */ (0,
|
31666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31381
31667
|
InputOrGroup,
|
31382
31668
|
{
|
31383
31669
|
name: subFieldName,
|
@@ -31406,9 +31692,10 @@ var ArrayField = ({
|
|
31406
31692
|
);
|
31407
31693
|
}),
|
31408
31694
|
provided.placeholder,
|
31409
|
-
/* @__PURE__ */ (0,
|
31695
|
+
!addDisabled && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31410
31696
|
"button",
|
31411
31697
|
{
|
31698
|
+
type: "button",
|
31412
31699
|
className: getClassName10("addButton"),
|
31413
31700
|
onClick: () => {
|
31414
31701
|
const existingValue = value || [];
|
@@ -31419,7 +31706,7 @@ var ArrayField = ({
|
|
31419
31706
|
const newArrayState = regenerateArrayState(newValue);
|
31420
31707
|
onChange(newValue, mapArrayStateToUi(newArrayState));
|
31421
31708
|
},
|
31422
|
-
children: /* @__PURE__ */ (0,
|
31709
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Plus, { size: 21 })
|
31423
31710
|
}
|
31424
31711
|
)
|
31425
31712
|
]
|
@@ -31434,8 +31721,8 @@ var ArrayField = ({
|
|
31434
31721
|
|
31435
31722
|
// components/InputOrGroup/fields/DefaultField/index.tsx
|
31436
31723
|
init_react_import();
|
31437
|
-
var
|
31438
|
-
var getClassName11 = get_class_name_factory_default("Input",
|
31724
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
31725
|
+
var getClassName11 = get_class_name_factory_default("Input", styles_default9);
|
31439
31726
|
var DefaultField = ({
|
31440
31727
|
field,
|
31441
31728
|
onChange,
|
@@ -31445,16 +31732,16 @@ var DefaultField = ({
|
|
31445
31732
|
label,
|
31446
31733
|
id
|
31447
31734
|
}) => {
|
31448
|
-
return /* @__PURE__ */ (0,
|
31735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
31449
31736
|
FieldLabelInternal,
|
31450
31737
|
{
|
31451
31738
|
label: label || name,
|
31452
|
-
icon: /* @__PURE__ */ (0,
|
31453
|
-
field.type === "text" && /* @__PURE__ */ (0,
|
31454
|
-
field.type === "number" && /* @__PURE__ */ (0,
|
31739
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
31740
|
+
field.type === "text" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Type, { size: 16 }),
|
31741
|
+
field.type === "number" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Hash, { size: 16 })
|
31455
31742
|
] }),
|
31456
31743
|
readOnly,
|
31457
|
-
children: /* @__PURE__ */ (0,
|
31744
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
31458
31745
|
"input",
|
31459
31746
|
{
|
31460
31747
|
className: getClassName11("input"),
|
@@ -31488,22 +31775,52 @@ var import_react17 = require("react");
|
|
31488
31775
|
init_react_import();
|
31489
31776
|
var import_react16 = require("react");
|
31490
31777
|
|
31491
|
-
//
|
31492
|
-
|
31493
|
-
|
31778
|
+
// components/ExternalInput/styles.module.css
|
31779
|
+
var styles_default11 = {
|
31780
|
+
"ExternalInput-actions": "styles_ExternalInput-actions",
|
31781
|
+
"ExternalInput-button": "styles_ExternalInput-button",
|
31782
|
+
"ExternalInput--dataSelected": "styles_ExternalInput--dataSelected",
|
31783
|
+
"ExternalInput-detachButton": "styles_ExternalInput-detachButton",
|
31784
|
+
ExternalInputModal: "styles_ExternalInputModal",
|
31785
|
+
"ExternalInputModal-grid": "styles_ExternalInputModal-grid",
|
31786
|
+
"ExternalInputModal--filtersToggled": "styles_ExternalInputModal--filtersToggled",
|
31787
|
+
"ExternalInputModal-filters": "styles_ExternalInputModal-filters",
|
31788
|
+
"ExternalInputModal-masthead": "styles_ExternalInputModal-masthead",
|
31789
|
+
"ExternalInputModal-tableWrapper": "styles_ExternalInputModal-tableWrapper",
|
31790
|
+
"ExternalInputModal-table": "styles_ExternalInputModal-table",
|
31791
|
+
"ExternalInputModal-thead": "styles_ExternalInputModal-thead",
|
31792
|
+
"ExternalInputModal-th": "styles_ExternalInputModal-th",
|
31793
|
+
"ExternalInputModal-td": "styles_ExternalInputModal-td",
|
31794
|
+
"ExternalInputModal-tr": "styles_ExternalInputModal-tr",
|
31795
|
+
"ExternalInputModal-tbody": "styles_ExternalInputModal-tbody",
|
31796
|
+
"ExternalInputModal--hasData": "styles_ExternalInputModal--hasData",
|
31797
|
+
"ExternalInputModal-loadingBanner": "styles_ExternalInputModal-loadingBanner",
|
31798
|
+
"ExternalInputModal--isLoading": "styles_ExternalInputModal--isLoading",
|
31799
|
+
"ExternalInputModal-searchForm": "styles_ExternalInputModal-searchForm",
|
31800
|
+
"ExternalInputModal-search": "styles_ExternalInputModal-search",
|
31801
|
+
"ExternalInputModal-searchIcon": "styles_ExternalInputModal-searchIcon",
|
31802
|
+
"ExternalInputModal-searchIconText": "styles_ExternalInputModal-searchIconText",
|
31803
|
+
"ExternalInputModal-searchInput": "styles_ExternalInputModal-searchInput",
|
31804
|
+
"ExternalInputModal-searchActions": "styles_ExternalInputModal-searchActions",
|
31805
|
+
"ExternalInputModal-searchActionIcon": "styles_ExternalInputModal-searchActionIcon",
|
31806
|
+
"ExternalInputModal-footer": "styles_ExternalInputModal-footer"
|
31807
|
+
};
|
31494
31808
|
|
31495
31809
|
// components/Modal/index.tsx
|
31496
31810
|
init_react_import();
|
31497
31811
|
var import_react15 = require("react");
|
31498
31812
|
|
31499
|
-
//
|
31500
|
-
|
31501
|
-
|
31813
|
+
// components/Modal/styles.module.css
|
31814
|
+
var styles_default12 = {
|
31815
|
+
Modal: "styles_Modal",
|
31816
|
+
"Modal--isOpen": "styles_Modal--isOpen",
|
31817
|
+
"Modal-inner": "styles_Modal-inner"
|
31818
|
+
};
|
31502
31819
|
|
31503
31820
|
// components/Modal/index.tsx
|
31504
31821
|
var import_react_dom = __toESM(require_react_dom());
|
31505
|
-
var
|
31506
|
-
var getClassName12 = get_class_name_factory_default("Modal",
|
31822
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
31823
|
+
var getClassName12 = get_class_name_factory_default("Modal", styles_default12);
|
31507
31824
|
var Modal = ({
|
31508
31825
|
children,
|
31509
31826
|
onClose,
|
@@ -31514,10 +31831,10 @@ var Modal = ({
|
|
31514
31831
|
setRootEl(document.getElementById("puck-portal-root"));
|
31515
31832
|
}, []);
|
31516
31833
|
if (!rootEl) {
|
31517
|
-
return /* @__PURE__ */ (0,
|
31834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", {});
|
31518
31835
|
}
|
31519
31836
|
return (0, import_react_dom.createPortal)(
|
31520
|
-
/* @__PURE__ */ (0,
|
31837
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: getClassName12({ isOpen }), onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
31521
31838
|
"div",
|
31522
31839
|
{
|
31523
31840
|
className: getClassName12("inner"),
|
@@ -31531,9 +31848,9 @@ var Modal = ({
|
|
31531
31848
|
|
31532
31849
|
// components/ExternalInput/index.tsx
|
31533
31850
|
var import_react_spinners5 = require("react-spinners");
|
31534
|
-
var
|
31535
|
-
var getClassName13 = get_class_name_factory_default("ExternalInput",
|
31536
|
-
var getClassNameModal = get_class_name_factory_default("ExternalInputModal",
|
31851
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
31852
|
+
var getClassName13 = get_class_name_factory_default("ExternalInput", styles_default11);
|
31853
|
+
var getClassNameModal = get_class_name_factory_default("ExternalInputModal", styles_default11);
|
31537
31854
|
var dataCache = {};
|
31538
31855
|
var ExternalInput = ({
|
31539
31856
|
field,
|
@@ -31571,7 +31888,7 @@ var ExternalInput = ({
|
|
31571
31888
|
const search = (0, import_react16.useCallback)(
|
31572
31889
|
(query, filters2) => __async(void 0, null, function* () {
|
31573
31890
|
setIsLoading(true);
|
31574
|
-
const cacheKey = `${id}-${
|
31891
|
+
const cacheKey = `${id}-${query}-${JSON.stringify(filters2)}`;
|
31575
31892
|
const listData = dataCache[cacheKey] || (yield field.fetchList({ query, filters: filters2 }));
|
31576
31893
|
if (listData) {
|
31577
31894
|
setData(listData);
|
@@ -31584,7 +31901,7 @@ var ExternalInput = ({
|
|
31584
31901
|
(0, import_react16.useEffect)(() => {
|
31585
31902
|
search(searchQuery, filters);
|
31586
31903
|
}, []);
|
31587
|
-
return /* @__PURE__ */ (0,
|
31904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
31588
31905
|
"div",
|
31589
31906
|
{
|
31590
31907
|
className: getClassName13({
|
@@ -31593,30 +31910,31 @@ var ExternalInput = ({
|
|
31593
31910
|
}),
|
31594
31911
|
id,
|
31595
31912
|
children: [
|
31596
|
-
/* @__PURE__ */ (0,
|
31597
|
-
/* @__PURE__ */ (0,
|
31913
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: getClassName13("actions"), children: [
|
31914
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
31598
31915
|
"button",
|
31599
31916
|
{
|
31917
|
+
type: "button",
|
31600
31918
|
onClick: () => setOpen(true),
|
31601
31919
|
className: getClassName13("button"),
|
31602
|
-
children: value ? field.getItemSummary ? field.getItemSummary(value) : "External item" : /* @__PURE__ */ (0,
|
31603
|
-
/* @__PURE__ */ (0,
|
31604
|
-
/* @__PURE__ */ (0,
|
31920
|
+
children: value ? field.getItemSummary ? field.getItemSummary(value) : "External item" : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
31921
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Link, { size: "16" }),
|
31922
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: field.placeholder })
|
31605
31923
|
] })
|
31606
31924
|
}
|
31607
31925
|
),
|
31608
|
-
value && /* @__PURE__ */ (0,
|
31926
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
31609
31927
|
"button",
|
31610
31928
|
{
|
31611
31929
|
className: getClassName13("detachButton"),
|
31612
31930
|
onClick: () => {
|
31613
31931
|
onChange(null);
|
31614
31932
|
},
|
31615
|
-
children: /* @__PURE__ */ (0,
|
31933
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Unlock, { size: 16 })
|
31616
31934
|
}
|
31617
31935
|
)
|
31618
31936
|
] }),
|
31619
|
-
/* @__PURE__ */ (0,
|
31937
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Modal, { onClose: () => setOpen(false), isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
31620
31938
|
"form",
|
31621
31939
|
{
|
31622
31940
|
className: getClassNameModal({
|
@@ -31630,11 +31948,11 @@ var ExternalInput = ({
|
|
31630
31948
|
search(searchQuery, filters);
|
31631
31949
|
},
|
31632
31950
|
children: [
|
31633
|
-
/* @__PURE__ */ (0,
|
31634
|
-
/* @__PURE__ */ (0,
|
31635
|
-
/* @__PURE__ */ (0,
|
31636
|
-
/* @__PURE__ */ (0,
|
31637
|
-
/* @__PURE__ */ (0,
|
31951
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: getClassNameModal("masthead"), children: field.showSearch ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: getClassNameModal("searchForm"), children: [
|
31952
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: getClassNameModal("search"), children: [
|
31953
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: getClassNameModal("searchIconText"), children: "Search" }),
|
31954
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Search, { size: "18" }) }),
|
31955
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
31638
31956
|
"input",
|
31639
31957
|
{
|
31640
31958
|
className: getClassNameModal("searchInput"),
|
@@ -31649,9 +31967,9 @@ var ExternalInput = ({
|
|
31649
31967
|
}
|
31650
31968
|
)
|
31651
31969
|
] }),
|
31652
|
-
/* @__PURE__ */ (0,
|
31653
|
-
/* @__PURE__ */ (0,
|
31654
|
-
hasFilterFields && /* @__PURE__ */ (0,
|
31970
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: getClassNameModal("searchActions"), children: [
|
31971
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { type: "submit", loading: isLoading, fullWidth: true, children: "Search" }),
|
31972
|
+
hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
31655
31973
|
IconButton,
|
31656
31974
|
{
|
31657
31975
|
title: "Toggle filters",
|
@@ -31660,15 +31978,15 @@ var ExternalInput = ({
|
|
31660
31978
|
e.stopPropagation();
|
31661
31979
|
setFiltersToggled(!filtersToggled);
|
31662
31980
|
},
|
31663
|
-
children: /* @__PURE__ */ (0,
|
31981
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SlidersHorizontal, { size: 20 })
|
31664
31982
|
}
|
31665
31983
|
) })
|
31666
31984
|
] })
|
31667
|
-
] }) : /* @__PURE__ */ (0,
|
31668
|
-
/* @__PURE__ */ (0,
|
31669
|
-
hasFilterFields && /* @__PURE__ */ (0,
|
31985
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Heading, { rank: 2, size: "xs", children: field.placeholder || "Select data" }) }),
|
31986
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: getClassNameModal("grid"), children: [
|
31987
|
+
hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: getClassNameModal("filters"), children: hasFilterFields && Object.keys(filterFields).map((fieldName) => {
|
31670
31988
|
const filterField = filterFields[fieldName];
|
31671
|
-
return /* @__PURE__ */ (0,
|
31989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
31672
31990
|
InputOrGroup,
|
31673
31991
|
{
|
31674
31992
|
field: filterField,
|
@@ -31685,9 +32003,9 @@ var ExternalInput = ({
|
|
31685
32003
|
fieldName
|
31686
32004
|
);
|
31687
32005
|
}) }),
|
31688
|
-
/* @__PURE__ */ (0,
|
31689
|
-
/* @__PURE__ */ (0,
|
31690
|
-
/* @__PURE__ */ (0,
|
32006
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: getClassNameModal("tableWrapper"), children: [
|
32007
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("table", { className: getClassNameModal("table"), children: [
|
32008
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("thead", { className: getClassNameModal("thead"), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("tr", { className: getClassNameModal("tr"), children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
31691
32009
|
"th",
|
31692
32010
|
{
|
31693
32011
|
className: getClassNameModal("th"),
|
@@ -31696,8 +32014,8 @@ var ExternalInput = ({
|
|
31696
32014
|
},
|
31697
32015
|
key
|
31698
32016
|
)) }) }),
|
31699
|
-
/* @__PURE__ */ (0,
|
31700
|
-
return /* @__PURE__ */ (0,
|
32017
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("tbody", { className: getClassNameModal("tbody"), children: mappedData.map((item, i) => {
|
32018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
31701
32019
|
"tr",
|
31702
32020
|
{
|
31703
32021
|
style: { whiteSpace: "nowrap" },
|
@@ -31706,16 +32024,16 @@ var ExternalInput = ({
|
|
31706
32024
|
onChange(mapProp(data[i]));
|
31707
32025
|
setOpen(false);
|
31708
32026
|
},
|
31709
|
-
children: keys.map((key) => /* @__PURE__ */ (0,
|
32027
|
+
children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("td", { className: getClassNameModal("td"), children: item[key] }, key))
|
31710
32028
|
},
|
31711
32029
|
i
|
31712
32030
|
);
|
31713
32031
|
}) })
|
31714
32032
|
] }),
|
31715
|
-
/* @__PURE__ */ (0,
|
32033
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_spinners5.ClipLoader, { size: 24, "aria-label": "Loading" }) })
|
31716
32034
|
] })
|
31717
32035
|
] }),
|
31718
|
-
/* @__PURE__ */ (0,
|
32036
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: getClassNameModal("footer"), children: [
|
31719
32037
|
mappedData.length,
|
31720
32038
|
" result",
|
31721
32039
|
mappedData.length === 1 ? "" : "s"
|
@@ -31729,7 +32047,7 @@ var ExternalInput = ({
|
|
31729
32047
|
};
|
31730
32048
|
|
31731
32049
|
// components/InputOrGroup/fields/ExternalField/index.tsx
|
31732
|
-
var
|
32050
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
31733
32051
|
var ExternalField = ({
|
31734
32052
|
field,
|
31735
32053
|
onChange,
|
@@ -31751,13 +32069,13 @@ var ExternalField = ({
|
|
31751
32069
|
if (field.type !== "external") {
|
31752
32070
|
return null;
|
31753
32071
|
}
|
31754
|
-
return /* @__PURE__ */ (0,
|
32072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
31755
32073
|
FieldLabelInternal,
|
31756
32074
|
{
|
31757
32075
|
label: label || name,
|
31758
|
-
icon: /* @__PURE__ */ (0,
|
32076
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Link, { size: 16 }),
|
31759
32077
|
el: "div",
|
31760
|
-
children: /* @__PURE__ */ (0,
|
32078
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
31761
32079
|
ExternalInput,
|
31762
32080
|
{
|
31763
32081
|
name,
|
@@ -31783,8 +32101,8 @@ var ExternalField = ({
|
|
31783
32101
|
|
31784
32102
|
// components/InputOrGroup/fields/RadioField/index.tsx
|
31785
32103
|
init_react_import();
|
31786
|
-
var
|
31787
|
-
var getClassName14 = get_class_name_factory_default("Input",
|
32104
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
32105
|
+
var getClassName14 = get_class_name_factory_default("Input", styles_default9);
|
31788
32106
|
var RadioField = ({
|
31789
32107
|
field,
|
31790
32108
|
onChange,
|
@@ -31797,19 +32115,19 @@ var RadioField = ({
|
|
31797
32115
|
if (field.type !== "radio" || !field.options) {
|
31798
32116
|
return null;
|
31799
32117
|
}
|
31800
|
-
return /* @__PURE__ */ (0,
|
32118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
31801
32119
|
FieldLabelInternal,
|
31802
32120
|
{
|
31803
|
-
icon: /* @__PURE__ */ (0,
|
32121
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CheckCircle, { size: 16 }),
|
31804
32122
|
label: label || name,
|
31805
32123
|
readOnly,
|
31806
32124
|
el: "div",
|
31807
|
-
children: /* @__PURE__ */ (0,
|
32125
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName14("radioGroupItems"), id, children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
31808
32126
|
"label",
|
31809
32127
|
{
|
31810
32128
|
className: getClassName14("radio"),
|
31811
32129
|
children: [
|
31812
|
-
/* @__PURE__ */ (0,
|
32130
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
31813
32131
|
"input",
|
31814
32132
|
{
|
31815
32133
|
type: "radio",
|
@@ -31827,7 +32145,7 @@ var RadioField = ({
|
|
31827
32145
|
defaultChecked: value === option.value
|
31828
32146
|
}
|
31829
32147
|
),
|
31830
|
-
/* @__PURE__ */ (0,
|
32148
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName14("radioInner"), children: option.label || option.value })
|
31831
32149
|
]
|
31832
32150
|
},
|
31833
32151
|
option.label + option.value
|
@@ -31838,8 +32156,8 @@ var RadioField = ({
|
|
31838
32156
|
|
31839
32157
|
// components/InputOrGroup/fields/SelectField/index.tsx
|
31840
32158
|
init_react_import();
|
31841
|
-
var
|
31842
|
-
var getClassName15 = get_class_name_factory_default("Input",
|
32159
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
32160
|
+
var getClassName15 = get_class_name_factory_default("Input", styles_default9);
|
31843
32161
|
var SelectField = ({
|
31844
32162
|
field,
|
31845
32163
|
onChange,
|
@@ -31852,13 +32170,13 @@ var SelectField = ({
|
|
31852
32170
|
if (field.type !== "select" || !field.options) {
|
31853
32171
|
return null;
|
31854
32172
|
}
|
31855
|
-
return /* @__PURE__ */ (0,
|
32173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
31856
32174
|
FieldLabelInternal,
|
31857
32175
|
{
|
31858
32176
|
label: label || name,
|
31859
|
-
icon: /* @__PURE__ */ (0,
|
32177
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ChevronDown, { size: 16 }),
|
31860
32178
|
readOnly,
|
31861
|
-
children: /* @__PURE__ */ (0,
|
32179
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
31862
32180
|
"select",
|
31863
32181
|
{
|
31864
32182
|
id,
|
@@ -31872,7 +32190,7 @@ var SelectField = ({
|
|
31872
32190
|
onChange(e.currentTarget.value);
|
31873
32191
|
},
|
31874
32192
|
value,
|
31875
|
-
children: field.options.map((option) => /* @__PURE__ */ (0,
|
32193
|
+
children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
31876
32194
|
"option",
|
31877
32195
|
{
|
31878
32196
|
label: option.label,
|
@@ -31888,8 +32206,8 @@ var SelectField = ({
|
|
31888
32206
|
|
31889
32207
|
// components/InputOrGroup/fields/TextareaField/index.tsx
|
31890
32208
|
init_react_import();
|
31891
|
-
var
|
31892
|
-
var getClassName16 = get_class_name_factory_default("Input",
|
32209
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
32210
|
+
var getClassName16 = get_class_name_factory_default("Input", styles_default9);
|
31893
32211
|
var TextareaField = ({
|
31894
32212
|
onChange,
|
31895
32213
|
readOnly,
|
@@ -31898,13 +32216,13 @@ var TextareaField = ({
|
|
31898
32216
|
label,
|
31899
32217
|
id
|
31900
32218
|
}) => {
|
31901
|
-
return /* @__PURE__ */ (0,
|
32219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
31902
32220
|
FieldLabelInternal,
|
31903
32221
|
{
|
31904
32222
|
label: label || name,
|
31905
|
-
icon: /* @__PURE__ */ (0,
|
32223
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Type, { size: 16 }),
|
31906
32224
|
readOnly,
|
31907
|
-
children: /* @__PURE__ */ (0,
|
32225
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
31908
32226
|
"textarea",
|
31909
32227
|
{
|
31910
32228
|
id,
|
@@ -31928,14 +32246,16 @@ var import_use_debounce2 = require("use-debounce");
|
|
31928
32246
|
// components/InputOrGroup/fields/ObjectField/index.tsx
|
31929
32247
|
init_react_import();
|
31930
32248
|
|
31931
|
-
//
|
31932
|
-
|
31933
|
-
|
32249
|
+
// components/InputOrGroup/fields/ObjectField/styles.module.css
|
32250
|
+
var styles_default13 = {
|
32251
|
+
ObjectField: "styles_ObjectField",
|
32252
|
+
"ObjectField-fieldset": "styles_ObjectField-fieldset"
|
32253
|
+
};
|
31934
32254
|
|
31935
32255
|
// components/InputOrGroup/fields/ObjectField/index.tsx
|
31936
|
-
var
|
31937
|
-
var getClassName17 = get_class_name_factory_default("ObjectField",
|
31938
|
-
var getClassNameItem3 = get_class_name_factory_default("ObjectFieldItem",
|
32256
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
32257
|
+
var getClassName17 = get_class_name_factory_default("ObjectField", styles_default13);
|
32258
|
+
var getClassNameItem3 = get_class_name_factory_default("ObjectFieldItem", styles_default13);
|
31939
32259
|
var ObjectField = ({
|
31940
32260
|
field,
|
31941
32261
|
onChange,
|
@@ -31950,18 +32270,18 @@ var ObjectField = ({
|
|
31950
32270
|
return null;
|
31951
32271
|
}
|
31952
32272
|
const data = value || {};
|
31953
|
-
return /* @__PURE__ */ (0,
|
32273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
31954
32274
|
FieldLabelInternal,
|
31955
32275
|
{
|
31956
32276
|
label: label || name,
|
31957
|
-
icon: /* @__PURE__ */ (0,
|
32277
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MoreVertical, { size: 16 }),
|
31958
32278
|
el: "div",
|
31959
32279
|
readOnly,
|
31960
|
-
children: /* @__PURE__ */ (0,
|
32280
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: getClassName17(), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("fieldset", { className: getClassName17("fieldset"), children: Object.keys(field.objectFields).map((fieldName) => {
|
31961
32281
|
const subField = field.objectFields[fieldName];
|
31962
32282
|
const subFieldName = `${name}.${fieldName}`;
|
31963
32283
|
const wildcardFieldName = `${name}.${fieldName}`;
|
31964
|
-
return /* @__PURE__ */ (0,
|
32284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
31965
32285
|
InputOrGroup,
|
31966
32286
|
{
|
31967
32287
|
name: subFieldName,
|
@@ -31988,8 +32308,8 @@ var ObjectField = ({
|
|
31988
32308
|
};
|
31989
32309
|
|
31990
32310
|
// components/InputOrGroup/index.tsx
|
31991
|
-
var
|
31992
|
-
var getClassName18 = get_class_name_factory_default("Input",
|
32311
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
32312
|
+
var getClassName18 = get_class_name_factory_default("Input", styles_default9);
|
31993
32313
|
var FieldLabel = ({
|
31994
32314
|
children,
|
31995
32315
|
icon,
|
@@ -31999,11 +32319,11 @@ var FieldLabel = ({
|
|
31999
32319
|
className
|
32000
32320
|
}) => {
|
32001
32321
|
const El = el;
|
32002
|
-
return /* @__PURE__ */ (0,
|
32003
|
-
/* @__PURE__ */ (0,
|
32004
|
-
icon ? /* @__PURE__ */ (0,
|
32322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(El, { className, children: [
|
32323
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getClassName18("label"), children: [
|
32324
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName18("labelIcon"), children: icon }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, {}),
|
32005
32325
|
label,
|
32006
|
-
readOnly && /* @__PURE__ */ (0,
|
32326
|
+
readOnly && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName18("disabledIcon"), title: "Read-only", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Lock, { size: "12" }) })
|
32007
32327
|
] }),
|
32008
32328
|
children
|
32009
32329
|
] });
|
@@ -32020,7 +32340,7 @@ var FieldLabelInternal = ({
|
|
32020
32340
|
() => overrides.fieldLabel || FieldLabel,
|
32021
32341
|
[overrides]
|
32022
32342
|
);
|
32023
|
-
return /* @__PURE__ */ (0,
|
32343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
32024
32344
|
Wrapper,
|
32025
32345
|
{
|
32026
32346
|
label,
|
@@ -32060,7 +32380,7 @@ var InputOrGroup = (_a) => {
|
|
32060
32380
|
if (!field.render) {
|
32061
32381
|
return null;
|
32062
32382
|
}
|
32063
|
-
return /* @__PURE__ */ (0,
|
32383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName18(), children: field.render(__spreadValues({
|
32064
32384
|
field,
|
32065
32385
|
name,
|
32066
32386
|
readOnly
|
@@ -32089,17 +32409,19 @@ var InputOrGroup = (_a) => {
|
|
32089
32409
|
const mergedProps = __spreadProps(__spreadValues(__spreadValues({}, props), localProps), { field });
|
32090
32410
|
const children = defaultFields[field.type](mergedProps);
|
32091
32411
|
const Render2 = render[field.type];
|
32092
|
-
return /* @__PURE__ */ (0,
|
32412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Render2, __spreadProps(__spreadValues({}, mergedProps), { children }));
|
32093
32413
|
};
|
32094
32414
|
|
32095
|
-
//
|
32096
|
-
|
32097
|
-
|
32415
|
+
// components/Puck/components/Fields/styles.module.css
|
32416
|
+
var styles_default14 = {
|
32417
|
+
PuckFields: "styles_PuckFields",
|
32418
|
+
"PuckFields-loadingOverlay": "styles_PuckFields-loadingOverlay"
|
32419
|
+
};
|
32098
32420
|
|
32099
32421
|
// components/Puck/components/Fields/index.tsx
|
32100
32422
|
var import_react19 = require("react");
|
32101
|
-
var
|
32102
|
-
var getClassName19 = get_class_name_factory_default("PuckFields",
|
32423
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
32424
|
+
var getClassName19 = get_class_name_factory_default("PuckFields", styles_default14);
|
32103
32425
|
var defaultPageFields = {
|
32104
32426
|
title: { type: "text" }
|
32105
32427
|
};
|
@@ -32107,9 +32429,9 @@ var DefaultFields = ({
|
|
32107
32429
|
children,
|
32108
32430
|
isLoading
|
32109
32431
|
}) => {
|
32110
|
-
return /* @__PURE__ */ (0,
|
32432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: getClassName19(), children: [
|
32111
32433
|
children,
|
32112
|
-
isLoading && /* @__PURE__ */ (0,
|
32434
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: getClassName19("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_spinners6.ClipLoader, { "aria-label": "loading" }) })
|
32113
32435
|
] });
|
32114
32436
|
};
|
32115
32437
|
var Fields = () => {
|
@@ -32130,14 +32452,14 @@ var Fields = () => {
|
|
32130
32452
|
const isLoading = selectedItem ? (_c = componentState[selectedItem == null ? void 0 : selectedItem.props.id]) == null ? void 0 : _c.loading : (_d = componentState["puck-root"]) == null ? void 0 : _d.loading;
|
32131
32453
|
const rootProps = data.root.props || data.root;
|
32132
32454
|
const Wrapper = (0, import_react19.useMemo)(() => overrides.fields || DefaultFields, [overrides]);
|
32133
|
-
return /* @__PURE__ */ (0,
|
32455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
32134
32456
|
"form",
|
32135
32457
|
{
|
32136
32458
|
className: getClassName19(),
|
32137
32459
|
onSubmit: (e) => {
|
32138
32460
|
e.preventDefault();
|
32139
32461
|
},
|
32140
|
-
children: /* @__PURE__ */ (0,
|
32462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Wrapper, { isLoading, itemSelector, children: Object.keys(fields).map((fieldName) => {
|
32141
32463
|
const field = fields[fieldName];
|
32142
32464
|
const onChange = (value, updatedUi) => {
|
32143
32465
|
var _a2, _b2;
|
@@ -32203,7 +32525,7 @@ var Fields = () => {
|
|
32203
32525
|
};
|
32204
32526
|
if (selectedItem && itemSelector) {
|
32205
32527
|
const { readOnly = {} } = selectedItem;
|
32206
|
-
return /* @__PURE__ */ (0,
|
32528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
32207
32529
|
InputOrGroup,
|
32208
32530
|
{
|
32209
32531
|
field,
|
@@ -32219,7 +32541,7 @@ var Fields = () => {
|
|
32219
32541
|
);
|
32220
32542
|
} else {
|
32221
32543
|
const { readOnly = {} } = data.root;
|
32222
|
-
return /* @__PURE__ */ (0,
|
32544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
32223
32545
|
InputOrGroup,
|
32224
32546
|
{
|
32225
32547
|
field,
|
@@ -32249,19 +32571,25 @@ var import_react20 = require("react");
|
|
32249
32571
|
// components/ComponentList/index.tsx
|
32250
32572
|
init_react_import();
|
32251
32573
|
|
32252
|
-
//
|
32253
|
-
|
32254
|
-
|
32574
|
+
// components/ComponentList/styles.module.css
|
32575
|
+
var styles_default15 = {
|
32576
|
+
ComponentList: "styles_ComponentList",
|
32577
|
+
"ComponentList--isExpanded": "styles_ComponentList--isExpanded",
|
32578
|
+
"ComponentList-content": "styles_ComponentList-content",
|
32579
|
+
"ComponentList-title": "styles_ComponentList-title",
|
32580
|
+
"ComponentList-titleIcon": "styles_ComponentList-titleIcon"
|
32581
|
+
};
|
32255
32582
|
|
32256
32583
|
// components/ComponentList/index.tsx
|
32257
|
-
var
|
32258
|
-
var getClassName20 = get_class_name_factory_default("ComponentList",
|
32584
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
32585
|
+
var getClassName20 = get_class_name_factory_default("ComponentList", styles_default15);
|
32259
32586
|
var ComponentListItem = ({
|
32260
32587
|
name,
|
32588
|
+
label,
|
32261
32589
|
index
|
32262
32590
|
}) => {
|
32263
32591
|
const { overrides } = useAppContext();
|
32264
|
-
return /* @__PURE__ */ (0,
|
32592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Drawer.Item, { label, name, index, children: overrides.componentItem });
|
32265
32593
|
};
|
32266
32594
|
var ComponentList = ({
|
32267
32595
|
children,
|
@@ -32270,8 +32598,8 @@ var ComponentList = ({
|
|
32270
32598
|
}) => {
|
32271
32599
|
const { config, state, setUi } = useAppContext();
|
32272
32600
|
const { expanded = true } = state.ui.componentList[id] || {};
|
32273
|
-
return /* @__PURE__ */ (0,
|
32274
|
-
title && /* @__PURE__ */ (0,
|
32601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: getClassName20({ isExpanded: expanded }), children: [
|
32602
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
32275
32603
|
"button",
|
32276
32604
|
{
|
32277
32605
|
className: getClassName20("title"),
|
@@ -32284,15 +32612,17 @@ var ComponentList = ({
|
|
32284
32612
|
}),
|
32285
32613
|
title: expanded ? `Collapse${title ? ` ${title}` : ""}` : `Expand${title ? ` ${title}` : ""}`,
|
32286
32614
|
children: [
|
32287
|
-
/* @__PURE__ */ (0,
|
32288
|
-
/* @__PURE__ */ (0,
|
32615
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { children: title }),
|
32616
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName20("titleIcon"), children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChevronUp, { size: 12 }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChevronDown, { size: 12 }) })
|
32289
32617
|
]
|
32290
32618
|
}
|
32291
32619
|
),
|
32292
|
-
/* @__PURE__ */ (0,
|
32293
|
-
|
32620
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName20("content"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Drawer, { droppableId: `component-list${title ? `:${title}` : ""}`, children: children || Object.keys(config.components).map((componentKey, i) => {
|
32621
|
+
var _a;
|
32622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
32294
32623
|
ComponentListItem,
|
32295
32624
|
{
|
32625
|
+
label: (_a = config.components[componentKey]["label"]) != null ? _a : componentKey,
|
32296
32626
|
name: componentKey,
|
32297
32627
|
index: i
|
32298
32628
|
},
|
@@ -32304,7 +32634,7 @@ var ComponentList = ({
|
|
32304
32634
|
ComponentList.Item = ComponentListItem;
|
32305
32635
|
|
32306
32636
|
// lib/use-component-list.tsx
|
32307
|
-
var
|
32637
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
32308
32638
|
var useComponentList = (config, ui) => {
|
32309
32639
|
const [componentList, setComponentList] = (0, import_react20.useState)();
|
32310
32640
|
(0, import_react20.useEffect)(() => {
|
@@ -32317,16 +32647,18 @@ var useComponentList = (config, ui) => {
|
|
32317
32647
|
if (category.visible === false || !category.components) {
|
32318
32648
|
return null;
|
32319
32649
|
}
|
32320
|
-
return /* @__PURE__ */ (0,
|
32650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
32321
32651
|
ComponentList,
|
32322
32652
|
{
|
32323
32653
|
id: categoryKey,
|
32324
32654
|
title: category.title || categoryKey,
|
32325
32655
|
children: category.components.map((componentName, i) => {
|
32656
|
+
var _a2;
|
32326
32657
|
matchedComponents.push(componentName);
|
32327
|
-
return /* @__PURE__ */ (0,
|
32658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
32328
32659
|
ComponentList.Item,
|
32329
32660
|
{
|
32661
|
+
label: (_a2 = config.components[componentName]["label"]) != null ? _a2 : componentName,
|
32330
32662
|
name: componentName,
|
32331
32663
|
index: i
|
32332
32664
|
},
|
@@ -32343,16 +32675,18 @@ var useComponentList = (config, ui) => {
|
|
32343
32675
|
);
|
32344
32676
|
if (remainingComponents.length > 0 && !((_a = ui.componentList.other) == null ? void 0 : _a.components) && ((_b = ui.componentList.other) == null ? void 0 : _b.visible) !== false) {
|
32345
32677
|
_componentList.push(
|
32346
|
-
/* @__PURE__ */ (0,
|
32678
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
32347
32679
|
ComponentList,
|
32348
32680
|
{
|
32349
32681
|
id: "other",
|
32350
32682
|
title: ((_c = ui.componentList.other) == null ? void 0 : _c.title) || "Other",
|
32351
32683
|
children: remainingComponents.map((componentName, i) => {
|
32352
|
-
|
32684
|
+
var _a2;
|
32685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
32353
32686
|
ComponentList.Item,
|
32354
32687
|
{
|
32355
32688
|
name: componentName,
|
32689
|
+
label: (_a2 = config.components[componentName]["label"]) != null ? _a2 : componentName,
|
32356
32690
|
index: i
|
32357
32691
|
},
|
32358
32692
|
componentName
|
@@ -32365,26 +32699,36 @@ var useComponentList = (config, ui) => {
|
|
32365
32699
|
}
|
32366
32700
|
setComponentList(_componentList);
|
32367
32701
|
}
|
32368
|
-
}, [config.categories, ui.componentList]);
|
32702
|
+
}, [config.categories, config.components, ui.componentList]);
|
32369
32703
|
return componentList;
|
32370
32704
|
};
|
32371
32705
|
|
32372
32706
|
// components/Puck/components/Components/index.tsx
|
32373
32707
|
var import_react21 = require("react");
|
32374
|
-
var
|
32708
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
32375
32709
|
var Components = () => {
|
32376
32710
|
const { config, state, overrides } = useAppContext();
|
32377
32711
|
const componentList = useComponentList(config, state.ui);
|
32378
32712
|
const Wrapper = (0, import_react21.useMemo)(() => overrides.components || "div", [overrides]);
|
32379
|
-
return /* @__PURE__ */ (0,
|
32713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Wrapper, { children: componentList ? componentList : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ComponentList, { id: "all" }) });
|
32380
32714
|
};
|
32381
32715
|
|
32382
32716
|
// components/Puck/components/Preview/index.tsx
|
32383
32717
|
init_react_import();
|
32384
32718
|
var import_react22 = require("react");
|
32385
|
-
var
|
32719
|
+
var import_auto_frame_component = __toESM(require("@measured/auto-frame-component"));
|
32720
|
+
|
32721
|
+
// components/Puck/components/Preview/styles.module.css
|
32722
|
+
var styles_default16 = {
|
32723
|
+
PuckPreview: "styles_PuckPreview",
|
32724
|
+
"PuckPreview-frame": "styles_PuckPreview-frame"
|
32725
|
+
};
|
32726
|
+
|
32727
|
+
// components/Puck/components/Preview/index.tsx
|
32728
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
32729
|
+
var getClassName21 = get_class_name_factory_default("PuckPreview", styles_default16);
|
32386
32730
|
var Preview = ({ id = "puck-preview" }) => {
|
32387
|
-
const { config, dispatch, state } = useAppContext();
|
32731
|
+
const { config, dispatch, state, setStatus, iframe } = useAppContext();
|
32388
32732
|
const Page = (0, import_react22.useCallback)(
|
32389
32733
|
(pageProps) => {
|
32390
32734
|
var _a, _b;
|
@@ -32393,16 +32737,28 @@ var Preview = ({ id = "puck-preview" }) => {
|
|
32393
32737
|
[config.root]
|
32394
32738
|
);
|
32395
32739
|
const rootProps = state.data.root.props || state.data.root;
|
32396
|
-
const
|
32397
|
-
return /* @__PURE__ */ (0,
|
32740
|
+
const ref = (0, import_react22.useRef)(null);
|
32741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
32398
32742
|
"div",
|
32399
32743
|
{
|
32744
|
+
className: getClassName21(),
|
32400
32745
|
id,
|
32401
32746
|
onClick: () => {
|
32402
32747
|
dispatch({ type: "setUi", ui: __spreadProps(__spreadValues({}, state.ui), { itemSelector: null }) });
|
32403
32748
|
},
|
32404
|
-
|
32405
|
-
|
32749
|
+
children: iframe.enabled ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
32750
|
+
import_auto_frame_component.default,
|
32751
|
+
{
|
32752
|
+
id: "preview-frame",
|
32753
|
+
className: getClassName21("frame"),
|
32754
|
+
"data-rfd-iframe": true,
|
32755
|
+
ref,
|
32756
|
+
onStylesLoaded: () => {
|
32757
|
+
setStatus("READY");
|
32758
|
+
},
|
32759
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Page, __spreadProps(__spreadValues({ dispatch, state }, rootProps), { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DropZone, { zone: rootDroppableId }) }))
|
32760
|
+
}
|
32761
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { id: "preview-frame", className: getClassName21("frame"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Page, __spreadProps(__spreadValues({ dispatch, state }, rootProps), { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DropZone, { zone: rootDroppableId }) })) })
|
32406
32762
|
}
|
32407
32763
|
);
|
32408
32764
|
};
|
@@ -32434,9 +32790,24 @@ var areaContainsZones = (data, area) => {
|
|
32434
32790
|
// components/LayerTree/index.tsx
|
32435
32791
|
init_react_import();
|
32436
32792
|
|
32437
|
-
//
|
32438
|
-
|
32439
|
-
|
32793
|
+
// components/LayerTree/styles.module.css
|
32794
|
+
var styles_default17 = {
|
32795
|
+
LayerTree: "styles_LayerTree",
|
32796
|
+
"LayerTree-zoneTitle": "styles_LayerTree-zoneTitle",
|
32797
|
+
"LayerTree-helper": "styles_LayerTree-helper",
|
32798
|
+
Layer: "styles_Layer",
|
32799
|
+
"Layer-inner": "styles_Layer-inner",
|
32800
|
+
"Layer--containsZone": "styles_Layer--containsZone",
|
32801
|
+
"Layer-clickable": "styles_Layer-clickable",
|
32802
|
+
"Layer--isSelected": "styles_Layer--isSelected",
|
32803
|
+
"Layer-chevron": "styles_Layer-chevron",
|
32804
|
+
"Layer--childIsSelected": "styles_Layer--childIsSelected",
|
32805
|
+
"Layer-zones": "styles_Layer-zones",
|
32806
|
+
"Layer-title": "styles_Layer-title",
|
32807
|
+
"Layer-name": "styles_Layer-name",
|
32808
|
+
"Layer-icon": "styles_Layer-icon",
|
32809
|
+
"Layer-zoneIcon": "styles_Layer-zoneIcon"
|
32810
|
+
};
|
32440
32811
|
|
32441
32812
|
// lib/scroll-into-view.ts
|
32442
32813
|
init_react_import();
|
@@ -32464,11 +32835,12 @@ var isChildOfZone = (item, maybeChild, ctx) => {
|
|
32464
32835
|
};
|
32465
32836
|
|
32466
32837
|
// components/LayerTree/index.tsx
|
32467
|
-
var
|
32468
|
-
var
|
32469
|
-
var getClassNameLayer = get_class_name_factory_default("Layer",
|
32838
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
32839
|
+
var getClassName22 = get_class_name_factory_default("LayerTree", styles_default17);
|
32840
|
+
var getClassNameLayer = get_class_name_factory_default("Layer", styles_default17);
|
32470
32841
|
var LayerTree = ({
|
32471
32842
|
data,
|
32843
|
+
config,
|
32472
32844
|
zoneContent,
|
32473
32845
|
itemSelector,
|
32474
32846
|
setItemSelector,
|
@@ -32477,15 +32849,16 @@ var LayerTree = ({
|
|
32477
32849
|
}) => {
|
32478
32850
|
const zones = data.zones || {};
|
32479
32851
|
const ctx = (0, import_react23.useContext)(dropZoneContext);
|
32480
|
-
return /* @__PURE__ */ (0,
|
32481
|
-
label && /* @__PURE__ */ (0,
|
32482
|
-
/* @__PURE__ */ (0,
|
32852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
32853
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: getClassName22("zoneTitle"), children: [
|
32854
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: getClassName22("zoneIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Layers, { size: "16" }) }),
|
32483
32855
|
" ",
|
32484
32856
|
label
|
32485
32857
|
] }),
|
32486
|
-
/* @__PURE__ */ (0,
|
32487
|
-
zoneContent.length === 0 && /* @__PURE__ */ (0,
|
32858
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("ul", { className: getClassName22(), children: [
|
32859
|
+
zoneContent.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: getClassName22("helper"), children: "No items" }),
|
32488
32860
|
zoneContent.map((item, i) => {
|
32861
|
+
var _a;
|
32489
32862
|
const isSelected = (itemSelector == null ? void 0 : itemSelector.index) === i && (itemSelector.zone === zone || itemSelector.zone === rootDroppableId && !zone);
|
32490
32863
|
const zonesForItem = findZonesForArea(data, item.props.id);
|
32491
32864
|
const containsZone = Object.keys(zonesForItem).length > 0;
|
@@ -32499,7 +32872,7 @@ var LayerTree = ({
|
|
32499
32872
|
const selectedItem = itemSelector && data ? getItem(itemSelector, data) : null;
|
32500
32873
|
const isHovering = hoveringComponent === item.props.id;
|
32501
32874
|
const childIsSelected = isChildOfZone(item, selectedItem, ctx);
|
32502
|
-
return /* @__PURE__ */ (0,
|
32875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
32503
32876
|
"li",
|
32504
32877
|
{
|
32505
32878
|
className: getClassNameLayer({
|
@@ -32509,7 +32882,7 @@ var LayerTree = ({
|
|
32509
32882
|
childIsSelected
|
32510
32883
|
}),
|
32511
32884
|
children: [
|
32512
|
-
/* @__PURE__ */ (0,
|
32885
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
32513
32886
|
"button",
|
32514
32887
|
{
|
32515
32888
|
className: getClassNameLayer("clickable"),
|
@@ -32523,8 +32896,9 @@ var LayerTree = ({
|
|
32523
32896
|
zone
|
32524
32897
|
});
|
32525
32898
|
const id = zoneContent[i].props.id;
|
32899
|
+
const frame = getFrame();
|
32526
32900
|
scrollIntoView(
|
32527
|
-
|
32901
|
+
frame == null ? void 0 : frame.querySelector(
|
32528
32902
|
`[data-rfd-drag-handle-draggable-id="draggable-${id}"]`
|
32529
32903
|
)
|
32530
32904
|
);
|
@@ -32540,24 +32914,25 @@ var LayerTree = ({
|
|
32540
32914
|
setHoveringComponent(null);
|
32541
32915
|
},
|
32542
32916
|
children: [
|
32543
|
-
containsZone && /* @__PURE__ */ (0,
|
32917
|
+
containsZone && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
32544
32918
|
"div",
|
32545
32919
|
{
|
32546
32920
|
className: getClassNameLayer("chevron"),
|
32547
32921
|
title: isSelected ? "Collapse" : "Expand",
|
32548
|
-
children: /* @__PURE__ */ (0,
|
32922
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ChevronDown, { size: "12" })
|
32549
32923
|
}
|
32550
32924
|
),
|
32551
|
-
/* @__PURE__ */ (0,
|
32552
|
-
/* @__PURE__ */ (0,
|
32553
|
-
/* @__PURE__ */ (0,
|
32925
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: getClassNameLayer("title"), children: [
|
32926
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: getClassNameLayer("icon"), children: item.type === "Text" || item.type === "Heading" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Type, { size: "16" }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LayoutGrid, { size: "16" }) }),
|
32927
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: getClassNameLayer("name"), children: (_a = config.components[item.type]["label"]) != null ? _a : item.type })
|
32554
32928
|
] })
|
32555
32929
|
]
|
32556
32930
|
}
|
32557
32931
|
) }),
|
32558
|
-
containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ (0,
|
32932
|
+
containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: getClassNameLayer("zones"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
32559
32933
|
LayerTree,
|
32560
32934
|
{
|
32935
|
+
config,
|
32561
32936
|
data,
|
32562
32937
|
zoneContent: zones[zoneKey],
|
32563
32938
|
setItemSelector,
|
@@ -32577,9 +32952,9 @@ var LayerTree = ({
|
|
32577
32952
|
|
32578
32953
|
// components/Puck/components/Outline/index.tsx
|
32579
32954
|
var import_react24 = require("react");
|
32580
|
-
var
|
32955
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
32581
32956
|
var Outline = () => {
|
32582
|
-
const { dispatch, state, overrides } = useAppContext();
|
32957
|
+
const { dispatch, state, overrides, config } = useAppContext();
|
32583
32958
|
const { data, ui } = state;
|
32584
32959
|
const { itemSelector } = ui;
|
32585
32960
|
const setItemSelector = (0, import_react24.useCallback)(
|
@@ -32592,10 +32967,11 @@ var Outline = () => {
|
|
32592
32967
|
[]
|
32593
32968
|
);
|
32594
32969
|
const Wrapper = (0, import_react24.useMemo)(() => overrides.outline || "div", [overrides]);
|
32595
|
-
return /* @__PURE__ */ (0,
|
32596
|
-
(ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId]) && /* @__PURE__ */ (0,
|
32970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(dropZoneContext.Consumer, { children: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
32971
|
+
(ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId]) && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
32597
32972
|
LayerTree,
|
32598
32973
|
{
|
32974
|
+
config,
|
32599
32975
|
data,
|
32600
32976
|
label: areaContainsZones(data, "root") ? rootDroppableId : "",
|
32601
32977
|
zoneContent: data.content,
|
@@ -32605,9 +32981,10 @@ var Outline = () => {
|
|
32605
32981
|
),
|
32606
32982
|
Object.entries(findZonesForArea(data, "root")).map(
|
32607
32983
|
([zoneKey, zone]) => {
|
32608
|
-
return /* @__PURE__ */ (0,
|
32984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
32609
32985
|
LayerTree,
|
32610
32986
|
{
|
32987
|
+
config,
|
32611
32988
|
data,
|
32612
32989
|
label: zoneKey,
|
32613
32990
|
zone: zoneKey,
|
@@ -32731,14 +33108,441 @@ function useHistoryStore() {
|
|
32731
33108
|
};
|
32732
33109
|
}
|
32733
33110
|
|
33111
|
+
// components/Puck/components/Canvas/index.tsx
|
33112
|
+
init_react_import();
|
33113
|
+
|
33114
|
+
// ../../node_modules/css-box-model/dist/css-box-model.esm.js
|
33115
|
+
init_react_import();
|
33116
|
+
|
33117
|
+
// ../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
|
33118
|
+
init_react_import();
|
33119
|
+
var isProduction = process.env.NODE_ENV === "production";
|
33120
|
+
var prefix = "Invariant failed";
|
33121
|
+
function invariant(condition, message) {
|
33122
|
+
if (condition) {
|
33123
|
+
return;
|
33124
|
+
}
|
33125
|
+
if (isProduction) {
|
33126
|
+
throw new Error(prefix);
|
33127
|
+
}
|
33128
|
+
var provided = typeof message === "function" ? message() : message;
|
33129
|
+
var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
|
33130
|
+
throw new Error(value);
|
33131
|
+
}
|
33132
|
+
|
33133
|
+
// ../../node_modules/css-box-model/dist/css-box-model.esm.js
|
33134
|
+
var getRect = function getRect2(_ref) {
|
33135
|
+
var top = _ref.top, right = _ref.right, bottom = _ref.bottom, left = _ref.left;
|
33136
|
+
var width = right - left;
|
33137
|
+
var height = bottom - top;
|
33138
|
+
var rect = {
|
33139
|
+
top,
|
33140
|
+
right,
|
33141
|
+
bottom,
|
33142
|
+
left,
|
33143
|
+
width,
|
33144
|
+
height,
|
33145
|
+
x: left,
|
33146
|
+
y: top,
|
33147
|
+
center: {
|
33148
|
+
x: (right + left) / 2,
|
33149
|
+
y: (bottom + top) / 2
|
33150
|
+
}
|
33151
|
+
};
|
33152
|
+
return rect;
|
33153
|
+
};
|
33154
|
+
var expand = function expand2(target, expandBy) {
|
33155
|
+
return {
|
33156
|
+
top: target.top - expandBy.top,
|
33157
|
+
left: target.left - expandBy.left,
|
33158
|
+
bottom: target.bottom + expandBy.bottom,
|
33159
|
+
right: target.right + expandBy.right
|
33160
|
+
};
|
33161
|
+
};
|
33162
|
+
var shrink = function shrink2(target, shrinkBy) {
|
33163
|
+
return {
|
33164
|
+
top: target.top + shrinkBy.top,
|
33165
|
+
left: target.left + shrinkBy.left,
|
33166
|
+
bottom: target.bottom - shrinkBy.bottom,
|
33167
|
+
right: target.right - shrinkBy.right
|
33168
|
+
};
|
33169
|
+
};
|
33170
|
+
var noSpacing = {
|
33171
|
+
top: 0,
|
33172
|
+
right: 0,
|
33173
|
+
bottom: 0,
|
33174
|
+
left: 0
|
33175
|
+
};
|
33176
|
+
var createBox = function createBox2(_ref2) {
|
33177
|
+
var borderBox = _ref2.borderBox, _ref2$margin = _ref2.margin, margin = _ref2$margin === void 0 ? noSpacing : _ref2$margin, _ref2$border = _ref2.border, border = _ref2$border === void 0 ? noSpacing : _ref2$border, _ref2$padding = _ref2.padding, padding = _ref2$padding === void 0 ? noSpacing : _ref2$padding;
|
33178
|
+
var marginBox = getRect(expand(borderBox, margin));
|
33179
|
+
var paddingBox = getRect(shrink(borderBox, border));
|
33180
|
+
var contentBox = getRect(shrink(paddingBox, padding));
|
33181
|
+
return {
|
33182
|
+
marginBox,
|
33183
|
+
borderBox: getRect(borderBox),
|
33184
|
+
paddingBox,
|
33185
|
+
contentBox,
|
33186
|
+
margin,
|
33187
|
+
border,
|
33188
|
+
padding
|
33189
|
+
};
|
33190
|
+
};
|
33191
|
+
var parse = function parse2(raw) {
|
33192
|
+
var value = raw.slice(0, -2);
|
33193
|
+
var suffix = raw.slice(-2);
|
33194
|
+
if (suffix !== "px") {
|
33195
|
+
return 0;
|
33196
|
+
}
|
33197
|
+
var result = Number(value);
|
33198
|
+
!!isNaN(result) ? process.env.NODE_ENV !== "production" ? invariant(false, "Could not parse value [raw: " + raw + ", without suffix: " + value + "]") : invariant(false) : void 0;
|
33199
|
+
return result;
|
33200
|
+
};
|
33201
|
+
var calculateBox = function calculateBox2(borderBox, styles) {
|
33202
|
+
var margin = {
|
33203
|
+
top: parse(styles.marginTop),
|
33204
|
+
right: parse(styles.marginRight),
|
33205
|
+
bottom: parse(styles.marginBottom),
|
33206
|
+
left: parse(styles.marginLeft)
|
33207
|
+
};
|
33208
|
+
var padding = {
|
33209
|
+
top: parse(styles.paddingTop),
|
33210
|
+
right: parse(styles.paddingRight),
|
33211
|
+
bottom: parse(styles.paddingBottom),
|
33212
|
+
left: parse(styles.paddingLeft)
|
33213
|
+
};
|
33214
|
+
var border = {
|
33215
|
+
top: parse(styles.borderTopWidth),
|
33216
|
+
right: parse(styles.borderRightWidth),
|
33217
|
+
bottom: parse(styles.borderBottomWidth),
|
33218
|
+
left: parse(styles.borderLeftWidth)
|
33219
|
+
};
|
33220
|
+
return createBox({
|
33221
|
+
borderBox,
|
33222
|
+
margin,
|
33223
|
+
padding,
|
33224
|
+
border
|
33225
|
+
});
|
33226
|
+
};
|
33227
|
+
var getBox = function getBox2(el) {
|
33228
|
+
var borderBox = el.getBoundingClientRect();
|
33229
|
+
var styles = window.getComputedStyle(el);
|
33230
|
+
return calculateBox(borderBox, styles);
|
33231
|
+
};
|
33232
|
+
|
33233
|
+
// components/Puck/components/Canvas/index.tsx
|
33234
|
+
var import_react27 = require("react");
|
33235
|
+
|
33236
|
+
// components/ViewportControls/index.tsx
|
33237
|
+
init_react_import();
|
33238
|
+
var import_react26 = require("react");
|
33239
|
+
|
33240
|
+
// components/ViewportControls/styles.module.css
|
33241
|
+
var styles_default18 = {
|
33242
|
+
ViewportControls: "styles_ViewportControls",
|
33243
|
+
"ViewportControls-divider": "styles_ViewportControls-divider",
|
33244
|
+
"ViewportControls-zoomSelect": "styles_ViewportControls-zoomSelect",
|
33245
|
+
"ViewportButton--isActive": "styles_ViewportButton--isActive",
|
33246
|
+
"ViewportButton-inner": "styles_ViewportButton-inner"
|
33247
|
+
};
|
33248
|
+
|
33249
|
+
// components/ViewportControls/index.tsx
|
33250
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
33251
|
+
var icons = {
|
33252
|
+
Smartphone: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Smartphone, { size: 16 }),
|
33253
|
+
Tablet: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Tablet, { size: 16 }),
|
33254
|
+
Monitor: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Monitor, { size: 16 })
|
33255
|
+
};
|
33256
|
+
var getClassName23 = get_class_name_factory_default("ViewportControls", styles_default18);
|
33257
|
+
var getClassNameButton = get_class_name_factory_default("ViewportButton", styles_default18);
|
33258
|
+
var ViewportButton = ({
|
33259
|
+
children,
|
33260
|
+
height = "auto",
|
33261
|
+
title,
|
33262
|
+
width,
|
33263
|
+
onClick
|
33264
|
+
}) => {
|
33265
|
+
const { state } = useAppContext();
|
33266
|
+
const [isActive, setIsActive] = (0, import_react26.useState)(false);
|
33267
|
+
(0, import_react26.useEffect)(() => {
|
33268
|
+
setIsActive(width === state.ui.viewports.current.width);
|
33269
|
+
}, [width, state.ui.viewports.current.width]);
|
33270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: getClassNameButton({ isActive }), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
33271
|
+
IconButton,
|
33272
|
+
{
|
33273
|
+
title,
|
33274
|
+
disabled: isActive,
|
33275
|
+
onClick: (e) => {
|
33276
|
+
e.stopPropagation();
|
33277
|
+
onClick({ width, height });
|
33278
|
+
},
|
33279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: getClassNameButton("inner"), children })
|
33280
|
+
}
|
33281
|
+
) });
|
33282
|
+
};
|
33283
|
+
var defaultZoomOptions = [
|
33284
|
+
{ label: "25%", value: 0.25 },
|
33285
|
+
{ label: "50%", value: 0.5 },
|
33286
|
+
{ label: "75%", value: 0.75 },
|
33287
|
+
{ label: "100%", value: 1 },
|
33288
|
+
{ label: "125%", value: 1.25 },
|
33289
|
+
{ label: "150%", value: 1.5 },
|
33290
|
+
{ label: "200%", value: 2 }
|
33291
|
+
];
|
33292
|
+
var ViewportControls = ({
|
33293
|
+
autoZoom,
|
33294
|
+
zoom,
|
33295
|
+
onViewportChange,
|
33296
|
+
onZoom
|
33297
|
+
}) => {
|
33298
|
+
const { viewports } = useAppContext();
|
33299
|
+
const defaultsContainAutoZoom = defaultZoomOptions.find(
|
33300
|
+
(option) => option.value === autoZoom
|
33301
|
+
);
|
33302
|
+
const zoomOptions = (0, import_react26.useMemo)(
|
33303
|
+
() => [
|
33304
|
+
...defaultZoomOptions,
|
33305
|
+
...defaultsContainAutoZoom ? [] : [
|
33306
|
+
{
|
33307
|
+
value: autoZoom,
|
33308
|
+
label: `${(autoZoom * 100).toFixed(0)}% (Auto)`
|
33309
|
+
}
|
33310
|
+
]
|
33311
|
+
].filter((a) => a.value <= autoZoom).sort((a, b) => a.value > b.value ? 1 : -1),
|
33312
|
+
[autoZoom]
|
33313
|
+
);
|
33314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: getClassName23(), children: [
|
33315
|
+
viewports.map((viewport, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
33316
|
+
ViewportButton,
|
33317
|
+
{
|
33318
|
+
height: viewport.height,
|
33319
|
+
width: viewport.width,
|
33320
|
+
title: viewport.label ? `Switch to ${viewport.label} viewport` : "Switch viewport",
|
33321
|
+
onClick: onViewportChange,
|
33322
|
+
children: typeof viewport.icon === "string" ? icons[viewport.icon] || viewport.icon : viewport.icon || icons.Smartphone
|
33323
|
+
},
|
33324
|
+
i
|
33325
|
+
)),
|
33326
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: getClassName23("divider") }),
|
33327
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
33328
|
+
IconButton,
|
33329
|
+
{
|
33330
|
+
title: "Zoom viewport out",
|
33331
|
+
disabled: zoom <= zoomOptions[0].value,
|
33332
|
+
onClick: (e) => {
|
33333
|
+
e.stopPropagation();
|
33334
|
+
onZoom(
|
33335
|
+
zoomOptions[Math.max(
|
33336
|
+
zoomOptions.findIndex((option) => option.value === zoom) - 1,
|
33337
|
+
0
|
33338
|
+
)].value
|
33339
|
+
);
|
33340
|
+
},
|
33341
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ZoomOut, { size: 16 })
|
33342
|
+
}
|
33343
|
+
),
|
33344
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
33345
|
+
IconButton,
|
33346
|
+
{
|
33347
|
+
title: "Zoom viewport in",
|
33348
|
+
disabled: zoom >= zoomOptions[zoomOptions.length - 1].value,
|
33349
|
+
onClick: (e) => {
|
33350
|
+
e.stopPropagation();
|
33351
|
+
onZoom(
|
33352
|
+
zoomOptions[Math.min(
|
33353
|
+
zoomOptions.findIndex((option) => option.value === zoom) + 1,
|
33354
|
+
zoomOptions.length - 1
|
33355
|
+
)].value
|
33356
|
+
);
|
33357
|
+
},
|
33358
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ZoomIn, { size: 16 })
|
33359
|
+
}
|
33360
|
+
),
|
33361
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: getClassName23("divider") }),
|
33362
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
33363
|
+
"select",
|
33364
|
+
{
|
33365
|
+
className: getClassName23("zoomSelect"),
|
33366
|
+
value: zoom.toString(),
|
33367
|
+
onChange: (e) => {
|
33368
|
+
onZoom(parseFloat(e.currentTarget.value));
|
33369
|
+
},
|
33370
|
+
children: zoomOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
33371
|
+
"option",
|
33372
|
+
{
|
33373
|
+
value: option.value,
|
33374
|
+
label: option.label
|
33375
|
+
},
|
33376
|
+
option.label
|
33377
|
+
))
|
33378
|
+
}
|
33379
|
+
)
|
33380
|
+
] });
|
33381
|
+
};
|
33382
|
+
|
33383
|
+
// components/Puck/components/Canvas/styles.module.css
|
33384
|
+
var styles_default19 = {
|
33385
|
+
PuckCanvas: "styles_PuckCanvas",
|
33386
|
+
"PuckCanvas-controls": "styles_PuckCanvas-controls",
|
33387
|
+
"PuckCanvas-inner": "styles_PuckCanvas-inner",
|
33388
|
+
"PuckCanvas-root": "styles_PuckCanvas-root",
|
33389
|
+
"PuckCanvas--ready": "styles_PuckCanvas--ready"
|
33390
|
+
};
|
33391
|
+
|
33392
|
+
// lib/get-zoom-config.ts
|
33393
|
+
init_react_import();
|
33394
|
+
var RESET_ZOOM_SMALLER_THAN_FRAME = true;
|
33395
|
+
var getZoomConfig = (uiViewport, frame, zoom) => {
|
33396
|
+
const box = getBox(frame);
|
33397
|
+
const { width: frameWidth, height: frameHeight } = box.contentBox;
|
33398
|
+
const viewportHeight = uiViewport.height === "auto" ? frameHeight : uiViewport.height;
|
33399
|
+
let rootHeight = 0;
|
33400
|
+
let autoZoom = 1;
|
33401
|
+
if (uiViewport.width > frameWidth || viewportHeight > frameHeight) {
|
33402
|
+
const widthZoom = Math.min(frameWidth / uiViewport.width, 1);
|
33403
|
+
const heightZoom = Math.min(frameHeight / viewportHeight, 1);
|
33404
|
+
zoom = widthZoom;
|
33405
|
+
if (widthZoom < heightZoom) {
|
33406
|
+
rootHeight = viewportHeight / zoom;
|
33407
|
+
} else {
|
33408
|
+
rootHeight = viewportHeight;
|
33409
|
+
zoom = heightZoom;
|
33410
|
+
}
|
33411
|
+
autoZoom = zoom;
|
33412
|
+
} else {
|
33413
|
+
if (RESET_ZOOM_SMALLER_THAN_FRAME) {
|
33414
|
+
autoZoom = 1;
|
33415
|
+
zoom = 1;
|
33416
|
+
rootHeight = viewportHeight;
|
33417
|
+
}
|
33418
|
+
}
|
33419
|
+
return { autoZoom, rootHeight, zoom };
|
33420
|
+
};
|
33421
|
+
|
33422
|
+
// components/Puck/components/Canvas/index.tsx
|
33423
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
33424
|
+
var getClassName24 = get_class_name_factory_default("PuckCanvas", styles_default19);
|
33425
|
+
var ZOOM_ON_CHANGE = true;
|
33426
|
+
var Canvas = () => {
|
33427
|
+
const { status, iframe } = useAppContext();
|
33428
|
+
const { dispatch, state, overrides, setUi, zoomConfig, setZoomConfig } = useAppContext();
|
33429
|
+
const { ui } = state;
|
33430
|
+
const frameRef = (0, import_react27.useRef)(null);
|
33431
|
+
const [showTransition, setShowTransition] = (0, import_react27.useState)(false);
|
33432
|
+
const defaultRender = (0, import_react27.useMemo)(() => {
|
33433
|
+
const PuckDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children });
|
33434
|
+
return PuckDefault;
|
33435
|
+
}, []);
|
33436
|
+
const CustomPreview = (0, import_react27.useMemo)(
|
33437
|
+
() => overrides.preview || defaultRender,
|
33438
|
+
[overrides]
|
33439
|
+
);
|
33440
|
+
const getFrameDimensions = (0, import_react27.useCallback)(() => {
|
33441
|
+
if (frameRef.current) {
|
33442
|
+
const frame = frameRef.current;
|
33443
|
+
const box = getBox(frame);
|
33444
|
+
return { width: box.contentBox.width, height: box.contentBox.height };
|
33445
|
+
}
|
33446
|
+
return { width: 0, height: 0 };
|
33447
|
+
}, [frameRef]);
|
33448
|
+
const resetAutoZoom = (0, import_react27.useCallback)(
|
33449
|
+
(ui2 = state.ui) => {
|
33450
|
+
if (frameRef.current) {
|
33451
|
+
setZoomConfig(
|
33452
|
+
getZoomConfig(ui2.viewports.current, frameRef.current, zoomConfig.zoom)
|
33453
|
+
);
|
33454
|
+
}
|
33455
|
+
},
|
33456
|
+
[frameRef, zoomConfig, state.ui]
|
33457
|
+
);
|
33458
|
+
(0, import_react27.useEffect)(() => {
|
33459
|
+
setShowTransition(false);
|
33460
|
+
resetAutoZoom();
|
33461
|
+
}, [frameRef, ui.leftSideBarVisible, ui.rightSideBarVisible]);
|
33462
|
+
(0, import_react27.useEffect)(() => {
|
33463
|
+
const { height: frameHeight } = getFrameDimensions();
|
33464
|
+
if (ui.viewports.current.height === "auto") {
|
33465
|
+
setZoomConfig(__spreadProps(__spreadValues({}, zoomConfig), {
|
33466
|
+
rootHeight: frameHeight / zoomConfig.zoom
|
33467
|
+
}));
|
33468
|
+
}
|
33469
|
+
}, [zoomConfig.zoom]);
|
33470
|
+
(0, import_react27.useEffect)(() => {
|
33471
|
+
const observer = new ResizeObserver(() => {
|
33472
|
+
setShowTransition(false);
|
33473
|
+
resetAutoZoom();
|
33474
|
+
});
|
33475
|
+
if (document.body) {
|
33476
|
+
observer.observe(document.body);
|
33477
|
+
}
|
33478
|
+
return () => {
|
33479
|
+
observer.disconnect();
|
33480
|
+
};
|
33481
|
+
}, []);
|
33482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
33483
|
+
"div",
|
33484
|
+
{
|
33485
|
+
className: getClassName24({
|
33486
|
+
ready: status === "READY" || !iframe.enabled
|
33487
|
+
}),
|
33488
|
+
onClick: () => dispatch({
|
33489
|
+
type: "setUi",
|
33490
|
+
ui: { itemSelector: null },
|
33491
|
+
recordHistory: true
|
33492
|
+
}),
|
33493
|
+
children: [
|
33494
|
+
ui.viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: getClassName24("controls"), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
33495
|
+
ViewportControls,
|
33496
|
+
{
|
33497
|
+
autoZoom: zoomConfig.autoZoom,
|
33498
|
+
zoom: zoomConfig.zoom,
|
33499
|
+
onViewportChange: (viewport) => {
|
33500
|
+
setShowTransition(true);
|
33501
|
+
const uiViewport = __spreadProps(__spreadValues({}, viewport), {
|
33502
|
+
height: viewport.height || "auto",
|
33503
|
+
zoom: zoomConfig.zoom
|
33504
|
+
});
|
33505
|
+
const newUi = __spreadProps(__spreadValues({}, ui), {
|
33506
|
+
viewports: __spreadProps(__spreadValues({}, ui.viewports), { current: uiViewport })
|
33507
|
+
});
|
33508
|
+
setUi(newUi);
|
33509
|
+
if (ZOOM_ON_CHANGE) {
|
33510
|
+
resetAutoZoom(newUi);
|
33511
|
+
}
|
33512
|
+
},
|
33513
|
+
onZoom: (zoom) => {
|
33514
|
+
setShowTransition(true);
|
33515
|
+
setZoomConfig(__spreadProps(__spreadValues({}, zoomConfig), { zoom }));
|
33516
|
+
}
|
33517
|
+
}
|
33518
|
+
) }),
|
33519
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: getClassName24("inner"), ref: frameRef, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
33520
|
+
"div",
|
33521
|
+
{
|
33522
|
+
className: getClassName24("root"),
|
33523
|
+
style: {
|
33524
|
+
width: iframe.enabled ? ui.viewports.current.width : void 0,
|
33525
|
+
height: zoomConfig.rootHeight,
|
33526
|
+
transform: iframe.enabled ? `scale(${zoomConfig.zoom})` : void 0,
|
33527
|
+
transition: showTransition ? "width 150ms ease-out, height 150ms ease-out, transform 150ms ease-out" : "",
|
33528
|
+
overflow: iframe.enabled ? void 0 : "auto"
|
33529
|
+
},
|
33530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Preview, {}) })
|
33531
|
+
}
|
33532
|
+
) })
|
33533
|
+
]
|
33534
|
+
}
|
33535
|
+
);
|
33536
|
+
};
|
33537
|
+
|
32734
33538
|
// components/Puck/index.tsx
|
32735
|
-
var
|
32736
|
-
var
|
33539
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
33540
|
+
var getClassName25 = get_class_name_factory_default("Puck", styles_default8);
|
32737
33541
|
function Puck({
|
32738
33542
|
children,
|
32739
33543
|
config,
|
32740
33544
|
data: initialData = { content: [], root: { props: { title: "" } } },
|
32741
|
-
ui: initialUi
|
33545
|
+
ui: initialUi,
|
32742
33546
|
onChange,
|
32743
33547
|
onPublish,
|
32744
33548
|
plugins = [],
|
@@ -32746,32 +33550,63 @@ function Puck({
|
|
32746
33550
|
renderHeader,
|
32747
33551
|
renderHeaderActions,
|
32748
33552
|
headerTitle,
|
32749
|
-
headerPath
|
33553
|
+
headerPath,
|
33554
|
+
viewports = defaultViewports,
|
33555
|
+
iframe = {
|
33556
|
+
enabled: true
|
33557
|
+
}
|
32750
33558
|
}) {
|
33559
|
+
var _a;
|
32751
33560
|
const historyStore = useHistoryStore();
|
32752
|
-
const [reducer] = (0,
|
33561
|
+
const [reducer] = (0, import_react28.useState)(
|
32753
33562
|
() => createReducer({ config, record: historyStore.record })
|
32754
33563
|
);
|
32755
|
-
const [initialAppState] = (0,
|
32756
|
-
|
32757
|
-
|
32758
|
-
|
32759
|
-
|
32760
|
-
|
32761
|
-
|
32762
|
-
|
32763
|
-
|
32764
|
-
|
32765
|
-
|
32766
|
-
|
32767
|
-
|
32768
|
-
|
32769
|
-
|
32770
|
-
{
|
32771
|
-
|
32772
|
-
|
32773
|
-
|
32774
|
-
|
33564
|
+
const [initialAppState] = (0, import_react28.useState)(() => {
|
33565
|
+
var _a2, _b, _c, _d;
|
33566
|
+
const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
|
33567
|
+
let clientUiState = {};
|
33568
|
+
if (typeof window !== "undefined") {
|
33569
|
+
const viewportWidth = window.innerWidth;
|
33570
|
+
const viewportDifferences = Object.entries(viewports).map(([key, value]) => ({
|
33571
|
+
key,
|
33572
|
+
diff: Math.abs(viewportWidth - value.width)
|
33573
|
+
})).sort((a, b) => a.diff > b.diff ? 1 : -1);
|
33574
|
+
const closestViewport = viewportDifferences[0].key;
|
33575
|
+
if (iframe.enabled) {
|
33576
|
+
clientUiState = __spreadProps(__spreadValues({}, window.matchMedia("(min-width: 638px)").matches ? {} : {
|
33577
|
+
leftSideBarVisible: false,
|
33578
|
+
rightSideBarVisible: false
|
33579
|
+
}), {
|
33580
|
+
viewports: __spreadProps(__spreadValues({}, initial.viewports), {
|
33581
|
+
current: __spreadProps(__spreadValues({}, initial.viewports.current), {
|
33582
|
+
height: ((_b = (_a2 = initialUi == null ? void 0 : initialUi.viewports) == null ? void 0 : _a2.current) == null ? void 0 : _b.height) || viewports[closestViewport].height || "auto",
|
33583
|
+
width: ((_d = (_c = initialUi == null ? void 0 : initialUi.viewports) == null ? void 0 : _c.current) == null ? void 0 : _d.width) || viewports[closestViewport].width
|
33584
|
+
})
|
33585
|
+
})
|
33586
|
+
});
|
33587
|
+
}
|
33588
|
+
}
|
33589
|
+
return __spreadProps(__spreadValues({}, defaultAppState), {
|
33590
|
+
data: initialData,
|
33591
|
+
ui: __spreadProps(__spreadValues(__spreadValues({}, initial), clientUiState), {
|
33592
|
+
// Store categories under componentList on state to allow render functions and plugins to modify
|
33593
|
+
componentList: config.categories ? Object.entries(config.categories).reduce(
|
33594
|
+
(acc, [categoryName, category]) => {
|
33595
|
+
return __spreadProps(__spreadValues({}, acc), {
|
33596
|
+
[categoryName]: {
|
33597
|
+
title: category.title,
|
33598
|
+
components: category.components,
|
33599
|
+
expanded: category.defaultExpanded,
|
33600
|
+
visible: category.visible
|
33601
|
+
}
|
33602
|
+
});
|
33603
|
+
},
|
33604
|
+
{}
|
33605
|
+
) : {}
|
33606
|
+
})
|
33607
|
+
});
|
33608
|
+
});
|
33609
|
+
const [appState, dispatch] = (0, import_react28.useReducer)(
|
32775
33610
|
reducer,
|
32776
33611
|
flushZones(initialAppState)
|
32777
33612
|
);
|
@@ -32782,9 +33617,9 @@ function Puck({
|
|
32782
33617
|
config,
|
32783
33618
|
dispatch
|
32784
33619
|
);
|
32785
|
-
const [menuOpen, setMenuOpen] = (0,
|
33620
|
+
const [menuOpen, setMenuOpen] = (0, import_react28.useState)(false);
|
32786
33621
|
const { itemSelector, leftSideBarVisible, rightSideBarVisible } = ui;
|
32787
|
-
const setItemSelector = (0,
|
33622
|
+
const setItemSelector = (0, import_react28.useCallback)(
|
32788
33623
|
(newItemSelector) => {
|
32789
33624
|
if (newItemSelector === itemSelector)
|
32790
33625
|
return;
|
@@ -32797,21 +33632,21 @@ function Puck({
|
|
32797
33632
|
[itemSelector]
|
32798
33633
|
);
|
32799
33634
|
const selectedItem = itemSelector ? getItem(itemSelector, data) : null;
|
32800
|
-
(0,
|
33635
|
+
(0, import_react28.useEffect)(() => {
|
32801
33636
|
if (onChange)
|
32802
33637
|
onChange(data);
|
32803
33638
|
}, [data]);
|
32804
33639
|
const { onDragStartOrUpdate, placeholderStyle } = usePlaceholderStyle();
|
32805
|
-
const [draggedItem, setDraggedItem] = (0,
|
33640
|
+
const [draggedItem, setDraggedItem] = (0, import_react28.useState)();
|
32806
33641
|
const rootProps = data.root.props || data.root;
|
32807
|
-
(0,
|
33642
|
+
(0, import_react28.useEffect)(() => {
|
32808
33643
|
if (Object.keys(data.root).length > 0 && !data.root.props) {
|
32809
33644
|
console.error(
|
32810
33645
|
"Warning: Defining props on `root` is deprecated. Please use `root.props`. This will be a breaking change in a future release."
|
32811
33646
|
);
|
32812
33647
|
}
|
32813
33648
|
}, []);
|
32814
|
-
const toggleSidebars = (0,
|
33649
|
+
const toggleSidebars = (0, import_react28.useCallback)(
|
32815
33650
|
(sidebar) => {
|
32816
33651
|
const widerViewport = window.matchMedia("(min-width: 638px)").matches;
|
32817
33652
|
const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
|
@@ -32825,7 +33660,7 @@ function Puck({
|
|
32825
33660
|
},
|
32826
33661
|
[dispatch, leftSideBarVisible, rightSideBarVisible]
|
32827
33662
|
);
|
32828
|
-
(0,
|
33663
|
+
(0, import_react28.useEffect)(() => {
|
32829
33664
|
if (!window.matchMedia("(min-width: 638px)").matches) {
|
32830
33665
|
dispatch({
|
32831
33666
|
type: "setUi",
|
@@ -32848,59 +33683,54 @@ function Puck({
|
|
32848
33683
|
window.removeEventListener("resize", handleResize);
|
32849
33684
|
};
|
32850
33685
|
}, []);
|
32851
|
-
const defaultRender = (0,
|
32852
|
-
const PuckDefault = ({ children: children2 }) => /* @__PURE__ */ (0,
|
33686
|
+
const defaultRender = (0, import_react28.useMemo)(() => {
|
33687
|
+
const PuckDefault = ({ children: children2 }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_jsx_runtime34.Fragment, { children: children2 });
|
32853
33688
|
return PuckDefault;
|
32854
33689
|
}, []);
|
32855
|
-
const defaultHeaderRender = (0,
|
33690
|
+
const defaultHeaderRender = (0, import_react28.useMemo)(() => {
|
32856
33691
|
if (renderHeader) {
|
32857
33692
|
console.warn(
|
32858
33693
|
"`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"
|
32859
33694
|
);
|
32860
|
-
const RenderHeader = (
|
32861
|
-
var _b =
|
33695
|
+
const RenderHeader = (_a2) => {
|
33696
|
+
var _b = _a2, { actions } = _b, props = __objRest(_b, ["actions"]);
|
32862
33697
|
const Comp = renderHeader;
|
32863
|
-
return /* @__PURE__ */ (0,
|
33698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState, children: actions }));
|
32864
33699
|
};
|
32865
33700
|
return RenderHeader;
|
32866
33701
|
}
|
32867
33702
|
return defaultRender;
|
32868
33703
|
}, [renderHeader]);
|
32869
|
-
const defaultHeaderActionsRender = (0,
|
33704
|
+
const defaultHeaderActionsRender = (0, import_react28.useMemo)(() => {
|
32870
33705
|
if (renderHeaderActions) {
|
32871
33706
|
console.warn(
|
32872
33707
|
"`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."
|
32873
33708
|
);
|
32874
33709
|
const RenderHeader = (props) => {
|
32875
33710
|
const Comp = renderHeaderActions;
|
32876
|
-
return /* @__PURE__ */ (0,
|
33711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState }));
|
32877
33712
|
};
|
32878
33713
|
return RenderHeader;
|
32879
33714
|
}
|
32880
33715
|
return defaultRender;
|
32881
33716
|
}, [renderHeader]);
|
32882
|
-
const loadedOverrides = (0,
|
33717
|
+
const loadedOverrides = (0, import_react28.useMemo)(() => {
|
32883
33718
|
return loadOverrides({ overrides, plugins });
|
32884
33719
|
}, [plugins]);
|
32885
|
-
const CustomPuck = (0,
|
33720
|
+
const CustomPuck = (0, import_react28.useMemo)(
|
32886
33721
|
() => loadedOverrides.puck || defaultRender,
|
32887
33722
|
[loadedOverrides]
|
32888
33723
|
);
|
32889
|
-
const
|
32890
|
-
() => loadedOverrides.preview || defaultRender,
|
32891
|
-
[loadedOverrides]
|
32892
|
-
);
|
32893
|
-
const CustomHeader = (0, import_react26.useMemo)(
|
33724
|
+
const CustomHeader = (0, import_react28.useMemo)(
|
32894
33725
|
() => loadedOverrides.header || defaultHeaderRender,
|
32895
33726
|
[loadedOverrides]
|
32896
33727
|
);
|
32897
|
-
const CustomHeaderActions = (0,
|
33728
|
+
const CustomHeaderActions = (0, import_react28.useMemo)(
|
32898
33729
|
() => loadedOverrides.headerActions || defaultHeaderActionsRender,
|
32899
33730
|
[loadedOverrides]
|
32900
33731
|
);
|
32901
|
-
|
32902
|
-
|
32903
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
33732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "Puck", children: [
|
33733
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
32904
33734
|
AppProvider,
|
32905
33735
|
{
|
32906
33736
|
value: {
|
@@ -32911,10 +33741,12 @@ function Puck({
|
|
32911
33741
|
resolveData,
|
32912
33742
|
plugins,
|
32913
33743
|
overrides: loadedOverrides,
|
32914
|
-
history
|
33744
|
+
history,
|
33745
|
+
viewports,
|
33746
|
+
iframe
|
32915
33747
|
},
|
32916
|
-
children: /* @__PURE__ */ (0,
|
32917
|
-
|
33748
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
33749
|
+
DragDropContext,
|
32918
33750
|
{
|
32919
33751
|
onDragUpdate: (update) => {
|
32920
33752
|
setDraggedItem(__spreadValues(__spreadValues({}, draggedItem), update));
|
@@ -32968,7 +33800,7 @@ function Puck({
|
|
32968
33800
|
});
|
32969
33801
|
}
|
32970
33802
|
},
|
32971
|
-
children: /* @__PURE__ */ (0,
|
33803
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
32972
33804
|
DropZoneProvider,
|
32973
33805
|
{
|
32974
33806
|
value: {
|
@@ -32980,77 +33812,75 @@ function Puck({
|
|
32980
33812
|
draggedItem,
|
32981
33813
|
placeholderStyle,
|
32982
33814
|
mode: "edit",
|
32983
|
-
areaId: "root"
|
32984
|
-
disableZoom
|
33815
|
+
areaId: "root"
|
32985
33816
|
},
|
32986
|
-
children: /* @__PURE__ */ (0,
|
33817
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CustomPuck, { children: children || /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
32987
33818
|
"div",
|
32988
33819
|
{
|
32989
|
-
className:
|
33820
|
+
className: getClassName25({
|
32990
33821
|
leftSideBarVisible,
|
32991
33822
|
menuOpen,
|
32992
|
-
rightSideBarVisible
|
32993
|
-
disableZoom
|
33823
|
+
rightSideBarVisible
|
32994
33824
|
}),
|
32995
33825
|
children: [
|
32996
|
-
/* @__PURE__ */ (0,
|
33826
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
32997
33827
|
CustomHeader,
|
32998
33828
|
{
|
32999
|
-
actions: /* @__PURE__ */ (0,
|
33000
|
-
/* @__PURE__ */ (0,
|
33001
|
-
/* @__PURE__ */ (0,
|
33829
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
33830
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CustomHeaderActions, {}),
|
33831
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
33002
33832
|
Button,
|
33003
33833
|
{
|
33004
33834
|
onClick: () => {
|
33005
33835
|
onPublish && onPublish(data);
|
33006
33836
|
},
|
33007
|
-
icon: /* @__PURE__ */ (0,
|
33837
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Globe, { size: "14px" }),
|
33008
33838
|
children: "Publish"
|
33009
33839
|
}
|
33010
33840
|
)
|
33011
33841
|
] }),
|
33012
|
-
children: /* @__PURE__ */ (0,
|
33013
|
-
/* @__PURE__ */ (0,
|
33014
|
-
/* @__PURE__ */ (0,
|
33842
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("header", { className: getClassName25("header"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: getClassName25("headerInner"), children: [
|
33843
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: getClassName25("headerToggle"), children: [
|
33844
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName25("leftSideBarToggle"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
33015
33845
|
IconButton,
|
33016
33846
|
{
|
33017
33847
|
onClick: () => {
|
33018
33848
|
toggleSidebars("left");
|
33019
33849
|
},
|
33020
33850
|
title: "Toggle left sidebar",
|
33021
|
-
children: /* @__PURE__ */ (0,
|
33851
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PanelLeft, { focusable: "false" })
|
33022
33852
|
}
|
33023
33853
|
) }),
|
33024
|
-
/* @__PURE__ */ (0,
|
33854
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName25("rightSideBarToggle"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
33025
33855
|
IconButton,
|
33026
33856
|
{
|
33027
33857
|
onClick: () => {
|
33028
33858
|
toggleSidebars("right");
|
33029
33859
|
},
|
33030
33860
|
title: "Toggle right sidebar",
|
33031
|
-
children: /* @__PURE__ */ (0,
|
33861
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PanelRight, { focusable: "false" })
|
33032
33862
|
}
|
33033
33863
|
) })
|
33034
33864
|
] }),
|
33035
|
-
/* @__PURE__ */ (0,
|
33865
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName25("headerTitle"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Heading, { rank: 2, size: "xs", children: [
|
33036
33866
|
headerTitle || rootProps.title || "Page",
|
33037
|
-
headerPath && /* @__PURE__ */ (0,
|
33867
|
+
headerPath && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
33038
33868
|
" ",
|
33039
|
-
/* @__PURE__ */ (0,
|
33869
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("code", { className: getClassName25("headerPath"), children: headerPath })
|
33040
33870
|
] })
|
33041
33871
|
] }) }),
|
33042
|
-
/* @__PURE__ */ (0,
|
33043
|
-
/* @__PURE__ */ (0,
|
33872
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: getClassName25("headerTools"), children: [
|
33873
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName25("menuButton"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
33044
33874
|
IconButton,
|
33045
33875
|
{
|
33046
33876
|
onClick: () => {
|
33047
33877
|
return setMenuOpen(!menuOpen);
|
33048
33878
|
},
|
33049
33879
|
title: "Toggle menu bar",
|
33050
|
-
children: menuOpen ? /* @__PURE__ */ (0,
|
33880
|
+
children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChevronDown, { focusable: "false" })
|
33051
33881
|
}
|
33052
33882
|
) }),
|
33053
|
-
/* @__PURE__ */ (0,
|
33883
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
33054
33884
|
MenuBar,
|
33055
33885
|
{
|
33056
33886
|
appState,
|
@@ -33058,7 +33888,7 @@ function Puck({
|
|
33058
33888
|
dispatch,
|
33059
33889
|
onPublish,
|
33060
33890
|
menuOpen,
|
33061
|
-
renderHeaderActions: () => /* @__PURE__ */ (0,
|
33891
|
+
renderHeaderActions: () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CustomHeaderActions, {}),
|
33062
33892
|
setMenuOpen
|
33063
33893
|
}
|
33064
33894
|
)
|
@@ -33066,38 +33896,19 @@ function Puck({
|
|
33066
33896
|
] }) })
|
33067
33897
|
}
|
33068
33898
|
),
|
33069
|
-
/* @__PURE__ */ (0,
|
33070
|
-
/* @__PURE__ */ (0,
|
33071
|
-
/* @__PURE__ */ (0,
|
33899
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: getClassName25("leftSideBar"), children: [
|
33900
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SidebarSection, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Components, {}) }),
|
33901
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SidebarSection, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Outline, {}) })
|
33072
33902
|
] }),
|
33073
|
-
/* @__PURE__ */ (0,
|
33074
|
-
|
33075
|
-
{
|
33076
|
-
className: getClassName22("frame"),
|
33077
|
-
onClick: () => setItemSelector(null),
|
33078
|
-
children: [
|
33079
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: getClassName22("root"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Preview, {}) }) }),
|
33080
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
33081
|
-
"div",
|
33082
|
-
{
|
33083
|
-
style: {
|
33084
|
-
background: "var(--puck-color-grey-11)",
|
33085
|
-
height: "100%",
|
33086
|
-
flexGrow: 1
|
33087
|
-
}
|
33088
|
-
}
|
33089
|
-
)
|
33090
|
-
]
|
33091
|
-
}
|
33092
|
-
),
|
33093
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: getClassName22("rightSideBar"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
33903
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Canvas, {}),
|
33904
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName25("rightSideBar"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
33094
33905
|
SidebarSection,
|
33095
33906
|
{
|
33096
33907
|
noPadding: true,
|
33097
33908
|
noBorderTop: true,
|
33098
33909
|
showBreadcrumbs: true,
|
33099
|
-
title: selectedItem ? selectedItem.type : "Page",
|
33100
|
-
children: /* @__PURE__ */ (0,
|
33910
|
+
title: selectedItem ? (_a = config.components[selectedItem.type]["label"]) != null ? _a : selectedItem.type : "Page",
|
33911
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Fields, {})
|
33101
33912
|
}
|
33102
33913
|
) })
|
33103
33914
|
]
|
@@ -33109,7 +33920,7 @@ function Puck({
|
|
33109
33920
|
)
|
33110
33921
|
}
|
33111
33922
|
),
|
33112
|
-
/* @__PURE__ */ (0,
|
33923
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { id: "puck-portal-root" })
|
33113
33924
|
] });
|
33114
33925
|
}
|
33115
33926
|
Puck.Components = Components;
|
@@ -33119,13 +33930,13 @@ Puck.Preview = Preview;
|
|
33119
33930
|
|
33120
33931
|
// components/Render/index.tsx
|
33121
33932
|
init_react_import();
|
33122
|
-
var
|
33933
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
33123
33934
|
function Render({ config, data }) {
|
33124
33935
|
var _a;
|
33125
33936
|
const rootProps = data.root.props || data.root;
|
33126
33937
|
const title = (rootProps == null ? void 0 : rootProps.title) || "";
|
33127
33938
|
if ((_a = config.root) == null ? void 0 : _a.render) {
|
33128
|
-
return /* @__PURE__ */ (0,
|
33939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DropZoneProvider, { value: { data, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
33129
33940
|
config.root.render,
|
33130
33941
|
__spreadProps(__spreadValues({}, rootProps), {
|
33131
33942
|
puck: {
|
@@ -33134,11 +33945,11 @@ function Render({ config, data }) {
|
|
33134
33945
|
title,
|
33135
33946
|
editMode: false,
|
33136
33947
|
id: "puck-root",
|
33137
|
-
children: /* @__PURE__ */ (0,
|
33948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DropZone, { zone: rootDroppableId })
|
33138
33949
|
})
|
33139
33950
|
) });
|
33140
33951
|
}
|
33141
|
-
return /* @__PURE__ */ (0,
|
33952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DropZoneProvider, { value: { data, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DropZone, { zone: rootDroppableId }) });
|
33142
33953
|
}
|
33143
33954
|
|
33144
33955
|
// lib/migrate.ts
|
@@ -33228,8 +34039,20 @@ var resolveAllData = (data, config, onResolveStart, onResolveEnd) => __async(voi
|
|
33228
34039
|
// lib/use-puck.ts
|
33229
34040
|
init_react_import();
|
33230
34041
|
var usePuck = () => {
|
33231
|
-
const {
|
33232
|
-
|
34042
|
+
const {
|
34043
|
+
state: appState,
|
34044
|
+
config,
|
34045
|
+
history,
|
34046
|
+
dispatch,
|
34047
|
+
selectedItem
|
34048
|
+
} = useAppContext();
|
34049
|
+
return {
|
34050
|
+
appState,
|
34051
|
+
config,
|
34052
|
+
dispatch,
|
34053
|
+
history,
|
34054
|
+
selectedItem: selectedItem || null
|
34055
|
+
};
|
33233
34056
|
};
|
33234
34057
|
// Annotate the CommonJS export names for ESM import in node:
|
33235
34058
|
0 && (module.exports = {
|
@@ -33433,6 +34256,14 @@ lucide-react/dist/esm/icons/lock.js:
|
|
33433
34256
|
* See the LICENSE file in the root directory of this source tree.
|
33434
34257
|
*)
|
33435
34258
|
|
34259
|
+
lucide-react/dist/esm/icons/monitor.js:
|
34260
|
+
(**
|
34261
|
+
* @license lucide-react v0.298.0 - ISC
|
34262
|
+
*
|
34263
|
+
* This source code is licensed under the ISC license.
|
34264
|
+
* See the LICENSE file in the root directory of this source tree.
|
34265
|
+
*)
|
34266
|
+
|
33436
34267
|
lucide-react/dist/esm/icons/more-vertical.js:
|
33437
34268
|
(**
|
33438
34269
|
* @license lucide-react v0.298.0 - ISC
|
@@ -33481,6 +34312,22 @@ lucide-react/dist/esm/icons/sliders-horizontal.js:
|
|
33481
34312
|
* See the LICENSE file in the root directory of this source tree.
|
33482
34313
|
*)
|
33483
34314
|
|
34315
|
+
lucide-react/dist/esm/icons/smartphone.js:
|
34316
|
+
(**
|
34317
|
+
* @license lucide-react v0.298.0 - ISC
|
34318
|
+
*
|
34319
|
+
* This source code is licensed under the ISC license.
|
34320
|
+
* See the LICENSE file in the root directory of this source tree.
|
34321
|
+
*)
|
34322
|
+
|
34323
|
+
lucide-react/dist/esm/icons/tablet.js:
|
34324
|
+
(**
|
34325
|
+
* @license lucide-react v0.298.0 - ISC
|
34326
|
+
*
|
34327
|
+
* This source code is licensed under the ISC license.
|
34328
|
+
* See the LICENSE file in the root directory of this source tree.
|
34329
|
+
*)
|
34330
|
+
|
33484
34331
|
lucide-react/dist/esm/icons/trash.js:
|
33485
34332
|
(**
|
33486
34333
|
* @license lucide-react v0.298.0 - ISC
|
@@ -33505,6 +34352,22 @@ lucide-react/dist/esm/icons/unlock.js:
|
|
33505
34352
|
* See the LICENSE file in the root directory of this source tree.
|
33506
34353
|
*)
|
33507
34354
|
|
34355
|
+
lucide-react/dist/esm/icons/zoom-in.js:
|
34356
|
+
(**
|
34357
|
+
* @license lucide-react v0.298.0 - ISC
|
34358
|
+
*
|
34359
|
+
* This source code is licensed under the ISC license.
|
34360
|
+
* See the LICENSE file in the root directory of this source tree.
|
34361
|
+
*)
|
34362
|
+
|
34363
|
+
lucide-react/dist/esm/icons/zoom-out.js:
|
34364
|
+
(**
|
34365
|
+
* @license lucide-react v0.298.0 - ISC
|
34366
|
+
*
|
34367
|
+
* This source code is licensed under the ISC license.
|
34368
|
+
* See the LICENSE file in the root directory of this source tree.
|
34369
|
+
*)
|
34370
|
+
|
33508
34371
|
lucide-react/dist/esm/lucide-react.js:
|
33509
34372
|
(**
|
33510
34373
|
* @license lucide-react v0.298.0 - ISC
|