@puckeditor/plugin-pages 0.9.0-canary.ecc60986 → 0.9.0-canary.ef531ef9
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/index.css +178 -162
- package/dist/index.d.mts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +71 -33
- package/dist/index.mjs +71 -33
- package/package.json +5 -5
package/dist/index.css
CHANGED
|
@@ -438,12 +438,12 @@ p {
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
/* css-module:/home/runner/work/platform/platform/packages/platform-client/components/ActionModal/ActionModal.module.css/#css-module-data */
|
|
441
|
-
.
|
|
441
|
+
._ActionModal_10j8y_1 {
|
|
442
442
|
display: block;
|
|
443
443
|
min-width: 356px;
|
|
444
444
|
}
|
|
445
|
-
._ActionModal-
|
|
446
|
-
color: var(--puck-color-grey-02);
|
|
445
|
+
._ActionModal-header_10j8y_6 {
|
|
446
|
+
color: var( --_puck-platform-action-modal-color-text, var(--puck-color-grey-02) );
|
|
447
447
|
display: flex;
|
|
448
448
|
justify-content: center;
|
|
449
449
|
text-align: center;
|
|
@@ -452,27 +452,27 @@ p {
|
|
|
452
452
|
padding: 24px;
|
|
453
453
|
padding-bottom: 16px;
|
|
454
454
|
}
|
|
455
|
-
._ActionModal-
|
|
455
|
+
._ActionModal-body_10j8y_20 {
|
|
456
456
|
display: flex;
|
|
457
457
|
flex-direction: column;
|
|
458
458
|
gap: 16px;
|
|
459
459
|
padding: 24px;
|
|
460
460
|
padding-top: 8px;
|
|
461
461
|
}
|
|
462
|
-
._ActionModal-
|
|
463
|
-
border-top: 1px solid var(--puck-color-grey-09);
|
|
464
|
-
background-color: var(--puck-color-grey-12);
|
|
462
|
+
._ActionModal-footer_10j8y_28 {
|
|
463
|
+
border-top: var( --_puck-platform-action-modal-footer-border-top, 1px solid var(--puck-color-grey-09) );
|
|
464
|
+
background-color: var( --_puck-platform-action-modal-footer-color-bg, var(--puck-color-grey-12) );
|
|
465
465
|
display: flex;
|
|
466
466
|
justify-content: flex-end;
|
|
467
467
|
padding: 16px 24px;
|
|
468
468
|
}
|
|
469
469
|
|
|
470
470
|
/* css-module:/home/runner/work/platform/platform/packages/platform-client/components/Modal/Modal.module.css/#css-module-data */
|
|
471
|
-
._Modal-
|
|
471
|
+
._Modal-background_10jdm_1 {
|
|
472
472
|
align-items: center;
|
|
473
473
|
display: flex;
|
|
474
474
|
justify-content: center;
|
|
475
|
-
background: #00000050;
|
|
475
|
+
background: var(--_puck-platform-modal-color-backdrop, #00000050);
|
|
476
476
|
position: fixed;
|
|
477
477
|
top: 0;
|
|
478
478
|
left: 0;
|
|
@@ -482,14 +482,14 @@ p {
|
|
|
482
482
|
opacity: 0;
|
|
483
483
|
pointer-events: none;
|
|
484
484
|
}
|
|
485
|
-
._Modal--
|
|
485
|
+
._Modal--visible_10jdm_16 > ._Modal-background_10jdm_1 {
|
|
486
486
|
opacity: 1;
|
|
487
|
-
transition: opacity ease 100ms;
|
|
487
|
+
transition: var(--_puck-platform-modal-transition, opacity ease 100ms);
|
|
488
488
|
pointer-events: auto;
|
|
489
489
|
}
|
|
490
|
-
._Modal-
|
|
491
|
-
background: white;
|
|
492
|
-
border-radius: 16px;
|
|
490
|
+
._Modal-modal_10jdm_22 {
|
|
491
|
+
background: var(--_puck-platform-modal-color-bg, white);
|
|
492
|
+
border-radius: var(--_puck-platform-modal-radius, 16px);
|
|
493
493
|
display: block;
|
|
494
494
|
max-height: calc(100vh - 24px);
|
|
495
495
|
margin-inline: 24px;
|
|
@@ -497,148 +497,162 @@ p {
|
|
|
497
497
|
}
|
|
498
498
|
|
|
499
499
|
/* css-module:/home/runner/work/platform/platform/packages/platform-client/components/Button/Button.module.css/#css-module-data */
|
|
500
|
-
.
|
|
500
|
+
._Button_z2rgr_1 {
|
|
501
501
|
appearance: none;
|
|
502
|
-
background: none;
|
|
503
|
-
border: 1px solid transparent;
|
|
504
|
-
border-radius: 8px;
|
|
505
|
-
color: var(--puck-color-white);
|
|
502
|
+
background: var(--_puck-platform-button-color-bg, none);
|
|
503
|
+
border: var(--_puck-platform-button-border, 1px solid transparent);
|
|
504
|
+
border-radius: var(--_puck-platform-button-radius, 8px);
|
|
505
|
+
color: var(--_puck-platform-button-color-text, var(--puck-color-white));
|
|
506
506
|
display: inline-flex;
|
|
507
507
|
align-items: center;
|
|
508
508
|
gap: 8px;
|
|
509
|
-
letter-spacing: 0.05ch;
|
|
510
|
-
font-family: var(--puck-font-family);
|
|
511
|
-
font-size: 14px;
|
|
512
|
-
font-weight: 400;
|
|
509
|
+
letter-spacing: var(--_puck-platform-button-letter-spacing, 0.05ch);
|
|
510
|
+
font-family: var( --_puck-platform-button-font-family, var(--puck-font-family) );
|
|
511
|
+
font-size: var(--_puck-platform-button-font-size, 14px);
|
|
512
|
+
font-weight: var(--_puck-platform-button-font-weight, 400);
|
|
513
513
|
box-sizing: border-box;
|
|
514
|
-
line-height: 1;
|
|
514
|
+
line-height: var(--_puck-platform-button-line-height, 1);
|
|
515
515
|
text-align: center;
|
|
516
516
|
text-decoration: none;
|
|
517
|
-
transition: background-color 50ms ease-in;
|
|
517
|
+
transition: var( --_puck-platform-button-transition, background-color 50ms ease-in );
|
|
518
518
|
cursor: pointer;
|
|
519
519
|
white-space: nowrap;
|
|
520
520
|
margin: 0;
|
|
521
521
|
}
|
|
522
|
-
.
|
|
523
|
-
.
|
|
524
|
-
transition: none;
|
|
522
|
+
._Button_z2rgr_1:hover,
|
|
523
|
+
._Button_z2rgr_1:active {
|
|
524
|
+
transition: var(--_puck-platform-button-transition-interactive, none);
|
|
525
525
|
}
|
|
526
|
-
.
|
|
527
|
-
outline: 2px solid var(--puck-color-azure-05);
|
|
528
|
-
outline-offset: 2px;
|
|
526
|
+
._Button_z2rgr_1:focus-visible {
|
|
527
|
+
outline: var( --_puck-platform-button-focus-outline, 2px solid var(--puck-color-azure-05) );
|
|
528
|
+
outline-offset: var(--_puck-platform-button-focus-outline-offset, 2px);
|
|
529
529
|
}
|
|
530
|
-
._Button--
|
|
531
|
-
font-size: var(--puck-font-size-xxxs);
|
|
530
|
+
._Button--tiny_z2rgr_43 {
|
|
531
|
+
font-size: var( --_puck-platform-button-tiny-font-size, var(--puck-font-size-xxxs) );
|
|
532
532
|
padding: 2px 8px;
|
|
533
533
|
}
|
|
534
|
-
._Button--
|
|
535
|
-
font-size: var(--puck-font-size-xxs);
|
|
534
|
+
._Button--small_z2rgr_51 {
|
|
535
|
+
font-size: var( --_puck-platform-button-small-font-size, var(--puck-font-size-xxs) );
|
|
536
536
|
padding: 4px 8px;
|
|
537
537
|
}
|
|
538
|
-
._Button--
|
|
538
|
+
._Button--medium_z2rgr_59 {
|
|
539
|
+
font-size: var(--_puck-platform-button-medium-font-size, 14px);
|
|
540
|
+
font-weight: var(--_puck-platform-button-medium-font-weight, 400);
|
|
539
541
|
min-height: 34px;
|
|
540
542
|
padding-bottom: 7px;
|
|
541
543
|
padding-left: 15px;
|
|
542
544
|
padding-right: 15px;
|
|
543
545
|
padding-top: 7px;
|
|
544
546
|
}
|
|
545
|
-
._Button--
|
|
547
|
+
._Button--large_z2rgr_69 {
|
|
548
|
+
font-size: var(--_puck-platform-button-large-font-size, 14px);
|
|
549
|
+
font-weight: var(--_puck-platform-button-large-font-weight, 400);
|
|
546
550
|
padding-bottom: 11px;
|
|
547
551
|
padding-left: 19px;
|
|
548
552
|
padding-right: 19px;
|
|
549
553
|
padding-top: 11px;
|
|
550
554
|
}
|
|
551
|
-
._Button--
|
|
552
|
-
background-image:
|
|
553
|
-
linear-gradient(
|
|
554
|
-
210deg,
|
|
555
|
-
var(--puck-color-azure-01) 0%,
|
|
556
|
-
var(--puck-color-azure-03) 30%,
|
|
557
|
-
var(--puck-color-red-05) 130%);
|
|
555
|
+
._Button--brand_z2rgr_78 {
|
|
556
|
+
background-image: var( --_puck-platform-button-brand-background-image, linear-gradient( 210deg, var(--puck-color-azure-01) 0%, var(--puck-color-azure-03) 30%, var(--puck-color-red-05) 130% ) );
|
|
558
557
|
border: none;
|
|
559
558
|
}
|
|
560
559
|
@media (hover: hover) and (pointer: fine) {
|
|
561
|
-
._Button--
|
|
562
|
-
opacity: 0.8;
|
|
560
|
+
._Button--brand_z2rgr_78:hover {
|
|
561
|
+
opacity: var(--_puck-platform-button-brand-opacity-hover, 0.8);
|
|
563
562
|
}
|
|
564
563
|
}
|
|
565
|
-
._Button--
|
|
566
|
-
opacity: 0.8;
|
|
564
|
+
._Button--brand_z2rgr_78:active {
|
|
565
|
+
opacity: var(--_puck-platform-button-brand-opacity-active, 0.8);
|
|
567
566
|
}
|
|
568
|
-
._Button--
|
|
569
|
-
background: var(--puck-color-azure-04);
|
|
567
|
+
._Button--primary_z2rgr_101 {
|
|
568
|
+
background: var( --_puck-platform-button-primary-color-bg, var(--puck-color-azure-04) );
|
|
569
|
+
border: var(--_puck-platform-button-primary-border, 1px solid transparent);
|
|
570
|
+
color: var( --_puck-platform-button-primary-color-text, var(--puck-color-white) );
|
|
570
571
|
}
|
|
571
572
|
@media (hover: hover) and (pointer: fine) {
|
|
572
|
-
._Button--
|
|
573
|
-
background-color: var(--puck-color-azure-03);
|
|
573
|
+
._Button--primary_z2rgr_101:hover {
|
|
574
|
+
background-color: var( --_puck-platform-button-primary-color-bg-hover, var(--puck-color-azure-03) );
|
|
574
575
|
}
|
|
575
576
|
}
|
|
576
|
-
._Button--
|
|
577
|
-
background-color: var(--puck-color-azure-02);
|
|
577
|
+
._Button--primary_z2rgr_101:active {
|
|
578
|
+
background-color: var( --_puck-platform-button-primary-color-bg-active, var(--puck-color-azure-02) );
|
|
578
579
|
}
|
|
579
|
-
._Button--
|
|
580
|
-
|
|
581
|
-
|
|
580
|
+
._Button--secondary_z2rgr_129 {
|
|
581
|
+
background: var(--_puck-platform-button-secondary-color-bg, none);
|
|
582
|
+
border: var(--_puck-platform-button-secondary-border, 1px solid currentColor);
|
|
583
|
+
color: var(--_puck-platform-button-secondary-color-text, currentColor);
|
|
582
584
|
}
|
|
583
585
|
@media (hover: hover) and (pointer: fine) {
|
|
584
|
-
._Button--
|
|
585
|
-
background-color: var(--puck-color-azure-12);
|
|
586
|
-
border-color: var(--puck-color-azure-12);
|
|
587
|
-
color: var(--puck-color-azure-04);
|
|
586
|
+
._Button--secondary_z2rgr_129:hover {
|
|
587
|
+
background-color: var( --_puck-platform-button-secondary-color-bg-hover, var(--puck-color-azure-12) );
|
|
588
|
+
border-color: var( --_puck-platform-button-secondary-color-border-hover, var(--puck-color-azure-12) );
|
|
589
|
+
color: var( --_puck-platform-button-secondary-color-text-hover, var(--puck-color-azure-04) );
|
|
588
590
|
}
|
|
589
591
|
}
|
|
590
|
-
._Button--
|
|
591
|
-
background-color: var(--puck-color-azure-11);
|
|
592
|
-
color: var(--puck-color-black);
|
|
592
|
+
._Button--secondary_z2rgr_129:active {
|
|
593
|
+
background-color: var( --_puck-platform-button-secondary-color-bg-active, var(--puck-color-azure-11) );
|
|
594
|
+
color: var( --_puck-platform-button-secondary-color-text-active, var(--puck-color-black) );
|
|
593
595
|
}
|
|
594
|
-
._Button--
|
|
595
|
-
background: var(--puck-color-red-04);
|
|
596
|
+
._Button--danger_z2rgr_163 {
|
|
597
|
+
background: var( --_puck-platform-button-danger-color-bg, var(--puck-color-red-04) );
|
|
596
598
|
}
|
|
597
599
|
@media (hover: hover) and (pointer: fine) {
|
|
598
|
-
._Button--
|
|
599
|
-
background-color: var(--puck-color-red-03);
|
|
600
|
+
._Button--danger_z2rgr_163:hover {
|
|
601
|
+
background-color: var( --_puck-platform-button-danger-color-bg-hover, var(--puck-color-red-03) );
|
|
600
602
|
}
|
|
601
603
|
}
|
|
602
|
-
._Button--
|
|
603
|
-
background-color: var(--puck-color-red-02);
|
|
604
|
+
._Button--danger_z2rgr_163:active {
|
|
605
|
+
background-color: var( --_puck-platform-button-danger-color-bg-active, var(--puck-color-red-02) );
|
|
604
606
|
}
|
|
605
|
-
._Button--
|
|
606
|
-
border-radius: 0;
|
|
607
|
+
._Button--flush_z2rgr_186 {
|
|
608
|
+
border-radius: var(--_puck-platform-button-flush-radius, 0);
|
|
607
609
|
}
|
|
608
|
-
._Button--
|
|
610
|
+
._Button--ghost_z2rgr_190 {
|
|
609
611
|
align-items: center;
|
|
610
|
-
background-color: transparent;
|
|
612
|
+
background-color: var(--_puck-platform-button-ghost-color-bg, transparent);
|
|
611
613
|
border: none;
|
|
612
|
-
border-radius: 8px;
|
|
613
|
-
color: var(--puck-color-azure-04);
|
|
614
|
+
border-radius: var(--_puck-platform-button-ghost-radius, 8px);
|
|
615
|
+
color: var( --_puck-platform-button-ghost-color-text, var(--puck-color-azure-04) );
|
|
614
616
|
display: flex;
|
|
615
617
|
}
|
|
616
618
|
@media (hover: hover) and (pointer: fine) {
|
|
617
|
-
._Button--
|
|
618
|
-
background-color: var(--puck-color-grey-11);
|
|
619
|
-
color: var(--puck-color-azure-04);
|
|
619
|
+
._Button--ghost_z2rgr_190:hover {
|
|
620
|
+
background-color: var( --_puck-platform-button-ghost-color-bg-hover, var(--puck-color-grey-11) );
|
|
621
|
+
color: var( --_puck-platform-button-ghost-color-text-hover, var(--puck-color-azure-04) );
|
|
620
622
|
cursor: pointer;
|
|
621
623
|
}
|
|
622
624
|
}
|
|
623
|
-
._Button--
|
|
624
|
-
._Button--
|
|
625
|
-
._Button--
|
|
626
|
-
._Button--
|
|
627
|
-
background-color: var(--puck-color-grey-12);
|
|
628
|
-
border-color: var(--puck-color-grey-08);
|
|
629
|
-
color: var(--puck-color-grey-07);
|
|
625
|
+
._Button--disabled_z2rgr_216,
|
|
626
|
+
._Button--disabled_z2rgr_216:hover,
|
|
627
|
+
._Button--secondary_z2rgr_129._Button--disabled_z2rgr_216,
|
|
628
|
+
._Button--secondary_z2rgr_129._Button--disabled_z2rgr_216:hover {
|
|
629
|
+
background-color: var( --_puck-platform-button-disabled-color-bg, var(--puck-color-grey-12) );
|
|
630
|
+
border-color: var( --_puck-platform-button-disabled-color-border, var(--puck-color-grey-08) );
|
|
631
|
+
color: var( --_puck-platform-button-disabled-color-text, var(--puck-color-grey-07) );
|
|
630
632
|
cursor: not-allowed;
|
|
631
633
|
}
|
|
632
|
-
._Button--
|
|
634
|
+
._Button--secondary_z2rgr_129._Button--disabled_z2rgr_216,
|
|
635
|
+
._Button--secondary_z2rgr_129._Button--disabled_z2rgr_216:hover {
|
|
636
|
+
background-color: var( --_puck-platform-button-secondary-color-bg-disabled, var(--puck-color-grey-12) );
|
|
637
|
+
border-color: var( --_puck-platform-button-secondary-color-border-disabled, var(--puck-color-grey-08) );
|
|
638
|
+
color: var( --_puck-platform-button-secondary-color-text-disabled, var(--puck-color-grey-07) );
|
|
639
|
+
}
|
|
640
|
+
._Button--primary_z2rgr_101._Button--disabled_z2rgr_216,
|
|
641
|
+
._Button--primary_z2rgr_101._Button--disabled_z2rgr_216:hover {
|
|
642
|
+
background-color: var( --_puck-platform-button-primary-color-bg-disabled, var(--puck-color-grey-12) );
|
|
643
|
+
border-color: var( --_puck-platform-button-primary-color-border-disabled, var(--puck-color-grey-08) );
|
|
644
|
+
color: var( --_puck-platform-button-primary-color-text-disabled, var(--puck-color-grey-07) );
|
|
645
|
+
}
|
|
646
|
+
._Button--fullWidth_z2rgr_267 {
|
|
633
647
|
justify-content: center;
|
|
634
648
|
width: 100%;
|
|
635
649
|
}
|
|
636
|
-
._Button-
|
|
650
|
+
._Button-spinner_z2rgr_272 {
|
|
637
651
|
padding-left: 8px;
|
|
638
652
|
}
|
|
639
653
|
|
|
640
654
|
/* css-module:/home/runner/work/platform/platform/packages/platform-client/components/Loader/styles.module.css/#css-module-data */
|
|
641
|
-
@keyframes _loader-
|
|
655
|
+
@keyframes _loader-animation_68nru_1 {
|
|
642
656
|
0% {
|
|
643
657
|
transform: rotate(0deg) scale(1);
|
|
644
658
|
}
|
|
@@ -649,89 +663,89 @@ p {
|
|
|
649
663
|
transform: rotate(360deg) scale(1);
|
|
650
664
|
}
|
|
651
665
|
}
|
|
652
|
-
.
|
|
666
|
+
._Loader_68nru_13 {
|
|
653
667
|
background: transparent;
|
|
654
|
-
border-radius: 100
|
|
655
|
-
border: 2px solid currentColor;
|
|
668
|
+
border-radius: var(--_puck-platform-loader-radius, 100%);
|
|
669
|
+
border: var(--_puck-platform-loader-border, 2px solid currentColor);
|
|
656
670
|
border-bottom-color: transparent;
|
|
657
671
|
display: inline-block;
|
|
658
|
-
animation: _loader-
|
|
672
|
+
animation: _loader-animation_68nru_1 var(--_puck-platform-loader-animation-duration, 1s) 0s infinite linear;
|
|
659
673
|
animation-fill-mode: both;
|
|
660
674
|
}
|
|
661
675
|
|
|
662
676
|
/* css-module:/home/runner/work/platform/platform/packages/platform-client/components/Heading/Heading.module.css/#css-module-data */
|
|
663
|
-
.
|
|
677
|
+
._Heading_l89dy_1 {
|
|
664
678
|
display: block;
|
|
665
|
-
font-family: var(--heading-font-family, var(--puck-font-family));
|
|
666
|
-
font-weight: 700;
|
|
679
|
+
font-family: var( --_puck-platform-heading-font-family, var(--heading-font-family, var(--puck-font-family)) );
|
|
680
|
+
font-weight: var(--_puck-platform-heading-font-weight, 700);
|
|
667
681
|
margin: 0;
|
|
668
682
|
}
|
|
669
|
-
.
|
|
670
|
-
font-weight: 700;
|
|
683
|
+
._Heading_l89dy_1 b {
|
|
684
|
+
font-weight: var(--_puck-platform-heading-bold-font-weight, 700);
|
|
671
685
|
}
|
|
672
|
-
._Heading--
|
|
673
|
-
._Heading--
|
|
674
|
-
font-weight: 500;
|
|
675
|
-
letter-spacing: -
|
|
676
|
-
line-height: 1;
|
|
686
|
+
._Heading--brand_l89dy_15,
|
|
687
|
+
._Heading--brand_l89dy_15 * {
|
|
688
|
+
font-weight: var(--_puck-platform-heading-brand-font-weight, 500);
|
|
689
|
+
letter-spacing: var(--_puck-platform-heading-brand-letter-spacing, -0.07em);
|
|
690
|
+
line-height: var(--_puck-platform-heading-brand-line-height, 1);
|
|
677
691
|
}
|
|
678
|
-
._Heading--
|
|
679
|
-
font-weight: 700;
|
|
692
|
+
._Heading--brand_l89dy_15 b {
|
|
693
|
+
font-weight: var(--_puck-platform-heading-brand-bold-font-weight, 700);
|
|
680
694
|
}
|
|
681
|
-
._Heading--
|
|
682
|
-
font-size: var(--puck-font-size-xxxl);
|
|
695
|
+
._Heading--xxxxl_l89dy_26 {
|
|
696
|
+
font-size: var( --_puck-platform-heading-xxxxl-font-size, var(--puck-font-size-xxxl) );
|
|
683
697
|
}
|
|
684
|
-
._Heading--
|
|
685
|
-
font-size: var(--puck-font-size-xxl);
|
|
698
|
+
._Heading--xxxl_l89dy_33 {
|
|
699
|
+
font-size: var( --_puck-platform-heading-xxxl-font-size, var(--puck-font-size-xxl) );
|
|
686
700
|
}
|
|
687
|
-
._Heading--
|
|
688
|
-
font-size: var(--puck-font-size-xl);
|
|
701
|
+
._Heading--xxl_l89dy_40 {
|
|
702
|
+
font-size: var( --_puck-platform-heading-xxl-font-size, var(--puck-font-size-xl) );
|
|
689
703
|
}
|
|
690
|
-
._Heading--
|
|
691
|
-
font-size: var(--puck-font-size-l);
|
|
704
|
+
._Heading--xl_l89dy_47 {
|
|
705
|
+
font-size: var( --_puck-platform-heading-xl-font-size, var(--puck-font-size-l) );
|
|
692
706
|
}
|
|
693
|
-
._Heading--
|
|
694
|
-
font-size: var(--puck-font-size-m);
|
|
707
|
+
._Heading--l_l89dy_54 {
|
|
708
|
+
font-size: var(--_puck-platform-heading-l-font-size, var(--puck-font-size-m));
|
|
695
709
|
}
|
|
696
|
-
._Heading--
|
|
697
|
-
font-size: var(--puck-font-size-s);
|
|
710
|
+
._Heading--m_l89dy_58 {
|
|
711
|
+
font-size: var(--_puck-platform-heading-m-font-size, var(--puck-font-size-s));
|
|
698
712
|
}
|
|
699
|
-
._Heading--
|
|
700
|
-
font-size: var(--puck-font-size-xs);
|
|
713
|
+
._Heading--s_l89dy_62 {
|
|
714
|
+
font-size: var( --_puck-platform-heading-s-font-size, var(--puck-font-size-xs) );
|
|
701
715
|
}
|
|
702
|
-
._Heading--
|
|
703
|
-
font-size: var(--puck-font-size-xxs);
|
|
716
|
+
._Heading--xs_l89dy_69 {
|
|
717
|
+
font-size: var( --_puck-platform-heading-xs-font-size, var(--puck-font-size-xxs) );
|
|
704
718
|
}
|
|
705
|
-
._Heading--
|
|
706
|
-
font-size: var(--puck-font-size-xxs);
|
|
719
|
+
._Heading--xxs_l89dy_76 {
|
|
720
|
+
font-size: var( --_puck-platform-heading-xxs-font-size, var(--puck-font-size-xxs) );
|
|
707
721
|
}
|
|
708
722
|
@media (min-width: 768px) {
|
|
709
|
-
._Heading--
|
|
710
|
-
font-size: var(--puck-font-size-xxxxl);
|
|
723
|
+
._Heading--xxxxl_l89dy_26 {
|
|
724
|
+
font-size: var( --_puck-platform-heading-xxxxl-font-size-desktop, var(--puck-font-size-xxxxl) );
|
|
711
725
|
}
|
|
712
|
-
._Heading--
|
|
713
|
-
font-size: var(--puck-font-size-xxxl);
|
|
726
|
+
._Heading--xxxl_l89dy_33 {
|
|
727
|
+
font-size: var( --_puck-platform-heading-xxxl-font-size-desktop, var(--puck-font-size-xxxl) );
|
|
714
728
|
}
|
|
715
|
-
._Heading--
|
|
716
|
-
font-size: var(--puck-font-size-xxl);
|
|
729
|
+
._Heading--xxl_l89dy_40 {
|
|
730
|
+
font-size: var( --_puck-platform-heading-xxl-font-size-desktop, var(--puck-font-size-xxl) );
|
|
717
731
|
}
|
|
718
|
-
._Heading--
|
|
719
|
-
font-size: var(--puck-font-size-xl);
|
|
732
|
+
._Heading--xl_l89dy_47 {
|
|
733
|
+
font-size: var( --_puck-platform-heading-xl-font-size-desktop, var(--puck-font-size-xl) );
|
|
720
734
|
}
|
|
721
|
-
._Heading--
|
|
722
|
-
font-size: var(--puck-font-size-l);
|
|
735
|
+
._Heading--l_l89dy_54 {
|
|
736
|
+
font-size: var( --_puck-platform-heading-l-font-size-desktop, var(--puck-font-size-l) );
|
|
723
737
|
}
|
|
724
|
-
._Heading--
|
|
725
|
-
font-size: var(--puck-font-size-m);
|
|
738
|
+
._Heading--m_l89dy_58 {
|
|
739
|
+
font-size: var( --_puck-platform-heading-m-font-size-desktop, var(--puck-font-size-m) );
|
|
726
740
|
}
|
|
727
|
-
._Heading--
|
|
728
|
-
font-size: var(--puck-font-size-s);
|
|
741
|
+
._Heading--s_l89dy_62 {
|
|
742
|
+
font-size: var( --_puck-platform-heading-s-font-size-desktop, var(--puck-font-size-s) );
|
|
729
743
|
}
|
|
730
|
-
._Heading--
|
|
731
|
-
font-size: var(--puck-font-size-xs);
|
|
744
|
+
._Heading--xs_l89dy_69 {
|
|
745
|
+
font-size: var( --_puck-platform-heading-xs-font-size-desktop, var(--puck-font-size-xs) );
|
|
732
746
|
}
|
|
733
|
-
._Heading--
|
|
734
|
-
font-size: var(--puck-font-size-xxs);
|
|
747
|
+
._Heading--xxs_l89dy_76 {
|
|
748
|
+
font-size: var( --_puck-platform-heading-xxs-font-size-desktop, var(--puck-font-size-xxs) );
|
|
735
749
|
}
|
|
736
750
|
}
|
|
737
751
|
|
|
@@ -969,38 +983,40 @@ p {
|
|
|
969
983
|
}
|
|
970
984
|
|
|
971
985
|
/* css-module:/home/runner/work/platform/platform/packages/platform-client/components/IconButton/IconButton.module.css/#css-module-data */
|
|
972
|
-
.
|
|
986
|
+
._IconButton_voaix_1 {
|
|
973
987
|
align-items: center;
|
|
974
|
-
background: transparent;
|
|
988
|
+
background: var(--_puck-platform-icon-button-color-bg, transparent);
|
|
975
989
|
border: none;
|
|
976
|
-
border-radius: 4px;
|
|
977
|
-
color: currentColor;
|
|
990
|
+
border-radius: var(--_puck-platform-icon-button-radius, 4px);
|
|
991
|
+
color: var(--_puck-platform-icon-button-color-icon, currentColor);
|
|
978
992
|
display: flex;
|
|
979
|
-
font-family: var(--puck-font-family);
|
|
993
|
+
font-family: var( --_puck-platform-icon-button-font-family, var(--puck-font-family) );
|
|
980
994
|
justify-content: center;
|
|
981
995
|
padding: 4px;
|
|
982
|
-
transition: background-color 50ms ease-in, color 50ms ease-in;
|
|
996
|
+
transition: var( --_puck-platform-icon-button-transition, background-color 50ms ease-in, color 50ms ease-in );
|
|
983
997
|
}
|
|
984
|
-
.
|
|
985
|
-
outline: 2px solid var(--puck-color-azure-05);
|
|
986
|
-
outline-offset: -2px;
|
|
998
|
+
._IconButton_voaix_1:focus-visible {
|
|
999
|
+
outline: var( --_puck-platform-icon-button-focus-outline, 2px solid var(--puck-color-azure-05) );
|
|
1000
|
+
outline-offset: var(--_puck-platform-icon-button-focus-outline-offset, -2px);
|
|
987
1001
|
}
|
|
988
1002
|
@media (hover: hover) and (pointer: fine) {
|
|
989
|
-
.
|
|
990
|
-
background: var(--puck-color-azure-10);
|
|
1003
|
+
._IconButton_voaix_1:hover:not(._IconButton--disabled_voaix_30) {
|
|
1004
|
+
background: var( --_puck-platform-icon-button-color-bg-hover, var(--puck-color-azure-10) );
|
|
1005
|
+
color: var(--_puck-platform-icon-button-color-icon-hover, currentColor);
|
|
991
1006
|
cursor: pointer;
|
|
992
|
-
transition: none;
|
|
1007
|
+
transition: var(--_puck-platform-icon-button-transition-interactive, none);
|
|
993
1008
|
}
|
|
994
|
-
._IconButton--
|
|
995
|
-
background: var(--puck-color-grey-04);
|
|
996
|
-
color: var(--puck-color-azure-10);
|
|
1009
|
+
._IconButton--dark_voaix_40:hover:not(._IconButton--disabled_voaix_30) {
|
|
1010
|
+
background: var( --_puck-platform-icon-button-dark-color-bg-hover, var(--puck-color-grey-04) );
|
|
1011
|
+
color: var( --_puck-platform-icon-button-dark-color-icon-hover, var(--puck-color-azure-10) );
|
|
997
1012
|
}
|
|
998
1013
|
}
|
|
999
|
-
.
|
|
1000
|
-
background: var(--puck-color-azure-11);
|
|
1001
|
-
|
|
1014
|
+
._IconButton_voaix_1:active {
|
|
1015
|
+
background: var( --_puck-platform-icon-button-color-bg-active, var(--puck-color-azure-11) );
|
|
1016
|
+
color: var(--_puck-platform-icon-button-color-icon-active, currentColor);
|
|
1017
|
+
transition: var(--_puck-platform-icon-button-transition-interactive, none);
|
|
1002
1018
|
}
|
|
1003
|
-
._IconButton-
|
|
1019
|
+
._IconButton-title_voaix_61 {
|
|
1004
1020
|
clip: rect(0 0 0 0);
|
|
1005
1021
|
clip-path: inset(100%);
|
|
1006
1022
|
height: 1px;
|
|
@@ -1009,8 +1025,8 @@ p {
|
|
|
1009
1025
|
white-space: nowrap;
|
|
1010
1026
|
width: 1px;
|
|
1011
1027
|
}
|
|
1012
|
-
._IconButton--
|
|
1013
|
-
color: var(--puck-color-grey-07);
|
|
1028
|
+
._IconButton--disabled_voaix_30 {
|
|
1029
|
+
color: var( --_puck-platform-icon-button-color-icon-disabled, var(--puck-color-grey-07) );
|
|
1014
1030
|
}
|
|
1015
1031
|
|
|
1016
1032
|
/* css-module:/home/runner/work/platform/platform/packages/platform-client/components/InfoBar/InfoBar.module.css/#css-module-data */
|
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,13 @@ import * as _puckeditor_core_dist_actions_Dgllwd_W from '@puckeditor/core/dist/a
|
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
+
/** A request to the pages API, as `prepareRequest` receives and returns it. */
|
|
6
|
+
type RequestOptions = {
|
|
7
|
+
/** The JSON body. Only POST requests send one. */
|
|
8
|
+
body?: Record<string, any>;
|
|
9
|
+
headers?: HeadersInit;
|
|
10
|
+
credentials?: RequestCredentials;
|
|
11
|
+
};
|
|
5
12
|
type PagePluginOptions = {
|
|
6
13
|
/** Where `puckHandler` serves the pages API. Defaults to `/api/puck/pages`. */
|
|
7
14
|
host?: string;
|
|
@@ -9,6 +16,11 @@ type PagePluginOptions = {
|
|
|
9
16
|
siteUrl?: string;
|
|
10
17
|
/** The page to open first. Defaults to the `path` search param. */
|
|
11
18
|
initialPath?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Customizes each request to the pages API, to add headers, add metadata to the body,
|
|
21
|
+
* or change credentials. The headers and body it returns are merged over the defaults.
|
|
22
|
+
*/
|
|
23
|
+
prepareRequest?: (opts: RequestOptions) => RequestOptions | Promise<RequestOptions>;
|
|
12
24
|
};
|
|
13
25
|
|
|
14
26
|
declare function createPagesPlugin(opts?: PagePluginOptions): {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,13 @@ import * as _puckeditor_core_dist_actions_Dgllwd_W from '@puckeditor/core/dist/a
|
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
+
/** A request to the pages API, as `prepareRequest` receives and returns it. */
|
|
6
|
+
type RequestOptions = {
|
|
7
|
+
/** The JSON body. Only POST requests send one. */
|
|
8
|
+
body?: Record<string, any>;
|
|
9
|
+
headers?: HeadersInit;
|
|
10
|
+
credentials?: RequestCredentials;
|
|
11
|
+
};
|
|
5
12
|
type PagePluginOptions = {
|
|
6
13
|
/** Where `puckHandler` serves the pages API. Defaults to `/api/puck/pages`. */
|
|
7
14
|
host?: string;
|
|
@@ -9,6 +16,11 @@ type PagePluginOptions = {
|
|
|
9
16
|
siteUrl?: string;
|
|
10
17
|
/** The page to open first. Defaults to the `path` search param. */
|
|
11
18
|
initialPath?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Customizes each request to the pages API, to add headers, add metadata to the body,
|
|
21
|
+
* or change credentials. The headers and body it returns are merged over the defaults.
|
|
22
|
+
*/
|
|
23
|
+
prepareRequest?: (opts: RequestOptions) => RequestOptions | Promise<RequestOptions>;
|
|
12
24
|
};
|
|
13
25
|
|
|
14
26
|
declare function createPagesPlugin(opts?: PagePluginOptions): {
|
package/dist/index.js
CHANGED
|
@@ -5104,7 +5104,7 @@ init_react_import();
|
|
|
5104
5104
|
|
|
5105
5105
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/ActionModal/ActionModal.module.css#css-module
|
|
5106
5106
|
init_react_import();
|
|
5107
|
-
var ActionModal_module_default = { "ActionModal": "
|
|
5107
|
+
var ActionModal_module_default = { "ActionModal": "_ActionModal_10j8y_1", "ActionModal-header": "_ActionModal-header_10j8y_6", "ActionModal-body": "_ActionModal-body_10j8y_20", "ActionModal-footer": "_ActionModal-footer_10j8y_28" };
|
|
5108
5108
|
|
|
5109
5109
|
// ../platform-client/lib/index.ts
|
|
5110
5110
|
init_react_import();
|
|
@@ -5148,7 +5148,7 @@ init_react_import();
|
|
|
5148
5148
|
|
|
5149
5149
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Modal/Modal.module.css#css-module
|
|
5150
5150
|
init_react_import();
|
|
5151
|
-
var Modal_module_default = { "Modal-background": "_Modal-
|
|
5151
|
+
var Modal_module_default = { "Modal-background": "_Modal-background_10jdm_1", "Modal--visible": "_Modal--visible_10jdm_16", "Modal-modal": "_Modal-modal_10jdm_22" };
|
|
5152
5152
|
|
|
5153
5153
|
// ../platform-client/components/Modal/Modal.tsx
|
|
5154
5154
|
var import_react11 = require("react");
|
|
@@ -5166,20 +5166,21 @@ var import_react10 = require("react");
|
|
|
5166
5166
|
|
|
5167
5167
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Button/Button.module.css#css-module
|
|
5168
5168
|
init_react_import();
|
|
5169
|
-
var Button_module_default = { "Button": "
|
|
5169
|
+
var Button_module_default = { "Button": "_Button_z2rgr_1", "Button--tiny": "_Button--tiny_z2rgr_43", "Button--small": "_Button--small_z2rgr_51", "Button--medium": "_Button--medium_z2rgr_59", "Button--large": "_Button--large_z2rgr_69", "Button--brand": "_Button--brand_z2rgr_78", "Button--primary": "_Button--primary_z2rgr_101", "Button--secondary": "_Button--secondary_z2rgr_129", "Button--danger": "_Button--danger_z2rgr_163", "Button--flush": "_Button--flush_z2rgr_186", "Button--ghost": "_Button--ghost_z2rgr_190", "Button--disabled": "_Button--disabled_z2rgr_216", "Button--fullWidth": "_Button--fullWidth_z2rgr_267", "Button-spinner": "_Button-spinner_z2rgr_272" };
|
|
5170
5170
|
|
|
5171
5171
|
// ../platform-client/components/Loader/index.tsx
|
|
5172
5172
|
init_react_import();
|
|
5173
5173
|
|
|
5174
5174
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Loader/styles.module.css#css-module
|
|
5175
5175
|
init_react_import();
|
|
5176
|
-
var styles_module_default3 = { "Loader": "
|
|
5176
|
+
var styles_module_default3 = { "Loader": "_Loader_68nru_13", "loader-animation": "_loader-animation_68nru_1" };
|
|
5177
5177
|
|
|
5178
5178
|
// ../platform-client/components/Loader/index.tsx
|
|
5179
5179
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
5180
5180
|
var getClassName = getClassNameFactory2("Loader", styles_module_default3);
|
|
5181
5181
|
var Loader = ({
|
|
5182
5182
|
color,
|
|
5183
|
+
label = "loading",
|
|
5183
5184
|
size: size4 = 16,
|
|
5184
5185
|
...props
|
|
5185
5186
|
}) => {
|
|
@@ -5192,7 +5193,7 @@ var Loader = ({
|
|
|
5192
5193
|
height: size4,
|
|
5193
5194
|
color
|
|
5194
5195
|
},
|
|
5195
|
-
"aria-label":
|
|
5196
|
+
"aria-label": label,
|
|
5196
5197
|
...props
|
|
5197
5198
|
}
|
|
5198
5199
|
);
|
|
@@ -5307,7 +5308,7 @@ init_react_import();
|
|
|
5307
5308
|
|
|
5308
5309
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Heading/Heading.module.css#css-module
|
|
5309
5310
|
init_react_import();
|
|
5310
|
-
var Heading_module_default = { "Heading": "
|
|
5311
|
+
var Heading_module_default = { "Heading": "_Heading_l89dy_1", "Heading--brand": "_Heading--brand_l89dy_15", "Heading--xxxxl": "_Heading--xxxxl_l89dy_26", "Heading--xxxl": "_Heading--xxxl_l89dy_33", "Heading--xxl": "_Heading--xxl_l89dy_40", "Heading--xl": "_Heading--xl_l89dy_47", "Heading--l": "_Heading--l_l89dy_54", "Heading--m": "_Heading--m_l89dy_58", "Heading--s": "_Heading--s_l89dy_62", "Heading--xs": "_Heading--xs_l89dy_69", "Heading--xxs": "_Heading--xxs_l89dy_76" };
|
|
5311
5312
|
|
|
5312
5313
|
// ../platform-client/components/Heading/Heading.tsx
|
|
5313
5314
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
@@ -5453,7 +5454,7 @@ var import_react16 = require("react");
|
|
|
5453
5454
|
|
|
5454
5455
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/IconButton/IconButton.module.css#css-module
|
|
5455
5456
|
init_react_import();
|
|
5456
|
-
var IconButton_module_default = { "IconButton": "
|
|
5457
|
+
var IconButton_module_default = { "IconButton": "_IconButton_voaix_1", "IconButton--disabled": "_IconButton--disabled_voaix_30", "IconButton--dark": "_IconButton--dark_voaix_40", "IconButton-title": "_IconButton-title_voaix_61" };
|
|
5457
5458
|
|
|
5458
5459
|
// ../platform-client/components/IconButton/IconButton.tsx
|
|
5459
5460
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
@@ -8555,11 +8556,17 @@ var toVersionSummary = (page) => ({
|
|
|
8555
8556
|
versionNumber: page.version,
|
|
8556
8557
|
createdAt: page.createdAt
|
|
8557
8558
|
});
|
|
8558
|
-
var
|
|
8559
|
-
|
|
8560
|
-
headers
|
|
8561
|
-
|
|
8562
|
-
|
|
8559
|
+
var mergeRequest = (defaults, prepared) => {
|
|
8560
|
+
const headers = new Headers(defaults.headers);
|
|
8561
|
+
new Headers(prepared.headers).forEach(
|
|
8562
|
+
(value, key) => headers.set(key, value)
|
|
8563
|
+
);
|
|
8564
|
+
return {
|
|
8565
|
+
headers,
|
|
8566
|
+
credentials: prepared.credentials ?? defaults.credentials,
|
|
8567
|
+
body: { ...defaults.body, ...prepared.body }
|
|
8568
|
+
};
|
|
8569
|
+
};
|
|
8563
8570
|
var PageApiError = class extends Error {
|
|
8564
8571
|
constructor(status, body) {
|
|
8565
8572
|
super(`Pages request failed with ${status}`);
|
|
@@ -8583,10 +8590,25 @@ var toQuery = (params) => {
|
|
|
8583
8590
|
};
|
|
8584
8591
|
var usePageApi = (opts) => {
|
|
8585
8592
|
const host = opts?.host ?? "/api/puck/pages";
|
|
8593
|
+
const prepareRequest = opts?.prepareRequest;
|
|
8586
8594
|
return (0, import_react24.useMemo)(() => {
|
|
8595
|
+
const send = async (url, method, body) => {
|
|
8596
|
+
const hasBody = method === "POST";
|
|
8597
|
+
const defaults = hasBody ? {
|
|
8598
|
+
headers: { "content-type": "application/json" },
|
|
8599
|
+
body: body ?? {}
|
|
8600
|
+
} : {};
|
|
8601
|
+
const request = prepareRequest ? mergeRequest(defaults, await prepareRequest(defaults)) : defaults;
|
|
8602
|
+
return fetch(url, {
|
|
8603
|
+
method,
|
|
8604
|
+
headers: request.headers,
|
|
8605
|
+
credentials: request.credentials,
|
|
8606
|
+
body: hasBody ? JSON.stringify(request.body) : void 0
|
|
8607
|
+
});
|
|
8608
|
+
};
|
|
8587
8609
|
const listPages = async (offset4) => {
|
|
8588
8610
|
const list = await json(
|
|
8589
|
-
|
|
8611
|
+
send(`${host}${toQuery({ offset: offset4 })}`, "GET")
|
|
8590
8612
|
);
|
|
8591
8613
|
return {
|
|
8592
8614
|
...list,
|
|
@@ -8610,41 +8632,43 @@ var usePageApi = (opts) => {
|
|
|
8610
8632
|
},
|
|
8611
8633
|
/** Reads a page at a version, its latest unless `versionId` is given. */
|
|
8612
8634
|
readPage: (id, versionId) => json(
|
|
8613
|
-
|
|
8614
|
-
method: "GET"
|
|
8615
|
-
})
|
|
8635
|
+
send(`${host}/${id}${toQuery({ version: versionId })}`, "GET")
|
|
8616
8636
|
).then(toPageRead),
|
|
8617
8637
|
/** Reads the page at a path, at its latest version. */
|
|
8618
|
-
readPageByPath: (path) => json(
|
|
8619
|
-
|
|
8620
|
-
)
|
|
8638
|
+
readPageByPath: (path) => json(send(`${host}/by-path${toQuery({ path })}`, "GET")).then(
|
|
8639
|
+
toPageRead
|
|
8640
|
+
),
|
|
8621
8641
|
/** Reads a page's version history from `offset`, the newest by default. */
|
|
8622
8642
|
readVersions: async (id, offset4) => {
|
|
8623
8643
|
const list = await json(
|
|
8624
|
-
|
|
8625
|
-
method: "GET"
|
|
8626
|
-
})
|
|
8644
|
+
send(`${host}/${id}/versions${toQuery({ offset: offset4 })}`, "GET")
|
|
8627
8645
|
);
|
|
8628
8646
|
return { ...list, results: list.results.map(toVersionSummary) };
|
|
8629
8647
|
},
|
|
8630
|
-
createPage: (body) => json(
|
|
8648
|
+
createPage: (body) => json(send(host, "POST", body)).then(toPageRead),
|
|
8631
8649
|
/** Saves a new version of a page, refused with a 409 if a newer one was saved since its base. */
|
|
8632
8650
|
saveVersion: (id, { data, baseVersionId }) => json(
|
|
8633
|
-
|
|
8651
|
+
send(`${host}/${id}/versions`, "POST", {
|
|
8634
8652
|
data,
|
|
8635
8653
|
previousVersion: baseVersionId === void 0 ? void 0 : Number(baseVersionId)
|
|
8636
8654
|
})
|
|
8637
8655
|
).then(toPageRead),
|
|
8638
8656
|
/** Moves a page, without saving a version. */
|
|
8639
|
-
movePage: (id, path) => json(
|
|
8657
|
+
movePage: (id, path) => json(send(`${host}/${id}`, "POST", { path })).then(
|
|
8658
|
+
toPage
|
|
8659
|
+
),
|
|
8640
8660
|
/** Publishes one of a page's versions. */
|
|
8641
8661
|
publishPage: (id, versionId) => json(
|
|
8642
|
-
|
|
8662
|
+
send(`${host}/${id}/publish`, "POST", {
|
|
8663
|
+
version: Number(versionId)
|
|
8664
|
+
})
|
|
8643
8665
|
).then(toPage),
|
|
8644
|
-
unpublishPage: (id) => json(
|
|
8645
|
-
|
|
8666
|
+
unpublishPage: (id) => json(send(`${host}/${id}/unpublish`, "POST")).then(
|
|
8667
|
+
toPage
|
|
8668
|
+
),
|
|
8669
|
+
deletePage: (id) => json(send(`${host}/${id}`, "DELETE"))
|
|
8646
8670
|
};
|
|
8647
|
-
}, [host]);
|
|
8671
|
+
}, [host, prepareRequest]);
|
|
8648
8672
|
};
|
|
8649
8673
|
|
|
8650
8674
|
// src/hooks/usePageEditorState.ts
|
|
@@ -8664,11 +8688,14 @@ function registerDynamicConfig(config, data) {
|
|
|
8664
8688
|
}
|
|
8665
8689
|
}
|
|
8666
8690
|
var resolvedVersions = /* @__PURE__ */ new WeakMap();
|
|
8667
|
-
var rememberResolvedData = (data, resolved) => resolvedVersions.set(data, resolved);
|
|
8691
|
+
var rememberResolvedData = (data, resolved) => resolvedVersions.set(data, resolvedVersions.get(resolved) ?? resolved);
|
|
8668
8692
|
var isDirty = ({
|
|
8669
8693
|
appState,
|
|
8670
8694
|
history
|
|
8671
|
-
}, version2) => history.histories.length > 1 && !(0, import_fast_equals.deepEqual)(
|
|
8695
|
+
}, version2) => history.histories.length > 1 && !(0, import_fast_equals.deepEqual)(
|
|
8696
|
+
appState.data,
|
|
8697
|
+
version2 && (resolvedVersions.get(version2.data) ?? version2.data)
|
|
8698
|
+
);
|
|
8672
8699
|
var usePageEditorState = () => {
|
|
8673
8700
|
const getPuck = (0, import_core3.useGetPuck)();
|
|
8674
8701
|
return (0, import_react25.useMemo)(() => {
|
|
@@ -8676,9 +8703,9 @@ var usePageEditorState = () => {
|
|
|
8676
8703
|
const { config } = getPuck();
|
|
8677
8704
|
const pageData = { root: {}, content: [], ...data };
|
|
8678
8705
|
registerDynamicConfig(config, pageData);
|
|
8679
|
-
|
|
8706
|
+
let resolvedData = (data && resolvedVersions.get(data)) ?? await (0, import_core3.resolveAllData)(pageData, config);
|
|
8707
|
+
if (isCurrent()) resolvedData = showData(resolvedData);
|
|
8680
8708
|
if (data) rememberResolvedData(data, resolvedData);
|
|
8681
|
-
if (isCurrent()) showData(resolvedData);
|
|
8682
8709
|
};
|
|
8683
8710
|
const showData = (data) => {
|
|
8684
8711
|
const { appState, history, dispatch } = getPuck();
|
|
@@ -8689,6 +8716,17 @@ var usePageEditorState = () => {
|
|
|
8689
8716
|
};
|
|
8690
8717
|
history.setHistories([{ state: nextState }]);
|
|
8691
8718
|
dispatch({ type: "set", state: nextState });
|
|
8719
|
+
const shownData = getPuck().appState.data;
|
|
8720
|
+
setTimeout(() => dropStaleHistory(nextState, shownData), 250);
|
|
8721
|
+
return shownData;
|
|
8722
|
+
};
|
|
8723
|
+
const dropStaleHistory = (shown, shownData) => {
|
|
8724
|
+
const { appState, history } = getPuck();
|
|
8725
|
+
const [first, ...rest] = history.histories;
|
|
8726
|
+
if (first?.state !== shown || !rest.length) return;
|
|
8727
|
+
history.setHistories(
|
|
8728
|
+
(0, import_fast_equals.deepEqual)(appState.data, shownData) ? [{ state: appState }] : [first, { state: appState }]
|
|
8729
|
+
);
|
|
8692
8730
|
};
|
|
8693
8731
|
const unloadPageData = () => {
|
|
8694
8732
|
const { appState, history } = getPuck();
|
package/dist/index.mjs
CHANGED
|
@@ -5099,7 +5099,7 @@ init_react_import();
|
|
|
5099
5099
|
|
|
5100
5100
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/ActionModal/ActionModal.module.css#css-module
|
|
5101
5101
|
init_react_import();
|
|
5102
|
-
var ActionModal_module_default = { "ActionModal": "
|
|
5102
|
+
var ActionModal_module_default = { "ActionModal": "_ActionModal_10j8y_1", "ActionModal-header": "_ActionModal-header_10j8y_6", "ActionModal-body": "_ActionModal-body_10j8y_20", "ActionModal-footer": "_ActionModal-footer_10j8y_28" };
|
|
5103
5103
|
|
|
5104
5104
|
// ../platform-client/lib/index.ts
|
|
5105
5105
|
init_react_import();
|
|
@@ -5143,7 +5143,7 @@ init_react_import();
|
|
|
5143
5143
|
|
|
5144
5144
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Modal/Modal.module.css#css-module
|
|
5145
5145
|
init_react_import();
|
|
5146
|
-
var Modal_module_default = { "Modal-background": "_Modal-
|
|
5146
|
+
var Modal_module_default = { "Modal-background": "_Modal-background_10jdm_1", "Modal--visible": "_Modal--visible_10jdm_16", "Modal-modal": "_Modal-modal_10jdm_22" };
|
|
5147
5147
|
|
|
5148
5148
|
// ../platform-client/components/Modal/Modal.tsx
|
|
5149
5149
|
import { createContext as createContext6, useContext as useContext7 } from "react";
|
|
@@ -5161,20 +5161,21 @@ import { useEffect as useEffect11, useState as useState9 } from "react";
|
|
|
5161
5161
|
|
|
5162
5162
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Button/Button.module.css#css-module
|
|
5163
5163
|
init_react_import();
|
|
5164
|
-
var Button_module_default = { "Button": "
|
|
5164
|
+
var Button_module_default = { "Button": "_Button_z2rgr_1", "Button--tiny": "_Button--tiny_z2rgr_43", "Button--small": "_Button--small_z2rgr_51", "Button--medium": "_Button--medium_z2rgr_59", "Button--large": "_Button--large_z2rgr_69", "Button--brand": "_Button--brand_z2rgr_78", "Button--primary": "_Button--primary_z2rgr_101", "Button--secondary": "_Button--secondary_z2rgr_129", "Button--danger": "_Button--danger_z2rgr_163", "Button--flush": "_Button--flush_z2rgr_186", "Button--ghost": "_Button--ghost_z2rgr_190", "Button--disabled": "_Button--disabled_z2rgr_216", "Button--fullWidth": "_Button--fullWidth_z2rgr_267", "Button-spinner": "_Button-spinner_z2rgr_272" };
|
|
5165
5165
|
|
|
5166
5166
|
// ../platform-client/components/Loader/index.tsx
|
|
5167
5167
|
init_react_import();
|
|
5168
5168
|
|
|
5169
5169
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Loader/styles.module.css#css-module
|
|
5170
5170
|
init_react_import();
|
|
5171
|
-
var styles_module_default3 = { "Loader": "
|
|
5171
|
+
var styles_module_default3 = { "Loader": "_Loader_68nru_13", "loader-animation": "_loader-animation_68nru_1" };
|
|
5172
5172
|
|
|
5173
5173
|
// ../platform-client/components/Loader/index.tsx
|
|
5174
5174
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
5175
5175
|
var getClassName = getClassNameFactory2("Loader", styles_module_default3);
|
|
5176
5176
|
var Loader = ({
|
|
5177
5177
|
color,
|
|
5178
|
+
label = "loading",
|
|
5178
5179
|
size: size4 = 16,
|
|
5179
5180
|
...props
|
|
5180
5181
|
}) => {
|
|
@@ -5187,7 +5188,7 @@ var Loader = ({
|
|
|
5187
5188
|
height: size4,
|
|
5188
5189
|
color
|
|
5189
5190
|
},
|
|
5190
|
-
"aria-label":
|
|
5191
|
+
"aria-label": label,
|
|
5191
5192
|
...props
|
|
5192
5193
|
}
|
|
5193
5194
|
);
|
|
@@ -5302,7 +5303,7 @@ init_react_import();
|
|
|
5302
5303
|
|
|
5303
5304
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Heading/Heading.module.css#css-module
|
|
5304
5305
|
init_react_import();
|
|
5305
|
-
var Heading_module_default = { "Heading": "
|
|
5306
|
+
var Heading_module_default = { "Heading": "_Heading_l89dy_1", "Heading--brand": "_Heading--brand_l89dy_15", "Heading--xxxxl": "_Heading--xxxxl_l89dy_26", "Heading--xxxl": "_Heading--xxxl_l89dy_33", "Heading--xxl": "_Heading--xxl_l89dy_40", "Heading--xl": "_Heading--xl_l89dy_47", "Heading--l": "_Heading--l_l89dy_54", "Heading--m": "_Heading--m_l89dy_58", "Heading--s": "_Heading--s_l89dy_62", "Heading--xs": "_Heading--xs_l89dy_69", "Heading--xxs": "_Heading--xxs_l89dy_76" };
|
|
5306
5307
|
|
|
5307
5308
|
// ../platform-client/components/Heading/Heading.tsx
|
|
5308
5309
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
@@ -5448,7 +5449,7 @@ import { useState as useState13 } from "react";
|
|
|
5448
5449
|
|
|
5449
5450
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/IconButton/IconButton.module.css#css-module
|
|
5450
5451
|
init_react_import();
|
|
5451
|
-
var IconButton_module_default = { "IconButton": "
|
|
5452
|
+
var IconButton_module_default = { "IconButton": "_IconButton_voaix_1", "IconButton--disabled": "_IconButton--disabled_voaix_30", "IconButton--dark": "_IconButton--dark_voaix_40", "IconButton-title": "_IconButton-title_voaix_61" };
|
|
5452
5453
|
|
|
5453
5454
|
// ../platform-client/components/IconButton/IconButton.tsx
|
|
5454
5455
|
import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
@@ -8550,11 +8551,17 @@ var toVersionSummary = (page) => ({
|
|
|
8550
8551
|
versionNumber: page.version,
|
|
8551
8552
|
createdAt: page.createdAt
|
|
8552
8553
|
});
|
|
8553
|
-
var
|
|
8554
|
-
|
|
8555
|
-
headers
|
|
8556
|
-
|
|
8557
|
-
|
|
8554
|
+
var mergeRequest = (defaults, prepared) => {
|
|
8555
|
+
const headers = new Headers(defaults.headers);
|
|
8556
|
+
new Headers(prepared.headers).forEach(
|
|
8557
|
+
(value, key) => headers.set(key, value)
|
|
8558
|
+
);
|
|
8559
|
+
return {
|
|
8560
|
+
headers,
|
|
8561
|
+
credentials: prepared.credentials ?? defaults.credentials,
|
|
8562
|
+
body: { ...defaults.body, ...prepared.body }
|
|
8563
|
+
};
|
|
8564
|
+
};
|
|
8558
8565
|
var PageApiError = class extends Error {
|
|
8559
8566
|
constructor(status, body) {
|
|
8560
8567
|
super(`Pages request failed with ${status}`);
|
|
@@ -8578,10 +8585,25 @@ var toQuery = (params) => {
|
|
|
8578
8585
|
};
|
|
8579
8586
|
var usePageApi = (opts) => {
|
|
8580
8587
|
const host = opts?.host ?? "/api/puck/pages";
|
|
8588
|
+
const prepareRequest = opts?.prepareRequest;
|
|
8581
8589
|
return useMemo20(() => {
|
|
8590
|
+
const send = async (url, method, body) => {
|
|
8591
|
+
const hasBody = method === "POST";
|
|
8592
|
+
const defaults = hasBody ? {
|
|
8593
|
+
headers: { "content-type": "application/json" },
|
|
8594
|
+
body: body ?? {}
|
|
8595
|
+
} : {};
|
|
8596
|
+
const request = prepareRequest ? mergeRequest(defaults, await prepareRequest(defaults)) : defaults;
|
|
8597
|
+
return fetch(url, {
|
|
8598
|
+
method,
|
|
8599
|
+
headers: request.headers,
|
|
8600
|
+
credentials: request.credentials,
|
|
8601
|
+
body: hasBody ? JSON.stringify(request.body) : void 0
|
|
8602
|
+
});
|
|
8603
|
+
};
|
|
8582
8604
|
const listPages = async (offset4) => {
|
|
8583
8605
|
const list = await json(
|
|
8584
|
-
|
|
8606
|
+
send(`${host}${toQuery({ offset: offset4 })}`, "GET")
|
|
8585
8607
|
);
|
|
8586
8608
|
return {
|
|
8587
8609
|
...list,
|
|
@@ -8605,41 +8627,43 @@ var usePageApi = (opts) => {
|
|
|
8605
8627
|
},
|
|
8606
8628
|
/** Reads a page at a version, its latest unless `versionId` is given. */
|
|
8607
8629
|
readPage: (id, versionId) => json(
|
|
8608
|
-
|
|
8609
|
-
method: "GET"
|
|
8610
|
-
})
|
|
8630
|
+
send(`${host}/${id}${toQuery({ version: versionId })}`, "GET")
|
|
8611
8631
|
).then(toPageRead),
|
|
8612
8632
|
/** Reads the page at a path, at its latest version. */
|
|
8613
|
-
readPageByPath: (path) => json(
|
|
8614
|
-
|
|
8615
|
-
)
|
|
8633
|
+
readPageByPath: (path) => json(send(`${host}/by-path${toQuery({ path })}`, "GET")).then(
|
|
8634
|
+
toPageRead
|
|
8635
|
+
),
|
|
8616
8636
|
/** Reads a page's version history from `offset`, the newest by default. */
|
|
8617
8637
|
readVersions: async (id, offset4) => {
|
|
8618
8638
|
const list = await json(
|
|
8619
|
-
|
|
8620
|
-
method: "GET"
|
|
8621
|
-
})
|
|
8639
|
+
send(`${host}/${id}/versions${toQuery({ offset: offset4 })}`, "GET")
|
|
8622
8640
|
);
|
|
8623
8641
|
return { ...list, results: list.results.map(toVersionSummary) };
|
|
8624
8642
|
},
|
|
8625
|
-
createPage: (body) => json(
|
|
8643
|
+
createPage: (body) => json(send(host, "POST", body)).then(toPageRead),
|
|
8626
8644
|
/** Saves a new version of a page, refused with a 409 if a newer one was saved since its base. */
|
|
8627
8645
|
saveVersion: (id, { data, baseVersionId }) => json(
|
|
8628
|
-
|
|
8646
|
+
send(`${host}/${id}/versions`, "POST", {
|
|
8629
8647
|
data,
|
|
8630
8648
|
previousVersion: baseVersionId === void 0 ? void 0 : Number(baseVersionId)
|
|
8631
8649
|
})
|
|
8632
8650
|
).then(toPageRead),
|
|
8633
8651
|
/** Moves a page, without saving a version. */
|
|
8634
|
-
movePage: (id, path) => json(
|
|
8652
|
+
movePage: (id, path) => json(send(`${host}/${id}`, "POST", { path })).then(
|
|
8653
|
+
toPage
|
|
8654
|
+
),
|
|
8635
8655
|
/** Publishes one of a page's versions. */
|
|
8636
8656
|
publishPage: (id, versionId) => json(
|
|
8637
|
-
|
|
8657
|
+
send(`${host}/${id}/publish`, "POST", {
|
|
8658
|
+
version: Number(versionId)
|
|
8659
|
+
})
|
|
8638
8660
|
).then(toPage),
|
|
8639
|
-
unpublishPage: (id) => json(
|
|
8640
|
-
|
|
8661
|
+
unpublishPage: (id) => json(send(`${host}/${id}/unpublish`, "POST")).then(
|
|
8662
|
+
toPage
|
|
8663
|
+
),
|
|
8664
|
+
deletePage: (id) => json(send(`${host}/${id}`, "DELETE"))
|
|
8641
8665
|
};
|
|
8642
|
-
}, [host]);
|
|
8666
|
+
}, [host, prepareRequest]);
|
|
8643
8667
|
};
|
|
8644
8668
|
|
|
8645
8669
|
// src/hooks/usePageEditorState.ts
|
|
@@ -8662,11 +8686,14 @@ function registerDynamicConfig(config, data) {
|
|
|
8662
8686
|
}
|
|
8663
8687
|
}
|
|
8664
8688
|
var resolvedVersions = /* @__PURE__ */ new WeakMap();
|
|
8665
|
-
var rememberResolvedData = (data, resolved) => resolvedVersions.set(data, resolved);
|
|
8689
|
+
var rememberResolvedData = (data, resolved) => resolvedVersions.set(data, resolvedVersions.get(resolved) ?? resolved);
|
|
8666
8690
|
var isDirty = ({
|
|
8667
8691
|
appState,
|
|
8668
8692
|
history
|
|
8669
|
-
}, version2) => history.histories.length > 1 && !deepEqual2(
|
|
8693
|
+
}, version2) => history.histories.length > 1 && !deepEqual2(
|
|
8694
|
+
appState.data,
|
|
8695
|
+
version2 && (resolvedVersions.get(version2.data) ?? version2.data)
|
|
8696
|
+
);
|
|
8670
8697
|
var usePageEditorState = () => {
|
|
8671
8698
|
const getPuck = useGetPuck();
|
|
8672
8699
|
return useMemo21(() => {
|
|
@@ -8674,9 +8701,9 @@ var usePageEditorState = () => {
|
|
|
8674
8701
|
const { config } = getPuck();
|
|
8675
8702
|
const pageData = { root: {}, content: [], ...data };
|
|
8676
8703
|
registerDynamicConfig(config, pageData);
|
|
8677
|
-
|
|
8704
|
+
let resolvedData = (data && resolvedVersions.get(data)) ?? await resolveAllData(pageData, config);
|
|
8705
|
+
if (isCurrent()) resolvedData = showData(resolvedData);
|
|
8678
8706
|
if (data) rememberResolvedData(data, resolvedData);
|
|
8679
|
-
if (isCurrent()) showData(resolvedData);
|
|
8680
8707
|
};
|
|
8681
8708
|
const showData = (data) => {
|
|
8682
8709
|
const { appState, history, dispatch } = getPuck();
|
|
@@ -8687,6 +8714,17 @@ var usePageEditorState = () => {
|
|
|
8687
8714
|
};
|
|
8688
8715
|
history.setHistories([{ state: nextState }]);
|
|
8689
8716
|
dispatch({ type: "set", state: nextState });
|
|
8717
|
+
const shownData = getPuck().appState.data;
|
|
8718
|
+
setTimeout(() => dropStaleHistory(nextState, shownData), 250);
|
|
8719
|
+
return shownData;
|
|
8720
|
+
};
|
|
8721
|
+
const dropStaleHistory = (shown, shownData) => {
|
|
8722
|
+
const { appState, history } = getPuck();
|
|
8723
|
+
const [first, ...rest] = history.histories;
|
|
8724
|
+
if (first?.state !== shown || !rest.length) return;
|
|
8725
|
+
history.setHistories(
|
|
8726
|
+
deepEqual2(appState.data, shownData) ? [{ state: appState }] : [first, { state: appState }]
|
|
8727
|
+
);
|
|
8690
8728
|
};
|
|
8691
8729
|
const unloadPageData = () => {
|
|
8692
8730
|
const { appState, history } = getPuck();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puckeditor/plugin-pages",
|
|
3
|
-
"version": "0.9.0-canary.
|
|
3
|
+
"version": "0.9.0-canary.ef531ef9",
|
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"zustand": "^5.0.8"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@puckeditor/core": "0.24.
|
|
34
|
+
"@puckeditor/core": "0.24.1-canary.2978ed6a",
|
|
35
35
|
"@radix-ui/react-popover": "^1.1.15",
|
|
36
36
|
"@testing-library/dom": "^10.4.1",
|
|
37
37
|
"@testing-library/react": "^16.3.2",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"typescript": "^5.5.4",
|
|
47
47
|
"vite-tsconfig-paths": "^5.1.4",
|
|
48
48
|
"vitest": "^4.1.11",
|
|
49
|
-
"eslint-config-custom": "0.9.0-canary.
|
|
50
|
-
"tsconfig": "0.9.0-canary.
|
|
51
|
-
"tsup-config": "0.9.0-canary.
|
|
49
|
+
"eslint-config-custom": "0.9.0-canary.ef531ef9",
|
|
50
|
+
"tsconfig": "0.9.0-canary.ef531ef9",
|
|
51
|
+
"tsup-config": "0.9.0-canary.ef531ef9"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@puckeditor/core": "^0",
|