@founderhq/journeys 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/_tsup-dts-rollup.d.cts +12 -0
- package/dist/_tsup-dts-rollup.d.ts +12 -0
- package/dist/index.cjs +30 -14
- package/dist/index.js +30 -14
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -323,6 +323,11 @@ architecture and security model are documented in
|
|
|
323
323
|
|
|
324
324
|
## Release notes
|
|
325
325
|
|
|
326
|
+
### 1.0.2
|
|
327
|
+
|
|
328
|
+
- Icons show again in the timeline, callout, card, metric, table and before-after blocks. From 0.6.0 to 1.0.1 they rendered with no stroke and were invisible.
|
|
329
|
+
- A glow spot (`blobs`) with a percentage `size` stays round: the size is a share of the screen's longer side, as the default `60vmax`. Before, "60%" was 60% of the width and of the height, which cut the glow off at its sides on a phone.
|
|
330
|
+
|
|
326
331
|
### 1.0.1
|
|
327
332
|
|
|
328
333
|
- The package now ships its MIT licence: a `LICENSE` file and the `license` field.
|
|
@@ -218,6 +218,9 @@ declare type BlobConfig = {
|
|
|
218
218
|
b: number;
|
|
219
219
|
a: number;
|
|
220
220
|
};
|
|
221
|
+
/** One side of the blob's round glow, e.g. "60vmax" (the default). A
|
|
222
|
+
* percentage is a share of the screen's longer side, so "60%" equals
|
|
223
|
+
* "60vmax". */
|
|
221
224
|
size?: string;
|
|
222
225
|
};
|
|
223
226
|
export { BlobConfig }
|
|
@@ -2194,6 +2197,15 @@ declare function resolveJourneyBlobDefaultSize(viewport?: JourneyBlobViewport):
|
|
|
2194
2197
|
export { resolveJourneyBlobDefaultSize }
|
|
2195
2198
|
export { resolveJourneyBlobDefaultSize as resolveJourneyBlobDefaultSize_alias_1 }
|
|
2196
2199
|
|
|
2200
|
+
/**
|
|
2201
|
+
* The CSS size of one side of a blob's square box. A blob is a circle, so
|
|
2202
|
+
* a percentage means a share of the screen's longer side, as the default
|
|
2203
|
+
* `60vmax` does. As plain CSS, "60%" would be 60 % of the width AND 60 % of
|
|
2204
|
+
* the height: a tall narrow box on a phone that cuts the round glow off at
|
|
2205
|
+
* its left and right sides.
|
|
2206
|
+
*/
|
|
2207
|
+
export declare function resolveJourneyBlobSize(size: string | undefined, viewport?: JourneyBlobViewport): string;
|
|
2208
|
+
|
|
2197
2209
|
/** Resolve editor font labels to the self-hosted faces shipped by Journeys. */
|
|
2198
2210
|
declare function resolveJourneyFontFamily(fontFamily: string | undefined): string | undefined;
|
|
2199
2211
|
export { resolveJourneyFontFamily }
|
|
@@ -218,6 +218,9 @@ declare type BlobConfig = {
|
|
|
218
218
|
b: number;
|
|
219
219
|
a: number;
|
|
220
220
|
};
|
|
221
|
+
/** One side of the blob's round glow, e.g. "60vmax" (the default). A
|
|
222
|
+
* percentage is a share of the screen's longer side, so "60%" equals
|
|
223
|
+
* "60vmax". */
|
|
221
224
|
size?: string;
|
|
222
225
|
};
|
|
223
226
|
export { BlobConfig }
|
|
@@ -2194,6 +2197,15 @@ declare function resolveJourneyBlobDefaultSize(viewport?: JourneyBlobViewport):
|
|
|
2194
2197
|
export { resolveJourneyBlobDefaultSize }
|
|
2195
2198
|
export { resolveJourneyBlobDefaultSize as resolveJourneyBlobDefaultSize_alias_1 }
|
|
2196
2199
|
|
|
2200
|
+
/**
|
|
2201
|
+
* The CSS size of one side of a blob's square box. A blob is a circle, so
|
|
2202
|
+
* a percentage means a share of the screen's longer side, as the default
|
|
2203
|
+
* `60vmax` does. As plain CSS, "60%" would be 60 % of the width AND 60 % of
|
|
2204
|
+
* the height: a tall narrow box on a phone that cuts the round glow off at
|
|
2205
|
+
* its left and right sides.
|
|
2206
|
+
*/
|
|
2207
|
+
export declare function resolveJourneyBlobSize(size: string | undefined, viewport?: JourneyBlobViewport): string;
|
|
2208
|
+
|
|
2197
2209
|
/** Resolve editor font labels to the self-hosted faces shipped by Journeys. */
|
|
2198
2210
|
declare function resolveJourneyFontFamily(fontFamily: string | undefined): string | undefined;
|
|
2199
2211
|
export { resolveJourneyFontFamily }
|
package/dist/index.cjs
CHANGED
|
@@ -5823,7 +5823,16 @@ function DynamicIcon({
|
|
|
5823
5823
|
}) {
|
|
5824
5824
|
const Icon = lucideIcons5[name];
|
|
5825
5825
|
if (isLucideIcon(Icon)) {
|
|
5826
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5826
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5827
|
+
Icon,
|
|
5828
|
+
__spreadProps(__spreadValues({
|
|
5829
|
+
size,
|
|
5830
|
+
className,
|
|
5831
|
+
style
|
|
5832
|
+
}, stroke ? { stroke } : {}), {
|
|
5833
|
+
children
|
|
5834
|
+
})
|
|
5835
|
+
);
|
|
5827
5836
|
}
|
|
5828
5837
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5829
5838
|
"span",
|
|
@@ -12083,6 +12092,15 @@ function resolveJourneyBlobDefaultSize(viewport) {
|
|
|
12083
12092
|
if (!viewport) return "60vmax";
|
|
12084
12093
|
return `${Math.max(viewport.width, viewport.height) * 0.6}px`;
|
|
12085
12094
|
}
|
|
12095
|
+
var PERCENT_SIZE = /^\s*(\d+(?:\.\d+)?)\s*%\s*$/;
|
|
12096
|
+
function resolveJourneyBlobSize(size, viewport) {
|
|
12097
|
+
if (size === void 0) return resolveJourneyBlobDefaultSize(viewport);
|
|
12098
|
+
const percent = PERCENT_SIZE.exec(size);
|
|
12099
|
+
if (!percent) return size;
|
|
12100
|
+
const share = Number(percent[1]);
|
|
12101
|
+
if (!viewport) return `${share}vmax`;
|
|
12102
|
+
return `${Math.max(viewport.width, viewport.height) * share / 100}px`;
|
|
12103
|
+
}
|
|
12086
12104
|
var BLOB_POSITIONS = [
|
|
12087
12105
|
[
|
|
12088
12106
|
{ x: "-5%", y: "-10%" },
|
|
@@ -12132,12 +12150,12 @@ function themedBlobGradient(peakAlpha) {
|
|
|
12132
12150
|
function colorKey(c) {
|
|
12133
12151
|
return `${c.r}-${c.g}-${c.b}-${c.a}`;
|
|
12134
12152
|
}
|
|
12135
|
-
function resolveBlobVisual(config, index,
|
|
12136
|
-
var _a
|
|
12153
|
+
function resolveBlobVisual(config, index, viewport) {
|
|
12154
|
+
var _a;
|
|
12137
12155
|
const color = config == null ? void 0 : config.color;
|
|
12138
12156
|
return {
|
|
12139
12157
|
position: (_a = config == null ? void 0 : config.position) != null ? _a : { x: "50%", y: "50%" },
|
|
12140
|
-
size: (
|
|
12158
|
+
size: resolveJourneyBlobSize(config == null ? void 0 : config.size, viewport),
|
|
12141
12159
|
background: color ? blobGradient(color) : themedBlobGradient(BLOB_PEAK_ALPHAS[index % BLOB_PEAK_ALPHAS.length]),
|
|
12142
12160
|
fadeKey: color ? colorKey(color) : `themed-${index % BLOB_PEAK_ALPHAS.length}`
|
|
12143
12161
|
};
|
|
@@ -12146,12 +12164,12 @@ function AnimatedBlob({
|
|
|
12146
12164
|
config,
|
|
12147
12165
|
index,
|
|
12148
12166
|
visible,
|
|
12149
|
-
|
|
12167
|
+
viewport
|
|
12150
12168
|
}) {
|
|
12151
12169
|
const { position, size, background, fadeKey } = resolveBlobVisual(
|
|
12152
12170
|
config,
|
|
12153
12171
|
index,
|
|
12154
|
-
|
|
12172
|
+
viewport
|
|
12155
12173
|
);
|
|
12156
12174
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12157
12175
|
react.m.div,
|
|
@@ -12185,12 +12203,12 @@ function AnimatedBlob({
|
|
|
12185
12203
|
function StaticBlob({
|
|
12186
12204
|
config,
|
|
12187
12205
|
index,
|
|
12188
|
-
|
|
12206
|
+
viewport
|
|
12189
12207
|
}) {
|
|
12190
12208
|
const { position, size, background } = resolveBlobVisual(
|
|
12191
12209
|
config,
|
|
12192
12210
|
index,
|
|
12193
|
-
|
|
12211
|
+
viewport
|
|
12194
12212
|
);
|
|
12195
12213
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12196
12214
|
"div",
|
|
@@ -12224,10 +12242,8 @@ function JourneyBlobLayer({
|
|
|
12224
12242
|
theme,
|
|
12225
12243
|
themeVariables
|
|
12226
12244
|
}) {
|
|
12227
|
-
const defaultSize = resolveJourneyBlobDefaultSize(viewport);
|
|
12228
12245
|
const blobConfigs = blobs ? blobs : showRandomBlobs ? BLOB_POSITIONS[stepIndex % BLOB_POSITIONS.length].map((position) => ({
|
|
12229
|
-
position
|
|
12230
|
-
size: defaultSize
|
|
12246
|
+
position
|
|
12231
12247
|
})) : [];
|
|
12232
12248
|
const themeStyle = themeVariables ? Object.fromEntries(
|
|
12233
12249
|
Object.entries(themeVariables).filter(([key]) => key.startsWith("--"))
|
|
@@ -12243,7 +12259,7 @@ function JourneyBlobLayer({
|
|
|
12243
12259
|
{
|
|
12244
12260
|
config: blobConfigs[index],
|
|
12245
12261
|
index,
|
|
12246
|
-
|
|
12262
|
+
viewport
|
|
12247
12263
|
},
|
|
12248
12264
|
slot
|
|
12249
12265
|
)) : BLOB_SLOTS.map((slot, index) => {
|
|
@@ -12254,7 +12270,7 @@ function JourneyBlobLayer({
|
|
|
12254
12270
|
config: (_a = blobConfigs[index]) != null ? _a : null,
|
|
12255
12271
|
index,
|
|
12256
12272
|
visible: index < blobConfigs.length,
|
|
12257
|
-
|
|
12273
|
+
viewport
|
|
12258
12274
|
},
|
|
12259
12275
|
slot
|
|
12260
12276
|
);
|
|
@@ -12829,7 +12845,7 @@ function useJourneyConfig({
|
|
|
12829
12845
|
|
|
12830
12846
|
// src/engine/journey-capture.ts
|
|
12831
12847
|
var JOURNEY_LIBRARY_NAME = "@founderhq/journeys";
|
|
12832
|
-
var JOURNEY_LIBRARY_VERSION = "1.0.
|
|
12848
|
+
var JOURNEY_LIBRARY_VERSION = "1.0.2";
|
|
12833
12849
|
var DEFAULT_QUEUE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
12834
12850
|
var MAX_QUEUED_CAPTURE_EVENTS = 100;
|
|
12835
12851
|
var MAX_BEACON_BYTES = 60 * 1024;
|
package/dist/index.js
CHANGED
|
@@ -3711,7 +3711,16 @@ function DynamicIcon({
|
|
|
3711
3711
|
}) {
|
|
3712
3712
|
const Icon = lucideIcons5[name];
|
|
3713
3713
|
if (isLucideIcon(Icon)) {
|
|
3714
|
-
return /* @__PURE__ */ jsx(
|
|
3714
|
+
return /* @__PURE__ */ jsx(
|
|
3715
|
+
Icon,
|
|
3716
|
+
__spreadProps(__spreadValues({
|
|
3717
|
+
size,
|
|
3718
|
+
className,
|
|
3719
|
+
style
|
|
3720
|
+
}, stroke ? { stroke } : {}), {
|
|
3721
|
+
children
|
|
3722
|
+
})
|
|
3723
|
+
);
|
|
3715
3724
|
}
|
|
3716
3725
|
return /* @__PURE__ */ jsx(
|
|
3717
3726
|
"span",
|
|
@@ -9971,6 +9980,15 @@ function resolveJourneyBlobDefaultSize(viewport) {
|
|
|
9971
9980
|
if (!viewport) return "60vmax";
|
|
9972
9981
|
return `${Math.max(viewport.width, viewport.height) * 0.6}px`;
|
|
9973
9982
|
}
|
|
9983
|
+
var PERCENT_SIZE = /^\s*(\d+(?:\.\d+)?)\s*%\s*$/;
|
|
9984
|
+
function resolveJourneyBlobSize(size, viewport) {
|
|
9985
|
+
if (size === void 0) return resolveJourneyBlobDefaultSize(viewport);
|
|
9986
|
+
const percent = PERCENT_SIZE.exec(size);
|
|
9987
|
+
if (!percent) return size;
|
|
9988
|
+
const share = Number(percent[1]);
|
|
9989
|
+
if (!viewport) return `${share}vmax`;
|
|
9990
|
+
return `${Math.max(viewport.width, viewport.height) * share / 100}px`;
|
|
9991
|
+
}
|
|
9974
9992
|
var BLOB_POSITIONS = [
|
|
9975
9993
|
[
|
|
9976
9994
|
{ x: "-5%", y: "-10%" },
|
|
@@ -10020,12 +10038,12 @@ function themedBlobGradient(peakAlpha) {
|
|
|
10020
10038
|
function colorKey(c) {
|
|
10021
10039
|
return `${c.r}-${c.g}-${c.b}-${c.a}`;
|
|
10022
10040
|
}
|
|
10023
|
-
function resolveBlobVisual(config, index,
|
|
10024
|
-
var _a
|
|
10041
|
+
function resolveBlobVisual(config, index, viewport) {
|
|
10042
|
+
var _a;
|
|
10025
10043
|
const color = config == null ? void 0 : config.color;
|
|
10026
10044
|
return {
|
|
10027
10045
|
position: (_a = config == null ? void 0 : config.position) != null ? _a : { x: "50%", y: "50%" },
|
|
10028
|
-
size: (
|
|
10046
|
+
size: resolveJourneyBlobSize(config == null ? void 0 : config.size, viewport),
|
|
10029
10047
|
background: color ? blobGradient(color) : themedBlobGradient(BLOB_PEAK_ALPHAS[index % BLOB_PEAK_ALPHAS.length]),
|
|
10030
10048
|
fadeKey: color ? colorKey(color) : `themed-${index % BLOB_PEAK_ALPHAS.length}`
|
|
10031
10049
|
};
|
|
@@ -10034,12 +10052,12 @@ function AnimatedBlob({
|
|
|
10034
10052
|
config,
|
|
10035
10053
|
index,
|
|
10036
10054
|
visible,
|
|
10037
|
-
|
|
10055
|
+
viewport
|
|
10038
10056
|
}) {
|
|
10039
10057
|
const { position, size, background, fadeKey } = resolveBlobVisual(
|
|
10040
10058
|
config,
|
|
10041
10059
|
index,
|
|
10042
|
-
|
|
10060
|
+
viewport
|
|
10043
10061
|
);
|
|
10044
10062
|
return /* @__PURE__ */ jsx(
|
|
10045
10063
|
m.div,
|
|
@@ -10073,12 +10091,12 @@ function AnimatedBlob({
|
|
|
10073
10091
|
function StaticBlob({
|
|
10074
10092
|
config,
|
|
10075
10093
|
index,
|
|
10076
|
-
|
|
10094
|
+
viewport
|
|
10077
10095
|
}) {
|
|
10078
10096
|
const { position, size, background } = resolveBlobVisual(
|
|
10079
10097
|
config,
|
|
10080
10098
|
index,
|
|
10081
|
-
|
|
10099
|
+
viewport
|
|
10082
10100
|
);
|
|
10083
10101
|
return /* @__PURE__ */ jsx(
|
|
10084
10102
|
"div",
|
|
@@ -10112,10 +10130,8 @@ function JourneyBlobLayer({
|
|
|
10112
10130
|
theme,
|
|
10113
10131
|
themeVariables
|
|
10114
10132
|
}) {
|
|
10115
|
-
const defaultSize = resolveJourneyBlobDefaultSize(viewport);
|
|
10116
10133
|
const blobConfigs = blobs ? blobs : showRandomBlobs ? BLOB_POSITIONS[stepIndex % BLOB_POSITIONS.length].map((position) => ({
|
|
10117
|
-
position
|
|
10118
|
-
size: defaultSize
|
|
10134
|
+
position
|
|
10119
10135
|
})) : [];
|
|
10120
10136
|
const themeStyle = themeVariables ? Object.fromEntries(
|
|
10121
10137
|
Object.entries(themeVariables).filter(([key]) => key.startsWith("--"))
|
|
@@ -10131,7 +10147,7 @@ function JourneyBlobLayer({
|
|
|
10131
10147
|
{
|
|
10132
10148
|
config: blobConfigs[index],
|
|
10133
10149
|
index,
|
|
10134
|
-
|
|
10150
|
+
viewport
|
|
10135
10151
|
},
|
|
10136
10152
|
slot
|
|
10137
10153
|
)) : BLOB_SLOTS.map((slot, index) => {
|
|
@@ -10142,7 +10158,7 @@ function JourneyBlobLayer({
|
|
|
10142
10158
|
config: (_a = blobConfigs[index]) != null ? _a : null,
|
|
10143
10159
|
index,
|
|
10144
10160
|
visible: index < blobConfigs.length,
|
|
10145
|
-
|
|
10161
|
+
viewport
|
|
10146
10162
|
},
|
|
10147
10163
|
slot
|
|
10148
10164
|
);
|
|
@@ -10717,7 +10733,7 @@ function useJourneyConfig({
|
|
|
10717
10733
|
|
|
10718
10734
|
// src/engine/journey-capture.ts
|
|
10719
10735
|
var JOURNEY_LIBRARY_NAME = "@founderhq/journeys";
|
|
10720
|
-
var JOURNEY_LIBRARY_VERSION = "1.0.
|
|
10736
|
+
var JOURNEY_LIBRARY_VERSION = "1.0.2";
|
|
10721
10737
|
var DEFAULT_QUEUE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
10722
10738
|
var MAX_QUEUED_CAPTURE_EVENTS = 100;
|
|
10723
10739
|
var MAX_BEACON_BYTES = 60 * 1024;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@founderhq/journeys",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Config-driven interactive journey/questionnaire engine for React",
|
|
6
6
|
"type": "module",
|
|
@@ -86,4 +86,4 @@
|
|
|
86
86
|
"dev:ts": "tsup --watch",
|
|
87
87
|
"typecheck": "node ../../scripts/run-tsc.mjs -p tsconfig.json --noEmit"
|
|
88
88
|
}
|
|
89
|
-
}
|
|
89
|
+
}
|