@hubspot/cms-dev-server 1.0.38 → 1.0.43
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/generateJsonFromJsx.js +1 -1
- package/dist/index.js +113 -134
- package/dist/internalSsr.js +6 -185
- package/dist/island-runtime.js +1 -187
- package/dist/run.js +113 -134
- package/dist/storybook/index.js +1 -1
- package/dist/storybook-main/main.js +10 -193
- package/package.json +3 -4
- package/dist/.DS_Store +0 -0
- package/types/lib/debugAuth.d.ts +0 -2
- package/types/lib/localComponentsLoader.d.ts +0 -2
- package/types/lib/viteAssetHandler.d.ts +0 -15
- package/types/plugins/hubspotStaticAssetPlugin.d.ts +0 -2
- package/types/plugins/remoteAssetsPlugin.d.ts +0 -7
- package/types/plugins/requestSigningPlugin.d.ts +0 -6
- package/types/routes/createAppServerRoutes.d.ts +0 -5
- package/types/routes/homeRouteHandler.d.ts +0 -3
package/dist/internalSsr.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../cms-js-internal/dist/types-
|
|
1
|
+
// ../cms-js-internal/dist/types-Bqf9htWu.js
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { createHash } from "crypto";
|
|
4
4
|
import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
|
|
@@ -386,16 +386,12 @@ var GATES = [
|
|
|
386
386
|
"CMS:JSRenderer:RemoveCjsPlugin",
|
|
387
387
|
"CMS:JSRenderer:RemoveMockClientEntryPlugin",
|
|
388
388
|
"CMS:JSRenderer:AnalyzeCmsModules",
|
|
389
|
-
"CMS:JSRenderer:ClientOnlySupplementalFieldSerialization",
|
|
390
|
-
"CMS:React:UnifiedThemePreview",
|
|
391
389
|
"CMS:JSRenderer:CompressResponse"
|
|
392
390
|
];
|
|
393
391
|
var ENABLED_FEATURES_GATE_MAP = {
|
|
394
392
|
"cms:jsr:getServerSideProps": "CMS:JSRenderer:GetServerSideProps",
|
|
395
393
|
"cms:jsr:RemoveCjsPlugin": "CMS:JSRenderer:RemoveCjsPlugin",
|
|
396
|
-
"cms:jsr:analyzeCmsModules": "CMS:JSRenderer:AnalyzeCmsModules"
|
|
397
|
-
"cms:jsr:clientOnlySupplementalFieldSerialization": "CMS:JSRenderer:ClientOnlySupplementalFieldSerialization",
|
|
398
|
-
"cms:react:unifiedThemePreview": "CMS:React:UnifiedThemePreview"
|
|
394
|
+
"cms:jsr:analyzeCmsModules": "CMS:JSRenderer:AnalyzeCmsModules"
|
|
399
395
|
};
|
|
400
396
|
function isUngatedFor(gates, gate) {
|
|
401
397
|
return gates.includes(gate);
|
|
@@ -546,180 +542,8 @@ import { renderToPipeableStream, renderToStaticMarkup } from "react-dom/server";
|
|
|
546
542
|
import * as cmsComponents from "@hubspot/cms-components";
|
|
547
543
|
import { ServerRenderContext } from "@hubspot/cms-components";
|
|
548
544
|
import { isValidElement, cloneElement } from "react";
|
|
549
|
-
|
|
550
|
-
// ../cms-js-internal/dist/decodeHtmlEntities-Byb4Xs5S.js
|
|
551
|
-
var namedEntities = {
|
|
552
|
-
"&": "&",
|
|
553
|
-
"<": "<",
|
|
554
|
-
">": ">",
|
|
555
|
-
""": '"',
|
|
556
|
-
"'": "'",
|
|
557
|
-
"'": "'",
|
|
558
|
-
" ": "\xA0",
|
|
559
|
-
// non-breaking space
|
|
560
|
-
"©": "\xA9",
|
|
561
|
-
"®": "\xAE",
|
|
562
|
-
"™": "\u2122",
|
|
563
|
-
"…": "\u2026",
|
|
564
|
-
"—": "\u2014",
|
|
565
|
-
"–": "\u2013",
|
|
566
|
-
"‘": "\u2018",
|
|
567
|
-
"’": "\u2019",
|
|
568
|
-
"“": "\u201C",
|
|
569
|
-
"”": "\u201D",
|
|
570
|
-
"•": "\u2022",
|
|
571
|
-
"·": "\xB7",
|
|
572
|
-
"€": "\u20AC",
|
|
573
|
-
"£": "\xA3",
|
|
574
|
-
"¥": "\xA5",
|
|
575
|
-
"¢": "\xA2",
|
|
576
|
-
// Common accented characters
|
|
577
|
-
"á": "\xE1",
|
|
578
|
-
// á
|
|
579
|
-
"à": "\xE0",
|
|
580
|
-
// à
|
|
581
|
-
"â": "\xE2",
|
|
582
|
-
// â
|
|
583
|
-
"ä": "\xE4",
|
|
584
|
-
// ä
|
|
585
|
-
"ã": "\xE3",
|
|
586
|
-
// ã
|
|
587
|
-
"å": "\xE5",
|
|
588
|
-
// å
|
|
589
|
-
"é": "\xE9",
|
|
590
|
-
// é
|
|
591
|
-
"è": "\xE8",
|
|
592
|
-
// è
|
|
593
|
-
"ê": "\xEA",
|
|
594
|
-
// ê
|
|
595
|
-
"ë": "\xEB",
|
|
596
|
-
// ë
|
|
597
|
-
"í": "\xED",
|
|
598
|
-
// í
|
|
599
|
-
"ì": "\xEC",
|
|
600
|
-
// ì
|
|
601
|
-
"î": "\xEE",
|
|
602
|
-
// î
|
|
603
|
-
"ï": "\xEF",
|
|
604
|
-
// ï
|
|
605
|
-
"ó": "\xF3",
|
|
606
|
-
// ó
|
|
607
|
-
"ò": "\xF2",
|
|
608
|
-
// ò
|
|
609
|
-
"ô": "\xF4",
|
|
610
|
-
// ô
|
|
611
|
-
"ö": "\xF6",
|
|
612
|
-
// ö
|
|
613
|
-
"õ": "\xF5",
|
|
614
|
-
// õ
|
|
615
|
-
"ú": "\xFA",
|
|
616
|
-
// ú
|
|
617
|
-
"ù": "\xF9",
|
|
618
|
-
// ù
|
|
619
|
-
"û": "\xFB",
|
|
620
|
-
// û
|
|
621
|
-
"ü": "\xFC",
|
|
622
|
-
// ü
|
|
623
|
-
"ñ": "\xF1",
|
|
624
|
-
// ñ
|
|
625
|
-
"ç": "\xE7",
|
|
626
|
-
// ç
|
|
627
|
-
// Uppercase versions
|
|
628
|
-
"Á": "\xC1",
|
|
629
|
-
// Á
|
|
630
|
-
"À": "\xC0",
|
|
631
|
-
// À
|
|
632
|
-
"Â": "\xC2",
|
|
633
|
-
// Â
|
|
634
|
-
"Ä": "\xC4",
|
|
635
|
-
// Ä
|
|
636
|
-
"Ã": "\xC3",
|
|
637
|
-
// Ã
|
|
638
|
-
"Å": "\xC5",
|
|
639
|
-
// Å
|
|
640
|
-
"É": "\xC9",
|
|
641
|
-
// É
|
|
642
|
-
"È": "\xC8",
|
|
643
|
-
// È
|
|
644
|
-
"Ê": "\xCA",
|
|
645
|
-
// Ê
|
|
646
|
-
"Ë": "\xCB",
|
|
647
|
-
// Ë
|
|
648
|
-
"Í": "\xCD",
|
|
649
|
-
// Í
|
|
650
|
-
"Ì": "\xCC",
|
|
651
|
-
// Ì
|
|
652
|
-
"Î": "\xCE",
|
|
653
|
-
// Î
|
|
654
|
-
"Ï": "\xCF",
|
|
655
|
-
// Ï
|
|
656
|
-
"Ó": "\xD3",
|
|
657
|
-
// Ó
|
|
658
|
-
"Ò": "\xD2",
|
|
659
|
-
// Ò
|
|
660
|
-
"Ô": "\xD4",
|
|
661
|
-
// Ô
|
|
662
|
-
"Ö": "\xD6",
|
|
663
|
-
// Ö
|
|
664
|
-
"Õ": "\xD5",
|
|
665
|
-
// Õ
|
|
666
|
-
"Ú": "\xDA",
|
|
667
|
-
// Ú
|
|
668
|
-
"Ù": "\xD9",
|
|
669
|
-
// Ù
|
|
670
|
-
"Û": "\xDB",
|
|
671
|
-
// Û
|
|
672
|
-
"Ü": "\xDC",
|
|
673
|
-
// Ü
|
|
674
|
-
"Ñ": "\xD1",
|
|
675
|
-
// Ñ
|
|
676
|
-
"Ç": "\xC7"
|
|
677
|
-
// Ç
|
|
678
|
-
};
|
|
679
|
-
function decodeHtmlEntities(text) {
|
|
680
|
-
if (typeof text !== "string") {
|
|
681
|
-
return text;
|
|
682
|
-
}
|
|
683
|
-
return text.replace(/&#(\d+);/g, (_, dec) => {
|
|
684
|
-
const num = parseInt(dec, 10);
|
|
685
|
-
if (num >= 0 && num <= 1114111) {
|
|
686
|
-
return String.fromCharCode(num);
|
|
687
|
-
}
|
|
688
|
-
return _;
|
|
689
|
-
}).replace(/&#x([0-9a-fA-F]+);/g, (_, hex) => {
|
|
690
|
-
const num = parseInt(hex, 16);
|
|
691
|
-
if (num >= 0 && num <= 1114111) {
|
|
692
|
-
return String.fromCharCode(num);
|
|
693
|
-
}
|
|
694
|
-
return _;
|
|
695
|
-
}).replace(
|
|
696
|
-
/&[a-zA-Z][a-zA-Z0-9]*;/g,
|
|
697
|
-
(entity) => namedEntities[entity] || entity
|
|
698
|
-
);
|
|
699
|
-
}
|
|
700
|
-
function decodeHtmlEntitiesInObject(obj) {
|
|
701
|
-
if (obj === null || obj === void 0) {
|
|
702
|
-
return obj;
|
|
703
|
-
}
|
|
704
|
-
if (typeof obj === "string") {
|
|
705
|
-
return decodeHtmlEntities(obj);
|
|
706
|
-
}
|
|
707
|
-
if (Array.isArray(obj)) {
|
|
708
|
-
return obj.map(decodeHtmlEntitiesInObject);
|
|
709
|
-
}
|
|
710
|
-
if (typeof obj === "object") {
|
|
711
|
-
const decoded = {};
|
|
712
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
713
|
-
decoded[key] = decodeHtmlEntitiesInObject(value);
|
|
714
|
-
}
|
|
715
|
-
return decoded;
|
|
716
|
-
}
|
|
717
|
-
return obj;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
// ../cms-js-internal/dist/index.js
|
|
721
545
|
var { setProperty, getProperty, hasProperty } = dotProp;
|
|
722
|
-
var serializeIslandDataForInlineScript = (tweakedIslandsArray, perServerRequestData, baseIndent = 0, prettyPrint
|
|
546
|
+
var serializeIslandDataForInlineScript = (tweakedIslandsArray, perServerRequestData, baseIndent = 0, prettyPrint) => {
|
|
723
547
|
const islandsArrayToSerialize = tweakedIslandsArray.map(
|
|
724
548
|
({
|
|
725
549
|
id,
|
|
@@ -765,7 +589,7 @@ var serializeIslandDataForInlineScript = (tweakedIslandsArray, perServerRequestD
|
|
|
765
589
|
if (filteredSupplementalFieldValues) {
|
|
766
590
|
output.supplementalFieldValues = filteredSupplementalFieldValues;
|
|
767
591
|
}
|
|
768
|
-
if (
|
|
592
|
+
if (output.clientOnly) {
|
|
769
593
|
output.supplementalFieldValues = supplementalFieldValues;
|
|
770
594
|
}
|
|
771
595
|
return output;
|
|
@@ -863,7 +687,7 @@ function getPerServerRequestUrls(perServerRequestData, viteDevServer) {
|
|
|
863
687
|
});
|
|
864
688
|
return perServerRequestDataWithUrls;
|
|
865
689
|
}
|
|
866
|
-
var createIslandsGlobalJsForClientInDev = (roots, perServerRequestData, viteDevServer, indent, prettyPrint
|
|
690
|
+
var createIslandsGlobalJsForClientInDev = (roots, perServerRequestData, viteDevServer, indent, prettyPrint) => {
|
|
867
691
|
const islands = getIslandUrls(roots, viteDevServer);
|
|
868
692
|
const perServerRequestDataWithUrls = getPerServerRequestUrls(
|
|
869
693
|
perServerRequestData,
|
|
@@ -875,8 +699,7 @@ var createIslandsGlobalJsForClientInDev = (roots, perServerRequestData, viteDevS
|
|
|
875
699
|
islands,
|
|
876
700
|
perServerRequestData,
|
|
877
701
|
indent,
|
|
878
|
-
prettyPrint
|
|
879
|
-
isUngatedForClientOnlySupplementalFieldSerialization
|
|
702
|
+
prettyPrint
|
|
880
703
|
)}${writeSharedStateToJsGlobal(
|
|
881
704
|
islands,
|
|
882
705
|
perServerRequestDataWithUrls,
|
|
@@ -1446,8 +1269,6 @@ export {
|
|
|
1446
1269
|
collectCssInDev,
|
|
1447
1270
|
collectCssModules,
|
|
1448
1271
|
createIslandsGlobalJsForClientInDev,
|
|
1449
|
-
decodeHtmlEntities,
|
|
1450
|
-
decodeHtmlEntitiesInObject,
|
|
1451
1272
|
doHealthChecksFailTheBuild,
|
|
1452
1273
|
escapeForInlineJS,
|
|
1453
1274
|
findAllComponentsIn,
|
package/dist/island-runtime.js
CHANGED
|
@@ -1,173 +1,3 @@
|
|
|
1
|
-
// ../cms-js-internal/dist/decodeHtmlEntities-Byb4Xs5S.js
|
|
2
|
-
var namedEntities = {
|
|
3
|
-
"&": "&",
|
|
4
|
-
"<": "<",
|
|
5
|
-
">": ">",
|
|
6
|
-
""": '"',
|
|
7
|
-
"'": "'",
|
|
8
|
-
"'": "'",
|
|
9
|
-
" ": "\xA0",
|
|
10
|
-
// non-breaking space
|
|
11
|
-
"©": "\xA9",
|
|
12
|
-
"®": "\xAE",
|
|
13
|
-
"™": "\u2122",
|
|
14
|
-
"…": "\u2026",
|
|
15
|
-
"—": "\u2014",
|
|
16
|
-
"–": "\u2013",
|
|
17
|
-
"‘": "\u2018",
|
|
18
|
-
"’": "\u2019",
|
|
19
|
-
"“": "\u201C",
|
|
20
|
-
"”": "\u201D",
|
|
21
|
-
"•": "\u2022",
|
|
22
|
-
"·": "\xB7",
|
|
23
|
-
"€": "\u20AC",
|
|
24
|
-
"£": "\xA3",
|
|
25
|
-
"¥": "\xA5",
|
|
26
|
-
"¢": "\xA2",
|
|
27
|
-
// Common accented characters
|
|
28
|
-
"á": "\xE1",
|
|
29
|
-
// á
|
|
30
|
-
"à": "\xE0",
|
|
31
|
-
// à
|
|
32
|
-
"â": "\xE2",
|
|
33
|
-
// â
|
|
34
|
-
"ä": "\xE4",
|
|
35
|
-
// ä
|
|
36
|
-
"ã": "\xE3",
|
|
37
|
-
// ã
|
|
38
|
-
"å": "\xE5",
|
|
39
|
-
// å
|
|
40
|
-
"é": "\xE9",
|
|
41
|
-
// é
|
|
42
|
-
"è": "\xE8",
|
|
43
|
-
// è
|
|
44
|
-
"ê": "\xEA",
|
|
45
|
-
// ê
|
|
46
|
-
"ë": "\xEB",
|
|
47
|
-
// ë
|
|
48
|
-
"í": "\xED",
|
|
49
|
-
// í
|
|
50
|
-
"ì": "\xEC",
|
|
51
|
-
// ì
|
|
52
|
-
"î": "\xEE",
|
|
53
|
-
// î
|
|
54
|
-
"ï": "\xEF",
|
|
55
|
-
// ï
|
|
56
|
-
"ó": "\xF3",
|
|
57
|
-
// ó
|
|
58
|
-
"ò": "\xF2",
|
|
59
|
-
// ò
|
|
60
|
-
"ô": "\xF4",
|
|
61
|
-
// ô
|
|
62
|
-
"ö": "\xF6",
|
|
63
|
-
// ö
|
|
64
|
-
"õ": "\xF5",
|
|
65
|
-
// õ
|
|
66
|
-
"ú": "\xFA",
|
|
67
|
-
// ú
|
|
68
|
-
"ù": "\xF9",
|
|
69
|
-
// ù
|
|
70
|
-
"û": "\xFB",
|
|
71
|
-
// û
|
|
72
|
-
"ü": "\xFC",
|
|
73
|
-
// ü
|
|
74
|
-
"ñ": "\xF1",
|
|
75
|
-
// ñ
|
|
76
|
-
"ç": "\xE7",
|
|
77
|
-
// ç
|
|
78
|
-
// Uppercase versions
|
|
79
|
-
"Á": "\xC1",
|
|
80
|
-
// Á
|
|
81
|
-
"À": "\xC0",
|
|
82
|
-
// À
|
|
83
|
-
"Â": "\xC2",
|
|
84
|
-
// Â
|
|
85
|
-
"Ä": "\xC4",
|
|
86
|
-
// Ä
|
|
87
|
-
"Ã": "\xC3",
|
|
88
|
-
// Ã
|
|
89
|
-
"Å": "\xC5",
|
|
90
|
-
// Å
|
|
91
|
-
"É": "\xC9",
|
|
92
|
-
// É
|
|
93
|
-
"È": "\xC8",
|
|
94
|
-
// È
|
|
95
|
-
"Ê": "\xCA",
|
|
96
|
-
// Ê
|
|
97
|
-
"Ë": "\xCB",
|
|
98
|
-
// Ë
|
|
99
|
-
"Í": "\xCD",
|
|
100
|
-
// Í
|
|
101
|
-
"Ì": "\xCC",
|
|
102
|
-
// Ì
|
|
103
|
-
"Î": "\xCE",
|
|
104
|
-
// Î
|
|
105
|
-
"Ï": "\xCF",
|
|
106
|
-
// Ï
|
|
107
|
-
"Ó": "\xD3",
|
|
108
|
-
// Ó
|
|
109
|
-
"Ò": "\xD2",
|
|
110
|
-
// Ò
|
|
111
|
-
"Ô": "\xD4",
|
|
112
|
-
// Ô
|
|
113
|
-
"Ö": "\xD6",
|
|
114
|
-
// Ö
|
|
115
|
-
"Õ": "\xD5",
|
|
116
|
-
// Õ
|
|
117
|
-
"Ú": "\xDA",
|
|
118
|
-
// Ú
|
|
119
|
-
"Ù": "\xD9",
|
|
120
|
-
// Ù
|
|
121
|
-
"Û": "\xDB",
|
|
122
|
-
// Û
|
|
123
|
-
"Ü": "\xDC",
|
|
124
|
-
// Ü
|
|
125
|
-
"Ñ": "\xD1",
|
|
126
|
-
// Ñ
|
|
127
|
-
"Ç": "\xC7"
|
|
128
|
-
// Ç
|
|
129
|
-
};
|
|
130
|
-
function decodeHtmlEntities(text) {
|
|
131
|
-
if (typeof text !== "string") {
|
|
132
|
-
return text;
|
|
133
|
-
}
|
|
134
|
-
return text.replace(/&#(\d+);/g, (_, dec) => {
|
|
135
|
-
const num = parseInt(dec, 10);
|
|
136
|
-
if (num >= 0 && num <= 1114111) {
|
|
137
|
-
return String.fromCharCode(num);
|
|
138
|
-
}
|
|
139
|
-
return _;
|
|
140
|
-
}).replace(/&#x([0-9a-fA-F]+);/g, (_, hex) => {
|
|
141
|
-
const num = parseInt(hex, 16);
|
|
142
|
-
if (num >= 0 && num <= 1114111) {
|
|
143
|
-
return String.fromCharCode(num);
|
|
144
|
-
}
|
|
145
|
-
return _;
|
|
146
|
-
}).replace(
|
|
147
|
-
/&[a-zA-Z][a-zA-Z0-9]*;/g,
|
|
148
|
-
(entity) => namedEntities[entity] || entity
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
function decodeHtmlEntitiesInObject(obj) {
|
|
152
|
-
if (obj === null || obj === void 0) {
|
|
153
|
-
return obj;
|
|
154
|
-
}
|
|
155
|
-
if (typeof obj === "string") {
|
|
156
|
-
return decodeHtmlEntities(obj);
|
|
157
|
-
}
|
|
158
|
-
if (Array.isArray(obj)) {
|
|
159
|
-
return obj.map(decodeHtmlEntitiesInObject);
|
|
160
|
-
}
|
|
161
|
-
if (typeof obj === "object") {
|
|
162
|
-
const decoded = {};
|
|
163
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
164
|
-
decoded[key] = decodeHtmlEntitiesInObject(value);
|
|
165
|
-
}
|
|
166
|
-
return decoded;
|
|
167
|
-
}
|
|
168
|
-
return obj;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
1
|
// ../cms-js-internal/dist/island-runtime/island-runtime.js
|
|
172
2
|
var onVisible = (islandEl, callback) => {
|
|
173
3
|
const observer = new IntersectionObserver((entries) => {
|
|
@@ -243,22 +73,6 @@ var startHydratingIdleRootsTimeout;
|
|
|
243
73
|
var shouldForceSeparateJsForAllIslands = /(&|\?)forceSeparateIslandJs=true/.test(window.location.search);
|
|
244
74
|
var scheduledHydrationIndexCtr = 1;
|
|
245
75
|
var rootsById = /* @__PURE__ */ new Map();
|
|
246
|
-
function createDecodedIslandCopy(island) {
|
|
247
|
-
const islandCopy = {
|
|
248
|
-
...island,
|
|
249
|
-
// Deep copy and decode HTML entities in props
|
|
250
|
-
props: decodeHtmlEntitiesInObject(island.props),
|
|
251
|
-
// Deep copy supplementalFieldValues if it exists
|
|
252
|
-
...island.supplementalFieldValues && {
|
|
253
|
-
supplementalFieldValues: decodeHtmlEntitiesInObject(island.supplementalFieldValues)
|
|
254
|
-
},
|
|
255
|
-
// Deep copy resolvedDataDependencies if it exists
|
|
256
|
-
...island.resolvedDataDependencies && {
|
|
257
|
-
resolvedDataDependencies: { ...island.resolvedDataDependencies }
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
return islandCopy;
|
|
261
|
-
}
|
|
262
76
|
var typedWindow = window;
|
|
263
77
|
var startHydratingIdleRoots = () => {
|
|
264
78
|
hydrationTypesToAccept.add("idle");
|
|
@@ -395,7 +209,7 @@ function getLoadableModuleFor(root) {
|
|
|
395
209
|
}
|
|
396
210
|
function hydrateIslandRoots() {
|
|
397
211
|
if (rootsToProcess === void 0) {
|
|
398
|
-
rootsToProcess = typedWindow.__islands
|
|
212
|
+
rootsToProcess = typedWindow.__islands;
|
|
399
213
|
if (window.location.search.includes("hsDebug=")) {
|
|
400
214
|
console.log("Starting to hydrate", rootsToProcess);
|
|
401
215
|
}
|