@drawbridge/components 0.1.23 → 0.1.25
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/bridge/form-subdomain-embed.js +1 -0
- package/dist/bridge/form-subdomain-embed.mjs +1 -0
- package/dist/bridge/form-subdomain.js +5 -2
- package/dist/bridge/form-subdomain.mjs +5 -2
- package/dist/bridge/template-modal.js +2 -2
- package/dist/bridge/template-modal.mjs +2 -2
- package/dist/dashboard/buttons-subscription.js +27 -66
- package/dist/dashboard/buttons-subscription.mjs +27 -65
- package/dist/dashboard/card-payment-method.js +1 -1
- package/dist/dashboard/card-payment-method.mjs +1 -1
- package/dist/dashboard/card-section.js +2 -2
- package/dist/dashboard/card-section.mjs +2 -2
- package/dist/dashboard/card-setting.js +3 -4
- package/dist/dashboard/card-setting.mjs +3 -4
- package/dist/dashboard/card-task.js +4 -22
- package/dist/dashboard/card-task.mjs +4 -22
- package/dist/dashboard/card-tile.js +6 -6
- package/dist/dashboard/card-tile.mjs +6 -6
- package/dist/dashboard/drawer.js +2 -7
- package/dist/dashboard/drawer.mjs +3 -8
- package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -5
- package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -5
- package/dist/dashboard/form-organization-campaign.js +1 -1
- package/dist/dashboard/form-organization-campaign.mjs +1 -1
- package/dist/dashboard/form-organization-identity.js +3 -3
- package/dist/dashboard/form-organization-identity.mjs +3 -3
- package/dist/dashboard/form-organization-workflow.js +9 -7
- package/dist/dashboard/form-organization-workflow.mjs +9 -7
- package/dist/dashboard/form-organization.js +40 -3
- package/dist/dashboard/form-organization.mjs +40 -3
- package/dist/dashboard/guide.js +238 -0
- package/dist/dashboard/guide.mjs +209 -0
- package/dist/dashboard/input-combobox.js +2 -7
- package/dist/dashboard/input-combobox.mjs +2 -7
- package/dist/dashboard/list.js +1 -1
- package/dist/dashboard/list.mjs +1 -1
- package/dist/dashboard/menu.js +96 -188
- package/dist/dashboard/menu.mjs +97 -189
- package/dist/dashboard/modal.js +3 -9
- package/dist/dashboard/modal.mjs +4 -10
- package/dist/dashboard/notice.js +3 -5
- package/dist/dashboard/notice.mjs +3 -5
- package/dist/dashboard/table-cell-title.js +0 -2
- package/dist/dashboard/table-cell-title.mjs +0 -2
- package/dist/dashboard/table.js +20 -61
- package/dist/dashboard/table.mjs +20 -61
- package/dist/dashboard/template-dashboard.js +133 -35
- package/dist/dashboard/template-dashboard.mjs +134 -36
- package/dist/dashboard/template-socket.js +3 -19
- package/dist/dashboard/template-socket.mjs +3 -19
- package/dist/dashboard/template-ui.js +186 -150
- package/dist/dashboard/template-ui.mjs +187 -151
- package/dist/shared/lib/helpers.js +2 -9
- package/dist/shared/lib/helpers.mjs +2 -9
- package/dist/shared/overlay.js +3 -5
- package/dist/shared/overlay.mjs +3 -5
- package/package.json +13 -28
- package/types/dashboard/card-task.d.ts +1 -5
- package/types/dashboard/guide.d.ts +23 -0
- package/types/dashboard/table.d.ts +1 -3
- package/types/dashboard/template-dashboard.d.ts +1 -4
- package/types/dashboard/template-ui.d.ts +2 -2
- package/dist/dashboard/lib/escape.js +0 -48
- package/dist/dashboard/lib/escape.mjs +0 -25
- package/dist/dashboard/lib/rail.js +0 -75
- package/dist/dashboard/lib/rail.mjs +0 -46
- package/dist/dashboard/lib/throttle.js +0 -57
- package/dist/dashboard/lib/throttle.mjs +0 -34
- package/dist/dashboard/template-rail.js +0 -674
- package/dist/dashboard/template-rail.mjs +0 -640
- package/dist/icons/book-open.js +0 -46
- package/dist/icons/book-open.mjs +0 -27
- package/dist/icons/task.js +0 -46
- package/dist/icons/task.mjs +0 -27
- package/dist/shared/lib/motion.js +0 -27
- package/dist/shared/lib/motion.mjs +0 -4
- package/types/dashboard/lib/rail.d.ts +0 -32
- package/types/dashboard/lib/throttle.d.ts +0 -5
- package/types/dashboard/template-rail.d.ts +0 -36
- package/types/icons/book-open.d.ts +0 -5
- package/types/icons/task.d.ts +0 -5
|
@@ -37,7 +37,7 @@ var import_navigation = require("next/navigation");
|
|
|
37
37
|
var import_react_query = require("@tanstack/react-query");
|
|
38
38
|
var import_hooks = require("./lib/hooks");
|
|
39
39
|
var import_wrapper_gradient = __toESM(require("../wrapper-gradient"));
|
|
40
|
-
var
|
|
40
|
+
var import_guide = __toESM(require("./guide"));
|
|
41
41
|
var import_menu = require("./menu");
|
|
42
42
|
var import_menu2 = __toESM(require("../icons/menu"));
|
|
43
43
|
var import_switch = __toESM(require("../icons/switch"));
|
|
@@ -52,6 +52,7 @@ const offsets = {
|
|
|
52
52
|
paddingTop: "pt-16 md:pt-0"
|
|
53
53
|
};
|
|
54
54
|
const isAccountPath = (path) => path === "/account" || path.startsWith("/account/");
|
|
55
|
+
let timeout;
|
|
55
56
|
const TemplateUIHeaderBack = ({
|
|
56
57
|
href,
|
|
57
58
|
icon: Icon = import_arrow_left.default,
|
|
@@ -123,7 +124,6 @@ const TemplateUiHeader = ({
|
|
|
123
124
|
active,
|
|
124
125
|
campaign = {},
|
|
125
126
|
className,
|
|
126
|
-
guide,
|
|
127
127
|
organization = {},
|
|
128
128
|
params,
|
|
129
129
|
path
|
|
@@ -187,14 +187,6 @@ const TemplateUiHeader = ({
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
),
|
|
190
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
191
|
-
import_template_rail.TemplateRailBook,
|
|
192
|
-
{
|
|
193
|
-
...{
|
|
194
|
-
guide
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
),
|
|
198
190
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
199
191
|
"div",
|
|
200
192
|
{
|
|
@@ -295,11 +287,21 @@ const TemplateUi = ({
|
|
|
295
287
|
queryKey: ["campaign", params.campaign]
|
|
296
288
|
});
|
|
297
289
|
const guide = (_b = (_a = account == null ? void 0 : account.data) == null ? void 0 : _a.guide) == null ? void 0 : _b[guideId];
|
|
290
|
+
const [run, setRun] = (0, import_react.useState)(false);
|
|
298
291
|
const modal = (0, import_hooks.useModal)({
|
|
299
292
|
queryClient
|
|
300
293
|
});
|
|
301
294
|
const actions = (0, import_react.useMemo)(
|
|
302
295
|
() => {
|
|
296
|
+
const reset = () => {
|
|
297
|
+
modal.close();
|
|
298
|
+
queryClient.setQueryData(
|
|
299
|
+
["menu"],
|
|
300
|
+
{
|
|
301
|
+
active: false
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
};
|
|
303
305
|
const menu2 = () => {
|
|
304
306
|
queryClient.setQueryData(
|
|
305
307
|
["menu"],
|
|
@@ -309,6 +311,10 @@ const TemplateUi = ({
|
|
|
309
311
|
);
|
|
310
312
|
};
|
|
311
313
|
return {
|
|
314
|
+
guide: () => {
|
|
315
|
+
reset();
|
|
316
|
+
setRun(true);
|
|
317
|
+
},
|
|
312
318
|
signout: () => {
|
|
313
319
|
modal.open({
|
|
314
320
|
message: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -345,158 +351,188 @@ const TemplateUi = ({
|
|
|
345
351
|
},
|
|
346
352
|
[queryClient, modal]
|
|
347
353
|
);
|
|
348
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
|
355
|
+
guide && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
356
|
+
import_guide.default,
|
|
357
|
+
{
|
|
358
|
+
...{
|
|
359
|
+
...guide,
|
|
360
|
+
callback: async ({ action, step, type }) => {
|
|
361
|
+
var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j;
|
|
362
|
+
const key = action + "." + type;
|
|
363
|
+
if ((_a2 = step == null ? void 0 : step.data) == null ? void 0 : _a2[key]) {
|
|
364
|
+
clearTimeout(timeout);
|
|
365
|
+
setRun(false);
|
|
366
|
+
if (Array.isArray((_c2 = (_b2 = step == null ? void 0 : step.data) == null ? void 0 : _b2[key]) == null ? void 0 : _c2.state) && ((_f = (_e2 = (_d2 = step == null ? void 0 : step.data) == null ? void 0 : _d2[key]) == null ? void 0 : _e2.state) == null ? void 0 : _f.length) > 0) {
|
|
367
|
+
const promises = [];
|
|
368
|
+
(_h = (_g = step == null ? void 0 : step.data) == null ? void 0 : _g[key]) == null ? void 0 : _h.state.map((args) => promises.push(queryClient.setQueryData(...args)));
|
|
369
|
+
await Promise.all(promises);
|
|
370
|
+
}
|
|
371
|
+
if ((_j = (_i = step == null ? void 0 : step.data) == null ? void 0 : _i[key]) == null ? void 0 : _j.timeout) {
|
|
372
|
+
timeout = setTimeout(
|
|
373
|
+
() => {
|
|
374
|
+
setRun(true);
|
|
375
|
+
},
|
|
376
|
+
step.data[key].timeout
|
|
377
|
+
);
|
|
378
|
+
}
|
|
367
379
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
380
|
+
if (type === "tour:end") {
|
|
381
|
+
setRun(false);
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
run
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
),
|
|
388
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
389
|
+
"div",
|
|
390
|
+
{
|
|
391
|
+
...{
|
|
392
|
+
className: "flex flex-col h-dvh overflow-hidden md:flex-row " + offsets.paddingTop
|
|
393
|
+
},
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
396
|
+
TemplateUiHeader,
|
|
397
|
+
{
|
|
398
|
+
...{
|
|
399
|
+
actions,
|
|
400
|
+
active: (_c = menu == null ? void 0 : menu.data) == null ? void 0 : _c.active,
|
|
401
|
+
campaign: campaign == null ? void 0 : campaign.data,
|
|
402
|
+
className: "z-30 fixed top-0 left-0 md:hidden",
|
|
403
|
+
organization: organization == null ? void 0 : organization.data,
|
|
404
|
+
params,
|
|
405
|
+
path
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
),
|
|
409
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
410
|
+
"div",
|
|
411
|
+
{
|
|
412
|
+
...{
|
|
413
|
+
className: "z-[25] fixed top-0 left-0 w-full flex flex-col justify-between bg-black h-full transition duration-200 ease-in md:z-0 md:relative md:w-1/3 lg:w-1/4 xl:w-1/5 " + (((_d = menu == null ? void 0 : menu.data) == null ? void 0 : _d.active) ? "translate-y-0 " + offsets.paddingTop : "-translate-y-full md:translate-y-0")
|
|
414
|
+
},
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
417
|
+
TemplateUiHeader,
|
|
418
|
+
{
|
|
419
|
+
...{
|
|
420
|
+
actions,
|
|
421
|
+
active: (_e = menu == null ? void 0 : menu.data) == null ? void 0 : _e.active,
|
|
422
|
+
campaign: campaign == null ? void 0 : campaign.data,
|
|
423
|
+
className: "hidden md:flex border-b border-gray-dark relative z-[3]",
|
|
424
|
+
organization: organization == null ? void 0 : organization.data,
|
|
425
|
+
params,
|
|
426
|
+
path
|
|
427
|
+
}
|
|
388
428
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
429
|
+
),
|
|
430
|
+
(params == null ? void 0 : params.organization) && !isAccountPath(path) && !path.includes("/admin") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
431
|
+
TemplateUiBand,
|
|
432
|
+
{
|
|
433
|
+
...{
|
|
434
|
+
record: params.campaign ? campaign == null ? void 0 : campaign.data : organization == null ? void 0 : organization.data
|
|
435
|
+
}
|
|
396
436
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
437
|
+
),
|
|
438
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
439
|
+
import_wrapper_gradient.default,
|
|
440
|
+
{
|
|
441
|
+
...{
|
|
442
|
+
className: "flex-1 min-h-0",
|
|
443
|
+
classNameGradient: "from-black to-transparent h-10",
|
|
444
|
+
classNameScroll: "h-full"
|
|
445
|
+
},
|
|
446
|
+
children: [
|
|
447
|
+
(params == null ? void 0 : params.organization) && !(organization == null ? void 0 : organization.isLoading) && (organization == null ? void 0 : organization.data) && !isAccountPath(path) && !path.includes("/admin") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: params.organization && params.campaign ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
448
|
+
import_menu.MenuCampaign,
|
|
449
|
+
{
|
|
450
|
+
...{
|
|
451
|
+
campaign: params.campaign,
|
|
452
|
+
onClick: actions.menu,
|
|
453
|
+
organization: params.organization,
|
|
454
|
+
path
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
params.organization + "-" + params.campaign
|
|
458
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
459
|
+
import_menu.MenuOrganization,
|
|
460
|
+
{
|
|
461
|
+
...{
|
|
462
|
+
onClick: actions.menu,
|
|
463
|
+
organization: params.organization,
|
|
464
|
+
path
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
params.organization
|
|
468
|
+
) }),
|
|
469
|
+
!(params == null ? void 0 : params.organization) && !isAccountPath(path) && !path.includes("/admin") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
470
|
+
import_menu.MenuApp,
|
|
471
|
+
{
|
|
472
|
+
...{
|
|
473
|
+
onClick: actions.menu,
|
|
474
|
+
path
|
|
475
|
+
}
|
|
426
476
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
path
|
|
477
|
+
),
|
|
478
|
+
path.includes("/admin") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
479
|
+
import_menu.MenuAdmin,
|
|
480
|
+
{
|
|
481
|
+
...{
|
|
482
|
+
onClick: actions.menu,
|
|
483
|
+
path
|
|
484
|
+
}
|
|
436
485
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
486
|
+
),
|
|
487
|
+
isAccountPath(path) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
488
|
+
import_menu.MenuAccount,
|
|
489
|
+
{
|
|
490
|
+
...{
|
|
491
|
+
onClick: actions.menu,
|
|
492
|
+
path
|
|
493
|
+
}
|
|
445
494
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
495
|
+
)
|
|
496
|
+
]
|
|
497
|
+
}
|
|
498
|
+
),
|
|
499
|
+
!isAccountPath(path) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
500
|
+
"div",
|
|
501
|
+
{
|
|
502
|
+
...{
|
|
503
|
+
className: "relative z-[3]"
|
|
504
|
+
},
|
|
505
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
506
|
+
import_menu.MenuAccountDropdown,
|
|
450
507
|
{
|
|
451
508
|
...{
|
|
509
|
+
actions,
|
|
510
|
+
account,
|
|
511
|
+
balance,
|
|
512
|
+
guide,
|
|
513
|
+
modal,
|
|
452
514
|
onClick: actions.menu,
|
|
453
515
|
path
|
|
454
516
|
}
|
|
455
517
|
}
|
|
456
518
|
)
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
path
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
)
|
|
479
|
-
}
|
|
480
|
-
)
|
|
481
|
-
]
|
|
482
|
-
}
|
|
483
|
-
),
|
|
484
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
485
|
-
import_template_rail.default,
|
|
486
|
-
{
|
|
487
|
-
...{
|
|
488
|
-
account: account == null ? void 0 : account.data,
|
|
489
|
-
campaign: campaign == null ? void 0 : campaign.data,
|
|
490
|
-
guide,
|
|
491
|
-
organization: organization == null ? void 0 : organization.data,
|
|
492
|
-
params,
|
|
493
|
-
path
|
|
494
|
-
},
|
|
495
|
-
children
|
|
496
|
-
}
|
|
497
|
-
)
|
|
498
|
-
]
|
|
499
|
-
}
|
|
500
|
-
);
|
|
519
|
+
}
|
|
520
|
+
)
|
|
521
|
+
]
|
|
522
|
+
}
|
|
523
|
+
),
|
|
524
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
525
|
+
"div",
|
|
526
|
+
{
|
|
527
|
+
...{
|
|
528
|
+
className: "flex flex-col h-full w-full md:w-3/4 lg:w-4/5"
|
|
529
|
+
},
|
|
530
|
+
children
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
)
|
|
536
|
+
] });
|
|
501
537
|
};
|
|
502
538
|
var template_ui_default = TemplateUi;
|